summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2022-08-31 13:19:26 +0200
committerGitHub <noreply@github.com>2022-08-31 13:19:26 +0200
commit5211a471c82f8952e64753fb84b962263f9945b0 (patch)
tree1406b12a64a641ca674e283743da3e62b255516f /compiler
parentd4c0d35b32e51eae06e65e78c253cdaf8bb42446 (diff)
downloadNim-5211a471c82f8952e64753fb84b962263f9945b0.tar.gz
fixes the regressions caused by the fix for #20107 [backport] (#20287)
* fixes the regressions caused by the fix for #20107 [backport]
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgexprs.nim1
-rw-r--r--compiler/injectdestructors.nim2
2 files changed, 2 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index fb2f4aeaf..99e43056d 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -735,6 +735,7 @@ proc derefBlock(p: BProc, e: PNode, d: var TLoc) =
   # We transform (block: x)[] to (block: x[])
   let e0 = e[0]
   var n = shallowCopy(e0)
+  n.typ = e.typ
   for i in 0 ..< e0.len - 1:
     n[i] = e0[i]
   n[e0.len-1] = newTreeIT(nkHiddenDeref, e.info, e.typ, e0[e0.len-1])
diff --git a/compiler/injectdestructors.nim b/compiler/injectdestructors.nim
index 867d30d96..4cb3b4f50 100644
--- a/compiler/injectdestructors.nim
+++ b/compiler/injectdestructors.nim
@@ -569,7 +569,7 @@ proc processScope(c: var Con; s: var Scope; ret: PNode): PNode =
 
 template processScopeExpr(c: var Con; s: var Scope; ret: PNode, processCall: untyped): PNode =
   assert not ret.typ.isEmptyType
-  var result = newNodeI(nkStmtListExpr, ret.info)
+  var result = newNodeIT(nkStmtListExpr, ret.info, ret.typ)
   # There is a possibility to do this check: s.wasMoved.len > 0 or s.final.len > 0
   # later and use it to eliminate the temporary when theres no need for it, but its
   # tricky because you would have to intercept moveOrCopy at a certain point
all typos for subexes docs' href='/ahoang/Nim/commit/doc/subexes.txt?h=devel&id=8e7917c3f7e259c33917e2c1e3774598e3f80869'>8e7917c3f ^
b336bf403 ^





0b44d812f ^
b336bf403 ^








3ea644690 ^
b336bf403 ^

0b44d812f ^
b336bf403 ^
0b44d812f ^
b336bf403 ^
0b44d812f ^
b336bf403 ^

0b44d812f ^
b336bf403 ^
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