Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Constructor::Positional tells what class it came from.
  • Loading branch information
timo committed Jan 24, 2013
1 parent b49cbe0 commit b5a63c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/core/Exception.pm
Expand Up @@ -885,7 +885,8 @@ my class X::Routine::Unwrap is Exception {
}

my class X::Constructor::Positional is Exception {
method message() { "Default constructor only takes named arguments" }
has $.name;
method message() { "Default constructor for '$.name' only takes named arguments" }
}

my class X::Hash::Store::OddNumber is Exception {
Expand Down
2 changes: 1 addition & 1 deletion src/core/Mu.pm
Expand Up @@ -51,7 +51,7 @@ my class Mu {
self.bless(*, |%attrinit);
}
multi method new($, *@) {
X::Constructor::Positional.new.throw;
X::Constructor::Positional.new(:name(self.^name)).throw();
}

method CREATE() {
Expand Down

0 comments on commit b5a63c6

Please sign in to comment.