t22673.nim 463 B

123456789101112131415161718192021
  1. discard """
  2. matrix: "--warningAsError:UseBase"
  3. """
  4. # bug #22673
  5. type RefEntry = ref object of RootObj
  6. type RefFile = ref object of RefEntry
  7. filename*: string
  8. data*: string
  9. type RefDir = ref object of RefEntry
  10. dirname*: string
  11. files*: seq[RefFile]
  12. method name*(e: RefEntry): lent string {.base.} =
  13. raiseAssert "Don't call the base method"
  14. method name*(e: RefFile): lent string = e.filename
  15. method name*(e: RefDir): lent string = e.dirname