summary refs log blame commit diff stats
path: root/tests/method/temptybody.nim
blob: 26285d05b79a561ecc1d71c35d1c1ea4b81cb913 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
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()