diff options
Diffstat (limited to 'tests/method/tmethods1.nim')
-rw-r--r-- | tests/method/tmethods1.nim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/method/tmethods1.nim b/tests/method/tmethods1.nim new file mode 100644 index 000000000..43a260bca --- /dev/null +++ b/tests/method/tmethods1.nim @@ -0,0 +1,22 @@ +discard """ + output: "do nothing" +""" + +method somethin(obj: TObject) = + echo "do nothing" + +type + TNode* = object {.inheritable.} + PNode* = ref TNode + + PNodeFoo* = ref object of TNode + + TSomethingElse = object + PSomethingElse = ref TSomethingElse + +method foo(a: PNode, b: PSomethingElse) = discard +method foo(a: PNodeFoo, b: PSomethingElse) = discard + +var o: TObject +o.somethin() + |