fix #544
This commit is contained in:
parent
1d55fd8d12
commit
70b5efa98d
2 changed files with 13 additions and 12 deletions
|
|
@ -51,17 +51,17 @@ while i < s.len:
|
|||
write(stdout, "Du heißt " & s)
|
||||
|
||||
# bug #544
|
||||
when false:
|
||||
# yay, fails again
|
||||
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)
|
||||
|
||||
# yay, fails again
|
||||
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, range[0..2]]
|
||||
discard foo(a, b)
|
||||
|
||||
# bug #1788
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue