mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
16 lines
495 B
Nim
16 lines
495 B
Nim
discard """
|
|
output: '''immediate'''
|
|
"""
|
|
|
|
# Test that immediate templates are preferred over non-immediate templates
|
|
|
|
template foo(a, b: untyped) = echo "foo expr"
|
|
template foo(a, b: int) = echo "foo int"
|
|
template foo(a, b: float) = echo "foo float"
|
|
template foo(a, b: string) = echo "foo string"
|
|
template foo(a, b: untyped) {.immediate.} = echo "immediate"
|
|
template foo(a, b: bool) = echo "foo bool"
|
|
template foo(a, b: char) = echo "foo char"
|
|
|
|
foo(undeclaredIdentifier, undeclaredIdentifier2)
|