28528519 (return % ₁₈)
286286
287287# #######################################
288- # FIXME : Nested captures of arguments
288+ # Nested captures - here `g` captures `x` because it is needed to initialize
289+ # the closure `h` which captures both `x` and `y`.
289290function f (x)
290291 function g (y)
291292 function h (z)
@@ -294,18 +295,58 @@ function f(x)
294295 end
295296end
296297# ---------------------
297- LoweringError:
298- function f (x)
299- # ╙ ── Found unexpected binding of kind argument
300- function g (y)
301- function h (z)
302-
303- Detailed provenance:
304- # ₈/x
305- └─ x
306- └─ x
307- └─ @ :1
308-
298+ 1 (method TestMod. f)
299+ 2 (call core. svec :x )
300+ 3 (call core. svec false )
301+ 4 (call JuliaLowering. eval_closure_type TestMod :# f#g##4 %₂ %₃)
302+ 5 (call core. svec :x :y )
303+ 6 (call core. svec false false )
304+ 7 (call JuliaLowering. eval_closure_type TestMod :# f#g#h##0 %₅ %₆)
305+ 8 TestMod.# f#g#h##0
306+ 9 (call core. svec % ₈ core. Any)
307+ 10 (call core. svec)
308+ 11 SourceLocation: :3 : 18
309+ 12 (call core. svec % ₉ % ₁₀ % ₁₁)
310+ 13 --- method core. nothing % ₁₂
311+ slots: [slot₁/ # self#(!read) slot₂/z]
312+ 1 (call core. getfield slot₁/ # self# :x)
313+ 2 (call core. getfield slot₁/ # self# :y)
314+ 3 (call core. tuple % ₁ % ₂ slot₂/ z)
315+ 4 (return % ₃)
316+ 14 TestMod.# f#g##4
317+ 15 (call core. svec % ₁₄ core. Any)
318+ 16 (call core. svec)
319+ 17 SourceLocation: :2 : 14
320+ 18 (call core. svec % ₁₅ % ₁₆ % ₁₇)
321+ 19 --- method core. nothing % ₁₈
322+ slots: [slot₁/ # self#(!read) slot₂/y(!read) slot₃/h]
323+ 1 TestMod.# f#g#h##0
324+ 2 (call core. getfield slot₁/ # self# :x)
325+ 3 (call core. typeof % ₂)
326+ 4 (call core. typeof slot₂/ y)
327+ 5 (call core. apply_type % ₁ % ₃ % ₄)
328+ 6 (call core. getfield slot₁/ # self# :x)
329+ 7 (new % ₅ % ₆ slot₂/ y)
330+ 8 (= slot₃/ h % ₇)
331+ 9 slot₃/ h
332+ 10 (return % ₉)
333+ 20 TestMod. f
334+ 21 (call core. Typeof % ₂₀)
335+ 22 (call core. svec % ₂₁ core. Any)
336+ 23 (call core. svec)
337+ 24 SourceLocation: :1 : 10
338+ 25 (call core. svec % ₂₂ % ₂₃ % ₂₄)
339+ 26 --- method core. nothing % ₂₅
340+ slots: [slot₁/ # self#(!read) slot₂/x(!read) slot₃/g]
341+ 1 TestMod.# f#g##4
342+ 2 (call core. typeof slot₂/ x)
343+ 3 (call core. apply_type % ₁ % ₂)
344+ 4 (new % ₃ slot₂/ x)
345+ 5 (= slot₃/ g % ₄)
346+ 6 slot₃/ g
347+ 7 (return % ₆)
348+ 27 TestMod. f
349+ 28 (return % ₂₇)
309350
310351# #######################################
311352# Global method capturing local variables
0 commit comments