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