# New Ticket Created by Richard Hainsworth
# Please include the string: [perl #74638]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=74638 >
from #perl6 Apr 24
this works:
rakudo: class B {has @.a;has $.u;method m { for $.u .. 4 { .WHAT.say;
say @.a[$_] }}}; my B $x.=new(:a<a b c d>,:u(3));$x.m
p6eval: rakudo de2ad3: OUTPUT«Int()dInt()»
these dont but should, I think:
attribute is cast to Num.
rakudo: class B {has @.a;has $.u;method m { for $.u .. 4 { .WHAT.say;
say @.a[+$_] }}}; my B $x.=new(:a<a b c d>,:u(+'3'));$x.m
p6eval: rakudo de2ad3: OUTPUT«Num()No applicable candidates found to
dispatch to for 'postcircumfix:<[ ]>'. Available candidates are:Mu :
Int $i;; *%_)Mu : Block $b;; *%_)Mu : !whatever_dispatch_helper ;;
*%_)current instr.: '!postcircumfix:<[ ]>' pc 10885
(src/builtins/Role.pir:73)»
attribute is cast to Str
finanalyst: rakudo: class B {has @.a;has $.u;method m { for $.u .. 4 {
.WHAT.say; say @.a[+$_] }}}; my B $x.=new(:a<a b c d>,:u('3'));$x.m
p6eval: rakudo de2ad3: OUTPUT«Str()No applicable candidates found to
dispatch to for 'postcircumfix:<[ ]>'. Available candidates are:Mu :
Int $i;; *%_)Mu : Block $b;; *%_)Mu : !whatever_dispatch_helper ;;
*%_)current instr.: '!postcircumfix:<[ ]>' pc 10885
(src/builtins/Role.pir:73)»