Skip to content

Commit

Permalink
close nim-lang#4318(add testcase for nim-lang#4318) (nim-lang#15904)
Browse files Browse the repository at this point in the history
* close nim-lang#4318(add testcase for nim-lang#4318)

* Update tests/objects/t4318.nim

Co-authored-by: Juan Carlos <[email protected]>

Co-authored-by: Juan Carlos <[email protected]>
  • Loading branch information
2 people authored and ardek66 committed Mar 26, 2021
1 parent b4d3b74 commit 396708c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/objects/t4318.nim
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 396708c

Please sign in to comment.