Skip to content
Browse files

make X::Attribute::Undeclared subclass X::Undeclared

  • Loading branch information...
1 parent 92899a2 commit 13fee9c1d5275be5ba21f177d278fe00f64c41cf @moritz moritz committed Aug 17, 2012
Showing with 13 additions and 12 deletions.
  1. +2 −1 src/Perl6/Actions.pm
  2. +11 −11 src/core/Exception.pm
View
3 src/Perl6/Actions.pm
@@ -1311,9 +1311,10 @@ class Perl6::Actions is HLL::Actions {
}
unless $found {
$*W.throw($/, ['X', 'Attribute', 'Undeclared'],
- name => $name,
+ symbol => $name,
package-kind => $*PKGDECL,
package-name => $*PACKAGE.HOW.name($*PACKAGE),
+ what => 'attribute',
);
}
$attr
View
22 src/core/Exception.pm
@@ -382,12 +382,20 @@ my class X::Placeholder::Mainline is X::Placeholder::Block {
}
}
-my class X::Attribute::Undeclared does X::Comp {
- has $.name;
+my class X::Undeclared does X::Comp {
+ has $.what = 'Variable';
+ has $.symbol;
+ method message() {
+ "$.what $.symbol is not declared";
+ }
+}
+
+my class X::Attribute::Undeclared is X::Undeclared {
has $.package-kind;
has $.package-name;
+
method message() {
- "Attribute $.name not declared in $.package-kind $.package-name";
+ "Attribute $.symbol not declared in $.package-kind $.package-name";
}
}
@@ -400,14 +408,6 @@ my class X::Redeclaration does X::Comp {
}
}
-my class X::Undeclared does X::Comp {
- has $.what = 'Variable';
- has $.symbol;
- method message() {
- "$.what $.symbol is not declared";
- }
-}
-
my class X::Phaser::Multiple does X::Comp {
has $.block;
method message() { "Only one $.block block is allowed" }

0 comments on commit 13fee9c

Please sign in to comment.
Something went wrong with that request. Please try again.