close #3482 no more cgen error with typed templates (#18094)

This commit is contained in:
Timothee Cour
2021-05-26 00:44:00 -07:00
committed by GitHub
parent c495628255
commit 8df55d0ad7

15
tests/misc/t3482.nim Normal file
View File

@@ -0,0 +1,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()