t4318.nim 239 B

123456789101112131415161718
  1. discard """
  2. matrix: "--mm:refc"
  3. """
  4. type
  5. A = object of RootObj
  6. B = object of A
  7. method identify(a:A) {.base.} = echo "A"
  8. method identify(b:B) = echo "B"
  9. var b: B
  10. doAssertRaises(ObjectAssignmentDefect):
  11. var a: A = b
  12. discard a