summary refs log tree commit diff stats
path: root/tests/template/tprefer_immediate.nim
blob: 3a4cfc07b019975f60373aa323120f509803a7ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)