# New Ticket Created by  Sam S. 
# Please include the string:  [perl #125518]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=125518 >


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

Reply via email to