mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
semcheck negative array length (#7518)
This commit is contained in:
committed by
Andreas Rumpf
parent
7e1f0e28ae
commit
651c0e45da
@@ -46,3 +46,7 @@ let arr3: array[0, string] = []
|
||||
doAssert(arr1.len == 0)
|
||||
doAssert(arr2.len == 0)
|
||||
doAssert(arr3.len == 0)
|
||||
|
||||
# Negative array length is not allowed (#6852)
|
||||
doAssert(not compiles(block:
|
||||
var arr: array[-1, int]))
|
||||
Reference in New Issue
Block a user