mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +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>
(cherry picked from commit 35f8803250)
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
|