Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Catch routine redeclaration in actions, rather than leaving it to IMC…
…C to whine about.
  • Loading branch information
jnthn committed Jul 9, 2011
1 parent dba1c2f commit a78aaa0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions NOMMAP.markdown
Expand Up @@ -20,8 +20,6 @@ Things that aren't blockers but might be worth knowing about:
(known - multis in nested lexical scopes in general just NYI - jnthn)
* 'has num $.attr' segfaults on access to .attr, because it uses the PMC form
of get_attribute
* two protos of the same name in the same scope produce an IMCC error
"error:imcc:Multiple declarations of lexical '&foo'"

## Lexical Multi-Part names
For my X::Base { ... }, my Foo::Bar { ... } etc. The our-scoped ones work.
Expand Down
4 changes: 4 additions & 0 deletions src/Perl6/Actions.pm
Expand Up @@ -1144,6 +1144,10 @@ class Perl6::Actions is HLL::Actions {
}
else {
# Install.
if $outer.symbol($name) {
$/.CURSOR.panic("Illegal redeclaration of routine '" ~
~$<deflongname>[0].ast ~ "'");
}
if $*SCOPE eq '' || $*SCOPE eq 'my' {
$*ST.install_lexical_symbol($outer, $name, $code);
}
Expand Down

0 comments on commit a78aaa0

Please sign in to comment.