1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tests: use .vv files directly in compiler_errors_test.v

This commit is contained in:
Delyan Angelov 2020-08-25 18:14:06 +03:00
parent f259d275fc
commit 86dfd3902f
299 changed files with 387 additions and 391 deletions

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/add_op_wrong_left_type_err_a.v:3:13: error: mismatched types `Aaa` and `any_int`
vlib/v/checker/tests/add_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)

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/add_op_wrong_left_type_err_b.v:2:13: error: mismatched types `[]int` and `any_int`
vlib/v/checker/tests/add_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)
| ~~~~~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/add_op_wrong_left_type_err_c.v:3:13: error: mismatched types `map_string_int` and `any_int`
vlib/v/checker/tests/add_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)

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/add_op_wrong_right_type_err_a.v:3:18: error: mismatched types `any_int` and `Aaa`
vlib/v/checker/tests/add_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{})

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/add_op_wrong_right_type_err_b.v:2:18: error: mismatched types `any_int` and `[]int`
vlib/v/checker/tests/add_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])
| ~~~~~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/add_op_wrong_right_type_err_c.v:3:18: error: mismatched types `any_int` and `map_string_int`
vlib/v/checker/tests/add_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)

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/alias_type_exists.v:1:1: error: type `Bird` doesn't exist
vlib/v/checker/tests/alias_type_exists.vv:1:1: error: type `Bird` doesn't exist
1 | type Pigeon Bird
| ~~~~~~~~~~~
2 |

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/ambiguous_function_call_a.v:2:2: error: ambiguous call to: `foo`, may refer to fn `foo` or variable `foo`
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)
| ~~~~~~~~~~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/ambiguous_function_call_b.v:3:2: error: ambiguous call to: `foo`, may refer to fn `foo` or variable `foo`
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)

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_declare_element_a.v:2:5: error: non-name `arr[0]` on left side of `:=`
vlib/v/checker/tests/array_declare_element_a.vv:2:5: error: non-name `arr[0]` on left side of `:=`
1 | fn main() {
2 | arr[0] := 2
| ~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_declare_element_b.v:3:5: error: non-name `arr[1]` on left side of `:=`
vlib/v/checker/tests/array_declare_element_b.vv:3:5: error: non-name `arr[1]` on left side of `:=`
1 | fn main() {
2 | arr := [1, 2]
3 | arr[1] := 1

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_declare_element_c.v:3:8: error: non-name `arr[1][0]` on left side of `:=`
vlib/v/checker/tests/array_declare_element_c.vv:3:8: error: non-name `arr[1][0]` on left side of `:=`
1 | fn main() {
2 | arr := [[1, 2], [0, 3]]
3 | arr[1][0] := 1

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_filter_anon_fn_err_a.v:2:23: error: function needs exactly 1 argument
vlib/v/checker/tests/array_filter_anon_fn_err_a.vv:2:23: error: function needs exactly 1 argument
1 | fn main() {
2 | a := [1,2,3,4].filter(fn(a int, b int) bool { return a > 0 })
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_filter_anon_fn_err_b.v:2:23: error: type mismatch, should use `fn(a int) bool {...}`
vlib/v/checker/tests/array_filter_anon_fn_err_b.vv:2:23: error: type mismatch, should use `fn(a int) bool {...}`
1 | fn main() {
2 | a := [1,2,3,4].filter(fn(a string) bool { return a.len > 0 })
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_filter_fn_err_a.v:5:23: error: function needs exactly 1 argument
vlib/v/checker/tests/array_filter_fn_err_a.vv:5:23: error: function needs exactly 1 argument
3 | }
4 | fn main() {
5 | a := [1,2,3,4].filter(fil)

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_filter_fn_err_b.v:5:23: error: type mismatch, should use `fn(a int) bool {...}`
vlib/v/checker/tests/array_filter_fn_err_b.vv:5:23: error: type mismatch, should use `fn(a int) bool {...}`
3 | }
4 | fn main() {
5 | a := [1,2,3,4].filter(fil)

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_insert_type_mismatch_a.v:3:14: error: type mismatch, should use `int`
vlib/v/checker/tests/array_insert_type_mismatch_a.vv:3:14: error: type mismatch, should use `int`
1 | fn main() {
2 | mut a := [1, 2]
3 | a.insert(1, 2.3)

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_insert_type_mismatch_b.v:3:14: error: type mismatch, should use `int`
vlib/v/checker/tests/array_insert_type_mismatch_b.vv:3:14: error: type mismatch, should use `int`
1 | fn main() {
2 | mut a := [1, 2]
3 | a.insert(1, 'abc')

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_insert_type_mismatch_c.v:3:14: error: type mismatch, should use `f64[]`
vlib/v/checker/tests/array_insert_type_mismatch_c.vv:3:14: error: type mismatch, should use `f64[]`
1 | fn main() {
2 | mut a := [1.1, 2.2]
3 | a.insert(1, [2, 3])

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_insert_type_mismatch_d.v:3:14: error: type mismatch, should use `int[]`
vlib/v/checker/tests/array_insert_type_mismatch_d.vv:3:14: error: type mismatch, should use `int[]`
1 | fn main() {
2 | mut a := [1, 2]
3 | a.insert(1, ['aa', 'bb', 'cc'])

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_map_anon_fn_err_a.v:2:20: error: function needs exactly 1 argument
vlib/v/checker/tests/array_map_anon_fn_err_a.vv:2:20: error: function needs exactly 1 argument
1 | fn main() {
2 | a := [1,2,3,4].map(fn(a int, b int) int {return a + b})
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_map_anon_fn_err_b.v:2:20: error: type mismatch, should use `fn(a int) int {...}`
vlib/v/checker/tests/array_map_anon_fn_err_b.vv:2:20: error: type mismatch, should use `fn(a int) int {...}`
1 | fn main() {
2 | a := [1,2,3,4].map(fn(a string) string { return a })
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_map_fn_err_a.v:5:20: error: function needs exactly 1 argument
vlib/v/checker/tests/array_map_fn_err_a.vv:5:20: error: function needs exactly 1 argument
3 | }
4 | fn main() {
5 | a := [1,2,3,4].map(add)

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_map_fn_err_b.v:5:20: error: type mismatch, should use `fn(a int) int {...}`
vlib/v/checker/tests/array_map_fn_err_b.vv:5:20: error: type mismatch, should use `fn(a int) int {...}`
3 | }
4 | fn main() {
5 | a := [1,2,3,4].map(add)

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_prepend_type_mismatch_a.v:3:12: error: type mismatch, should use `int`
vlib/v/checker/tests/array_prepend_type_mismatch_a.vv:3:12: error: type mismatch, should use `int`
1 | fn main() {
2 | mut a := [1, 2]
3 | a.prepend(2.3)

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_prepend_type_mismatch_b.v:3:12: error: type mismatch, should use `int`
vlib/v/checker/tests/array_prepend_type_mismatch_b.vv:3:12: error: type mismatch, should use `int`
1 | fn main() {
2 | mut a := [1, 2]
3 | a.prepend('abc')

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_prepend_type_mismatch_c.v:3:12: error: type mismatch, should use `f64[]`
vlib/v/checker/tests/array_prepend_type_mismatch_c.vv:3:12: error: type mismatch, should use `f64[]`
1 | fn main() {
2 | mut a := [1.1, 2.2]
3 | a.prepend([2, 3])

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/array_prepend_type_mismatch_d.v:3:12: error: type mismatch, should use `int[]`
vlib/v/checker/tests/array_prepend_type_mismatch_d.vv:3:12: error: type mismatch, should use `int[]`
1 | fn main() {
2 | mut a := [1, 2]
3 | a.prepend(['aa', 'bb', 'cc'])

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/arrow_op_wrong_left_type_err_a.v:4:2: error: cannot push on non-channel `i64`
vlib/v/checker/tests/arrow_op_wrong_left_type_err_a.vv:4:2: error: cannot push on non-channel `i64`
2 | ch := i64(3)
3 | obj := 5
4 | ch <- obj

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/arrow_op_wrong_left_type_err_b.v:4:8: error: cannot assign `string` to `obj` of type `int`
vlib/v/checker/tests/arrow_op_wrong_left_type_err_b.vv:4:8: error: cannot assign `string` to `obj` of type `int`
2 | ch := chan string{}
3 | mut obj := 9
4 | obj = <-ch

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/arrow_op_wrong_right_type_err_a.v:4:8: error: cannot push `string` on `chan_u64`
vlib/v/checker/tests/arrow_op_wrong_right_type_err_a.vv:4:8: error: cannot push `string` on `chan_u64`
2 | ch := chan u64{cap: 10}
3 | obj := 'test'
4 | ch <- obj

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/arrow_op_wrong_right_type_err_b.v:3:9: error: <- operator can only be used with `chan` types
vlib/v/checker/tests/arrow_op_wrong_right_type_err_b.vv:3:9: error: <- operator can only be used with `chan` types
1 | fn main() {
2 | ch := i64(3)
3 | obj := <-ch

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/assign_expr_type_err_a.v:3:2: error: operator <<= not defined on left operand type `f64`
vlib/v/checker/tests/assign_expr_type_err_a.vv:3:2: error: operator <<= not defined on left operand type `f64`
1 | fn main() {
2 | mut foo := 0.5
3 | foo <<= 1

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/assign_expr_type_err_b.v:3:9: error: operator %= not defined on right operand type `string`
vlib/v/checker/tests/assign_expr_type_err_b.vv:3:9: error: operator %= not defined on right operand type `string`
1 | fn main() {
2 | mut foo := 10
3 | foo %= 'hello'

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/assign_expr_type_err_c.v:3:2: error: operator *= not defined on left operand type `string`
vlib/v/checker/tests/assign_expr_type_err_c.vv:3:2: error: operator *= not defined on left operand type `string`
1 | fn main() {
2 | mut foo := 'hello'
3 | foo *= 10

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/assign_expr_type_err_d.v:3:9: error: operator /= not defined on right operand type `bool`
vlib/v/checker/tests/assign_expr_type_err_d.vv:3:9: error: operator /= not defined on right operand type `bool`
1 | fn main() {
2 | mut foo := 1.5
3 | foo /= true

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/assign_expr_type_err_e.v:3:2: error: operator -= not defined on left operand type `string`
vlib/v/checker/tests/assign_expr_type_err_e.vv:3:2: error: operator -= not defined on left operand type `string`
1 | fn main() {
2 | mut foo := 'hello'
3 | foo -= `a`

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/assign_expr_type_err_f.v:3:9: error: operator -= not defined on right operand type `bool`
vlib/v/checker/tests/assign_expr_type_err_f.vv:3:9: error: operator -= not defined on right operand type `bool`
1 | fn main() {
2 | mut foo := 10
3 | foo -= false

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/assign_expr_type_err_g.v:3:2: error: operator += not defined on left operand type `bool`
vlib/v/checker/tests/assign_expr_type_err_g.vv:3:2: error: operator += not defined on left operand type `bool`
1 | fn main() {
2 | mut foo := true
3 | foo += false

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/assign_expr_type_err_h.v:3:9: error: operator += not defined on right operand type `bool`
vlib/v/checker/tests/assign_expr_type_err_h.vv:3:9: error: operator += not defined on right operand type `bool`
1 | fn main() {
2 | mut foo := 'hello'
3 | foo += false

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/assign_expr_type_err_i.v:3:9: error: cannot assign `string` to `foo` of type `f64`
vlib/v/checker/tests/assign_expr_type_err_i.vv:3:9: error: cannot assign `string` to `foo` of type `f64`
1 | fn main() {
2 | mut foo := 1.5
3 | foo += 'hello'

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/assign_expr_undefined_err_a.v:2:7: error: undefined variable: `a`
vlib/v/checker/tests/assign_expr_undefined_err_a.vv:2:7: error: undefined variable: `a`
1 | fn main() {
2 | a := a
| ^

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/assign_expr_undefined_err_b.v:2:10: error: undefined variable: `a`
vlib/v/checker/tests/assign_expr_undefined_err_b.vv:2:10: error: undefined variable: `a`
1 | fn main() {
2 | a, b := a, b
| ^

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/assign_expr_undefined_err_c.v:2:10: error: undefined variable: `a`
vlib/v/checker/tests/assign_expr_undefined_err_c.vv:2:10: error: undefined variable: `a`
1 | fn main() {
2 | a, b := a + 1, b * 3
| ^

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/assign_expr_undefined_err_d.v:2:9: error: undefined variable: `s`
vlib/v/checker/tests/assign_expr_undefined_err_d.vv:2:9: error: undefined variable: `s`
1 | fn main() {
2 | s := '$s'
| ^

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/assign_expr_undefined_err_e.v:2:11: error: undefined variable: `a`
vlib/v/checker/tests/assign_expr_undefined_err_e.vv:2:11: error: undefined variable: `a`
1 | fn main() {
2 | a, b := -a, -b
| ^

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/assign_expr_undefined_err_f.v:2:12: error: undefined variable: `a`
vlib/v/checker/tests/assign_expr_undefined_err_f.vv:2:12: error: undefined variable: `a`
1 | fn main() {
2 | a, b := (-a + 1), 1
| ^

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/assign_fn_call_on_left_side_err.v:6:2: error: cannot call function `foo()` on the left side of an assignment
vlib/v/checker/tests/assign_fn_call_on_left_side_err.vv:6:2: error: cannot call function `foo()` on the left side of an assignment
4 |
5 | fn main() {
6 | foo('s') = 1

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/assign_multi_immutable_err.v:4:2: error: `a` is immutable, declare it with `mut` to make it mutable
vlib/v/checker/tests/assign_multi_immutable_err.vv:4:2: error: `a` is immutable, declare it with `mut` to make it mutable
2 | a := 10
3 | b := 20
4 | a, b = 1, 2

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/bin_lit_without_digit_err.v:2:14: error: number part of this binary is not provided
vlib/v/checker/tests/bin_lit_without_digit_err.vv:2:14: error: number part of this binary is not provided
1 | fn main() {
2 | println(0b**)
| ^

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/bin_lit_wrong_digit_err.v:2:18: error: this binary number has unsuitable digit `2`
vlib/v/checker/tests/bin_lit_wrong_digit_err.vv:2:18: error: this binary number has unsuitable digit `2`
1 | fn main() {
2 | println(0b1112)
| ^

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/bit_op_wrong_left_type_err.v:2:10: error: left type of `&` cannot be non-integer type any_float
vlib/v/checker/tests/bit_op_wrong_left_type_err.vv:2:10: error: left type of `&` cannot be non-integer type any_float
1 | fn main() {
2 | println(0.5 & 1)
| ~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/bit_op_wrong_right_type_err.v:2:14: error: right type of `|` cannot be non-integer type any_float
vlib/v/checker/tests/bit_op_wrong_right_type_err.vv:2:14: error: right type of `|` cannot be non-integer type any_float
1 | fn main() {
2 | println(1 | 0.5)
| ~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/blank_modify.v:2:2: error: cannot modify blank `_` identifier
vlib/v/checker/tests/blank_modify.vv:2:2: error: cannot modify blank `_` identifier
1 | fn main() {
2 | _ += 1
| ^

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/cannot_assign_array.v:9:11: error: cannot assign `[8]f64` to `ctx.vb` of type `string`
vlib/v/checker/tests/cannot_assign_array.vv:9:11: error: cannot assign `[8]f64` to `ctx.vb` of type `string`
7 | mut ctx := Context{}
8 | x := 2.32
9 | ctx.vb = [1.1, x, 3.3, 4.4, 5.0, 6.0, 7.0, 8.9]!!

View File

@ -1,25 +1,25 @@
vlib/v/checker/tests/cannot_cast_to_struct.v:10:12: error: cannot convert struct `Abc` to struct `Test`
vlib/v/checker/tests/cannot_cast_to_struct.vv:10:12: error: cannot convert struct `Abc` to struct `Test`
8 |
9 | fn main() {
10 | _ := Test(Abc{})
| ~~~~~
11 | sum := Alphabet(Xyz{})
12 | _ = Xyz(sum)
vlib/v/checker/tests/cannot_cast_to_struct.v:12:10: error: cannot cast `Alphabet` to struct
vlib/v/checker/tests/cannot_cast_to_struct.vv:12:10: error: cannot cast `Alphabet` to struct
10 | _ := Test(Abc{})
11 | sum := Alphabet(Xyz{})
12 | _ = Xyz(sum)
| ~~~
13 | _ = Xyz(5)
14 | s := Abc{}
vlib/v/checker/tests/cannot_cast_to_struct.v:13:10: error: cannot cast `any_int` to struct
vlib/v/checker/tests/cannot_cast_to_struct.vv:13:10: error: cannot cast `any_int` to struct
11 | sum := Alphabet(Xyz{})
12 | _ = Xyz(sum)
13 | _ = Xyz(5)
| ^
14 | s := Abc{}
15 | _ = Xyz(&s)
vlib/v/checker/tests/cannot_cast_to_struct.v:15:10: error: cannot cast `&Abc` to struct
vlib/v/checker/tests/cannot_cast_to_struct.vv:15:10: error: cannot cast `&Abc` to struct
13 | _ = Xyz(5)
14 | s := Abc{}
15 | _ = Xyz(&s)

View File

@ -1,18 +1,18 @@
vlib/v/checker/tests/cast_err.v:3:11: error: cannot cast to bool - use e.g. `some_int != 0` instead
vlib/v/checker/tests/cast_err.vv:3:11: error: cannot cast to bool - use e.g. `some_int != 0` instead
1 | fn test_bool_cast() {
2 | v := 3
3 | _ = bool(v)
| ^
4 | _ = bool(&v)
5 | _ = bool([2])
vlib/v/checker/tests/cast_err.v:4:11: error: cannot cast to bool - use e.g. `some_int != 0` instead
vlib/v/checker/tests/cast_err.vv:4:11: error: cannot cast to bool - use e.g. `some_int != 0` instead
2 | v := 3
3 | _ = bool(v)
4 | _ = bool(&v)
| ^
5 | _ = bool([2])
6 | }
vlib/v/checker/tests/cast_err.v:5:11: error: cannot cast to bool - use e.g. `some_int != 0` instead
vlib/v/checker/tests/cast_err.vv:5:11: error: cannot cast to bool - use e.g. `some_int != 0` instead
3 | _ = bool(v)
4 | _ = bool(&v)
5 | _ = bool([2])

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/cast_string_err.v:2:14: error: cannot cast type `any_int` to string, use `x.str()` instead
vlib/v/checker/tests/cast_string_err.vv:2:14: error: cannot cast type `any_int` to string, use `x.str()` instead
1 | fn main() {
2 | a := string(1)
| ^

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/cast_string_with_byte_err.v:2:19: error: can not cast type `byte` to string, use `by.str()` instead.
vlib/v/checker/tests/cast_string_with_byte_err.vv:2:19: error: can not cast type `byte` to string, use `by.str()` instead.
1 | for by in 'abc' {
2 | println(string(by))
| ~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/const_define_in_function_err.v:2:2: error: const can only be defined at the top level (outside of functions)
vlib/v/checker/tests/const_define_in_function_err.vv:2:2: error: const can only be defined at the top level (outside of functions)
1 | fn main() {
2 | const (a = 1)
| ~~~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/const_field_add_err.v:6:2: error: cannot modify constant `a`
vlib/v/checker/tests/const_field_add_err.vv:6:2: error: cannot modify constant `a`
4 |
5 | fn main() {
6 | a += 1

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/const_field_dec_err.v:6:2: error: cannot modify constant `a`
vlib/v/checker/tests/const_field_dec_err.vv:6:2: error: cannot modify constant `a`
4 |
5 | fn main() {
6 | a--

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/const_field_inc_err.v:6:2: error: cannot modify constant `a`
vlib/v/checker/tests/const_field_inc_err.vv:6:2: error: cannot modify constant `a`
4 |
5 | fn main() {
6 | a++

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/const_field_name_duplicate_err.v:3:2: error: duplicate const `aaa`
vlib/v/checker/tests/const_field_name_duplicate_err.vv:3:2: error: duplicate const `aaa`
1 | const (
2 | aaa = 1
3 | aaa = 2

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/const_field_name_snake_case.v:2:2: warning: const names cannot contain uppercase letters, use snake_case instead
vlib/v/checker/tests/const_field_name_snake_case.vv:2:2: warning: const names cannot contain uppercase letters, use snake_case instead
1 | const (
2 | Red = 1
| ~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/const_field_sub_err.v:6:2: error: cannot modify constant `a`
vlib/v/checker/tests/const_field_sub_err.vv:6:2: error: cannot modify constant `a`
4 |
5 | fn main() {
6 | a -= 1

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/dec_lit_wrong_digit_err.v:2:18: error: this number has unsuitable digit `q`
vlib/v/checker/tests/dec_lit_wrong_digit_err.vv:2:18: error: this number has unsuitable digit `q`
1 | fn main() {
2 | println(12345qrst+10)
| ^

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/div_op_wrong_left_type_err_a.v:3:13: error: mismatched types `Aaa` and `any_int`
vlib/v/checker/tests/div_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)

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/div_op_wrong_left_type_err_b.v:2:13: error: mismatched types `[]int` and `any_int`
vlib/v/checker/tests/div_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)
| ~~~~~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/div_op_wrong_left_type_err_c.v:3:13: error: mismatched types `map_string_int` and `any_int`
vlib/v/checker/tests/div_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)

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/div_op_wrong_right_type_err_a.v:3:18: error: mismatched types `any_int` and `Aaa`
vlib/v/checker/tests/div_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{})

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/div_op_wrong_right_type_err_b.v:2:18: error: mismatched types `any_int` and `[]int`
vlib/v/checker/tests/div_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])
| ~~~~~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/div_op_wrong_right_type_err_c.v:3:18: error: mismatched types `any_int` and `map_string_int`
vlib/v/checker/tests/div_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)

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/division_by_zero_float_err.v:2:14: error: division by zero
vlib/v/checker/tests/division_by_zero_float_err.vv:2:14: error: division by zero
1 | fn main() {
2 | println(1.0/0.0)
| ~~~

View File

@ -1,24 +1,24 @@
vlib/v/checker/tests/division_by_zero_int_err.v:2:12: error: division by zero
vlib/v/checker/tests/division_by_zero_int_err.vv:2:12: error: division by zero
1 | fn main() {
2 | println(1/0)
| ^
3 | println(1/0x0)
4 | println(1/0b0)
vlib/v/checker/tests/division_by_zero_int_err.v:3:12: error: division by zero
vlib/v/checker/tests/division_by_zero_int_err.vv:3:12: error: division by zero
1 | fn main() {
2 | println(1/0)
3 | println(1/0x0)
| ~~~
4 | println(1/0b0)
5 | println(1/0o0)
vlib/v/checker/tests/division_by_zero_int_err.v:4:12: error: division by zero
vlib/v/checker/tests/division_by_zero_int_err.vv:4:12: error: division by zero
2 | println(1/0)
3 | println(1/0x0)
4 | println(1/0b0)
| ~~~
5 | println(1/0o0)
6 | }
vlib/v/checker/tests/division_by_zero_int_err.v:5:12: error: division by zero
vlib/v/checker/tests/division_by_zero_int_err.vv:5:12: error: division by zero
3 | println(1/0x0)
4 | println(1/0b0)
5 | println(1/0o0)

View File

@ -1,11 +1,11 @@
vlib/v/checker/tests/enum_err.v:4:13: error: default value for enum has to be an integer
vlib/v/checker/tests/enum_err.vv:4:13: error: default value for enum has to be an integer
2 |
3 | enum Color {
4 | green = 'green'
| ~~~~~~~
5 | yellow = 1+1
6 | blue
vlib/v/checker/tests/enum_err.v:5:14: error: default value for enum has to be an integer
vlib/v/checker/tests/enum_err.vv:5:14: error: default value for enum has to be an integer
3 | enum Color {
4 | green = 'green'
5 | yellow = 1+1

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/enum_field_name_duplicate_err.v:5:2: error: field name `green` duplicate
vlib/v/checker/tests/enum_field_name_duplicate_err.vv:5:2: error: field name `green` duplicate
3 | yellow
4 | blue
5 | green

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/enum_field_overflow.v:4:2: error: enum value overflows
vlib/v/checker/tests/enum_field_overflow.vv:4:2: error: enum value overflows
2 | red
3 | green = 2147483647
4 | blue

View File

@ -1,11 +1,11 @@
vlib/v/checker/tests/enum_field_value_duplicate_err.v:3:10: error: enum value `0` already exists
vlib/v/checker/tests/enum_field_value_duplicate_err.vv:3:10: error: enum value `0` already exists
1 | enum Color {
2 | red
3 | green = 0
| ^
4 | blue = 1
5 | alpha = 1
vlib/v/checker/tests/enum_field_value_duplicate_err.v:5:10: error: enum value `1` already exists
vlib/v/checker/tests/enum_field_value_duplicate_err.vv:5:10: error: enum value `1` already exists
3 | green = 0
4 | blue = 1
5 | alpha = 1

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/enum_field_value_overflow.v:3:10: error: enum value `2147483648` overflows int
vlib/v/checker/tests/enum_field_value_overflow.vv:3:10: error: enum value `2147483648` overflows int
1 | enum Color {
2 | red
3 | green = 2147483648

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/float_lit_exp_not_integer_err.v:2:17: error: exponential part should be integer
vlib/v/checker/tests/float_lit_exp_not_integer_err.vv:2:17: error: exponential part should be integer
1 | fn main() {
2 | println(45e2.5)
| ^

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/float_lit_exp_without_digit_err.v:2:14: error: exponent has no digits
vlib/v/checker/tests/float_lit_exp_without_digit_err.vv:2:14: error: exponent has no digits
1 | fn main() {
2 | println(2E)
| ^

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/float_lit_too_many_points_err.v:2:19: error: too many decimal points in number
vlib/v/checker/tests/float_lit_too_many_points_err.vv:2:19: error: too many decimal points in number
1 | fn main() {
2 | println(123.45.67)
| ^

View File

@ -1,10 +1,10 @@
vlib/v/checker/tests/float_modulo_err.v:2:13: error: float modulo not allowed, use math.fmod() instead
vlib/v/checker/tests/float_modulo_err.vv:2:13: error: float modulo not allowed, use math.fmod() instead
1 | fn main() {
2 | println(3.0 % 2.0)
| ~~~
3 | println(f32(3.0) % f32(2.0))
4 | }
vlib/v/checker/tests/float_modulo_err.v:3:17: error: float modulo not allowed, use math.fmod() instead
vlib/v/checker/tests/float_modulo_err.vv:3:17: error: float modulo not allowed, use math.fmod() instead
1 | fn main() {
2 | println(3.0 % 2.0)
3 | println(f32(3.0) % f32(2.0))

View File

@ -1,9 +1,9 @@
vlib/v/checker/tests/fn_type_exists.v:1:1: error: type `Pants` doesn't exist
vlib/v/checker/tests/fn_type_exists.vv:1:1: error: type `Pants` doesn't exist
1 | type PantsCreator = fn (a Shirt) Pants
| ~~~~~~~~~~~~~~~~~
2 |
3 | type PantsConsumer = fn (p Pants)
vlib/v/checker/tests/fn_type_exists.v:3:1: error: type `Pants` doesn't exist
vlib/v/checker/tests/fn_type_exists.vv:3:1: error: type `Pants` doesn't exist
1 | type PantsCreator = fn (a Shirt) Pants
2 |
3 | type PantsConsumer = fn (p Pants)

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/for_in_index_optional.v:3:18: error: for in: cannot index `?[]string`
vlib/v/checker/tests/for_in_index_optional.vv:3:18: error: for in: cannot index `?[]string`
1 | import os
2 | fn main() {
3 | for file in os.ls('.') {

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/for_in_index_type.v:2:11: error: for in: cannot index `any_int`
vlib/v/checker/tests/for_in_index_type.vv:2:11: error: for in: cannot index `any_int`
1 | fn main() {
2 | for a in 52 {
| ~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/for_in_map_one_variable_err.v:3:6: error: declare a key and a value variable when ranging a map: `for key, val in map {`
vlib/v/checker/tests/for_in_map_one_variable_err.vv:3:6: error: declare a key and a value variable when ranging a map: `for key, val in map {`
use `_` if you do not need the variable
1 | fn main() {
2 | kvs := {'foo':'bar'}

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/for_in_range_not_match_type.v:2:11: error: range types do not match
vlib/v/checker/tests/for_in_range_not_match_type.vv:2:11: error: range types do not match
1 | fn main() {
2 | for i in 10..10.5 {
| ~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/for_in_range_string_type.v:2:11: error: range type can not be string
vlib/v/checker/tests/for_in_range_string_type.vv:2:11: error: range type can not be string
1 | fn main() {
2 | for i in 'a'..'b' {
| ~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/function_arg_mutable_err.v:1:18: error: mutable arguments are only allowed for arrays, maps, and structs
vlib/v/checker/tests/function_arg_mutable_err.vv:1:18: error: mutable arguments are only allowed for arrays, maps, and structs
return values instead: `fn foo(mut n int) {` => `fn foo(n int) int {`
1 | fn mod_ptr(mut a int) {
| ~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/function_arg_redefinition.v:1:17: error: redefinition of parameter `para1`
vlib/v/checker/tests/function_arg_redefinition.vv:1:17: error: redefinition of parameter `para1`
1 | fn f(para1 int, para1 f32) int {
| ~~~~~
2 | return para1

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/function_missing_return_type.v:1:1: error: missing return at end of function `h`
vlib/v/checker/tests/function_missing_return_type.vv:1:1: error: missing return at end of function `h`
1 | fn h() int {
| ~~~~~~~~~~
2 | }

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/function_variadic_arg_non_final.v:1:6: error: cannot use ...(variadic) with non-final parameter para1
vlib/v/checker/tests/function_variadic_arg_non_final.vv:1:6: error: cannot use ...(variadic) with non-final parameter para1
1 | fn f(para1 ...int, para2 f32) int {
| ~~~~~
2 | return 22

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/function_wrong_arg_type.v:7:7: error: cannot use type `f64` as type `int` in argument 1 to `f`
vlib/v/checker/tests/function_wrong_arg_type.vv:7:7: error: cannot use type `f64` as type `int` in argument 1 to `f`
5 | fn main() {
6 | a := 12.3
7 | q := f(a)

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/function_wrong_return_type.v:2:9: error: cannot use `any_float` as type `int` in return argument
vlib/v/checker/tests/function_wrong_return_type.vv:2:9: error: cannot use `any_float` as type `int` in return argument
1 | fn h() int {
2 | return 3.14
| ~~~~

View File

@ -1,3 +1,3 @@
vlib/v/checker/tests/globals/incorrect_name_global.v:1:1: error: global name `A` cannot contain uppercase letters, use snake_case instead
vlib/v/checker/tests/globals/incorrect_name_global.vv:1:1: error: global name `A` cannot contain uppercase letters, use snake_case instead
1 | __global A int = 1
| ~~~~~~~~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/globals_error.v:2:1: error: use `v --enable-globals ...` to enable globals
vlib/v/checker/tests/globals_error.vv:2:1: error: use `v --enable-globals ...` to enable globals
1 |
2 | __global rfcnt int
| ~~~~~~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/go_expr.v:2:5: error: expression in `go` must be a function call
vlib/v/checker/tests/go_expr.vv:2:5: error: expression in `go` must be a function call
1 | fn main() {
2 | go 1
| ^

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/go_mut_arg.v:14:16: error: function in `go` statement cannot contain mutable non-reference arguments
vlib/v/checker/tests/go_mut_arg.vv:14:16: error: function in `go` statement cannot contain mutable non-reference arguments
12 | a: 0
13 | }
14 | go change(mut x)

Some files were not shown because too many files have changed in this diff Show More