-
Notifications
You must be signed in to change notification settings - Fork 1
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
Calling .perl on an Match object produced by an inherited grammar fails with a Seq error #5124
Comments
From @sjnPlease inspect the attached example test. The following error appears when calling .perl on the Match object returned by a subclassed JSON::Tiny Grammar parser. $ perl6 Match.perl-error.t |
From @sjn# vim: ft=perl6 use v6; grammar A::B::Grammar is JSON::Tiny::Grammar { } module A::B { import A::B; # we need the &myparse sub plan 3; subtest { ok $result.perl, 'We can call .perl on the Match object'; #note "##### Match.gist is " ~ $result.gist; # This works }, "Parse JSON file and print stuff"; =finish { |
From @moritzGolfed even further: # vim: ft=perl6 use v6; my $result = JSON::Tiny::Grammar.parse( '{}', :actions(JSON::Tiny::Actions)); |
From @moritzThe underlying culprit is that deep down in that Match object there's a .made that's a Seq that has been iterated already: # vim: ft=perl6 use v6; my $result = JSON::Tiny::Grammar.parse( '{}', :actions(JSON::Tiny::Actions)); Maybe the real bug here is that (already iterated Seq).perl throws an exception instead of reproducing a Seq that already been iterated :-) |
From @moritzFixed with rakudo/rakudo@8ca26cebb4 and tested with Raku/roast@760dbe8465 |
@moritz - Status changed from 'new' to 'resolved' |
Migrated from rt.perl.org#127492 (status was 'resolved')
Searchable as RT127492$
The text was updated successfully, but these errors were encountered: