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
Infinite recursion when using Match object as hash key #1855
Comments
From @moritz./perl6 -e 'my %h = a => 1; "a" ~~ /./; say %h{$/}' |
From @gfldexmy %h; Foo.parse('abc'); -- rakudo ae66fe: OUTPUT<<maximum recursion depth exceededNL in |
From @pmichaudI've added a workaround for now that causes Match objects to act sanely Assigning ticket to moritz for spectest coverage; when we have spectests Pm |
The RT System itself - Status changed from 'new' to 'open' |
From @moritznow tested in S02-builtin_data_types/hash.t |
@moritz - Status changed from 'open' to 'resolved' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in S02-builtin_data_types/hash.t commit 8c3cfd3736de11047d6041384bfa9c8e043c7533 test for RT #75868, Match objects as Hash keys Inline Patchdiff --git a/S02-builtin_data_types/hash.t b/S02-builtin_data_types/hash.t
index 52fc7dd..54400df 100644
--- a/S02-builtin_data_types/hash.t
+++ b/S02-builtin_data_types/hash.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 74;
+plan 76;
# basic lvalue assignment
# L<S09/Hashes>
@@ -250,6 +250,15 @@ lives_ok { Hash.new("a" => "b") }, 'Hash.new($pair) lives';
is %h{*}.join('|'), %h.values.join('|'), '{*} zen slice';
}
+# RT #75868
+{
+ my %h = (ab => 'x', 'a' => 'y');
+ 'abc' ~~ /^(.)./;
+ is %h{$/}, 'x', 'can use $/ as hash key';
+ is %h{$0}, 'y', 'can use $0 as hash key';
+
+}
+
done_testing;
# vim: ft=perl6 |
Migrated from rt.perl.org#75868 (status was 'resolved')
Searchable as RT75868$
The text was updated successfully, but these errors were encountered: