fixes #206
This commit is contained in:
parent
69a994b59e
commit
fd532b6dab
2 changed files with 20 additions and 1 deletions
19
tests/trmacros/tnoalias2.nim
Normal file
19
tests/trmacros/tnoalias2.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
discard """
|
||||
output: '''0'''
|
||||
"""
|
||||
|
||||
# bug #206
|
||||
template optimizeOut{testFunc(a, b)}(a: int, b: int{alias}) : expr = 0
|
||||
|
||||
proc testFunc(a, b: int): int = result = a + b
|
||||
var testVar = 1
|
||||
echo testFunc(testVar, testVar)
|
||||
|
||||
|
||||
template ex{a = b + c}(a : int{noalias}, b, c : int) =
|
||||
a = b
|
||||
inc a, b
|
||||
echo "came here"
|
||||
|
||||
var x = 5
|
||||
x = x + x
|
||||
Loading…
Add table
Add a link
Reference in a new issue