Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rakudo allows required parameters after variadic parameters, STD doesn't #966

Closed
p6rt opened this issue May 2, 2009 · 5 comments
Closed

Comments

@p6rt
Copy link

p6rt commented May 2, 2009

Migrated from rt.perl.org#65324 (status was 'resolved')

Searchable as RT65324$

@p6rt
Copy link
Author

p6rt commented May 2, 2009

From @masak

<masak> rakudo​: sub foo(*@​data, $bar) { say $bar }; my @​data = 1,2,3;
foo(@​data, 'OH HAI')
<p6eval> rakudo ec69e2​: OUTPUT«1 2 3␤»
<masak> huh.
<masak> I'd expect the splat to be more greedy than that.
<TimToady> std​: sub foo(*@​data, $bar) { say $bar }; my @​data = 1,2,3;
foo(@​data, 'OH HAI')
<p6eval> std 26619​: OUTPUT«##### PARSE FAILED #####␤Can't put required
parameter after variadic parameters [...]
<TimToady> masak​: see ^
<TimToady> rakudo is being overly accepting here
<Matt-W> bug!!!
* masak submits!!!
<TimToady> will likely be put off till STD runs on rakudo :)

@p6rt
Copy link
Author

p6rt commented Oct 11, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S06-signature/slurpy-params.t

commit 1c854b7ffee2a159454af74d7adbf95de4dd7170
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Sun Oct 11 03​:33​:41 2009 +0000

  [t/spec] Test for RT #​65324
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;28747 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S06-signature/slurpy-params.t b/t/spec/S06-signature/slurpy-params.t
index aaed845..b6f07b9 100644
--- a/t/spec/S06-signature/slurpy-params.t
+++ b/t/spec/S06-signature/slurpy-params.t
@@ -3,7 +3,7 @@ use Test;
 
 # L<S06/List parameters/Slurpy parameters>
 
-plan 60;
+plan *;
 
 sub xelems(*@args) { @args.elems }
 sub xjoin(*@args)  { @args.join('|') }
@@ -289,4 +289,10 @@ These tests are the testing for "List parameters" section of Synopsis 06
     is $count, 1, 'Any slurpy param doesnt autothread';
 }
 
+#?rakudo todo 'RT 65324'
+eval_dies_ok 'sub rt65324(*@x, $oops) { say $oops }',
+             "Can't put required parameter after variadic parameters";
+
+done_testing;
+
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Oct 11, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Apr 3, 2010

From @jnthn

On Sat May 02 07​:58​:26 2009, masak wrote​:

<masak> rakudo​: sub foo(*@​data, $bar) { say $bar }; my @​data = 1,2,3;
foo(@​data, 'OH HAI')
<p6eval> rakudo ec69e2​: OUTPUT«1 2 3␤»
<masak> huh.
<masak> I'd expect the splat to be more greedy than that.
<TimToady> std​: sub foo(*@​data, $bar) { say $bar }; my @​data = 1,2,3;
foo(@​data, 'OH HAI')
<p6eval> std 26619​: OUTPUT«##### PARSE FAILED #####␤Can't put required
parameter after variadic parameters [...]
<TimToady> masak​: see ^
<TimToady> rakudo is being overly accepting here
<Matt-W> bug!!!
* masak submits!!!

jnthn fixes! jnthn unfudges tests!

<TimToady> will likely be put off till STD runs on rakudo :)

Speculation fail. ;-)

Jonathan

@p6rt
Copy link
Author

p6rt commented Apr 3, 2010

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Apr 3, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant