Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
If we use is also, we need to check the class we're trying to extend …
…already exists.
  • Loading branch information
jnthn committed Feb 11, 2009
1 parent 50a61ae commit b2e7ac9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/parser/actions.pm
Expand Up @@ -1656,6 +1656,11 @@ method package_def($/, $key) {
}
}

## If it is an "is also", check that the type did already exist.
if $block<isalso> && !$/.type_redeclaration() {
$/.panic("Cannot use 'is also' on non-existent class " ~ ~$<module_name>[0]);
}

# At the beginning, create the "class/module/grammar/role/etc"
# metaclass handle on which we do the other operations.
$init.unshift(
Expand Down

0 comments on commit b2e7ac9

Please sign in to comment.