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

Owner: Nobody
Requestors: ddgreen [at] gmail.com
Cc:
AdminCc:

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



Subject: Can't subset native types
Date: Sat, 13 May 2017 19:34:04 -0400
To: rakudobug [...] perl.org
From: Daniel Green <ddgreen [...] gmail.com>
Download (untitled) / with headers
text/plain 1.5k
[19:15] <MasterDuke_> m: subset uint15 of uint16 where 0 <= * <= 32775; my uint15 $a = 1
[19:15] <timotimo> right
[19:15] <+camelia> rakudo-moar 4298dd: OUTPUT: «Type check failed in assignment to $a; expected uint15 but got Int (1)␤  in block <unit> at <tmp> line 1␤␤»
[19:16] <MasterDuke_> seems like a bug to me
[19:16] <timotimo> do we do subsets of natives at all? anywhere?
[19:16] <MasterDuke_> but i don't know if subsetting natives is even allowed
[19:18] <MasterDuke_> m: subset uint15 of uint16 where 0 <= * <= 32775; my uint16 $a = 1; my uint15 $b = $a
[19:18] <+camelia> rakudo-moar 4298dd: OUTPUT: «Type check failed in assignment to $b; expected uint15 but got Int (1)␤  in block <unit> at <tmp> line 1␤␤»
[19:19] <MasterDuke_> i would think it should either work or error when i try to create the subset of the native type
[19:21] <MasterDuke_> a quick grep in roast shows nothing for subset of native types
[19:22] <timotimo> perhaps an NYI exception would be in order
[19:22] <timotimo> can you find anything in perl6-all-modules?
[19:23] <MasterDuke_> nothing there either
[19:23] <timotimo> good
[19:23] <timotimo> so nobody found a way to make it work
[19:25] <MasterDuke_> i'll rakudobug it so it doesn't slip through the cracks
[19:26] <MasterDuke_> any thought's on whether it should or shouldn't be allowed?
[19:27] <timotimo> it'd be cool if we could
[19:27] <timotimo> it might be a SMOP

It's not just a uint thing (since they have some other problems), native ints, nums, and strs do the same thing.


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