From 844ba2a177685e999084ce3fd46ab57f537a3d21 Mon Sep 17 00:00:00 2001 From: yuyi Date: Mon, 30 May 2022 18:49:13 +0800 Subject: [PATCH] checker: vfmt overload_return_type.vv (#14557) --- vlib/v/checker/tests/overload_return_type.out | 10 ++++----- vlib/v/checker/tests/overload_return_type.vv | 22 ++++++++++++------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/vlib/v/checker/tests/overload_return_type.out b/vlib/v/checker/tests/overload_return_type.out index 547519c4f..ff1aef715 100644 --- a/vlib/v/checker/tests/overload_return_type.out +++ b/vlib/v/checker/tests/overload_return_type.out @@ -1,6 +1,6 @@ -vlib/v/checker/tests/overload_return_type.vv:14:11: error: cannot assign to `two`: expected `Point`, not `int` - 12 | mut one := Point {x:1, y:2} - 13 | mut two := Point {x:5, y:1} - 14 | two = one + two +vlib/v/checker/tests/overload_return_type.vv:20:8: error: cannot assign to `two`: expected `Point`, not `int` + 18 | y: 1 + 19 | } + 20 | two = one + two | ~~~~~~~~~ - 15 | } + 21 | } diff --git a/vlib/v/checker/tests/overload_return_type.vv b/vlib/v/checker/tests/overload_return_type.vv index f9ae2f11d..03e0a901b 100644 --- a/vlib/v/checker/tests/overload_return_type.vv +++ b/vlib/v/checker/tests/overload_return_type.vv @@ -1,15 +1,21 @@ struct Point { - mut: - x int - y int +mut: + x int + y int } -fn (a Point) +(b Point) int { - return a.x + b.x +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 + mut one := Point{ + x: 1 + y: 2 + } + mut two := Point{ + x: 5 + y: 1 + } + two = one + two } -- 2.39.5