-
-
Save flaviut/76225c559b0c80210df2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| test.nim(2, 9) Error: undeclared identifier: 'T' | |
| ================================================ | |
| template foo[T](a: T, body: stmt): stmt {.immediate.} = | |
| var b: T | |
| body | |
| foo("a"): | |
| discard "" # Anything else too | |
| Compiles | |
| ======= | |
| template foo(T: typedesc, a: T, body: stmt): stmt {.immediate.} = | |
| var b: T | |
| body | |
| foo(string, "a"): | |
| discard "" # Anything else too |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment