* close #4318(add testcase for #4318) * Update tests/objects/t4318.nim Co-authored-by: Juan Carlos <juancarlospaco@gmail.com> Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
This commit is contained in:
parent
bbe49a14ae
commit
35f8803250
1 changed files with 12 additions and 0 deletions
12
tests/objects/t4318.nim
Normal file
12
tests/objects/t4318.nim
Normal file
|
|
@ -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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue