fixes #1343
This commit is contained in:
parent
f70b35b3b7
commit
ae681be629
3 changed files with 21 additions and 5 deletions
17
tests/vm/twrongarray.nim
Normal file
17
tests/vm/twrongarray.nim
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
discard """
|
||||
errormsg: "cannot evaluate at compile time: size"
|
||||
line: 16
|
||||
"""
|
||||
|
||||
#bug #1343
|
||||
|
||||
when false:
|
||||
proc one(dummy: int, size: int) =
|
||||
var x: array[size, int] # compile error: constant expression expected
|
||||
|
||||
proc three(size: int) =
|
||||
var x: array[size * 1, int] # compile error: cannot evaluate at compile time: size
|
||||
|
||||
proc two(dummy: int, size: int) =
|
||||
var x: array[size * 1, int] # compiles, but shouldn't?
|
||||
#assert(x.len == size) # just for fun
|
||||
Loading…
Add table
Add a link
Reference in a new issue