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
parent cdbf5b4699
commit 1707bc4a99
3 changed files with 16 additions and 10 deletions

View File

@@ -105,3 +105,16 @@ block t7244:
proc test(foo: var Foo) = discard
proc test(bar: var Bar) = test(Foo(bar))
import std/macros
#bug #20856
macro ensureImplWorksOnConstr(t: typed): untyped =
expectKind(t, nnkObjConstr)
doAssert t[0].getTypeInst.getImpl.repr == "A = object"
doAssert t[0].getImpl.repr == "A = object"
type A = object
ensureImplWorksOnConstr(A())