summary refs log tree commit diff stats
path: root/tests/compile/tloops.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-07-19 08:41:57 +0200
committerAraq <rumpf_a@web.de>2012-07-19 08:41:57 +0200
commitc9513c2e5a42e6a34e11568a708d3db80d2b6283 (patch)
treeb0afda9b00088e3e9d7c96acf915572f546cfb60 /tests/compile/tloops.nim
parentb9e7f30dda8a066e7a5e439b98d94fc729c1d9b5 (diff)
downloadNim-c9513c2e5a42e6a34e11568a708d3db80d2b6283.tar.gz
bugfix: constraint matching for tyGenericInst; implements #130
Diffstat (limited to 'tests/compile/tloops.nim')
-rwxr-xr-xtests/compile/tloops.nim23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/compile/tloops.nim b/tests/compile/tloops.nim
index 74a3992c9..2b1765b00 100755
--- a/tests/compile/tloops.nim
+++ b/tests/compile/tloops.nim
@@ -62,3 +62,26 @@ proc Foo(n: int): int =
 

 # We should come till here :-)

 discard Foo(345)

+
+# test the new type symbol lookup feature:
+
+type
+  MyType[T] = tuple[
+    x, y, z: T]
+  MyType2 = tuple[x, y: float]
+
+proc main[T]() =
+  var myType: MyType[T]
+  var b: MyType[T]
+  b = (1, 2, 3)
+  myType = b
+  echo myType
+  
+  var myType2: MyType2
+  var c: MyType2
+  c = (1.0, 2.0)
+  myType2 = c
+  echo myType2
+
+main[int]()
+