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
17
vlib/compiler/tests/repl/chained_fields/bd.repl
Normal file
17
vlib/compiler/tests/repl/chained_fields/bd.repl
Normal file
@@ -0,0 +1,17 @@
|
||||
struct A { mut: v int } struct B { a A } struct C { mut: b B } struct D { mut: c C }
|
||||
mut b := B{} b = B{A{2}}
|
||||
b.a.v = 1 // Error (field a immutable)
|
||||
b.a = A{} // Error (field a immutable)
|
||||
===output===
|
||||
cannot modify immutable field `a` (type `B`)
|
||||
declare the field with `mut:`
|
||||
struct B {
|
||||
mut:
|
||||
a A
|
||||
}
|
||||
cannot modify immutable field `a` (type `B`)
|
||||
declare the field with `mut:`
|
||||
struct B {
|
||||
mut:
|
||||
a A
|
||||
}
|
||||
Reference in New Issue
Block a user