diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2022-11-17 09:38:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-17 09:38:50 +0800 |
commit | 1707bc4a992bc966a7439facb9ee819023c22f77 (patch) | |
tree | 34faa9fea4f0734e63225bfc0f496aca8df94d7c /tests | |
parent | cdbf5b469949366d56f1eb2dbc7721eaf0cbc218 (diff) | |
download | Nim-1707bc4a992bc966a7439facb9ee819023c22f77.tar.gz |
fixes #20856; store defaults directly (#20859)
* fixes #20856; store defaults directly * fixes * fixes * check * fixes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/objects/tobjects_various.nim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/objects/tobjects_various.nim b/tests/objects/tobjects_various.nim index 8ec090f42..55db9312e 100644 --- a/tests/objects/tobjects_various.nim +++ b/tests/objects/tobjects_various.nim @@ -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()) |