masak (>>), coke (>):
> > <masak> rakudo: class A { sub b { 0x10 }; has $!c = b }; A.new
> > <p6eval> rakudo 4c94d7: OUTPUT«Could not find sub &b [...]
> > <masak`> this is biting me currently. I use subs because constants
> > didn't work in classes in alpha, and don't work at all in master.
> > <masak> jnthn: any ideas why this might be?
> > <jnthn> masak: lexical scope f'up, I guess.
> > * masak submits rakudobug
> > <jnthn> masak: file Rakudo bug but I can probably fix that without too
> > much trouble.
> > <masak> \o/
> > 
> > Calling &b from the class scope in general works fine, but not in the
> > RHS of an assignment to an attribute declaration.
> 
> This no longer dies; Does it do what you want, though?

Seems it does.

<masak> rakudo: class A { sub b { 0x10 }; has $!c = b; method foo { $!c } }; 
say A.new.foo
<p6eval> rakudo 69561e: OUTPUT«16␤»
<masak> \o/

Taking to tests.

Reply via email to