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
Some of the methods of the Grammar class (such as FAILGOAL and !cursor_pos) are exposed to Perl 6 code as NQPRoutine objects, which throw LTA exceptions when introspected in the usual Perl 6 ways:
➜ my $method = Grammar.^methods.first(*.name eq "!cursor_pos");
cannot stringify this
➜ say $method.name;
FAILGOAL
➜ say $method ~~ Regex;
Invocant requires a 'Failure' instance, but a type object was passed. Did you forget a .new?
➜ say $method.WHAT;
Method 'gist' not found for invocant of class 'NQPRoutine'
➜ say $method.WHAT.^name;
NQPRoutine
This is a regression which caused the Grammar::Debugger module to break, because its overloaded Grammar.find_method($obj, $name) does a $meth ~~ Regex check. (It now checks against $method.WHAT.^name first as a workaround.)
IRC comments:
<jnthn> Yeah, that's the issue...the NQP object is sneaking into Perl 6 land.
<jnthn> We'd kinda like the introspection to work out there
<jnthn> they should in theory get exposed as a ForeignRoutine or so
This is Rakudo version 2016.07.1-97-g4ee1048 built on MoarVM version 2016.07-11-g11e02fe
implementing Perl 6.c.
Except that now the fist line already throws an exception:
➜ my $meth = Grammar.^methods.first({ .name eq "FAILGOAL" }).^name;
X::TypeCheck::Binding exception produced no message
in block <unit> at -e line 1
Apparently, .first can no longer deal with returning a NQPRoutine... :)
One can use .^find_method to confirm that the underlying problem is still that NQPRoutine's are being leaked:
➜ say Grammar.^find_method("FAILGOAL").^name;
NQPRoutine
Migrated from rt.perl.org#125518 (status was 'new')
Searchable as RT125518$
The text was updated successfully, but these errors were encountered: