1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: warn when fixed-size ArrayInit doesn't have trailing {}. (#6137)

This commit is contained in:
Nick Treleaven
2020-08-16 03:54:05 +01:00
committed by GitHub
parent a02593204f
commit bab5c21224
15 changed files with 27 additions and 28 deletions

View File

@ -301,7 +301,7 @@ struct Foooj {
}
fn test_fixed() {
mut nums := [4]int
mut nums := [4]int{}
//x := nums[1..3]
//assert x.len == 2
assert nums[0] == 0
@ -310,7 +310,7 @@ fn test_fixed() {
assert nums[3] == 0
nums[1] = 7
assert nums[1] == 7
nums2 := [5]int // c_n
nums2 := [5]int{} // c_n
assert nums2[c_n - 1] == 0
}