# New Ticket Created by Tim King
# Please include the string: [perl #119605]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=119605 >
[17:44] <TimK1> rn: sub f (@a) { @a }; say f 1 ... 10; # should be 1 2 3 4 5 6
7 8 9 10
[17:44] <camelia> rakudo 8bfb3c, niecza v24-94-g1042054: OUTPUT«1 2 3 4 5 6 7 8
9 10»
[17:44] <TimK1> rn: sub f (Num @a) { @a }; say f 1 ... 10; # same thing, but
with type in signature
[17:44] <camelia> niecza v24-94-g1042054: OUTPUT«1 2 3 4 5 6 7 8 9 10»
[17:44] <camelia> ..rakudo 8bfb3c: OUTPUT«Nominal type check failed for
parameter '@a'; expected Positional but got List instead in sub f at
/tmp/rE76b6Mr4d:1 in block at /tmp/rE76b6Mr4d:1»
[17:46] <TimK1> rn: sub f (Num @a) { @a }; say f [1 ... 10]; # same thing,
except passing an Array
[17:46] <camelia> rakudo 8bfb3c: OUTPUT«Nominal type check failed for parameter
'@a'; expected Positional but got Array instead in sub f at
/tmp/l7pZg_NrYr:1 in block at /tmp/l7pZg_NrYr:1»
[17:46] <camelia> ..niecza v24-94-g1042054: OUTPUT«1 2 3 4 5 6 7 8 9 10»
[17:46] <TimK1> Both List and Array do Positional, so I believe Niecza is
right. (Don't understand what any of it has to do with the type declaration of
the formal param.)
[17:44] <TimK1> rn: sub f (@a) { @a }; say f 1 ... 10; # should be 1 2 3 4 5 6 7 8 9 10
[17:44] <camelia> rakudo 8bfb3c, niecza v24-94-g1042054: OUTPUT«1 2 3 4 5 6 7 8 9 10»
[17:44] <TimK1> rn: sub f (Num @a) { @a }; say f 1 ... 10; # same thing, but with type in signature
[17:44] <camelia> niecza v24-94-g1042054: OUTPUT«1 2 3 4 5 6 7 8 9 10»
[17:44] <camelia> ..rakudo 8bfb3c: OUTPUT«Nominal type check failed for parameter '@a'; expected Positional but got List instead in sub f at /tmp/rE76b6Mr4d:1 in block at /tmp/rE76b6Mr4d:1»
[17:46] <TimK1> rn: sub f (Num @a) { @a }; say f [1 ... 10]; # same thing, except passing an Array
[17:46] <camelia> rakudo 8bfb3c: OUTPUT«Nominal type check failed for parameter '@a'; expected Positional but got Array instead in sub f at /tmp/l7pZg_NrYr:1 in block at /tmp/l7pZg_NrYr:1»
[17:46] <camelia> ..niecza v24-94-g1042054: OUTPUT«1 2 3 4 5 6 7 8 9 10»
[17:46] <TimK1> Both List and Array do Positional, so I believe Niecza is right. (Don't understand what any of it has to do with the type declaration of the formal param.)
|