checker: reorganize tests to match fmt tests
parent
41eb4453e3
commit
0f2f97e3e5
|
@ -360,6 +360,17 @@ pub fn (mut c Checker) infix_expr(infix_expr mut ast.InfixExpr) table.Type {
|
||||||
.left_shift {
|
.left_shift {
|
||||||
if left.kind == .array {
|
if left.kind == .array {
|
||||||
// `array << elm`
|
// `array << elm`
|
||||||
|
match infix_expr.left {
|
||||||
|
ast.Ident {
|
||||||
|
|
||||||
|
}
|
||||||
|
ast.SelectorExpr {
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
println('typeof: ${typeof(infix_expr.left)}')
|
||||||
|
}
|
||||||
|
}
|
||||||
// the expressions have different types (array_x and x)
|
// the expressions have different types (array_x and x)
|
||||||
if c.table.check(c.table.value_type(left_type), right_type) {
|
if c.table.check(c.table.value_type(left_type), right_type) {
|
||||||
// []T << T
|
// []T << T
|
||||||
|
|
|
@ -5,7 +5,7 @@ fn test_all() {
|
||||||
mut total_errors := 0
|
mut total_errors := 0
|
||||||
vexe := os.getenv('VEXE')
|
vexe := os.getenv('VEXE')
|
||||||
// vroot := os.dir(vexe)
|
// vroot := os.dir(vexe)
|
||||||
dir := 'vlib/v/checker/tests/inout'
|
dir := 'vlib/v/checker/tests'
|
||||||
files := os.ls(dir) or {
|
files := os.ls(dir) or {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/add_op_wrong_left_type_err_a.v:3:5: error: mismatched types `A` and `int`
|
||||||
|
1| struct A{}
|
||||||
|
2| fn main() {
|
||||||
|
3| A{} + 10
|
||||||
|
~~~
|
||||||
|
4| }
|
|
@ -0,0 +1,4 @@
|
||||||
|
struct A{}
|
||||||
|
fn main() {
|
||||||
|
A{} + 10
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
vlib/v/checker/tests/add_op_wrong_left_type_err_b.v:2:5: error: mismatched types `array_int` and `int`
|
||||||
|
1| fn main() {
|
||||||
|
2| [1,2,3] + 10
|
||||||
|
~~~~~~~
|
||||||
|
3| }
|
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
[1,2,3] + 10
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/add_op_wrong_left_type_err_c.v:3:5: error: mismatched types `map_string_int` and `int`
|
||||||
|
1| fn main() {
|
||||||
|
2| a := map[string]int
|
||||||
|
3| a + 10
|
||||||
|
^
|
||||||
|
4| }
|
|
@ -0,0 +1,4 @@
|
||||||
|
fn main() {
|
||||||
|
a := map[string]int
|
||||||
|
a + 10
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/add_op_wrong_right_type_err_a.v:3:10: error: mismatched types `int` and `A`
|
||||||
|
1| struct A{}
|
||||||
|
2| fn main() {
|
||||||
|
3| 10 + A{}
|
||||||
|
~~~
|
||||||
|
4| }
|
|
@ -0,0 +1,4 @@
|
||||||
|
struct A{}
|
||||||
|
fn main() {
|
||||||
|
10 + A{}
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
vlib/v/checker/tests/add_op_wrong_right_type_err_b.v:2:10: error: mismatched types `int` and `array_int`
|
||||||
|
1| fn main() {
|
||||||
|
2| 10 + [1,2,3]
|
||||||
|
~~~~~~~
|
||||||
|
3| }
|
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
10 + [1,2,3]
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/add_op_wrong_right_type_err_c.v:3:10: error: mismatched types `int` and `map_string_int`
|
||||||
|
1| fn main() {
|
||||||
|
2| a := map[string]int
|
||||||
|
3| 10 + a
|
||||||
|
^
|
||||||
|
4| }
|
|
@ -0,0 +1,4 @@
|
||||||
|
fn main() {
|
||||||
|
a := map[string]int
|
||||||
|
10 + a
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
vlib/v/checker/tests/alias_type_exists.v:1:1: error: type `Bird` doesn't exist
|
||||||
|
1| type Pigeon Bird
|
||||||
|
~~~~~~~~~~~
|
||||||
|
2|
|
||||||
|
3| fn main() {
|
|
@ -0,0 +1,5 @@
|
||||||
|
type Pigeon Bird
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/assign_expr_type_err_a.v:3:2: error: operator <<= not defined on left operand type `f64`
|
||||||
|
1| fn main() {
|
||||||
|
2| mut foo := 0.5
|
||||||
|
3| foo <<= 1
|
||||||
|
~~~
|
||||||
|
4| }
|
|
@ -0,0 +1,4 @@
|
||||||
|
fn main() {
|
||||||
|
mut foo := 0.5
|
||||||
|
foo <<= 1
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
mut foo := 0.5
|
mut foo := 0.5
|
||||||
foo <<= 1
|
foo <<= 1
|
||||||
}
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/assign_expr_type_err_b.v:3:9: error: operator %= not defined on right operand type `string`
|
||||||
|
1| fn main() {
|
||||||
|
2| mut foo := 10
|
||||||
|
3| foo %= 'hello'
|
||||||
|
~~~~~~~
|
||||||
|
4| }
|
|
@ -0,0 +1,4 @@
|
||||||
|
fn main() {
|
||||||
|
mut foo := 10
|
||||||
|
foo %= 'hello'
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
mut foo := 10
|
mut foo := 10
|
||||||
foo %= 'hello'
|
foo %= 'hello'
|
||||||
}
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/assign_expr_type_err_c.v:3:2: error: operator *= not defined on left operand type `string`
|
||||||
|
1| fn main() {
|
||||||
|
2| mut foo := 'hello'
|
||||||
|
3| foo *= 10
|
||||||
|
~~~
|
||||||
|
4| }
|
|
@ -0,0 +1,4 @@
|
||||||
|
fn main() {
|
||||||
|
mut foo := 'hello'
|
||||||
|
foo *= 10
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
mut foo := 'hello'
|
mut foo := 'hello'
|
||||||
foo *= 10
|
foo *= 10
|
||||||
}
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/assign_expr_type_err_d.v:3:9: error: operator /= not defined on right operand type `bool`
|
||||||
|
1| fn main() {
|
||||||
|
2| mut foo := 1.5
|
||||||
|
3| foo /= true
|
||||||
|
~~~~
|
||||||
|
4| }
|
|
@ -0,0 +1,4 @@
|
||||||
|
fn main() {
|
||||||
|
mut foo := 1.5
|
||||||
|
foo /= true
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
mut foo := 1.5
|
mut foo := 1.5
|
||||||
foo /= true
|
foo /= true
|
||||||
}
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/assign_expr_type_err_e.v:3:2: error: operator -= not defined on left operand type `string`
|
||||||
|
1| fn main() {
|
||||||
|
2| mut foo := 'hello'
|
||||||
|
3| foo -= `a`
|
||||||
|
~~~
|
||||||
|
4| }
|
|
@ -0,0 +1,4 @@
|
||||||
|
fn main() {
|
||||||
|
mut foo := 'hello'
|
||||||
|
foo -= `a`
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
mut foo := 'hello'
|
mut foo := 'hello'
|
||||||
foo -= `a`
|
foo -= `a`
|
||||||
}
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/assign_expr_type_err_f.v:3:9: error: operator -= not defined on right operand type `bool`
|
||||||
|
1| fn main() {
|
||||||
|
2| mut foo := 10
|
||||||
|
3| foo -= false
|
||||||
|
~~~~~
|
||||||
|
4| }
|
|
@ -0,0 +1,4 @@
|
||||||
|
fn main() {
|
||||||
|
mut foo := 10
|
||||||
|
foo -= false
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
mut foo := 10
|
mut foo := 10
|
||||||
foo -= false
|
foo -= false
|
||||||
}
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/assign_expr_type_err_g.v:3:2: error: operator += not defined on left operand type `bool`
|
||||||
|
1| fn main() {
|
||||||
|
2| mut foo := true
|
||||||
|
3| foo += false
|
||||||
|
~~~
|
||||||
|
4| }
|
|
@ -0,0 +1,4 @@
|
||||||
|
fn main() {
|
||||||
|
mut foo := true
|
||||||
|
foo += false
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
mut foo := true
|
mut foo := true
|
||||||
foo += false
|
foo += false
|
||||||
}
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/assign_expr_type_err_h.v:3:9: error: operator += not defined on right operand type `bool`
|
||||||
|
1| fn main() {
|
||||||
|
2| mut foo := 'hello'
|
||||||
|
3| foo += false
|
||||||
|
~~~~~
|
||||||
|
4| }
|
|
@ -0,0 +1,4 @@
|
||||||
|
fn main() {
|
||||||
|
mut foo := 'hello'
|
||||||
|
foo += false
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
mut foo := 'hello'
|
mut foo := 'hello'
|
||||||
foo += false
|
foo += false
|
||||||
}
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/assign_expr_type_err_i.v:3:9: error: cannot assign `string` to variable `foo` of type `f64`
|
||||||
|
1| fn main() {
|
||||||
|
2| mut foo := 1.5
|
||||||
|
3| foo += 'hello'
|
||||||
|
~~~~~~~
|
||||||
|
4| }
|
|
@ -0,0 +1,4 @@
|
||||||
|
fn main() {
|
||||||
|
mut foo := 1.5
|
||||||
|
foo += 'hello'
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
mut foo := 1.5
|
mut foo := 1.5
|
||||||
foo += 'hello'
|
foo += 'hello'
|
||||||
}
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
vlib/v/checker/tests/bit_op_wrong_left_type_err.v:2:2: error: left type of `&` cannot be non-integer type f64
|
||||||
|
1| fn main() {
|
||||||
|
2| 0.5 & 1
|
||||||
|
~~~
|
||||||
|
3| }
|
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
0.5 & 1
|
||||||
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
0.5 & 1
|
0.5 & 1
|
||||||
}
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
vlib/v/checker/tests/bit_op_wrong_right_type_err.v:2:6: error: right type of `|` cannot be non-integer type f64
|
||||||
|
1| fn main() {
|
||||||
|
2| 1 | 0.5
|
||||||
|
~~~
|
||||||
|
3| }
|
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
1 | 0.5
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
vlib/v/checker/tests/inout/cannot_assign_array.v:9:11: error: cannot assign `array_fixed_f64_8` to variable `ctx.vb` of type `string`
|
vlib/v/checker/tests/cannot_assign_array.v:9:11: error: cannot assign `array_fixed_f64_8` to variable `ctx.vb` of type `string`
|
||||||
7| mut ctx := Context{}
|
7| mut ctx := Context{}
|
||||||
8| x := 2.32
|
8| x := 2.32
|
||||||
9| ctx.vb = [1.1, x, 3.3, 4.4, 5.0, 6.0, 7.0, 8.9]!!
|
9| ctx.vb = [1.1, x, 3.3, 4.4, 5.0, 6.0, 7.0, 8.9]!!
|
|
@ -0,0 +1,10 @@
|
||||||
|
struct Context {
|
||||||
|
pub mut:
|
||||||
|
vb string
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
mut ctx := Context{}
|
||||||
|
x := 2.32
|
||||||
|
ctx.vb = [1.1, x, 3.3, 4.4, 5.0, 6.0, 7.0, 8.9]!!
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
vlib/v/checker/tests/decl_underscore.v:2:2: error: variable names cannot start with `__`
|
||||||
|
1| fn main() {
|
||||||
|
2| __abc := 1
|
||||||
|
~~~~~
|
||||||
|
3| }
|
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
__abc := 1
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/div_op_wrong_left_type_err_a.v:3:5: error: mismatched types `A` and `int`
|
||||||
|
1| struct A{}
|
||||||
|
2| fn main() {
|
||||||
|
3| A{} / 10
|
||||||
|
~~~
|
||||||
|
4| }
|
|
@ -0,0 +1,4 @@
|
||||||
|
struct A{}
|
||||||
|
fn main() {
|
||||||
|
A{} / 10
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
vlib/v/checker/tests/div_op_wrong_left_type_err_b.v:2:5: error: mismatched types `array_int` and `int`
|
||||||
|
1| fn main() {
|
||||||
|
2| [1,2,3] / 10
|
||||||
|
~~~~~~~
|
||||||
|
3| }
|
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
[1,2,3] / 10
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/div_op_wrong_left_type_err_c.v:3:5: error: mismatched types `map_string_int` and `int`
|
||||||
|
1| fn main() {
|
||||||
|
2| a := map[string]int
|
||||||
|
3| a / 10
|
||||||
|
^
|
||||||
|
4| }
|
|
@ -0,0 +1,4 @@
|
||||||
|
fn main() {
|
||||||
|
a := map[string]int
|
||||||
|
a / 10
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/div_op_wrong_right_type_err_a.v:3:10: error: mismatched types `int` and `A`
|
||||||
|
1| struct A{}
|
||||||
|
2| fn main() {
|
||||||
|
3| 10 / A{}
|
||||||
|
~~~
|
||||||
|
4| }
|
|
@ -0,0 +1,4 @@
|
||||||
|
struct A{}
|
||||||
|
fn main() {
|
||||||
|
10 / A{}
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
vlib/v/checker/tests/div_op_wrong_right_type_err_b.v:2:10: error: mismatched types `int` and `array_int`
|
||||||
|
1| fn main() {
|
||||||
|
2| 10 / [1,2,3]
|
||||||
|
~~~~~~~
|
||||||
|
3| }
|
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
10 / [1,2,3]
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/div_op_wrong_right_type_err_c.v:3:10: error: mismatched types `int` and `map_string_int`
|
||||||
|
1| fn main() {
|
||||||
|
2| a := map[string]int
|
||||||
|
3| 10 / a
|
||||||
|
^
|
||||||
|
4| }
|
|
@ -0,0 +1,4 @@
|
||||||
|
fn main() {
|
||||||
|
a := map[string]int
|
||||||
|
10 / a
|
||||||
|
}
|
|
@ -1,11 +1,11 @@
|
||||||
vlib/v/checker/tests/inout/enum_err.v:4:13: error: default value for enum has to be an integer
|
vlib/v/checker/tests/enum_err.v:4:13: error: default value for enum has to be an integer
|
||||||
2|
|
2|
|
||||||
3| enum Color {
|
3| enum Color {
|
||||||
4| green = 'green',
|
4| green = 'green',
|
||||||
~~~~~~~
|
~~~~~~~
|
||||||
5| yellow = 1+1,
|
5| yellow = 1+1,
|
||||||
6| blue,
|
6| blue,
|
||||||
vlib/v/checker/tests/inout/enum_err.v:5:14: error: default value for enum has to be an integer
|
vlib/v/checker/tests/enum_err.v:5:14: error: default value for enum has to be an integer
|
||||||
3| enum Color {
|
3| enum Color {
|
||||||
4| green = 'green',
|
4| green = 'green',
|
||||||
5| yellow = 1+1,
|
5| yellow = 1+1,
|
|
@ -0,0 +1,11 @@
|
||||||
|
module main
|
||||||
|
|
||||||
|
enum Color {
|
||||||
|
green = 'green',
|
||||||
|
yellow = 1+1,
|
||||||
|
blue,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main(){
|
||||||
|
println('hello')
|
||||||
|
}
|
|
@ -1,9 +1,9 @@
|
||||||
vlib/v/checker/tests/inout/fn_type_exists.v:1:1: error: type `Pants` doesn't exist
|
vlib/v/checker/tests/fn_type_exists.v:1:1: error: type `Pants` doesn't exist
|
||||||
1| type PantsCreator = fn (a Shirt) Pants
|
1| type PantsCreator = fn (a Shirt) Pants
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
2|
|
2|
|
||||||
3| type PantsConsumer = fn (p Pants)
|
3| type PantsConsumer = fn (p Pants)
|
||||||
vlib/v/checker/tests/inout/fn_type_exists.v:3:1: error: type `Pants` doesn't exist
|
vlib/v/checker/tests/fn_type_exists.v:3:1: error: type `Pants` doesn't exist
|
||||||
1| type PantsCreator = fn (a Shirt) Pants
|
1| type PantsCreator = fn (a Shirt) Pants
|
||||||
2|
|
2|
|
||||||
3| type PantsConsumer = fn (p Pants)
|
3| type PantsConsumer = fn (p Pants)
|
|
@ -0,0 +1,7 @@
|
||||||
|
type PantsCreator = fn (a Shirt) Pants
|
||||||
|
|
||||||
|
type PantsConsumer = fn (p Pants)
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/for-in-index-type.v:2:11: error: for in: cannot index `int`
|
||||||
|
1| fn main() {
|
||||||
|
2| for a in 52 {
|
||||||
|
~~
|
||||||
|
3| println(a)
|
||||||
|
4| }
|
|
@ -0,0 +1,5 @@
|
||||||
|
fn main() {
|
||||||
|
for a in 52 {
|
||||||
|
println(a)
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/for_in_range_not_match_type.v:2:11: error: range types do not match
|
||||||
|
1| fn main() {
|
||||||
|
2| for i in 10..10.5 {
|
||||||
|
~~
|
||||||
|
3| println(i)
|
||||||
|
4| }
|
|
@ -0,0 +1,5 @@
|
||||||
|
fn main() {
|
||||||
|
for i in 10..10.5 {
|
||||||
|
println(i)
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
vlib/v/checker/tests/for_in_range_string_type.v:2:11: error: range type can not be string
|
||||||
|
1| fn main() {
|
||||||
|
2| for i in 'a'..'b' {
|
||||||
|
~~~
|
||||||
|
3| println(i)
|
||||||
|
4| }
|
|
@ -0,0 +1,5 @@
|
||||||
|
fn main() {
|
||||||
|
for i in 'a'..'b' {
|
||||||
|
println(i)
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
vlib/v/checker/tests/go_expr.v:2:5: error: expression in `go` must be a function call
|
||||||
|
1| fn main() {
|
||||||
|
2| go 1
|
||||||
|
^
|
||||||
|
3| }
|
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
go 1
|
||||||
|
}
|
|
@ -1,53 +1,53 @@
|
||||||
vlib/v/checker/tests/inout/in_mismatch_type.v:13:7: error: the data type on the left of `in` does not match the array item type
|
vlib/v/checker/tests/in_mismatch_type.v:13:7: error: the data type on the left of `in` does not match the array item type
|
||||||
11| }
|
11| }
|
||||||
12| s := 'abcd'
|
12| s := 'abcd'
|
||||||
13| if 1 in a_s {
|
13| if 1 in a_s {
|
||||||
~~
|
~~
|
||||||
14| println('ok')
|
14| println('ok')
|
||||||
15| }
|
15| }
|
||||||
vlib/v/checker/tests/inout/in_mismatch_type.v:16:7: error: the data type on the left of `in` does not match the map key type
|
vlib/v/checker/tests/in_mismatch_type.v:16:7: error: the data type on the left of `in` does not match the map key type
|
||||||
14| println('ok')
|
14| println('ok')
|
||||||
15| }
|
15| }
|
||||||
16| if 2 in m {
|
16| if 2 in m {
|
||||||
~~
|
~~
|
||||||
17| println('yeah')
|
17| println('yeah')
|
||||||
18| }
|
18| }
|
||||||
vlib/v/checker/tests/inout/in_mismatch_type.v:19:7: error: the data type on the left of `in` must be a string
|
vlib/v/checker/tests/in_mismatch_type.v:19:7: error: the data type on the left of `in` must be a string
|
||||||
17| println('yeah')
|
17| println('yeah')
|
||||||
18| }
|
18| }
|
||||||
19| if 3 in s {
|
19| if 3 in s {
|
||||||
~~
|
~~
|
||||||
20| println('dope')
|
20| println('dope')
|
||||||
21| }
|
21| }
|
||||||
vlib/v/checker/tests/inout/in_mismatch_type.v:22:9: error: the data type on the left of `in` must be a string
|
vlib/v/checker/tests/in_mismatch_type.v:22:9: error: the data type on the left of `in` must be a string
|
||||||
20| println('dope')
|
20| println('dope')
|
||||||
21| }
|
21| }
|
||||||
22| if `a` in s {
|
22| if `a` in s {
|
||||||
~~
|
~~
|
||||||
23| println("oh no :'(")
|
23| println("oh no :'(")
|
||||||
24| }
|
24| }
|
||||||
vlib/v/checker/tests/inout/in_mismatch_type.v:25:7: error: `in` can only be used with an array/map/string
|
vlib/v/checker/tests/in_mismatch_type.v:25:7: error: `in` can only be used with an array/map/string
|
||||||
23| println("oh no :'(")
|
23| println("oh no :'(")
|
||||||
24| }
|
24| }
|
||||||
25| if 1 in 12 {
|
25| if 1 in 12 {
|
||||||
~~
|
~~
|
||||||
26| println('right')
|
26| println('right')
|
||||||
27| }
|
27| }
|
||||||
vlib/v/checker/tests/inout/in_mismatch_type.v:28:12: error: the data type on the left of `in` does not match the map key type
|
vlib/v/checker/tests/in_mismatch_type.v:28:12: error: the data type on the left of `in` does not match the map key type
|
||||||
26| println('right')
|
26| println('right')
|
||||||
27| }
|
27| }
|
||||||
28| if Int(2) in m {
|
28| if Int(2) in m {
|
||||||
~~
|
~~
|
||||||
29| println('yeah')
|
29| println('yeah')
|
||||||
30| }
|
30| }
|
||||||
vlib/v/checker/tests/inout/in_mismatch_type.v:31:15: error: the data type on the left of `in` does not match the array item type
|
vlib/v/checker/tests/in_mismatch_type.v:31:15: error: the data type on the left of `in` does not match the array item type
|
||||||
29| println('yeah')
|
29| println('yeah')
|
||||||
30| }
|
30| }
|
||||||
31| if Str2('3') in a_i {
|
31| if Str2('3') in a_i {
|
||||||
~~
|
~~
|
||||||
32| println('sure')
|
32| println('sure')
|
||||||
33| }
|
33| }
|
||||||
vlib/v/checker/tests/inout/in_mismatch_type.v:34:15: error: the data type on the left of `in` does not match the array item type
|
vlib/v/checker/tests/in_mismatch_type.v:34:15: error: the data type on the left of `in` does not match the array item type
|
||||||
32| println('sure')
|
32| println('sure')
|
||||||
33| }
|
33| }
|
||||||
34| if Str3('2') in a_i {
|
34| if Str3('2') in a_i {
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue