# New Ticket Created by  Chris Fields 
# Please include the string:  [perl #64814]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=64814 >


This may just be an error in the way I am trying to declare a typed  
array in an argument list (slurpy or otherwise), but I can't find  
anything in the spec.

The following three examples:

perl6 -e "class X {}; class Y {method z (X *...@a) { say 1} };  
Y.new.z(X.new);"
perl6 -e "class X {}; class Y {method z (X @a) { say 1} };  
Y.new.z(X.new);"
perl6 -e "class X {}; class Y {method z (X *...@a) { say 1} }; Y.new.z(3);"

all give the following error (the first two I would expect to pass):

cjfields:~ cjfields$ perl6 -e "class X {}; class Y {method z (X @a)  
{ say 1} }; Y.new.z(3);"
Non-Positional argument or Positional of wrong element type for @a in  
call to z
current instr.: 'die' pc 17350 (src/builtins/control.pir:222)
called from Sub '!SIGNATURE_BIND' pc 4023 (src/classes/Signature.pir: 
434)
called from Sub 'parrot;Y;z' pc 195 (EVAL_19:85)
called from Sub '_block14' pc 83 (EVAL_19:46)
called from Sub '!UNIT_START' pc 19340 (src/builtins/guts.pir:380)
called from Sub 'parrot;PCT;HLLCompiler;eval' pc 950 (src/PCT/ 
HLLCompiler.pir:529)
called from Sub 'parrot;PCT;HLLCompiler;command_line' pc 1510 (src/PCT/ 
HLLCompiler.pir:800)
called from Sub 'parrot;Perl6;Compiler;main' pc 23975 (perl6.pir:164)

These work (I would expect second example to fail); .of appears to be  
a noop:

perl6 -e "class X {}; class Y {method z (*...@a of X) { say 1} };  
Y.new.z(X.new);"
perl6 -e "class X {}; class Y {method a (*...@a of X) { say 1} };  
Y.new.a(3)"

cjfields:t cjfields$ rakudo -v
This is Rakudo Perl 6, revision 38180 built on parrot 1.0.0-devel
for darwin-2level.

Copyright 2006-2008, The Perl Foundation.


Reply via email to