summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2017-05-13 20:48:33 +0300
committerZahary Karadjov <zahary@gmail.com>2017-05-13 20:48:44 +0300
commit672c24e4b8fcfc07cdba6a36a2fc0445cdc3d9e9 (patch)
treed10844a3ad545f64aef9582e87566524c3c2046c /tests
parent05bfa4799697a4e06c4777b03f8009bebd4129d9 (diff)
downloadNim-672c24e4b8fcfc07cdba6a36a2fc0445cdc3d9e9.tar.gz
fix affecting templates with explicit generic params
Diffstat (limited to 'tests')
-rw-r--r--tests/template/tgenerictemplates.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/template/tgenerictemplates.nim b/tests/template/tgenerictemplates.nim
new file mode 100644
index 000000000..2c83bc0ec
--- /dev/null
+++ b/tests/template/tgenerictemplates.nim
@@ -0,0 +1,13 @@
+type
+  SomeObj = object of RootObj
+
+  Foo[T, U] = object
+    x: T
+    y: U
+
+template someTemplate[T](): tuple[id: int32, obj: T] =
+  var result: tuple[id: int32, obj: T] = (0'i32, T())
+  result
+
+let ret = someTemplate[SomeObj]()
+