fixes endless recursion with static type parameters

This commit is contained in:
Araq 2015-02-14 21:47:21 +01:00
commit 442dc30922
2 changed files with 27 additions and 2 deletions

View file

@ -0,0 +1,17 @@
type
RectArray*[R, C: static[int], T] = distinct array[R * C, T]
StaticMatrix*[R, C: static[int], T] = object
elements*: RectArray[R, C, T]
StaticVector*[N: static[int], T] = StaticMatrix[N, 1, T]
proc foo*[N, T](a: StaticVector[N, T]): T = 0.T
proc foobar*[N, T](a, b: StaticVector[N, T]): T = 0.T
var a: StaticVector[3, int]
echo foo(a) # OK
echo foobar(a, a) # <--- hangs compiler