fixes #798
This commit is contained in:
parent
5d6053173a
commit
7c065bfadf
12 changed files with 10 additions and 2 deletions
11
tests/trmacros/tpartial.nim
Normal file
11
tests/trmacros/tpartial.nim
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
discard """
|
||||
output: '''-2'''
|
||||
"""
|
||||
|
||||
proc p(x, y: int; cond: bool): int =
|
||||
result = if cond: x + y else: x - y
|
||||
|
||||
template optP{p(x, y, true)}(x, y: expr): expr = x - y
|
||||
template optP{p(x, y, false)}(x, y: expr): expr = x + y
|
||||
|
||||
echo p(2, 4, true)
|
||||
Loading…
Add table
Add a link
Reference in a new issue