diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2022-08-24 19:31:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-24 13:31:44 +0200 |
commit | e832fea160409dff94799b3c79e018c6e9a957d6 (patch) | |
tree | f6545cd981d40670e4475f2290ff298fc77572ed /compiler | |
parent | b8dc58d8843af7dbd0ee2f3274e0d4cf18391dd2 (diff) | |
download | Nim-e832fea160409dff94799b3c79e018c6e9a957d6.tar.gz |
fixes #20227; skip distinct types for genObjConstr [JS backend] (#20229)
fixes #20227; skip distinct types for genObjConstr
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/jsgen.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index 39009bd2f..bbc64a2f0 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -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: |