On Sat Apr 11 14:56:36 2009, masak wrote:
> <jnthn> rakudo: class Foo { has @.body; has &.writer = method ($x) {
> @!body.push($x) }; }; my $x = Foo.new; $x.writer("oh");
> $x.writer("hai"); .say for $x.body;
> <p6eval> rakudo 5b679a: OUTPUT«Could not locate a method 'writer' to
> invoke on lass 'Foo'.
> * masak submits rakudobug
> <masak> rakudo: class A { has &!m = method {}; method f { &!m() } };
A.new.f
> <p6eval> rakudo 5b679a: OUTPUT«No such attribute '!m' [...]
> <masak> rakudo: class A { has $!m = method { say "OH HAI {self}" };
> method f { self.$!m() } }; A.new.f
> <p6eval> rakudo 5b679a: OUTPUT«OH HAI A<0xb6a19880>␤»
> <masak> that works. :)
> <masak> those & sigils on attributes don't work so well.

Fixed in git 60f709d and spectests added to S12-attributes/instance.t.

Thanks,

Jonathan

Reply via email to