summary refs log tree commit diff stats
path: root/compiler/lambdalifting.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/lambdalifting.nim')
-rw-r--r--compiler/lambdalifting.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim
index 53fca4863..753602c80 100644
--- a/compiler/lambdalifting.nim
+++ b/compiler/lambdalifting.nim
@@ -716,11 +716,16 @@ proc liftCapturedVars(n: PNode; owner: PSym; d: DetectionPass;
         #localError(n.info, "internal error: closure to closure created")
         # now we know better, so patch it:
         n.sons[0] = x.sons[0]
+        n.sons[1] = x.sons[1]
   of nkLambdaKinds, nkIteratorDef:
     if n.typ != nil and n[namePos].kind == nkSym:
       let m = newSymNode(n[namePos].sym)
       m.typ = n.typ
       result = liftCapturedVars(m, owner, d, c)
+  of nkHiddenStdConv:
+    if n.len == 2:
+      n.sons[1] = liftCapturedVars(n[1], owner, d, c)
+      if n[1].kind == nkClosure: result = n[1]
   else:
     if owner.isIterator:
       if n.kind == nkYieldStmt:
m?h=devel&id=6ff66bfd519f076b5453b1bdcf94086b4ee658f4'>^
b64eeeb43 ^

328e7a100 ^
ce859d8c1 ^
b64eeeb43 ^
b64eeeb43 ^





70ea45cdb ^
b64eeeb43 ^




9de3bc8ef ^
669a56449 ^

ce859d8c1 ^
b64eeeb43 ^
51672aef7 ^
b64eeeb43 ^





669a56449 ^
b64eeeb43 ^
51672aef7 ^
b64eeeb43 ^

9de3bc8ef ^

51672aef7 ^
b64eeeb43 ^




51672aef7 ^
d68181246 ^
7c065bfad ^
51672aef7 ^

b64eeeb43 ^


70ea45cdb ^
b64eeeb43 ^




9de3bc8ef ^
73c6efdf6 ^
b64eeeb43 ^
2589d69ed ^
9de3bc8ef ^
ce859d8c1 ^
9de3bc8ef ^
ce859d8c1 ^
b64eeeb43 ^


328e7a100 ^
9de3bc8ef ^
b64eeeb43 ^



328e7a100 ^
9de3bc8ef ^
b64eeeb43 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103