tnildispatcher.nim 422 B

12345678910111213141516171819202122
  1. discard """
  2. outputsub: '''Error: unhandled exception: cannot dispatch; dispatcher is nil [NilAccessDefect]'''
  3. exitcode: 1
  4. """
  5. # bug #5599
  6. type
  7. Base = ref object of RootObj
  8. Derived = ref object of Base
  9. method inner(obj: Base) {.base.} =
  10. quit "to override"
  11. method outer(obj: Base) {.base.} =
  12. echo "outer"
  13. obj.inner()
  14. method inner(obj: Derived) =
  15. echo "inner Derived"
  16. var x: Derived
  17. x.outer()