* fixes #18469

* Update compiler/injectdestructors.nim
This commit is contained in:
Andreas Rumpf 2021-07-20 22:15:06 +02:00 • committed by GitHub
commit f8519657c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 74 additions and 15 deletions

View file

@ -2229,16 +2229,6 @@ proc genTupleConstr(p: PProc, n: PNode, r: var TCompRes) =
r.res.addf("Field$#: $#", [i.rope, a.res])
r.res.add("}")
proc lookupFieldAgain(ty: PType; field: PSym): PSym =
var ty = ty
while ty != nil:
ty = ty.skipTypes(skipPtrs)
assert(ty.kind in {tyTuple, tyObject})
result = lookupInRecord(ty.n, field.name)
if result != nil: break
ty = ty[0]
if result == nil: result = field
proc genObjConstr(p: PProc, n: PNode, r: var TCompRes) =
var a: TCompRes
r.kind = resExpr