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

Parametric role used a second time will use old default values (MoarVM only) #3628

Closed
p6rt opened this issue Dec 28, 2014 · 4 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Dec 28, 2014

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

Searchable as RT123511$

@p6rt
Copy link
Author

p6rt commented Dec 28, 2014

From @skids

(01​:15​:28 PM) skids​: r​: role A [ :$a = 1, :$b = $a * 2] { method foo { say "$a $b" } }; role B does A[​:a(1)] { }; role C does A[​:a(2)] { }; B.new.foo; C.new.foo;
(01​:15​:31 PM) camelia​: rakudo-parrot ce1e74​: OUTPUT«1 2␤2 4␤»
(01​:15​:31 PM) camelia​: ..rakudo-moar ce1e74​: OUTPUT«1 2␤2 2␤»
(01​:15​:45 PM) skids​: r-p++

rakudo-perl's results are correct, rakudo-moarvm is failing to recalculate
the new default value based on the new provided role parameter.

@p6rt
Copy link
Author

p6rt commented Sep 2, 2015

From @usev6

This works now with rakudo.moar (on 'nom' and 'glr')​:

$ perl6-m -e 'role A [ :$a = 1, :$b = $a * 2] { method foo { say "$a $b" } }; role B does A[​:a(1)] { }; role C does A[​:a(2)] { }; B.new.foo; C.new.foo;'
1 2
2 4

I added a test to S14-roles/parameterized-mixin.t with commit Raku/roast@6e925d7898.

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Sep 2, 2015

From @usev6

This works now with rakudo.moar (on 'nom' and 'glr')​:

$ perl6-m -e 'role A [ :$a = 1, :$b = $a * 2] { method foo { say "$a $b" } }; role B does A[​:a(1)] { }; role C does A[​:a(2)] { }; B.new.foo; C.new.foo;'
1 2
2 4

I added a test to S14-roles/parameterized-mixin.t with commit Raku/roast@6e925d7898.

I'm closing this ticket as 'resolved'.

@p6rt p6rt closed this as completed Sep 2, 2015
@p6rt
Copy link
Author

p6rt commented Sep 2, 2015

@usev6 - Status changed from 'new' to 'resolved'

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

No branches or pull requests

1 participant