# New Ticket Created by Vasily Chekalkin # Please include the string: [perl #55620] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=55620 >
Hello. Trivial reproducible bug: in rakudo 'say 1 ~~ Perl6Scalar'. There is patch for src/ops/object.ops -- Bacek.
diff --git a/src/ops/object.ops b/src/ops/object.ops index e70b454..8f07a12 100644 --- a/src/ops/object.ops +++ b/src/ops/object.ops @@ -106,9 +106,15 @@ if (PMC_IS_NULL(method_pmc)) { - real_exception(interp, next, METH_NOT_FOUND, - "Method '%Ss' not found for invocant of class '%Ss'", meth, - VTABLE_get_string(interp, VTABLE_get_class(interp, object))); + PMC * const _class = VTABLE_get_class(interp, object); + + if (PMC_IS_NULL(_class)) + real_exception(interp, next, METH_NOT_FOUND, + "Method '%Ss' not found for non-object", meth); + else + real_exception(interp, next, METH_NOT_FOUND, + "Method '%Ss' not found for invocant of class '%Ss'", meth, + VTABLE_get_string(interp, _class)); } interp->current_object = object; interp->current_cont = $3; @@ -138,9 +144,15 @@ opcode_t *dest; if (PMC_IS_NULL(method_pmc)) { - real_exception(interp, next, METH_NOT_FOUND, - "Method '%Ss' not found for invocant of class '%Ss'", meth, - VTABLE_get_string(interp, VTABLE_get_class(interp, object))); + PMC * const _class = VTABLE_get_class(interp, object); + + if (PMC_IS_NULL(_class)) + real_exception(interp, next, METH_NOT_FOUND, + "Method '%Ss' not found for non-object", meth); + else + real_exception(interp, next, METH_NOT_FOUND, + "Method '%Ss' not found for invocant of class '%Ss'", meth, + VTABLE_get_string(interp, _class)); } interp->current_cont = CONTEXT(interp)->current_cont; PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL;