From 35f8803250d5e12cbff79614cd9f3ef0a622066d Mon Sep 17 00:00:00 2001 From: flywind <43030857+xflywind@users.noreply.github.com> Date: Wed, 11 Nov 2020 10:29:17 +0800 Subject: [PATCH] close #4318(add testcase for #4318) (#15904) * close #4318(add testcase for #4318) * Update tests/objects/t4318.nim Co-authored-by: Juan Carlos Co-authored-by: Juan Carlos --- tests/objects/t4318.nim | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/objects/t4318.nim diff --git a/tests/objects/t4318.nim b/tests/objects/t4318.nim new file mode 100644 index 0000000000..34ff722f5c --- /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