diff options
author | zah <zahary@gmail.com> | 2019-01-07 13:10:54 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-01-07 12:10:54 +0100 |
commit | 87f8ec5b92d5647ab4b1875262e845d51dd82763 (patch) | |
tree | 6dc75f243cbfd0eb8ba93258bb9dcc65bb42c56e /tests | |
parent | 5345c5b1302e7beca5eb88ed510570e8e4431413 (diff) | |
download | Nim-87f8ec5b92d5647ab4b1875262e845d51dd82763.tar.gz |
Fix #10073 (#10218)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/statictypes/tstatictypes.nim | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/statictypes/tstatictypes.nim b/tests/statictypes/tstatictypes.nim index 2a3b7332d..9888165cc 100644 --- a/tests/statictypes/tstatictypes.nim +++ b/tests/statictypes/tstatictypes.nim @@ -116,3 +116,19 @@ block: Tensor[B: static[Backend]; T] = object BackProp[B: static[Backend],T] = proc (gradient: Tensor[B,T]): Tensor[B,T] + +# https://github.com/nim-lang/Nim/issues/10073 +block: + proc foo[N: static int](x: var int, + y: int, + z: static int, + arr: array[N, int]): auto = + var t1 = (a: x, b: y, c: z, d: N) + var t2 = (x, y, z, N) + doAssert t1 == t2 + result = t1 + + var y = 20 + var x = foo(y, 10, 15, [1, 2, 3]) + doAssert x == (20, 10, 15, 3) + |