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
Comments
From @masak<masak> rakudo: { &^c("$^a, $^b") }.("morning", "perl6ers", &say) |
From @kylehaThis 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 [t/spec] Test for RT #68116 Inline Patchdiff --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 |
The RT System itself - Status changed from 'new' to 'open' |
From @masakThe particular circumstances involved in this ticket are resolved. (But see |
@masak - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#68116 (status was 'resolved')
Searchable as RT68116$
The text was updated successfully, but these errors were encountered: