summary refs log blame commit diff stats
path: root/tests/trmacros/tnoendlessrec.nim
blob: 508770ca7f336ceef512bc00bee496dcf7936236 (plain) (tree)
1
2
3
4
5
6
7
8
9
10





                                            
                                               


              
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)