v2 / vlib / v / slow_tests / repl / immutable_len_fields / fields.3.repl.skip
11 lines · 11 sloc · 208 bytes · 6a32c810703f4ec0c39fe18298ebe6c40acac8f1
Raw
1mut ints := []int
2ints.len = 0 // Error (field len immutable)
3println('BYE')
4===output===
5cannot modify immutable field `len` (type `array`)
6declare the field with `mut:`
7struct array {
8mut:
9 len int
10}
11BYE
12