summary refs log tree commit diff stats
path: root/tests/method/tvtable.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/method/tvtable.nim')
-rw-r--r--tests/method/tvtable.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/method/tvtable.nim b/tests/method/tvtable.nim
new file mode 100644
index 000000000..8d98dd42c
--- /dev/null
+++ b/tests/method/tvtable.nim
@@ -0,0 +1,19 @@
+type FooBase = ref object of RootObj

+  dummy: int

+type Foo = ref object of FooBase

+  value : float32

+type Foo2 = ref object of Foo

+  change : float32

+method bar(x: FooBase, a: float32) {.base.} =

+  discard

+method bar(x: Foo, a: float32)  =

+  x.value += a

+method bar(x: Foo2, a: float32)  =

+  x.value += a

+

+

+proc test() =

+  var x = new Foo2

+  x.bar(2.3)

+

+test()
\ No newline at end of file