This commit is contained in:
zah 2019-01-07 13:10:54 +02:00 • committed by Andreas Rumpf
commit 87f8ec5b92
2 changed files with 24 additions and 1 deletions

View file

@ -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)