Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added test for call to block with slurpy
The functionality was already there.
  • Loading branch information
Carl Masak committed May 26, 2012
1 parent cd60db0 commit 2b55922
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/QAST/Compiler.nqp
Expand Up @@ -464,6 +464,10 @@ class QAST::Compiler is HLL::Compiler {
# both registers and literals.
return $post;
}
elsif $result eq 'p' && $desired eq 'P' {
# <jnthn> Hmm...lowercase p doesn't make any sense
return $post;
}
else {
pir::die("Coercion from '$result' to '$desired' NYI");
}
Expand Down
25 changes: 25 additions & 0 deletions t/qast/qast.t
Expand Up @@ -790,3 +790,28 @@ is_qast(
'DDD, greg',
'callmethod with named arguments works');

{
my $elems := QAST::Block.new(
QAST::Var.new( :name('array'), :slurpy, :scope('local'), :decl('param') ),
QAST::Op.new(
:op('elems'),
QAST::Var.new( :name('array'), :scope('local') ),
),
);

is_qast(
QAST::Block.new(
$elems,
QAST::Op.new(
:op('call'),
QAST::BVal.new( :value($elems) ),
QAST::IVal.new( :value(1) ),
QAST::IVal.new( :value(2) ),
QAST::IVal.new( :value(3) ),
QAST::IVal.new( :value(4) ),
)
),
4,
'call to block with slurpy parameter works');
}

0 comments on commit 2b55922

Please sign in to comment.