Skip to content

Commit

Permalink
Close #8545 by add a test case (#17432)
Browse files Browse the repository at this point in the history
Co-authored-by: Timothee Cour <[email protected]>
  • Loading branch information
konsumlamm and timotheecour authored Mar 21, 2021
1 parent b70e33f commit eca0b87
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/misc/t8545.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
discard """
targets: "c cpp js"
"""

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

0 comments on commit eca0b87

Please sign in to comment.