Permalink
Browse files

[Perl6::Actions] throw X::TypeCheck::Splice everywhere

This make the remaining two code paths for macros catch up
with the fact that we now throw X::TypeCheck::Splice when
a macro to be spliced into mainline code doesn't return
an AST. See also fc88876.
  • Loading branch information...
1 parent fc88876 commit 7d10d1aae2288b9e7c9529c9899bd845ced808fc @masak masak committed Aug 30, 2012
Showing with 11 additions and 6 deletions.
  1. +11 −6 src/Perl6/Actions.pm
View
@@ -3531,10 +3531,11 @@ class Perl6::Actions is HLL::Actions {
return 1;
}
unless istype($quasi_ast, $ast_class) {
- $*W.throw($/, 'X::TypeCheck::MacroUnquote',
- got => $quasi_ast,
- expected => $ast_class,
- symbol => $*longname.text,
+ $*W.throw('X::TypeCheck::Splice',
+ got => $quasi_ast,
+ expected => $ast_class,
+ symbol => $*longname.text,
+ action => 'macro application',
);
}
$past := QAST::Block.new(
@@ -3924,8 +3925,12 @@ class Perl6::Actions is HLL::Actions {
return 1;
}
unless istype($quasi_ast, $ast_class) {
- # XXX: Need to awesomeize with which type it got
- $/.CURSOR.panic('Macro did not return AST');
+ $*W.throw('X::TypeCheck::Splice',
+ got => $quasi_ast,
+ expected => $ast_class,
+ symbol => $name,
+ action => 'macro application',
+ );
}
my $past := QAST::Block.new(
:blocktype<raw>,

0 comments on commit 7d10d1a

Please sign in to comment.