summary refs log tree commit diff stats
path: root/compiler/ccgexprs.nim
diff options
context:
space:
mode:
authorAndrii Riabushenko <cdome@bk.ru>2020-01-19 20:33:23 +0000
committerAndrii Riabushenko <cdome@bk.ru>2020-01-19 20:33:23 +0000
commit6f3476d39ce9b2f621976ec8b05078485befad7e (patch)
treec15758a29a9bfb3e50715a6ee9f557199e6ac1fd /compiler/ccgexprs.nim
parente349f7ad2196023f0ebed2ee93265a1c86e3f88c (diff)
downloadNim-6f3476d39ce9b2f621976ec8b05078485befad7e.tar.gz
Revert "fixes #13195"
This reverts commit cd7904f2b29e623998a1d32ee726d000f56fc5ce.
Diffstat (limited to 'compiler/ccgexprs.nim')
-rw-r--r--compiler/ccgexprs.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 885ee3486..eed29ff4b 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -2818,10 +2818,11 @@ proc getNullValueAux(p: BProc; t: PType; obj, constOrNil: PNode,
     # designated initilization is the only way to init non first element of unions
     # branches are allowed to have no members (b.len == 0), in this case they don't need initializer
     if  b.kind == nkRecList and b.len > 0:
-      result.add "._" &  mangleRecFieldName(p.module, obj[0].sym) & "_" & $selectedBranch & " = {"
+      result.add "._i" & $selectedBranch & " = {"
       getNullValueAux(p, t,  b, constOrNil, result, countB, isConst, info)
       result.add "}"
     elif b.kind == nkSym:
+      result.add "." & lastSon(obj[selectedBranch]).sym.loc.r & " = "
       getNullValueAux(p, t,  b, constOrNil, result, countB, isConst, info)
     result.add "}"