diff options
Diffstat (limited to 'tests/compile')
-rwxr-xr-x | tests/compile/tloops.nim | 23 |
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]() + |