Skip to content
Permalink
Browse files

Make X::Trait::Unknown a bit more resilient

So that it doesn't barf when getting strange values, making it nigh impossible
to debug stuff with traits.
  • Loading branch information...
lizmat committed Jan 14, 2019
1 parent bcc8054 commit 54fe8a1a8bc8332faf2402b71148bd5abd32b4a3
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/core/Exception.pm6
@@ -900,7 +900,11 @@ my class X::Trait::Unknown is Exception {
has $.subtype; # wrong subtype being tried
has $.declaring; # variable, sub, parameter, etc.
method message () {
"Can't use unknown trait '$.type $.subtype' in a$.declaring declaration."
"Can't use unknown trait '{
try { $.type } // "unknown type"
}' -> '{
try { $.subtype } // "unknown subtype"
}' in a$.declaring declaration."
}
}
my class X::Comp::Trait::Unknown is X::Trait::Unknown does X::Comp { };

0 comments on commit 54fe8a1

Please sign in to comment.
You can’t perform that action at this time.