Skip to content

Commit

Permalink
Close nim-lang#8545 by add a test case
Browse files Browse the repository at this point in the history
  • Loading branch information
konsumlamm committed Mar 21, 2021
1 parent b70e33f commit 0efa230
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"
"""

# https://github.com/nim-lang/Nim/issues/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 0efa230

Please sign in to comment.