added missing test for methods
This commit is contained in:
parent
7349d12e96
commit
f151b7efd1
1 changed files with 21 additions and 0 deletions
21
tests/method/tnildispatcher.nim
Normal file
21
tests/method/tnildispatcher.nim
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
discard """
|
||||
outputsub: '''Error: unhandled exception: cannot dispatch; dispatcher is nil [NilAccessError]'''
|
||||
exitcode: 1
|
||||
"""
|
||||
# bug #5599
|
||||
type
|
||||
Base = ref object of RootObj
|
||||
Derived = ref object of Base
|
||||
|
||||
method inner(obj: Base) {.base.} =
|
||||
quit "to override"
|
||||
|
||||
method outer(obj: Base) {.base.} =
|
||||
echo "outer"
|
||||
obj.inner()
|
||||
|
||||
method inner(obj: Derived) =
|
||||
echo "inner Derived"
|
||||
|
||||
var x: Derived
|
||||
x.outer()
|
||||
Loading…
Add table
Add a link
Reference in a new issue