@@ -287,21 +287,25 @@ function _to_lowered_expr(ex::SyntaxTree, stmt_offset::Int)
287287 elseif k == K " method"
288288 cs = map (e-> _to_lowered_expr (e, stmt_offset), children (ex))
289289 # Ad-hoc unwrapping to satisfy `Expr(:method)` expectations
290- c1 = cs[1 ] isa QuoteNode ? cs[1 ]. value : cs[1 ]
290+ cs1 = cs[1 ]
291+ c1 = cs1 isa QuoteNode ? cs1. value : cs1
291292 Expr (:method , c1, cs[2 : end ]. .. )
292293 elseif k == K " newvar"
293294 Core. NewvarNode (_to_lowered_expr (ex[1 ], stmt_offset))
294295 elseif k == K " opaque_closure_method"
295296 args = map (e-> _to_lowered_expr (e, stmt_offset), children (ex))
296297 # opaque_closure_method has special non-evaluated semantics for the
297298 # `functionloc` line number node so we need to undo a level of quoting
298- @assert args[4 ] isa QuoteNode
299- args[4 ] = args[4 ]. value
299+ arg4 = args[4 ]
300+ @assert arg4 isa QuoteNode
301+ args[4 ] = arg4. value
300302 Expr (:opaque_closure_method , args... )
301303 elseif k == K " meta"
302304 args = Any[_to_lowered_expr (e, stmt_offset) for e in children (ex)]
303305 # Unpack K"Symbol" QuoteNode as `Expr(:meta)` requires an identifier here.
304- args[1 ] = args[1 ]. value
306+ arg1 = args[1 ]
307+ @assert arg1 isa QuoteNode
308+ args[1 ] = arg1. value
305309 Expr (:meta , args... )
306310 elseif k == K " static_eval"
307311 @assert numchildren (ex) == 1
@@ -339,7 +343,11 @@ function _to_lowered_expr(ex::SyntaxTree, stmt_offset::Int)
339343 if isnothing (head)
340344 throw (LoweringError (ex, " Unhandled form for kind $k " ))
341345 end
342- Expr (head, map (e-> _to_lowered_expr (e, stmt_offset), children (ex))... )
346+ ret = Expr (head)
347+ for e in children (ex)
348+ push! (ret. args, _to_lowered_expr (e, stmt_offset))
349+ end
350+ return ret
343351 end
344352end
345353
0 commit comments