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.nim15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/objects/tobjects_various.nim b/tests/objects/tobjects_various.nim
index 315193de9..55db9312e 100644
--- a/tests/objects/tobjects_various.nim
+++ b/tests/objects/tobjects_various.nim
@@ -31,7 +31,7 @@ block tobject2:
 
 block tofopr:
   type
-    TMyType = object {.inheritable.}
+    TMyType {.inheritable.} = object
       len: int
       data: string
 
@@ -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())