diff options
-rw-r--r-- | tests/objects/t4318.nim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/objects/t4318.nim b/tests/objects/t4318.nim new file mode 100644 index 000000000..34ff722f5 --- /dev/null +++ b/tests/objects/t4318.nim @@ -0,0 +1,12 @@ +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 |