diff --git a/src/core.c/traits.pm6 b/src/core.c/traits.pm6 index 04a65d2faa2..44414cec2f1 100644 --- a/src/core.c/traits.pm6 +++ b/src/core.c/traits.pm6 @@ -451,7 +451,7 @@ multi sub trait_mod:(Attribute:D $target, $thunk) { elsif nqp::istype($expr, Whatever) { $pkg.^add_fallback( -> $obj, $name { - so $attr.get_value($obj).can($name); + nqp::can(nqp::decont($attr.get_value: $obj), nqp::decont($name)) }, -> $obj, $name { -> $self, |c { @@ -483,7 +483,7 @@ multi sub trait_mod:(Attribute:D $target, $thunk) { else { $pkg.^add_fallback( -> $obj, $name { - ?$expr.can($name) + nqp::can(nqp::decont($expr), nqp::decont($name)) }, -> $obj, $name { -> $self, |c {