v/vlib/v/checker/tests/no_heap_struct.vv

26 lines
183 B
V

struct Abc {
mut:
n int
}
struct St {
mut:
a &Abc
}
fn f(x &Abc) St {
s := St{
a: x
}
return s
}
fn g(mut x Abc) &Abc {
return x
}
fn h(x &Abc) &Abc {
y := x
return y
}