t4318.nim 199 B

12345678910111213
  1. type
  2. A = object of RootObj
  3. B = object of A
  4. method identify(a:A) {.base.} = echo "A"
  5. method identify(b:B) = echo "B"
  6. var b: B
  7. doAssertRaises(ObjectAssignmentDefect):
  8. var a: A = b
  9. discard a