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

24 lines
372 B
V

struct Foo {
}
pub fn (f Foo) str() string { return 'Foo{}' }
fn process_foo(foo &Foo) {
println('>process_foo, called for ${foo} === ${*foo}')
}
fn get_foo() Foo {
println('>get_foo')
return Foo{}
}
/*
// TODO: Fix this. It 'works' only with tcc, but is not stable.
fn test_ref_fn_arg() {
process_foo(get_foo())
println(3434)
assert true
}
*/
fn test_dummy(){}