summary refs log tree commit diff stats
path: root/tests/misc/t3482.nim
blob: 33b3b8f40f6b76f37a50b7f85e63cf61f24a50cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
discard """
  action: reject
  nimout: "t3482.nim(13, 8) Error: undeclared identifier: 'output'"
"""
# bug #3482 (correct behavior since 1.4.0, cgen error in 1.2.0)
template foo*(body: typed) =
  if true:
    body

proc test =
  foo:
    var output = ""
  echo output.len

test()