blob: 48b886cb89a474c1136f551beafffc544e9a7338 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
discard """
# just tests that this doesn't crash the compiler
errormsg: "cannot instantiate: 'a:type'"
"""
# bug #8545
template bar(a: static[bool]): untyped = int
proc main() =
proc foo1(a: static[bool]): auto = 1
doAssert foo1(true) == 1
proc foo2(a: static[bool]): bar(a) = 1
doAssert foo2(true) == 1
proc foo3(a: static[bool]): bar(cast[static[bool]](a)) = 1
doAssert foo3(true) == 1
proc foo4(a: static[bool]): bar(static(a)) = 1
doAssert foo4(true) == 1
static: main()
main()
|