mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
19 lines
247 B
V
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
|