NQPMatchRole currently checks if self.actions is null and only looks
for and action method if it isn't null. This works for NQP types, but
not for Raku types (Grammar, etc) where an unset actions object is
Mu (which is non-null). As a result, the current code incorrectly
tries to call any methods on Mu with matching names as though they
were action methods. This rarely goes well.
This PR adds a check to see if the self.actions does not inherit
from Any (that is, is Mu) and skips the method on Mu action
objects. (We check for !nqp::istype($actions, Any) instead of
nqp::istype(Mu, $actions) because the latter errors for some NQP
types).
NQPMatchRole
currently checks ifself.actions
is null and only looks for and action method if it isn't null. This works for NQP types, but not for Raku types (Grammar
, etc) where an unset actions object isMu
(which is non-null). As a result, the current code incorrectly tries to call any methods onMu
with matching names as though they were action methods. This rarely goes well.This PR adds a check to see if the
self.actions
does not inherit fromAny
(that is, isMu
) and skips the method onMu
action objects. (We check for!nqp::istype($actions, Any)
instead ofnqp::istype(Mu, $actions)
because the latter errors for some NQP types).Fixes rakudo/rakudo#5443