Revert "fixes #13195"

This reverts commit cd7904f2b2.
This commit is contained in:
Andrii Riabushenko 2020-01-19 20:33:23 +00:00
commit 6f3476d39c
3 changed files with 4 additions and 29 deletions

View file

@ -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 "}"