t20515.nim 305 B

123456789101112131415161718192021
  1. discard """
  2. errormsg: "Base method 'zzz' requires explicit '{.gcsafe.}' to be GC-safe"
  3. line: 10
  4. """
  5. type
  6. A = ref object of RootObj
  7. B = ref object of A
  8. method zzz(a: A) {.base.} =
  9. discard
  10. var s: seq[int]
  11. method zzz(a: B) =
  12. echo s
  13. proc xxx(someObj: A) {.gcsafe.} =
  14. someObj.zzz()
  15. xxx(B())