summary refs log tree commit diff stats
path: root/tests/objects/t4318.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/objects/t4318.nim')
-rw-r--r--tests/objects/t4318.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/objects/t4318.nim b/tests/objects/t4318.nim
new file mode 100644
index 000000000..beadd6909
--- /dev/null
+++ b/tests/objects/t4318.nim
@@ -0,0 +1,17 @@
+discard """
+  matrix: "--mm:refc"
+"""
+
+
+type
+  A = object of RootObj
+  B = object of A
+
+method identify(a:A) {.base.} = echo "A"
+method identify(b:B) = echo "B"
+
+var b: B
+
+doAssertRaises(ObjectAssignmentDefect):
+  var a: A = b
+  discard a