This commit is contained in:
Araq 2013-07-24 22:32:09 +02:00
commit b1d4dfa6b1
4 changed files with 21 additions and 3 deletions

View file

@ -46,3 +46,15 @@ while i < s.len:
i = i + 1
write(stdout, "Du heißt " & s)
# bug #544
type Bar [T; I:range] = array[I, T]
proc foo*[T; I:range](a, b: Bar[T, I]): Bar[T, I] =
when len(a) != 3:
# Error: constant expression expected
{.fatal:"Dimensions have to be 3".}
#...
block:
var a, b: Bar[int, 0..2]
discard foo(a, b)