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
commit 8df55d0ad7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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()