jnthn / grammar-debugger

Grammar::Debugger and Grammer::Tracer Perl 6 modules
36 stars 19 forks source link

Invocant requires a 'Failure' instance, but a type was passed. Did you forget a .new? #17

Closed zostay closed 7 years ago

zostay commented 9 years ago

Tests are failing.

% prove -e 'perl6 -Ilib'
t/debugger.t .. 1/1
# Failed test 'grammar.parse(...) with the debugger works'
# at t/debugger.t line 14
# Invocant requires a 'Failure' instance, but a type object was passed.  Did you forget a .new?
# Looks like you failed 1 test of 1
t/debugger.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests
t/tracer.t .... 1/1
# Failed test 'grammar.parse(...) with the tracer works'
# at t/tracer.t line 14
# Invocant requires a 'Failure' instance, but a type object was passed.  Did you forget a .new?
# Looks like you failed 1 test of 1
t/tracer.t .... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests

Test Summary Report
-------------------
t/debugger.t (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
t/tracer.t  (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=2, Tests=2,  1 wallclock secs ( 0.02 usr  0.01 sys +  1.11 cusr  0.08 csys =  1.22 CPU)
Result: FAIL
zostay commented 9 years ago

After some investigation, this appears to be an NQP bug. This line is failing:

return $meth unless $meth ~~ Regex;

Passing Regex to the smart match op is causing the "Invocant requires…" message because "!cursor_init" is passed in, which returns an NQPRoutine, which does not implement Mu, so it doesn't stringify properly with .gist or.perl and does not have a complete implementation of .ACCEPTS.

jnthn commented 7 years ago

Tests are passing now; closing.