Gitly
English
Русский
Español
日本語
中文
Português
Pricing
Log in
Register
vxx2
/
vlib
/
v
/
checker
/
tests
/
immutable_pointer_selector_field_err.vv
22
lines
·
19
sloc
·
251 bytes
·
6e63a22212c65a49734ed499ab6d92fef84ead48
Raw
1
struct AnotherStruct {
2
mut:
3
str string
4
}
5
6
@[params]
7
struct MyOptions {
8
data &AnotherStruct
9
}
10
11
fn fn_test(args MyOptions) {
12
mut x := args.data
13
x.str = 'why is this possible?'
14
}
15
16
fn main() {
17
fn_test(
18
data: &AnotherStruct{
19
str: 'test'
20
}
21
)
22
}
23