Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range.new confused by type objects #5602

Open
p6rt opened this issue Aug 20, 2016 · 1 comment
Open

Range.new confused by type objects #5602

p6rt opened this issue Aug 20, 2016 · 1 comment
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 20, 2016

Migrated from rt.perl.org#129014 (status was 'new')

Searchable as RT129014$

@p6rt
Copy link
Author

p6rt commented Aug 20, 2016

From zefram@fysh.org

The Range class allows most values to be used as endpoints, even things
such as type objects. But certain type objects get mistaken for defined
objects, causing silly error results​:

Range.new(List, Pair).perl
List..Pair
Range.new(Seq, List).perl
Seq objects are not valid endpoints for Ranges
  in block <unit> at <unknown file> line 1
Range.new(List, Int).perl
List..Int
Range.new(Int, List).perl
Use of uninitialized value of type List in numeric context in block <unit> at <unknown file> line 1
Use of uninitialized value of type List in numeric context in block <unit> at <unknown file> line 1
Invocant requires an instance of type Int, but a type object was passed. Did you forget a .new?
  in block <unit> at <unknown file> line 1

These type objects should be either successfully allowed or cleanly
prohibited. They don't have the disadvantages that the corresponding
defined objects would have, so they should probably be allowed.

-zefram

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant