Skip to content

Commit

Permalink
Add X::Comp::Trait exception
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jul 27, 2013
1 parent fb836dc commit 0d3c78c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/core/Exception.pm
Expand Up @@ -451,6 +451,16 @@ my class X::NYI is Exception {
} }
my class X::Comp::NYI is X::NYI does X::Comp { }; my class X::Comp::NYI is X::NYI does X::Comp { };


my class X::Trait is Exception {
has $.type; # is, will, of etc.
has $.subtype; # wrong subtype being tried
has $.declaring; # variable, sub, parameter, etc.
method message () {
"You cannot say '$.type $.subtype' in a $.declaring declaration."
}
}
my class X::Comp::Trait is X::Trait does X::Comp { };

my class X::OutOfRange is Exception { my class X::OutOfRange is Exception {
has $.what = 'Argument'; has $.what = 'Argument';
has $.got = '<unknown>'; has $.got = '<unknown>';
Expand Down

0 comments on commit 0d3c78c

Please sign in to comment.