Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
s/X::Routine::Banned/X::Method::Banned/
Since we only use the exception for methods now
  • Loading branch information
lizmat committed Mar 7, 2014
1 parent c735e4d commit 6676f76
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/core/Any.pm
Expand Up @@ -3,7 +3,7 @@ my class Pair { ... }
my class Range { ... }
my class X::Bind::Slice { ... }
my class X::Bind::ZenSlice { ... }
my class X::Routine::Banned { ... }
my class X::Method::Banned { ... }

my class Any { # declared in BOOTSTRAP
# my class Any is Mu {
Expand Down Expand Up @@ -266,13 +266,13 @@ my class Any { # declared in BOOTSTRAP
method KeyBag() { DEPRECATED("'BagHash'"); self.BagHash }

method length is hidden_from_backtrace {
fail X::Routine::Banned.new(
fail X::Method::Banned.new(
banned => ".length",
didyoumean => ".chars, .graphs or .codes",
);
}
method bytes is hidden_from_backtrace {
fail X::Routine::Banned.new(
fail X::Method::Banned.new(
banned => ".bytes",
didyoumean => ".encode(\$encoding).bytes",
);
Expand Down
17 changes: 8 additions & 9 deletions src/core/Exception.pm
Expand Up @@ -86,6 +86,14 @@ my class X::Method::InvalidQualifier is Exception {
}
}

my class X::Method::Banned is Exception {
has $.banned = "something";
has $.didyoumean = "something else";
method message() {
qq{"$.banned" is banned in Perl 6.
Did you mean $.didyoumean instead?}
}
}

sub EXCEPTION(|) {
my Mu $vm_ex := nqp::shift(nqp::p6argvmarray());
Expand Down Expand Up @@ -1050,15 +1058,6 @@ my class X::Augment::NoSuchType does X::Comp {
method message() { "You tried to augment $.package-kind $.package, but it does not exist" }
}

my class X::Routine::Banned is Exception {
has $.banned = "something";
has $.didyoumean = "something else";
method message() {
qq{"$.banned" is banned in Perl 6.
Did you mean $.didyoumean instead?}
}
}

my class X::Routine::Unwrap is Exception {
method message() { "Cannot unwrap routine: invalid wrap handle" }
}
Expand Down

0 comments on commit 6676f76

Please sign in to comment.