diff options
author | Zahary Karadjov <zahary@gmail.com> | 2018-05-26 20:46:22 +0300 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2018-05-26 20:46:22 +0300 |
commit | 1c478db37546c0ec94537dca6a6aa81e3c623390 (patch) | |
tree | 027b202abd810d0dbe8a76f5d31b5dabdfab69a0 /tests | |
parent | 09283bb9399f3eba62d2ce682d25b7b34a4ec135 (diff) | |
download | Nim-1c478db37546c0ec94537dca6a6aa81e3c623390.tar.gz |
fix #7883; fix #7829
Diffstat (limited to 'tests')
-rw-r--r-- | tests/template/tgenerictemplates.nim | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/template/tgenerictemplates.nim b/tests/template/tgenerictemplates.nim index 2c83bc0ec..142505b1a 100644 --- a/tests/template/tgenerictemplates.nim +++ b/tests/template/tgenerictemplates.nim @@ -11,3 +11,27 @@ template someTemplate[T](): tuple[id: int32, obj: T] = let ret = someTemplate[SomeObj]() +# https://github.com/nim-lang/Nim/issues/7829 +proc inner*[T](): int = + discard + +template outer*[A](): untyped = + inner[A]() + +template outer*[B](x: int): untyped = + inner[B]() + +var i1 = outer[int]() +var i2 = outer[int](i1) + +# https://github.com/nim-lang/Nim/issues/7883 +template t1[T: int|int64](s: string): T = + var t: T + t + +template t1[T: int|int64](x: int, s: string): T = + var t: T + t + +var i3: int = t1[int]("xx") + |