# New Ticket Created by Stephane Payrard
# Please include the string: [perl #126263]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=126263 >
grammar G { token TOP() { 'a' } }
class A { method TOP($/) { G.parse('a'); } }
G.parse('a', :actions(A));
=begin pod
perl6 u
Cannot assign to a readonly variable or a value
in method TOP at u:2
in regex TOP at u:1
in block <unit> at u:3
The example is pretty stupid because it would lead to a infinite recursion.
This is just a golfed version of a real example which used a grammar to drive
tests
on another grammar that led to the same error.
=end pod