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
Defining and calling a method in a grammar causes Null PMC access in find_method() #1295
Comments
From @carbinI am not sure if this is supposed to work or not but the NPMCA is
<carlin> rakudo: grammar foo { rule TOP { 'lorem' | <.panic> }; method -- |
From @moritz10:39 < carlin> rakudo: grammar foo { rule TOP { 'lorem' | <.panic> }; |
The RT System itself - Status changed from 'new' to 'open' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S05-grammar/methods.t commit 1304265c541f9a396febab7315706dff5cef6af6 [t/spec] tests for RT #69228, calling methods from a grammar Inline Patchdiff --git a/t/spec/S05-grammar/methods.t b/t/spec/S05-grammar/methods.t
new file mode 100644
index 0000000..6da2f7d
--- /dev/null
+++ b/t/spec/S05-grammar/methods.t
@@ -0,0 +1,17 @@
+use v6;
+use Test;
+
+plan *;
+
+grammar WithMethod {
+ rule TOP { 'lorem' | <.panic> }
+ method panic { die "The sky is falling!"; }
+};
+
+dies_ok { WithMethod.parse('unrelated') },
+ 'Can call die() from a method within a grammar';
+
+try { WithMethod.parse('unrelated') };
+ok "$!" ~~ /'The sky is falling!'/, 'and got the exception message';
+
+done_testing; |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#69228 (status was 'resolved')
Searchable as RT69228$
The text was updated successfully, but these errors were encountered: