1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/compiler/tests/repl/immutable_len_fields/fields.3.repl
2020-01-20 23:04:26 +01:00

12 lines
208 B
Plaintext

mut ints := []int
ints.len = 0 // Error (field len immutable)
println('BYE')
===output===
cannot modify immutable field `len` (type `array`)
declare the field with `mut:`
struct array {
mut:
len int
}
BYE