Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Catch adding a null method - it's almost certainly a sign of a problem.
  • Loading branch information
jnthn committed Apr 20, 2011
1 parent e199d50 commit 30a5cbb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/metamodel/how/NQPClassHOW.pm
Expand Up @@ -61,6 +61,9 @@ knowhow NQPClassHOW {
if %!methods{$name} {
pir::die("This class already has a method named " ~ $name);
}
if pir::isnull__IP($code_obj) || pir::isa__IPs($code_obj, 'Undef') {
pir::die("Cannot add a null method '$name' to class '$!name'");
}
%!methods{$name} := $code_obj;
}

Expand Down

0 comments on commit 30a5cbb

Please sign in to comment.