forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close nim-lang#8545 by add a test case
- Loading branch information
1 parent
b70e33f
commit 0efa230
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |