Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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
Carl Masak committed Aug 30, 2012
1 parent fc88876 commit 7d10d1a
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/Perl6/Actions.pm
Expand Up @@ -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(
Expand Down Expand Up @@ -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>,
Expand Down

0 comments on commit 7d10d1a

Please sign in to comment.