Skip to content

Commit

Permalink
check name clashes for enum names
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Sep 18, 2010
1 parent 12088a8 commit e59e96d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Perl6/Actions.pm
Expand Up @@ -1540,6 +1540,11 @@ method type_declarator:sym<enum>($/) {
unless $*SCOPE eq '' || $*SCOPE eq 'our' {
$/.CURSOR.panic("Do not yet support $*SCOPE scoped enums");
}

if $/.CURSOR.is_name(~$<name>[0]) {
$/.CURSOR.panic("Illegal redeclaration of symbol '"
~ $<name>[0] ~ "'");
}

# Install names.
$/.CURSOR.add_name(~$<name>[0]);
Expand Down

0 comments on commit e59e96d

Please sign in to comment.