Skip to content

Commit eca0b87

Browse files
Close #8545 by add a test case (#17432)
Co-authored-by: Timothee Cour <[email protected]>
1 parent b70e33f commit eca0b87

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/misc/t8545.nim

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
discard """
2+
targets: "c cpp js"
3+
"""
4+
5+
# bug #8545
6+
7+
template bar(a: static[bool]): untyped = int
8+
9+
proc main() =
10+
proc foo1(a: static[bool]): auto = 1
11+
doAssert foo1(true) == 1
12+
13+
proc foo2(a: static[bool]): bar(a) = 1
14+
doAssert foo2(true) == 1
15+
16+
proc foo3(a: static[bool]): bar(cast[static[bool]](a)) = 1
17+
doAssert foo3(true) == 1
18+
19+
proc foo4(a: static[bool]): bar(static(a)) = 1
20+
doAssert foo4(true) == 1
21+
22+
static: main()
23+
main()

0 commit comments

Comments
 (0)