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

The combination of prefix:<+> and slurpy arrays doesn't work in Rakudo #1693

Closed
p6rt opened this issue Apr 16, 2010 · 7 comments
Closed

The combination of prefix:<+> and slurpy arrays doesn't work in Rakudo #1693

p6rt opened this issue Apr 16, 2010 · 7 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Apr 16, 2010

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

Searchable as RT74410$

@p6rt
Copy link
Author

p6rt commented Apr 16, 2010

From @masak

<masak> rakudo​: -> *@​a { @​a[+0] }.()
<p6eval> rakudo 78faa0​: OUTPUT«No applicable candidates found to
dispatch to for 'postcircumfix​:<[ ]>'. Available candidates are​:␤​:(Mu
: Int $i;; *%_)␤​:(Mu : Block $b;; *%_)␤​:(Mu :
!whatever_dispatch_helper ;; *%_) [...]
* masak submits rakudobug
<moritz_> rakudo​: -> *@​a { @​a[0] }.()
<p6eval> rakudo 78faa0​: ( no output )
<masak> something with + that makes it not a good index.
<moritz_> rakudo​: say (+0).WHAT
<p6eval> rakudo 78faa0​: OUTPUT«Num()␤»
<masak> that, probably :)
<moritz_> :-)
<masak> the funny thing is that it works with non-slurpy arrays​:
<masak> rakudo​: -> @​a { say @​a[+0] }.([5])
<p6eval> rakudo 78faa0​: OUTPUT«5␤»
<moritz_> yeh knew, we've had lots of trouble with slurpy params
<moritz_> colomon and me

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

From @bbkr

$ perl6 -e '-> *@​a { @​a[+0] }.()'

(compiles without error)

# using sample data​:
$ perl6 -e '-> *@​a { say @​a[+0] }.([5])'
5

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

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

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

From @bbkr

taken for tests

[14​:32] <moritz_> bbkr​: S06-signature/slurpy-params.t probably

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

From @bbkr

tests added in t/spec/S06-signature/slurpy-params.t

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

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

@p6rt p6rt closed this as completed Aug 3, 2010
@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

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 c5d5e34edb598ce84b0858855707ca20fbeabf94
Author​: bbkr <bbkr@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Tue Aug 3 12​:41​:02 2010 +0000

  [t/spec] tests for RT #​74410 The combination of prefix​:<+> and slurpy arrays doesnt work
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;31893 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 5c4d542..ddd4139 100644
--- a/t/spec/S06-signature/slurpy-params.t
+++ b/t/spec/S06-signature/slurpy-params.t
@@ -323,6 +323,12 @@ eval_dies_ok 'sub rt65324(*@x, $oops) { say $oops }',
     A(5, 4);
 }
 
+# RT #74410
+{
+    is -> *@a { @a[+0] }.([5]), 5,
+        'slurpy array can be indexed if index contains prefix:<+>';
+}
+
 done_testing;
 
 # vim: ft=perl6

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant