You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
grammar D { our token doo { doo }; }; say 'doo' ~~ &D::doo
rakudo-moar a6f563: OUTPUT«Type check failed in binding <anon>; expected 'D' but got 'Cursor' in regex doo at /tmp/8wglQQkyMB:1 in block <unit> at /tmp/8wglQQkyMB:1»
grammar D { token doo is export { doo }; }; import D; say 'doo' ~~ &doo
rakudo-moar a6f563: OUTPUT«Type check failed in binding <anon>; expected 'D' but got 'Cursor' in regex doo at /tmp/anZydiSimC:1 in block <unit> at /tmp/anZydiSimC:1»
It works when we mess with the invocant:
grammar D { our token doo(Mu:) { doo }; }; say 'doo' ~~ &D::doo
rakudo-moar a6f563: OUTPUT«「doo」»
grammar D { token doo(Mu:) is export { doo }; }; import D; say 'doo' ~~ &doo
rakudo-moar a6f563: OUTPUT«「doo」»
grammar D { our token doo(Mu:) { doo }; }; say 'doo' ~~ / <&D::doo> /
rakudo-moar a6f563: OUTPUT«「doo」»
It should work without "restricting" the invocant to Mu.
Migrated from rt.perl.org#125169 (status was 'resolved')
Searchable as RT125169$
The text was updated successfully, but these errors were encountered: