Skip to content

Commit 8df55d0

Browse files
authored
close #3482 no more cgen error with typed templates (#18094)
1 parent c495628 commit 8df55d0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/misc/t3482.nim

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
discard """
2+
action: reject
3+
nimout: "t3482.nim(13, 8) Error: undeclared identifier: 'output'"
4+
"""
5+
# bug #3482 (correct behavior since 1.4.0, cgen error in 1.2.0)
6+
template foo*(body: typed) =
7+
if true:
8+
body
9+
10+
proc test =
11+
foo:
12+
var output = ""
13+
echo output.len
14+
15+
test()

0 commit comments

Comments
 (0)