tstatic_callable.nim 332 B

12345678910111213
  1. # bug #16987
  2. proc getNum(a: int): int = a
  3. # Below calls "doAssert getNum(123) == 123" at compile time.
  4. static:
  5. doAssert getNum(123) == 123
  6. # Below calls evaluate the "getNum(123)" at compile time, but the
  7. # results of those calls get used at run time.
  8. doAssert (static getNum(123)) == 123
  9. doAssert (static(getNum(123))) == 123