Browse files

Make A::B.new in the case that A::B doens't exist emit a message that…

… mentions A::B, not just a null PMC access.
  • Loading branch information...
1 parent e889ed4 commit 9a20634ae6cf444b432d5b8dce40688a78b461fa @jnthn jnthn committed Apr 3, 2010
Showing with 12 additions and 1 deletion.
  1. +7 −1 src/Perl6/Actions.pm
  2. +5 −0 src/builtins/Failure.pir
View
8 src/Perl6/Actions.pm
@@ -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> {
View
5 src/builtins/Failure.pir
@@ -112,6 +112,11 @@ A Perl 6 Exception object.
.return ($I0)
.end
+.sub '' :vtable('invoke') :method
+ $P0 = self.'exception'()
+ $P0.'throw'()
+.end
+
=back
=cut

0 comments on commit 9a20634

Please sign in to comment.