@@ -359,14 +359,13 @@ function closures_to_opaque(ex::Expr, return_type = nothing)
359359 end
360360 return _ex
361361 elseif head === :generator
362- f_args = Expr (:tuple , Any[x. args[1 ] for x in args[2 : end ]]. .. )
362+ f_args = Expr (:tuple )
363+ f_args. args = Any[x. args[1 ] for x in args[2 : end ]]
363364 iters = Any[x. args[2 ] for x in args[2 : end ]]
364- return Expr (
365- :call ,
366- GlobalRef (Base, :Generator ),
367- closures_to_opaque (Expr (:(-> ), f_args, args[1 ])),
368- iters...
369- )
365+ new_ex = Expr (:call , GlobalRef (Base, :Generator ),
366+ closures_to_opaque (Expr (:(-> ), f_args, args[1 ])))
367+ append! (new_ex. args, iters)
368+ return new_ex
370369 elseif head === :opaque_closure
371370 return closures_to_opaque (args[1 ])
372371 elseif head === :return && return_type != = nothing
@@ -375,7 +374,9 @@ function closures_to_opaque(ex::Expr, return_type = nothing)
375374 _tconvert (return_type, closures_to_opaque (args[1 ], return_type))
376375 )
377376 end
378- return Expr (head, Any[closures_to_opaque (x, return_type) for x in args]. .. )
377+ new_ex = Expr (head)
378+ new_ex. args = Any[closures_to_opaque (x, return_type) for x in args]
379+ return new_ex
379380end
380381
381382"""
0 commit comments