Nim/tests/trmacros/tnoendlessrec.nim
2017-07-25 09:28:23 +02:00

10 lines
153 B
Nim

discard """
output: "4"
"""
# test that an endless recursion is avoided:
template optLen{len(x)}(x: typed): int = len(x)
var s = "lala"
echo len(s)