Skip to content

Commit

Permalink
Intercept method not found error for STORE
Browse files Browse the repository at this point in the history
So that we can give a better than LTA error message
  • Loading branch information
lizmat committed May 20, 2014
1 parent 2ea11cc commit 10ceb28
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Perl6/Metamodel/BOOTSTRAP.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -2929,6 +2929,12 @@ nqp::sethllconfig('perl6', nqp::hash(
},
'method_not_found_error', -> $obj, str $name {
my $type := $obj.HOW.name($obj);
if $name eq 'STORE' {
my %ex := nqp::gethllsym('perl6', 'P6EX');
if !nqp::isnull(%ex) && nqp::existskey(%ex,'X::Assignment::RO') {
nqp::atkey(%ex, 'X::Assignment::RO')($type);
}
}
nqp::die("Method '$name' not found for invocant of class '$type'");
}
#?endif
Expand Down

0 comments on commit 10ceb28

Please sign in to comment.