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
call simple code block with named param unexpectedly produce FixedIntegerArray: index out of bounds! #907
Comments
From @ilyabelikinHi there,
Ilya |
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 a09001edb5fe490880d97fc8e3e58fa7d18bbdb5 [t/spec] Tests for RT #64844 Inline Patchdiff --git a/t/spec/S02-builtin_data_types/anon_block.t b/t/spec/S02-builtin_data_types/anon_block.t
index 3cc0d60..41056ab 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 31;
+plan 34;
# L<S04/"The Relationship of Blocks and Declarations">
# L<S06/"Anonymous subroutines">
@@ -30,6 +30,25 @@ my $anon_block = { 1 };
isa_ok($anon_block, Block);
is($anon_block(), 1, '{} <anon block> works');
+# RT #64844
+{
+ eval '$anon_block( 1 )';
+ #?rakudo todo 'Parrot support for zero-arg subs?'
+ ok $! ~~ Exception, 'too many parameters';
+
+ if $! !~~ Exception {
+ skip 2, q{tests don't work if previous test fails};
+ }
+ else {
+ my $errmsg = ~$!;
+
+ eval '$anon_block( foo => "RT #64844" )';
+ ok $! ~~ Exception, 'too many parameters';
+ #?rakudo todo 'RT #64844'
+ is ~$!, $errmsg, 'same error for named param as positional';
+ }
+}
+
# L<S06/""Pointy blocks"">
{
# pointy subs |
The RT System itself - Status changed from 'new' to 'open' |
From @moritzOn Sun Apr 19 04:31:22 2009, ihrd wrote:
10:30 <@moritz_> rakudo: my $foo = { "Yay" }; say $foo(foo => 'bar'); I consider this error message sufficiently awesome to close this ticket. |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#64844 (status was 'resolved')
Searchable as RT64844$
The text was updated successfully, but these errors were encountered: