fixes #20227; skip distinct types for genObjConstr
This commit is contained in:
parent
b8dc58d884
commit
e832fea160
2 changed files with 19 additions and 1 deletions
|
|
@ -2272,6 +2272,7 @@ proc genObjConstr(p: PProc, n: PNode, r: var TCompRes) =
|
|||
r.kind = resExpr
|
||||
var initList : Rope
|
||||
var fieldIDs = initIntSet()
|
||||
let nTyp = n.typ.skipTypes(abstractInst)
|
||||
for i in 1..<n.len:
|
||||
if i > 1: initList.add(", ")
|
||||
var it = n[i]
|
||||
|
|
@ -2280,7 +2281,7 @@ proc genObjConstr(p: PProc, n: PNode, r: var TCompRes) =
|
|||
gen(p, val, a)
|
||||
var f = it[0].sym
|
||||
if f.loc.r == nil: f.loc.r = mangleName(p.module, f)
|
||||
fieldIDs.incl(lookupFieldAgain(n.typ, f).id)
|
||||
fieldIDs.incl(lookupFieldAgain(nTyp, f).id)
|
||||
|
||||
let typ = val.typ.skipTypes(abstractInst)
|
||||
if a.typ == etyBaseIndex:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue