Skip to content

Commit

Permalink
Make A::B.new in the case that A::B doens't exist emit a message that…
Browse files Browse the repository at this point in the history
… mentions A::B, not just a null PMC access.
  • Loading branch information
jnthn committed Apr 2, 2010
1 parent e889ed4 commit 9a20634
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Perl6/Actions.pm
Expand Up @@ -1746,7 +1746,13 @@ method term:sym<name>($/) {
$var := PAST::Var.new( :name(~$<longname>), :scope('lexical') );
}
else {
$var := PAST::Var.new( :name(~$name), :namespace($ns), :scope('package') );
$var := PAST::Var.new(
:name(~$name), :namespace($ns), :scope('package'),
:viviself(PAST::Op.new(
:pasttype('call'), :name('!FAIL'),
"Can not find sub " ~ ~$<longname>
))
);
}
my $past := $var;
if $<args> {
Expand Down
5 changes: 5 additions & 0 deletions src/builtins/Failure.pir
Expand Up @@ -112,6 +112,11 @@ A Perl 6 Exception object.
.return ($I0)
.end

.sub '' :vtable('invoke') :method
$P0 = self.'exception'()
$P0.'throw'()
.end

=back

=cut
Expand Down

0 comments on commit 9a20634

Please sign in to comment.