mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 06:18:51 +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>
This commit is contained in:
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
|
||||
Reference in New Issue
Block a user