# New Ticket Created by  Elizabeth Mattijsen 
# Please include the string:  [perl #120501]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=120501 >


[00:09:37] <lizmat>      just found an inconsistency:
[00:09:41] <lizmat>      r: my &foo; say &foo.WHAT
[00:09:44] <+camelia>    rakudo-parrot 0cfe87, rakudo-jvm 882e33: OUTPUT«(Any)␤»
[00:09:52] <lizmat>      r: sub a(:&b) { say &b.WHAT }; a()
[00:09:55] <+camelia>    rakudo-parrot 0cfe87, rakudo-jvm 882e33: 
OUTPUT«(Callable)␤»
[00:10:20] <lizmat>      a &foo variable is different from a &foo parameter?
[00:10:55] <lue>         r: my &foo; sub a(:&b) { say &b.WHAT }; a(:b(&foo));
[00:10:58] <+camelia>    rakudo-parrot 0cfe87: OUTPUT«Nominal type check failed 
for parameter '&b'; expected Callable but got Any instead␤  in sub a at 
/tmp/BEpd93gJkp:1␤  in block  at /tmp/BEpd93gJkp:1␤  in any  at 
/tmp/BEpd93gJkp:1␤  in any  at gen/parrot/stage2/NQPHLL.nqp:1146␤  in any eval 
at …»
[00:10:59] <+camelia>    ..rakudo-jvm 882e33: OUTPUT«Nominal type check failed 
for parameter '&b'␤  in block  at /tmp/uZuye0JnXG:1␤  in any eval at 
gen/jvm/stage2/NQPHLL.nqp:1086␤  in any evalfiles at 
gen/jvm/stage2/NQPHLL.nqp:1292␤  in any command_eval at 
gen/jvm/stage2/NQPHLL.nqp:1196␤  in any com…»
[00:11:30] <lizmat>     lue: indeed
[00:11:47] <lizmat>      r: sub a(&b?) { say &b.WHAT }; a()  # doesn't have to 
be a named parameter
[00:11:50] <+camelia>    rakudo-parrot 0cfe87, rakudo-jvm 882e33: 
OUTPUT«(Callable)␤»
[00:11:54] <lue>         r: my $igil; my @rray; my %ash; my &ode; say 
$igil.WHAT; say @rray.WHAT; say %ash.WHAT; say &ode.WHAT;
[00:11:56] <+camelia>    rakudo-parrot 0cfe87, rakudo-jvm 882e33: 
OUTPUT«(Any)␤(Array)␤(Hash)␤(Any)␤»
[00:12:07] <lue>         $ and & have something in common :)
[00:12:35] <lizmat>      but why would that be diffferent for parameters ?
[00:12:40] <lue>         $ -> Any makes sense to me, & -> Any less so. (It 
should be & -> Callable IMO, like @ -> Array or % -> Hash)
[00:13:38] <lue>         r: sub a($ig?, @rr?, %as?, &od?) { say $ig.WHAT; say 
@rr.WHAT; say %as.WHAT; say &od.WHAT }; a()
[00:13:41] <+camelia>    rakudo-parrot 0cfe87, rakudo-jvm 882e33: 
OUTPUT«(Any)␤(Array)␤(Hash)␤(Callable)␤»
[00:13:55] <lue>         & is the only inconsistent one it seems.
[00:14:05] <lizmat>      yup
[00:14:11] lizmat        submits rakudobug

Reply via email to