v/vlib/v/checker/tests/overload_return_type.vv

22 lines
192 B
V

struct Point {
mut:
x int
y int
}
fn (a Point) + (b Point) int {
return a.x + b.x
}
fn main() {
mut one := Point{
x: 1
y: 2
}
mut two := Point{
x: 5
y: 1
}
two = one + two
}