From 684d2e6dbf31446c9f48cda0def626cbfef3422c Mon Sep 17 00:00:00 2001 From: yuyi Date: Thu, 28 Jan 2021 21:53:54 +0800 Subject: [PATCH] checker: merge ambiguous_function_call tests (#8388) --- vlib/v/checker/tests/ambiguous_function_call.out | 13 +++++++++++++ vlib/v/checker/tests/ambiguous_function_call.vv | 13 +++++++++++++ vlib/v/checker/tests/ambiguous_function_call_a.out | 6 ------ vlib/v/checker/tests/ambiguous_function_call_a.vv | 7 ------- vlib/v/checker/tests/ambiguous_function_call_b.out | 7 ------- vlib/v/checker/tests/ambiguous_function_call_b.vv | 8 -------- 6 files changed, 26 insertions(+), 28 deletions(-) create mode 100644 vlib/v/checker/tests/ambiguous_function_call.out create mode 100644 vlib/v/checker/tests/ambiguous_function_call.vv delete mode 100644 vlib/v/checker/tests/ambiguous_function_call_a.out delete mode 100644 vlib/v/checker/tests/ambiguous_function_call_a.vv delete mode 100644 vlib/v/checker/tests/ambiguous_function_call_b.out delete mode 100644 vlib/v/checker/tests/ambiguous_function_call_b.vv diff --git a/vlib/v/checker/tests/ambiguous_function_call.out b/vlib/v/checker/tests/ambiguous_function_call.out new file mode 100644 index 0000000000..b88ef1a440 --- /dev/null +++ b/vlib/v/checker/tests/ambiguous_function_call.out @@ -0,0 +1,13 @@ +vlib/v/checker/tests/ambiguous_function_call.vv:2:2: error: ambiguous call to: `foo1`, may refer to fn `foo1` or variable `foo1` + 1 | fn foo1(foo1 int) { + 2 | foo1(foo1 + 1) + | ~~~~~~~~~~~~~~ + 3 | } + 4 | +vlib/v/checker/tests/ambiguous_function_call.vv:7:2: error: ambiguous call to: `foo2`, may refer to fn `foo2` or variable `foo2` + 5 | fn foo2() { + 6 | foo2 := 1 + 7 | foo2(foo2) + | ~~~~~~~~~~ + 8 | } + 9 | diff --git a/vlib/v/checker/tests/ambiguous_function_call.vv b/vlib/v/checker/tests/ambiguous_function_call.vv new file mode 100644 index 0000000000..2d21224a45 --- /dev/null +++ b/vlib/v/checker/tests/ambiguous_function_call.vv @@ -0,0 +1,13 @@ +fn foo1(foo1 int) { + foo1(foo1 + 1) +} + +fn foo2() { + foo2 := 1 + foo2(foo2) +} + +fn main() { + foo1(5) + foo2() +} diff --git a/vlib/v/checker/tests/ambiguous_function_call_a.out b/vlib/v/checker/tests/ambiguous_function_call_a.out deleted file mode 100644 index 5207658e8e..0000000000 --- a/vlib/v/checker/tests/ambiguous_function_call_a.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/ambiguous_function_call_a.vv:2:2: error: ambiguous call to: `foo`, may refer to fn `foo` or variable `foo` - 1 | fn foo(foo int) { - 2 | foo(foo + 1) - | ~~~~~~~~~~~~ - 3 | } - 4 | diff --git a/vlib/v/checker/tests/ambiguous_function_call_a.vv b/vlib/v/checker/tests/ambiguous_function_call_a.vv deleted file mode 100644 index e8ec08cdf7..0000000000 --- a/vlib/v/checker/tests/ambiguous_function_call_a.vv +++ /dev/null @@ -1,7 +0,0 @@ -fn foo(foo int) { - foo(foo + 1) -} - -fn main() { - foo(5) -} diff --git a/vlib/v/checker/tests/ambiguous_function_call_b.out b/vlib/v/checker/tests/ambiguous_function_call_b.out deleted file mode 100644 index 4dd519cf3d..0000000000 --- a/vlib/v/checker/tests/ambiguous_function_call_b.out +++ /dev/null @@ -1,7 +0,0 @@ -vlib/v/checker/tests/ambiguous_function_call_b.vv:3:2: error: ambiguous call to: `foo`, may refer to fn `foo` or variable `foo` - 1 | fn foo() { - 2 | foo := 1 - 3 | foo(foo) - | ~~~~~~~~ - 4 | } - 5 | diff --git a/vlib/v/checker/tests/ambiguous_function_call_b.vv b/vlib/v/checker/tests/ambiguous_function_call_b.vv deleted file mode 100644 index c1dbab3b34..0000000000 --- a/vlib/v/checker/tests/ambiguous_function_call_b.vv +++ /dev/null @@ -1,8 +0,0 @@ -fn foo() { - foo := 1 - foo(foo) -} - -fn main() { - foo() -}