checker: merge ambiguous_function_call tests (#8388)

pull/8396/head
yuyi 2021-01-28 21:53:54 +08:00 committed by GitHub
parent 4fcd8d8a98
commit 684d2e6dbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 28 deletions

View File

@ -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 |

View File

@ -0,0 +1,13 @@
fn foo1(foo1 int) {
foo1(foo1 + 1)
}
fn foo2() {
foo2 := 1
foo2(foo2)
}
fn main() {
foo1(5)
foo2()
}

View File

@ -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 |

View File

@ -1,7 +0,0 @@
fn foo(foo int) {
foo(foo + 1)
}
fn main() {
foo(5)
}

View File

@ -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 |

View File

@ -1,8 +0,0 @@
fn foo() {
foo := 1
foo(foo)
}
fn main() {
foo()
}