diff options
Diffstat (limited to 'tests/objects/tobjects_various.nim')
-rw-r--r-- | tests/objects/tobjects_various.nim | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/objects/tobjects_various.nim b/tests/objects/tobjects_various.nim index a6c4628af..55db9312e 100644 --- a/tests/objects/tobjects_various.nim +++ b/tests/objects/tobjects_various.nim @@ -17,7 +17,6 @@ block tobject2: z: int # added a field proc getPoint( p: var TPoint2d) = - {.breakpoint.} writeLine(stdout, p.x) var p: TPoint3d @@ -32,7 +31,7 @@ block tobject2: block tofopr: type - TMyType = object {.inheritable.} + TMyType {.inheritable.} = object len: int data: string @@ -106,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()) |