fixes #20856; store defaults directly (#20859)

* fixes #20856; store defaults directly

* fixes

* fixes

* check

* fixes
This commit is contained in:
ringabout 2022-11-17 09:38:50 +08:00 • committed by GitHub
commit 1707bc4a99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 10 deletions

View file

@ -1066,13 +1066,6 @@ proc transform(c: PTransf, n: PNode): PNode =
result = n
of nkExceptBranch:
result = transformExceptBranch(c, n)
of nkObjConstr:
result = n
if result.typ.skipTypes({tyGenericInst, tyAlias, tySink}).kind == tyObject or
result.typ.skipTypes({tyGenericInst, tyAlias, tySink}).kind == tyRef and result.typ.skipTypes({tyGenericInst, tyAlias, tySink})[0].kind == tyObject:
result.sons.add result[0].sons
result[0] = newNodeIT(nkType, result.info, result.typ)
result = transformSons(c, result)
of nkCheckedFieldExpr:
result = transformSons(c, n)
if result[0].kind != nkDotExpr: