summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-11-17 09:38:50 +0800
committerGitHub <noreply@github.com>2022-11-17 09:38:50 +0800
commit1707bc4a992bc966a7439facb9ee819023c22f77 (patch)
tree34faa9fea4f0734e63225bfc0f496aca8df94d7c /tests
parentcdbf5b469949366d56f1eb2dbc7721eaf0cbc218 (diff)
downloadNim-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.nim13
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())