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

repl: add more stats and tests; compiler: tcc fixes

This commit is contained in:
Delyan Angelov
2019-09-16 00:41:12 +03:00
committed by Alexander Medvednikov
parent ff4ef337da
commit 854de4e7e0
8 changed files with 79 additions and 10 deletions

View File

@@ -0,0 +1,30 @@
mut s := 'hello world'
s.len = 0 // Error (field len immutable)
mut a := []string
a.len = 0 // Error (field len immutable)
mut ints := []int
ints.len = 0 // Error (field len immutable)
println('BYE')
===output===
.vrepl_temp.v:2:5: cannot modify immutable field `len` (type `string`)
declare the field with `mut:`
struct string {
mut:
len int
}
.vrepl_temp.v:3:5: cannot modify immutable field `len` (type `array`)
declare the field with `mut:`
struct array {
mut:
len int
}
.vrepl_temp.v:4:8: cannot modify immutable field `len` (type `array`)
declare the field with `mut:`
struct array {
mut:
len int
}
BYE