@@ -414,7 +414,7 @@ function expand_tuple_destruct(ctx, ex)
414414 end
415415
416416 if kind (rhs) == K " tuple"
417- num_splat = sum (kind (rh) == K " ..." for rh in children (rhs))
417+ num_splat = sum (kind (rh) == K " ..." for rh in children (rhs); init = 0 )
418418 if num_splat == 0 && (numchildren (lhs) - num_slurp) > numchildren (rhs)
419419 throw (LoweringError (ex, " More variables on left hand side than right hand in tuple assignment" ))
420420 end
@@ -1402,7 +1402,7 @@ function expand_condition(ctx, ex)
14021402 if isblock
14031403 # Special handling so that the rules for `&&` and `||` can be applied
14041404 # to the last statement of a block
1405- @ast ctx ex [K " block" ex[1 : end - 1 ]. .. test]
1405+ @ast ctx ex [K " block" map (e -> expand_forms_2 (ctx,e), ex[1 : end - 1 ]) ... test]
14061406 else
14071407 test
14081408 end
@@ -3094,13 +3094,13 @@ function expand_arrow_arglist(ctx, arglist, arrowname)
30943094 if k == K " block"
30953095 @chk numchildren (arglist) == 2
30963096 arglist = @ast ctx arglist [K " tuple"
3097- ex [1 ]
3098- [K " parameters" ex [2 ]]
3097+ arglist [1 ]
3098+ [K " parameters" arglist [2 ]]
30993099 ]
31003100 elseif k != K " tuple"
31013101 # `x::Int -> body`
31023102 arglist = @ast ctx arglist [K " tuple"
3103- ex [1 ]
3103+ arglist [1 ]
31043104 ]
31053105 end
31063106 @ast ctx arglist [K " call"
@@ -3665,7 +3665,7 @@ function _rewrite_ctor_new_calls(ctx, ex, struct_name, global_struct_name, ctor_
36653665 full_struct_type = if kind (ex[1 ]) == K " curly"
36663666 # new{A,B}(...)
36673667 new_type_params = ex[1 ][2 : end ]
3668- n_type_splat = sum (kind (t) == K " ..." for t in new_type_params)
3668+ n_type_splat = sum (kind (t) == K " ..." for t in new_type_params; init = 0 )
36693669 n_type_nonsplat = length (new_type_params) - n_type_splat
36703670 if n_type_splat == 0 && n_type_nonsplat < length (struct_typevars)
36713671 throw (LoweringError (ex[1 ], " too few type parameters specified in `new{...}`" ))
@@ -3685,7 +3685,7 @@ function _rewrite_ctor_new_calls(ctx, ex, struct_name, global_struct_name, ctor_
36853685 end
36863686 end
36873687 new_args = ex[2 : end ]
3688- n_splat = sum (kind (t) == K " ..." for t in new_args)
3688+ n_splat = sum (kind (t) == K " ..." for t in new_args; init = 0 )
36893689 n_nonsplat = length (new_args) - n_splat
36903690 n_fields = length (field_types)
36913691 function throw_n_fields_error (desc)
0 commit comments