On Sat May 22 07:47:38 2010, masak wrote:
> <finanalyst> rakudo: class A {has $.a; has @.m; method foo { for $.a
> .. 5 { say @.m[$_] }}}; my A $x.=new(:a(2.0),:m(1,2,3,4,5));$x.foo
> <p6eval> rakudo 9a15b8: OUTPUT«No applicable candidates found to
> dispatch to for 'postcircumfix:<[ ]>'. Available candidates are:␤:(Mu
> : Int $i;; *%_)␤:(Mu : Block $b;; *%_)␤:(Mu :
> !whatever_dispatch_helper ;; *%_) [...]
> <finanalyst> isBEKaml: thats the error
> <masak> rakudo: class A { has @.m; method foo { @.m[2.0] } };
> A.new(:m(1,2,3)).foo
> <p6eval> rakudo 9a15b8: OUTPUT«No applicable candidates found to
> dispatch to for 'postcircumfix:<[ ]>'. Available candidates are:␤:(Mu
> : Int $i;; *%_)␤:(Mu : Block $b;; *%_)␤:(Mu :
> !whatever_dispatch_helper ;; *%_)␤ [...]
> * masak submits rakudobug
> <masak> finanalyst++
> <masak> rakudo: my @m = 1,2,3; say @m[2.0]
> <p6eval> rakudo 9a15b8: OUTPUT«3␤»
> <finanalyst> masak: somehow the type of the attribute is being
> 'imported' during the call to new
> <masak> finanalyst: you mean of $.a? but that's not it, my example
> didn't use $.a
> <isBEKaml> rakudo: class A { has @.m; method foo { @.m[2] } };
> A.new(:m(1,2,3)).foo
> <p6eval> rakudo 9a15b8:  ( no output )
> <finanalyst> masak: I ran across a bug where arrays inside a method
> were being treated differently than outside. is this the same thing?
> <finanalyst> we discussed it about two weeks ago
> <colomon> finanalyst: probably is the same thing.
> <masak> rakudo: class A { has @.m; }; A.new(:m(1,2,3)).m[2.0]
> <p6eval> rakudo 9a15b8: OUTPUT«No applicable candidates found to
> dispatch to for 'postcircumfix:<[ ]>'. Available candidates are:␤:(Mu
> : Int $i;; *%_)␤:(Mu : Block $b;; *%_)␤:(Mu :
> !whatever_dispatch_helper ;; *%_) [...]
> <masak> it's not even methods.
> <masak> it's just the attribute array.

Works now:

15:03 <@jnthn> rakudo: class A { has @.m; }; say A.new(:m(1,2,3)).m[2.0]
15:03 < p6eval> rakudo ee7620: OUTPUT«3␤»

Given to moritz++ for spectesting.

Thanks,

Jonathan

Reply via email to