@@ -3229,7 +3229,7 @@ class QAST::CompilerJAST {
3229
3229
# Look for one required positional case. Methods with no params
3230
3230
# beyond the invocant are always this.
3231
3231
my $ param := $ block . params[0 ];
3232
- if ! $ param . named && ! $ param . slurpy && ! $ param . default {
3232
+ if ! $ param . named && ! $ param . slurpy && ! $ param . default && ! $ param . list {
3233
3233
if nqp ::objprimspec($ param . returns ) == 0 {
3234
3234
$ jmeth . add_argument(' __arg_0' , $ TYPE_SMO );
3235
3235
$ il . append (JAST::Instruction. new ( : op(' aload' ), ' __arg_0' ));
@@ -3257,7 +3257,7 @@ class QAST::CompilerJAST {
3257
3257
elsif $ num_params == 2 {
3258
3258
my $ is_obj_obj := 1 ;
3259
3259
for $ block . params {
3260
- if $ _ . named || $ _ . slurpy || $ _ . default || nqp ::objprimspec($ _ . returns ) != 0 {
3260
+ if $ _ . named || $ _ . slurpy || $ _ . default || nqp ::objprimspec($ _ . returns ) != 0 || $ _ . list {
3261
3261
$ is_obj_obj := 0 ;
3262
3262
last ;
3263
3263
}
@@ -3477,6 +3477,29 @@ class QAST::CompilerJAST {
3477
3477
' bindlex_' ~ typechar($ type ), $ jtype , $ jtype , $ TYPE_CF , ' Integer' ));
3478
3478
$ il . append (pop_ins($ type ));
3479
3479
}
3480
+
3481
+ # Emit any additional tasks and typechecks.
3482
+ for $ _ . list {
3483
+ my $ * BLOCK := $ block ;
3484
+ if nqp ::istype($ _ , QAST ::ParamTypeCheck) {
3485
+ my $ lbl := JAST::Label. new ( : name(self . unique (" tc_ok" )) );
3486
+ my $ tc := self . as_jast($ _ [0 ], : want($ RT_INT ));
3487
+ $ il . append ($ tc . jast);
3488
+ $ * STACK . obtain($ il , $ tc );
3489
+ $ il . append ($ L2I );
3490
+ $ il . append (JAST::Instruction. new ( : op(' ifne' ), $ lbl ));
3491
+ $ il . append (JAST::Instruction. new ( : op(' aload' ), ' tc' ));
3492
+ $ il . append (JAST::Instruction. new ( : op(' invokestatic' ), $ TYPE_OPS ,
3493
+ " paramcheckassertfail" , ' V' , $ TYPE_TC ));
3494
+ $ il . append ($ lbl );
3495
+ }
3496
+ else {
3497
+ my $ task := self . as_jast($ _ , : want($ RT_VOID ));
3498
+ $ il . append ($ task . jast);
3499
+ $ * STACK . obtain($ il , $ task );
3500
+ }
3501
+ }
3502
+
3480
3503
$ param_idx ++ ;
3481
3504
}
3482
3505
}
0 commit comments