Skip Menu |
Report information
Id: 129014
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: zefram [at] fysh.org
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



From: Zefram <zefram [...] fysh.org>
Date: Sat, 20 Aug 2016 10:15:00 +0100
Subject: [BUG] Range.new confused by type objects
To: rakudobug [...] perl.org
Download (untitled) / with headers
text/plain 962b
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: Show quoted text
> Range.new(List, Pair).perl
List..Pair Show quoted text
> Range.new(Seq, List).perl
Seq objects are not valid endpoints for Ranges in block <unit> at <unknown file> line 1 Show quoted text
> Range.new(List, Int).perl
List..Int Show quoted text
> 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


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org