summary refs log tree commit diff stats
path: root/tests/objects
diff options
context:
space:
mode:
authornarimiran <narimiran@disroot.org>2019-02-27 12:39:35 +0100
committernarimiran <narimiran@disroot.org>2019-02-27 12:39:35 +0100
commit588610b395e5cfc5ae12fbb05fbec57d7e00caa1 (patch)
tree230f9494a2a162a252ddbf7d9ef722caf406499a /tests/objects
parentca4b971bc81b2e751e0388d80896fde7079b1679 (diff)
downloadNim-588610b395e5cfc5ae12fbb05fbec57d7e00caa1.tar.gz
add tests, closes #3012, closes #7244
Diffstat (limited to 'tests/objects')
-rw-r--r--tests/objects/tobjects_various.nim21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/objects/tobjects_various.nim b/tests/objects/tobjects_various.nim
index 504681b99..a6c4628af 100644
--- a/tests/objects/tobjects_various.nim
+++ b/tests/objects/tobjects_various.nim
@@ -85,3 +85,24 @@ block tfefobjsyntax:
 
   var y: ref FooBar = (ref Baz)(n: "n", m: "m")
   invoke((ref Baz)(y))
+
+
+
+block t3012:
+  type
+    A {.inheritable.} = object
+    C {.inheritable.} = ref object
+
+  type
+    AA = ref object of A
+    CC = ref object of C
+
+
+
+block t7244:
+  type
+    Foo = ref object of RootRef
+    Bar = ref object of Foo
+
+  proc test(foo: var Foo) = discard
+  proc test(bar: var Bar) = test(Foo(bar))