checker: merge mul_op_wrong_type_err tests to just one (#7491)

pull/7494/head
yuyi 2020-12-23 16:14:32 +08:00 committed by GitHub
parent 36cc70983e
commit 0dd385d480
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 73 additions and 86 deletions

View File

@ -1,6 +0,0 @@
vlib/v/checker/tests/mul_op_wrong_left_type_err_a.vv:3:13: error: mismatched types `Aaa` and `any_int`
1 | struct Aaa{}
2 | fn main() {
3 | println(Aaa{} * 10)
| ~~~~~
4 | }

View File

@ -1,4 +0,0 @@
struct Aaa{}
fn main() {
println(Aaa{} * 10)
}

View File

@ -1,5 +0,0 @@
vlib/v/checker/tests/mul_op_wrong_left_type_err_b.vv:2:13: error: mismatched types `[]int` and `any_int`
1 | fn main() {
2 | println([1,2,3] * 10)
| ~~~~~~~
3 | }

View File

@ -1,3 +0,0 @@
fn main() {
println([1,2,3] * 10)
}

View File

@ -1,6 +0,0 @@
vlib/v/checker/tests/mul_op_wrong_left_type_err_c.vv:3:13: error: mismatched types `map[string]int` and `any_int`
1 | fn main() {
2 | a := map[string]int
3 | println(a * 10)
| ^
4 | }

View File

@ -1,4 +0,0 @@
fn main() {
a := map[string]int
println(a * 10)
}

View File

@ -1,7 +0,0 @@
vlib/v/checker/tests/mul_op_wrong_left_type_err_d.vv:6:11: error: infix expr: cannot use `any_float` (right expression) as `math.complex.Complex`
4 | fn main() {
5 | c1 := cmplx.complex(1,-2)
6 | c2 := c1 * 2.0
| ^
7 | println(c2)
8 | }

View File

@ -1,8 +0,0 @@
import math
import math.complex as cmplx
fn main() {
c1 := cmplx.complex(1,-2)
c2 := c1 * 2.0
println(c2)
}

View File

@ -1,6 +0,0 @@
vlib/v/checker/tests/mul_op_wrong_right_type_err_a.vv:3:18: error: mismatched types `any_int` and `Aaa`
1 | struct Aaa{}
2 | fn main() {
3 | println(10 * Aaa{})
| ~~~~~
4 | }

View File

@ -1,4 +0,0 @@
struct Aaa{}
fn main() {
println(10 * Aaa{})
}

View File

@ -1,5 +0,0 @@
vlib/v/checker/tests/mul_op_wrong_right_type_err_b.vv:2:18: error: mismatched types `any_int` and `[]int`
1 | fn main() {
2 | println(10 * [1,2,3])
| ~~~~~~~
3 | }

View File

@ -1,3 +0,0 @@
fn main() {
println(10 * [1,2,3])
}

View File

@ -1,6 +0,0 @@
vlib/v/checker/tests/mul_op_wrong_right_type_err_c.vv:3:18: error: mismatched types `any_int` and `map[string]int`
1 | fn main() {
2 | a := map[string]int
3 | println(10 * a)
| ^
4 | }

View File

@ -1,4 +0,0 @@
fn main() {
a := map[string]int
println(10 * a)
}

View File

@ -1,7 +0,0 @@
vlib/v/checker/tests/mul_op_wrong_right_type_err_d.vv:6:12: error: infix expr: cannot use `math.complex.Complex` (right expression) as `any_float`
4 | fn main() {
5 | c1 := cmplx.complex(1,-2)
6 | c2 := 2.0 * c1
| ^
7 | println(c2)
8 | }

View File

@ -1,8 +0,0 @@
import math
import math.complex as cmplx
fn main() {
c1 := cmplx.complex(1,-2)
c2 := 2.0 * c1
println(c2)
}

View File

@ -0,0 +1,56 @@
vlib/v/checker/tests/mul_op_wrong_type_err.vv:5:13: error: mismatched types `Aaa` and `any_int`
3 | struct Aaa{}
4 | fn main() {
5 | println(Aaa{} * 10)
| ~~~~~
6 | println(10 * Aaa{})
7 | println([1,2,3] * 10)
vlib/v/checker/tests/mul_op_wrong_type_err.vv:6:18: error: mismatched types `any_int` and `Aaa`
4 | fn main() {
5 | println(Aaa{} * 10)
6 | println(10 * Aaa{})
| ~~~~~
7 | println([1,2,3] * 10)
8 | println(10 * [1,2,3])
vlib/v/checker/tests/mul_op_wrong_type_err.vv:7:13: error: mismatched types `[]int` and `any_int`
5 | println(Aaa{} * 10)
6 | println(10 * Aaa{})
7 | println([1,2,3] * 10)
| ~~~~~~~
8 | println(10 * [1,2,3])
9 | a := map[string]int
vlib/v/checker/tests/mul_op_wrong_type_err.vv:8:18: error: mismatched types `any_int` and `[]int`
6 | println(10 * Aaa{})
7 | println([1,2,3] * 10)
8 | println(10 * [1,2,3])
| ~~~~~~~
9 | a := map[string]int
10 | println(a * 10)
vlib/v/checker/tests/mul_op_wrong_type_err.vv:10:13: error: mismatched types `map[string]int` and `any_int`
8 | println(10 * [1,2,3])
9 | a := map[string]int
10 | println(a * 10)
| ^
11 | println(10 * a)
12 | c1 := cmplx.complex(1,-2)
vlib/v/checker/tests/mul_op_wrong_type_err.vv:11:18: error: mismatched types `any_int` and `map[string]int`
9 | a := map[string]int
10 | println(a * 10)
11 | println(10 * a)
| ^
12 | c1 := cmplx.complex(1,-2)
13 | c2 := c1 * 2.0
vlib/v/checker/tests/mul_op_wrong_type_err.vv:13:11: error: infix expr: cannot use `any_float` (right expression) as `math.complex.Complex`
11 | println(10 * a)
12 | c1 := cmplx.complex(1,-2)
13 | c2 := c1 * 2.0
| ^
14 | println(c2)
15 | c3 := 2.0 * c1
vlib/v/checker/tests/mul_op_wrong_type_err.vv:15:12: error: infix expr: cannot use `math.complex.Complex` (right expression) as `any_float`
13 | c2 := c1 * 2.0
14 | println(c2)
15 | c3 := 2.0 * c1
| ^
16 | println(c3)
17 | }

View File

@ -0,0 +1,17 @@
import math
import math.complex as cmplx
struct Aaa{}
fn main() {
println(Aaa{} * 10)
println(10 * Aaa{})
println([1,2,3] * 10)
println(10 * [1,2,3])
a := map[string]int
println(a * 10)
println(10 * a)
c1 := cmplx.complex(1,-2)
c2 := c1 * 2.0
println(c2)
c3 := 2.0 * c1
println(c3)
}