bugfix: immediate templates are preferred consistently (danger: breaks code)

This commit is contained in:
Araq 2014-02-04 17:29:34 +01:00
commit c097acedd3
4 changed files with 55 additions and 10 deletions

View file

@ -0,0 +1,17 @@
discard """
output: '''immediate'''
"""
# Test that immediate templates are preferred over non-immediate templates
template foo(a, b: expr) = 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: expr) {.immediate.} = echo "immediate"
template foo(a, b: bool) = echo "foo bool"
template foo(a, b: char) = echo "foo char"
foo(undeclaredIdentifier, undeclaredIdentifier2)