mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
* 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>
13 lines
199 B
Nim
13 lines
199 B
Nim
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
|