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

Subset types and lexicals don't mix #430

Closed
p6rt opened this issue Nov 25, 2008 · 4 comments
Closed

Subset types and lexicals don't mix #430

p6rt opened this issue Nov 25, 2008 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Nov 25, 2008

Migrated from rt.perl.org#60826 (status was 'resolved')

Searchable as RT60826$

@p6rt
Copy link
Author

p6rt commented Nov 25, 2008

From @moritz

Rakudo r33193​:

my $x = 5; subset MyInt of Int where { $^num % $x == 0}; my MyInt $a
= 10; say $a;
Type mismatch in assignment.

If I use a constant instead of the lexical $x, it works just fine.

There's a test for that in t/spec/S12-subset/subtypes.t

Moritz

@p6rt
Copy link
Author

p6rt commented Jan 11, 2009

@pmichaud - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Feb 11, 2009

From @jnthn

On Tue Nov 25 13​:56​:09 2008, moritz wrote​:

Rakudo r33193​:

my $x = 5; subset MyInt of Int where { $^num % $x == 0}; my MyInt $a
= 10; say $a;
Type mismatch in assignment.

If I use a constant instead of the lexical $x, it works just fine.

There's a test for that in t/spec/S12-subset/subtypes.t

This is working in current Rakudo. I unfudged the tests, and also stuck
in a couple of parens to one of them, since we don't currently parse
item assignment right and it was getting in the way of passing it. So,
resolving the ticket.

Thanks!

Jonathan

@p6rt
Copy link
Author

p6rt commented Feb 11, 2009

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Feb 11, 2009
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