diff options
author | Araq <rumpf_a@web.de> | 2014-11-16 21:59:21 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-11-16 21:59:21 +0100 |
commit | fd532b6dab930db7f456700f791065f22c155f9c (patch) | |
tree | 9a7798784af491c739520d0f77c6e3e7fec603d1 /tests/trmacros | |
parent | 69a994b59ee91d3221fe7a696cd40671b15e335b (diff) | |
download | Nim-fd532b6dab930db7f456700f791065f22c155f9c.tar.gz |
fixes #206
Diffstat (limited to 'tests/trmacros')
-rw-r--r-- | tests/trmacros/tnoalias2.nim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/trmacros/tnoalias2.nim b/tests/trmacros/tnoalias2.nim new file mode 100644 index 000000000..5a816acb9 --- /dev/null +++ b/tests/trmacros/tnoalias2.nim @@ -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 |