1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/v/tests/return_aliases_of_fixed_array_test.v
2023-07-13 11:58:49 +03:00

19 lines
247 B
V

type Mat = [2][2]int
fn test_main() {
a := Mat([[1, 2]!, [3, 4]!]!)
println(a.foo())
z := a.foo()
assert z == [[1, 2]!, [3, 4]!]!
}
// vfmt off
fn (v Mat) foo() Mat {
return v
}
fn bar() Mat {
return Mat([[1, 2]!, [3, 4]!]!)
}
// vfmt on