summary refs log blame commit diff stats
path: root/tests/system/tstatic_callable.nim
blob: 92d1fca8d9e16e9a48800bfd289f46aaf67252bc (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                 
# bug #16987

proc getNum(a: int): int = a

# Below calls "doAssert getNum(123) == 123" at compile time.
static:
  doAssert getNum(123) == 123

# Below calls evaluate the "getNum(123)" at compile time, but the
# results of those calls get used at run time.
doAssert (static getNum(123)) == 123
doAssert (static(getNum(123))) == 123