Skip to content

Commit

Permalink
fix "cannot have attributes" error message for the mainline. jnthn++
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Oct 29, 2011
1 parent 9c6aedb commit 40f181b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Perl6/Actions.pm
Expand Up @@ -1229,7 +1229,11 @@ class Perl6::Actions is HLL::Actions {
if $*SCOPE eq 'has' {
# Ensure current package can take attributes.
unless pir::can($*PACKAGE.HOW, 'add_attribute') {
$/.CURSOR.panic("A $*PKGDECL cannot have attributes");
if $*PKGDECL {
$/.CURSOR.panic("A $*PKGDECL cannot have attributes");
} else {
$/.CURSOR.panic("You can't declare an attribute here; maybe you'd like a class or a role?");
}
}

# Create container descriptor and decide on any default value..
Expand Down

0 comments on commit 40f181b

Please sign in to comment.