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 won't accept subs as valid &-sigilled parameters in Rakudo #1191

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

Rakudo won't accept subs as valid &-sigilled parameters in Rakudo #1191

p6rt opened this issue Aug 2, 2009 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 2, 2009

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

Searchable as RT68116$

@p6rt
Copy link
Author

p6rt commented Aug 2, 2009

From @masak

<masak> rakudo​: { &^c("$^a, $^b") }.("morning", "perl6ers", &say)
<p6eval> rakudo e02bc0​: OUTPUT«Parameter type check failed; expected
Callable, but got Code for c in call to _block50
* masak submits rakudobug
<masak> rakudo​: { &^foo }.(&say)
<p6eval> rakudo e02bc0​: OUTPUT«Parameter type check failed; expected
Callable, but got Code for foo in call to _block50
<masak> rakudo​: -> &foo {}.(&say)
<p6eval> rakudo e02bc0​: OUTPUT«Parameter type check failed; expected
Callable, but got Code for foo in call to _block50
<masak> rakudo​: (sub (&foo) {}).(&say)
<p6eval> rakudo e02bc0​: OUTPUT«Parameter type check failed; expected
Callable, but got Code for foo in call to _block50

@p6rt
Copy link
Author

p6rt commented Aug 10, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S02-builtin_data_types/anon_block.t

commit 649dc2cb2a29b472f30c35d88b4c3ac66e9a19f1
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Mon Aug 10 21​:51​:55 2009 +0000

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

Inline Patch
diff --git a/t/spec/S02-builtin_data_types/anon_block.t b/t/spec/S02-builtin_data_types/anon_block.t
index d0862a1..b75ac81 100644
--- a/t/spec/S02-builtin_data_types/anon_block.t
+++ b/t/spec/S02-builtin_data_types/anon_block.t
@@ -11,7 +11,7 @@ This covers anonymous blocks and subs, as well as pointy blocks
 
 =end description
 
-plan 34;
+plan 42;
 
 # L<S04/"The Relationship of Blocks and Declarations">
 # L<S06/"Anonymous subroutines">
@@ -126,4 +126,27 @@ is((sub { { { 3 } } }).(), 3, 'ditto, even if nested');
 dies_ok({(sub { { $^x } }).()}, 'implicit params become errors');
 isnt((sub { -> { 3 } }).(), 3, 'as are pointies');
 
+# RT #68116
+{
+    sub rt68116 { 68116 }
+    is &rt68116(), 68116, 'check that sub is callable via &';
+    is { &^x() }.( &rt68116 ), 68116,
+        'call via { &^pos() }( &s ) works for sub';
+    is -> &x { &x() }.( &rt68116 ), 68116,
+        'call via -> &point { &point() }.( &s ) works for sub';
+    is (sub (&x) { &x() }).( &rt68116 ), 68116,
+        'call via (sub (&x) { &x() }).( &s ) works for sub';
+
+    multi mone { 'one' }
+    is &mone(), 'one', 'check that mutli is callable via &';
+    #?rakudo 3 skip 'RT #68116'
+    is { &^x() }.( &mone ), 'one',
+        'call via { &^pos() }( &s ) works for multi';
+    is -> &x { &x() }.( &mone ), 'one',
+        'call via -> &point { &point() }.( &s ) works for multi';
+    is (sub (&x) { &x() }).( &mone ), 'one',
+        'call via (sub (&x) { &x() }).( &s ) works for multi';
+    
+}
+
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Aug 10, 2009

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

@p6rt
Copy link
Author

p6rt commented Mar 20, 2010

From @masak

The particular circumstances involved in this ticket are resolved. (But see
[perl #​73688].)

@p6rt
Copy link
Author

p6rt commented Mar 20, 2010

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

@p6rt p6rt closed this as completed Mar 20, 2010
@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