summary refs log tree commit diff stats
path: root/tests/method
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-03-25 13:05:32 +0100
committerAraq <rumpf_a@web.de>2015-03-25 13:05:32 +0100
commit94f2d639b18f71a4d17347ab134c155dc00cc788 (patch)
tree0c57bb0d8fe86c56de24669bea39f77667fa5b2f /tests/method
parent117903a6ae01201522af6a2a95aa7c4e0f5fd6a2 (diff)
downloadNim-94f2d639b18f71a4d17347ab134c155dc00cc788.tar.gz
fixes #2401
Diffstat (limited to 'tests/method')
-rw-r--r--tests/method/temptybody.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/method/temptybody.nim b/tests/method/temptybody.nim
new file mode 100644
index 000000000..26285d05b
--- /dev/null
+++ b/tests/method/temptybody.nim
@@ -0,0 +1,11 @@
+# bug #2401
+
+type MyClass = ref object of RootObj
+
+method HelloWorld*(obj: MyClass) =
+  when defined(myPragma):
+    echo("Hello World")
+  # discard # with this line enabled it works
+
+var obj = MyClass()
+obj.HelloWorld()