diff options
author | Araq <rumpf_a@web.de> | 2013-03-18 00:22:21 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-03-18 00:22:21 +0100 |
commit | 0761b449edebe3263174a84ebcbef35dc5a4fac0 (patch) | |
tree | 0f614b32c2d2d3204a7ccff6b2ccdce55db83ff9 /tests | |
parent | 65319ba22db90e821c3e29091b10df8f84b3714b (diff) | |
download | Nim-0761b449edebe3263174a84ebcbef35dc5a4fac0.tar.gz |
fixes #304
Diffstat (limited to 'tests')
-rw-r--r-- | tests/compile/thygienictempl.nim | 8 | ||||
-rw-r--r-- | tests/compile/toverprc.nim | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/compile/thygienictempl.nim b/tests/compile/thygienictempl.nim index 98983dc55..3cdbac40e 100644 --- a/tests/compile/thygienictempl.nim +++ b/tests/compile/thygienictempl.nim @@ -8,3 +8,11 @@ template t() = echo(foo) var foo = 12 t() + + +template test_in(a, b, c: expr): bool {.immediate, dirty.} = + var result {.gensym.}: bool = false + false + +when isMainModule: + assert test_in(ret2, "test", str_val) diff --git a/tests/compile/toverprc.nim b/tests/compile/toverprc.nim index f3aa66b80..467dd36c3 100644 --- a/tests/compile/toverprc.nim +++ b/tests/compile/toverprc.nim @@ -25,3 +25,11 @@ var x = stdin.readline.split.map(parseInt).max echo x, " is the maximum!" echo "another number: ", takeParseInt(parseInt) + +type + TFoo[a,b] = object + lorem: a + ipsum: b + +proc bar[a,b](f: TFoo[a,b], x: a) = echo(x, " ", f.lorem, f.ipsum) +proc bar[a,b](f: TFoo[a,b], x: b) = echo(x, " ", f.lorem, f.ipsum) |