twrongarray.nim 463 B

123456789101112131415161718
  1. discard """
  2. errormsg: "cannot evaluate at compile time: size"
  3. line: 16
  4. """
  5. #bug #1343
  6. when false:
  7. proc one(dummy: int, size: int) =
  8. var x: array[size, int] # compile error: constant expression expected
  9. proc three(size: int) =
  10. var x: array[size * 1, int] # compile error: cannot evaluate at compile time: size
  11. proc two(dummy: int, size: int) =
  12. var x: array[size * 1, int] # compiles, but shouldn't?
  13. # doAssert(x.len == size) # just for fun