summary refs log tree commit diff stats
path: root/tests/objects/tobjects_various.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/objects/tobjects_various.nim')
-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())