mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
repl: execute REPL tests ~1.5x to 2x faster
This commit is contained in:
committed by
Alexander Medvednikov
parent
64a9f43405
commit
d92291dd76
19
vlib/compiler/tests/repl/chained_fields/ef.repl
Normal file
19
vlib/compiler/tests/repl/chained_fields/ef.repl
Normal file
@@ -0,0 +1,19 @@
|
||||
struct E { mut: v []int } struct F { e []E } mut f := F{}
|
||||
f.e << E{} // Error (field e immutable)
|
||||
f.e[0].v << 1 // Error (field e immutable)
|
||||
e := E{}
|
||||
e.v << 1 // Error (e immutable)
|
||||
===output===
|
||||
cannot modify immutable field `e` (type `F`)
|
||||
declare the field with `mut:`
|
||||
struct F {
|
||||
mut:
|
||||
e []E
|
||||
}
|
||||
cannot modify immutable field `e` (type `F`)
|
||||
declare the field with `mut:`
|
||||
struct F {
|
||||
mut:
|
||||
e []E
|
||||
}
|
||||
`e` is immutable (can't <<)
|
||||
Reference in New Issue
Block a user