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

Can't subset native types #6248

Open
p6rt opened this issue May 13, 2017 · 1 comment
Open

Can't subset native types #6248

p6rt opened this issue May 13, 2017 · 1 comment

Comments

@p6rt
Copy link

p6rt commented May 13, 2017

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

Searchable as RT131310$

@p6rt
Copy link
Author

p6rt commented May 13, 2017

From @MasterDuke17

[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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant