Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[common] An extra sanity check for add_parent (discovered missing whi…
…le fixing the previous issue, though unrelated to it).
  • Loading branch information
jnthn committed Nov 17, 2010
1 parent 9269db5 commit 0b1a12d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/NQP/NQPSetting.pm
Expand Up @@ -524,6 +524,9 @@ my knowhow NQPClassHOW {
if $!composed {
die("NQPClassHOW does not support adding parents after being composed.");
}
if $obj =:= $parent {
die("Cannot make a class its own parent.");
}
my $i := 0;
while $i != +@!parents {
if @!parents[$i] =:= $parent {
Expand Down

0 comments on commit 0b1a12d

Please sign in to comment.