Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Naively add .object attribute to Method::NotFound
Part of work in progress
  • Loading branch information
lizmat committed Apr 7, 2014
1 parent c575000 commit 2991f8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/core/Exception.pm
Expand Up @@ -66,6 +66,7 @@ my class X::AdHoc is Exception {
}

my class X::Method::NotFound is Exception {
has $.object;
has $.method;
has $.typename;
has Bool $.private = False;
Expand Down
12 changes: 7 additions & 5 deletions src/core/Mu.pm
Expand Up @@ -569,9 +569,10 @@ my class Mu { # declared in BOOTSTRAP
$meth ??
$meth(SELF, |c) !!
X::Method::NotFound.new(
method => '!' ~ $name,
typename => $type.HOW.name($type),
:private,
object => SELF,
method => '!' ~ $name,
typename => $type.HOW.name($type),
:private,
).throw;
}

Expand All @@ -594,8 +595,9 @@ my class Mu { # declared in BOOTSTRAP
my @result := SELF.dispatch:<.*>($name, |c);
if @result.elems == 0 {
X::Method::NotFound.new(
method => $name,
typename => SELF.HOW.name(SELF),
object => SELF,
method => $name,
typename => SELF.HOW.name(SELF),
).throw;
}
@result
Expand Down

0 comments on commit 2991f8e

Please sign in to comment.