summary refs log tree commit diff stats
path: root/tests/ic/tmethods.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ic/tmethods.nim')
-rw-r--r--tests/ic/tmethods.nim28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/ic/tmethods.nim b/tests/ic/tmethods.nim
new file mode 100644
index 000000000..251f26889
--- /dev/null
+++ b/tests/ic/tmethods.nim
@@ -0,0 +1,28 @@
+discard """
+  output: '''Base abc'''
+"""
+
+import mbaseobj
+
+var c = Base(s: "abc")
+m c
+
+#!EDIT!#
+
+discard """
+  output: '''Base abc
+Inherited abc'''
+"""
+
+import mbaseobj
+
+type
+  Inherited = ref object of Base
+
+method m(i: Inherited) =
+  procCall m(Base i)
+  echo "Inherited ", i.s
+
+var c = Inherited(s: "abc")
+m c
+