diff options
Diffstat (limited to 'tests/method/tmultim6.nim')
-rw-r--r-- | tests/method/tmultim6.nim | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/tests/method/tmultim6.nim b/tests/method/tmultim6.nim deleted file mode 100644 index 97ed2845c..000000000 --- a/tests/method/tmultim6.nim +++ /dev/null @@ -1,30 +0,0 @@ -discard """ - output: "collide: unit, thing | collide: unit, thing | collide: thing, unit |" -""" -# Test multi methods - -type - TThing = object {.inheritable.} - TUnit[T] = object of TThing - x: T - TParticle = object of TThing - a, b: int - -method collide(a, b: TThing) {.base, inline.} = - quit "to override!" - -method collide[T](a: TThing, b: TUnit[T]) {.inline.} = - write stdout, "collide: thing, unit | " - -method collide[T](a: TUnit[T], b: TThing) {.inline.} = - write stdout, "collide: unit, thing | " - -proc test(a, b: TThing) {.inline.} = - collide(a, b) - -var - a: TThing - b, c: TUnit[string] -collide(b, TThing(c)) -test(b, c) -collide(a, b) |