tmethods.nim 314 B

1234567891011121314151617181920212223242526272829
  1. discard """
  2. output: '''Base abc'''
  3. """
  4. import mbaseobj
  5. var c = Base(s: "abc")
  6. m c
  7. #!EDIT!#
  8. discard """
  9. output: '''Base abc
  10. Inherited abc'''
  11. """
  12. import mbaseobj
  13. type
  14. Inherited = ref object of Base
  15. method m(i: Inherited) =
  16. procCall m(Base i)
  17. echo "Inherited ", i.s
  18. var c = Inherited(s: "abc")
  19. m c