Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
RT #115356: redeclaring a class as a role
  • Loading branch information
moritz committed Oct 20, 2012
1 parent d171b92 commit b866287
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Perl6/Grammar.pm
Expand Up @@ -1371,8 +1371,8 @@ grammar Perl6::Grammar is HLL::Grammar {
# If it exists already, then it's either uncomposed (in which
# case we just stubbed it), a role (in which case multiple
# variants are OK) or else an illegal redecl.
if $exists && $*PKGDECL ne 'role' {
if $*PACKAGE.HOW.is_composed($*PACKAGE) {
if $exists && ($*PKGDECL ne 'role' || !nqp::can($*PACKAGE.HOW, 'configure_punning')) {
if $*PKGDECL eq 'role' || $*PACKAGE.HOW.is_composed($*PACKAGE) {
$*W.throw($/, ['X', 'Redeclaration'],
symbol => $longname.name(),
);
Expand Down

0 comments on commit b866287

Please sign in to comment.