From 84edbd83da81429ac7ce8bcfb246dc6b891169ef Mon Sep 17 00:00:00 2001 From: yuyi Date: Thu, 28 May 2020 00:12:34 +0800 Subject: [PATCH] all: fix struct names error --- vlib/builtin/array_test.v | 2 +- vlib/builtin/map_test.v | 6 +++--- .../tests/add_op_wrong_left_type_err_a.out | 8 ++++---- .../tests/add_op_wrong_left_type_err_a.vv | 4 ++-- .../tests/add_op_wrong_right_type_err_a.out | 8 ++++---- .../tests/add_op_wrong_right_type_err_a.vv | 4 ++-- .../tests/div_op_wrong_left_type_err_a.out | 8 ++++---- .../tests/div_op_wrong_left_type_err_a.vv | 4 ++-- .../tests/div_op_wrong_right_type_err_a.out | 8 ++++---- .../tests/div_op_wrong_right_type_err_a.vv | 4 ++-- .../tests/immutable_array_field_assign.out | 2 +- .../tests/immutable_array_field_assign.vv | 4 ++-- .../tests/immutable_array_field_shift.out | 4 ++-- .../tests/immutable_array_field_shift.vv | 10 +++++----- .../tests/immutable_array_struct_assign.out | 2 +- .../tests/immutable_array_struct_assign.vv | 4 ++-- .../tests/immutable_array_struct_shift.out | 2 +- .../tests/immutable_array_struct_shift.vv | 4 ++-- vlib/v/checker/tests/immutable_field.out | 4 ++-- vlib/v/checker/tests/immutable_field.vv | 4 ++-- .../checker/tests/immutable_field_postfix.out | 8 ++++---- .../v/checker/tests/immutable_field_postfix.vv | 4 ++-- .../checker/tests/immutable_struct_postfix.out | 4 ++-- .../checker/tests/immutable_struct_postfix.vv | 4 ++-- .../tests/minus_op_wrong_left_type_err_a.out | 8 ++++---- .../tests/minus_op_wrong_left_type_err_a.vv | 4 ++-- .../tests/minus_op_wrong_right_type_err_a.out | 8 ++++---- .../tests/minus_op_wrong_right_type_err_a.vv | 4 ++-- .../tests/mod_op_wrong_left_type_err_c.out | 4 ++-- .../tests/mod_op_wrong_left_type_err_c.vv | 4 ++-- .../tests/mod_op_wrong_right_type_err_c.out | 4 ++-- .../tests/mod_op_wrong_right_type_err_c.vv | 4 ++-- .../tests/mul_op_wrong_left_type_err_a.out | 8 ++++---- .../tests/mul_op_wrong_left_type_err_a.vv | 4 ++-- .../tests/mul_op_wrong_right_type_err_a.out | 8 ++++---- .../tests/mul_op_wrong_right_type_err_a.vv | 4 ++-- .../tests/struct_field_name_duplicate_err.out | 2 +- .../tests/struct_field_name_duplicate_err.vv | 2 +- vlib/v/checker/tests/unknown_field.out | 2 +- vlib/v/gen/js/tests/hello/hello.v | 10 +++++----- vlib/v/tests/inout/enum_print.vv | 4 ++-- vlib/v/tests/inout/nested_structs.out | 6 +++--- vlib/v/tests/inout/nested_structs.vv | 12 ++++++------ vlib/v/tests/mut_test.v | 10 +++++----- vlib/v/tests/pointers_str_test.v | 4 ++-- vlib/v/tests/repl/chained_fields/bd.repl.skip | 18 +++++++++--------- vlib/v/tests/repl/chained_fields/c.repl.skip | 18 +++++++++--------- vlib/v/tests/repl/chained_fields/c2.repl.skip | 6 +++--- vlib/v/tests/repl/chained_fields/d.repl.skip | 4 ++-- vlib/v/tests/string_interpolation_test.v | 6 +++--- 50 files changed, 142 insertions(+), 142 deletions(-) diff --git a/vlib/builtin/array_test.v b/vlib/builtin/array_test.v index 7702a93935..dfa510433e 100644 --- a/vlib/builtin/array_test.v +++ b/vlib/builtin/array_test.v @@ -89,7 +89,7 @@ struct Chunk { val string } -struct K { +struct Kkk { q []Chunk } diff --git a/vlib/builtin/map_test.v b/vlib/builtin/map_test.v index 223266516a..0b4a44eaf3 100644 --- a/vlib/builtin/map_test.v +++ b/vlib/builtin/map_test.v @@ -4,13 +4,13 @@ struct User { name string } -struct A { +struct Aaa { mut: m map[string]int users map[string]User } -fn (mut a A) set(key string, val int) { +fn (mut a Aaa) set(key string, val int) { a.m[key] = val } @@ -47,7 +47,7 @@ fn test_map() { users['1'] = User{'Peter'} peter := users['1'] assert peter.name == 'Peter' - mut a := A{ + mut a := Aaa{ m: map[string]int users: map[string]User } diff --git a/vlib/v/checker/tests/add_op_wrong_left_type_err_a.out b/vlib/v/checker/tests/add_op_wrong_left_type_err_a.out index cee46d4a7e..5218880bc5 100644 --- a/vlib/v/checker/tests/add_op_wrong_left_type_err_a.out +++ b/vlib/v/checker/tests/add_op_wrong_left_type_err_a.out @@ -1,6 +1,6 @@ -vlib/v/checker/tests/add_op_wrong_left_type_err_a.v:3:5: error: mismatched types `A` and `any_int` - 1 | struct A{} +vlib/v/checker/tests/add_op_wrong_left_type_err_a.v:3:5: error: mismatched types `Aaa` and `any_int` + 1 | struct Aaa{} 2 | fn main() { - 3 | A{} + 10 - | ~~~ + 3 | Aaa{} + 10 + | ~~~~~ 4 | } diff --git a/vlib/v/checker/tests/add_op_wrong_left_type_err_a.vv b/vlib/v/checker/tests/add_op_wrong_left_type_err_a.vv index 5a3069eb14..625abda679 100644 --- a/vlib/v/checker/tests/add_op_wrong_left_type_err_a.vv +++ b/vlib/v/checker/tests/add_op_wrong_left_type_err_a.vv @@ -1,4 +1,4 @@ -struct A{} +struct Aaa{} fn main() { - A{} + 10 + Aaa{} + 10 } diff --git a/vlib/v/checker/tests/add_op_wrong_right_type_err_a.out b/vlib/v/checker/tests/add_op_wrong_right_type_err_a.out index d77e2624ff..922ea4c658 100644 --- a/vlib/v/checker/tests/add_op_wrong_right_type_err_a.out +++ b/vlib/v/checker/tests/add_op_wrong_right_type_err_a.out @@ -1,6 +1,6 @@ -vlib/v/checker/tests/add_op_wrong_right_type_err_a.v:3:10: error: mismatched types `any_int` and `A` - 1 | struct A{} +vlib/v/checker/tests/add_op_wrong_right_type_err_a.v:3:10: error: mismatched types `any_int` and `Aaa` + 1 | struct Aaa{} 2 | fn main() { - 3 | 10 + A{} - | ~~~ + 3 | 10 + Aaa{} + | ~~~~~ 4 | } diff --git a/vlib/v/checker/tests/add_op_wrong_right_type_err_a.vv b/vlib/v/checker/tests/add_op_wrong_right_type_err_a.vv index 3a98920ac4..01af6499a3 100644 --- a/vlib/v/checker/tests/add_op_wrong_right_type_err_a.vv +++ b/vlib/v/checker/tests/add_op_wrong_right_type_err_a.vv @@ -1,4 +1,4 @@ -struct A{} +struct Aaa{} fn main() { - 10 + A{} + 10 + Aaa{} } diff --git a/vlib/v/checker/tests/div_op_wrong_left_type_err_a.out b/vlib/v/checker/tests/div_op_wrong_left_type_err_a.out index 410eb4a874..83027ae65f 100644 --- a/vlib/v/checker/tests/div_op_wrong_left_type_err_a.out +++ b/vlib/v/checker/tests/div_op_wrong_left_type_err_a.out @@ -1,6 +1,6 @@ -vlib/v/checker/tests/div_op_wrong_left_type_err_a.v:3:5: error: mismatched types `A` and `any_int` - 1 | struct A{} +vlib/v/checker/tests/div_op_wrong_left_type_err_a.v:3:5: error: mismatched types `Aaa` and `any_int` + 1 | struct Aaa{} 2 | fn main() { - 3 | A{} / 10 - | ~~~ + 3 | Aaa{} / 10 + | ~~~~~ 4 | } diff --git a/vlib/v/checker/tests/div_op_wrong_left_type_err_a.vv b/vlib/v/checker/tests/div_op_wrong_left_type_err_a.vv index d52d510b99..a8286b703f 100644 --- a/vlib/v/checker/tests/div_op_wrong_left_type_err_a.vv +++ b/vlib/v/checker/tests/div_op_wrong_left_type_err_a.vv @@ -1,4 +1,4 @@ -struct A{} +struct Aaa{} fn main() { - A{} / 10 + Aaa{} / 10 } diff --git a/vlib/v/checker/tests/div_op_wrong_right_type_err_a.out b/vlib/v/checker/tests/div_op_wrong_right_type_err_a.out index 747f8deda7..017990d293 100644 --- a/vlib/v/checker/tests/div_op_wrong_right_type_err_a.out +++ b/vlib/v/checker/tests/div_op_wrong_right_type_err_a.out @@ -1,6 +1,6 @@ -vlib/v/checker/tests/div_op_wrong_right_type_err_a.v:3:10: error: mismatched types `any_int` and `A` - 1 | struct A{} +vlib/v/checker/tests/div_op_wrong_right_type_err_a.v:3:10: error: mismatched types `any_int` and `Aaa` + 1 | struct Aaa{} 2 | fn main() { - 3 | 10 / A{} - | ~~~ + 3 | 10 / Aaa{} + | ~~~~~ 4 | } diff --git a/vlib/v/checker/tests/div_op_wrong_right_type_err_a.vv b/vlib/v/checker/tests/div_op_wrong_right_type_err_a.vv index ae12960e94..5abff6d9f8 100644 --- a/vlib/v/checker/tests/div_op_wrong_right_type_err_a.vv +++ b/vlib/v/checker/tests/div_op_wrong_right_type_err_a.vv @@ -1,4 +1,4 @@ -struct A{} +struct Aaa{} fn main() { - 10 / A{} + 10 / Aaa{} } diff --git a/vlib/v/checker/tests/immutable_array_field_assign.out b/vlib/v/checker/tests/immutable_array_field_assign.out index decd799c34..53638f57a8 100644 --- a/vlib/v/checker/tests/immutable_array_field_assign.out +++ b/vlib/v/checker/tests/immutable_array_field_assign.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/immutable_array_field_assign.v:9:4: error: field `i` of struct `A` is immutable +vlib/v/checker/tests/immutable_array_field_assign.v:9:4: error: field `i` of struct `Aaa` is immutable 7 | i: [0] 8 | } 9 | a.i[0] = 3 diff --git a/vlib/v/checker/tests/immutable_array_field_assign.vv b/vlib/v/checker/tests/immutable_array_field_assign.vv index 1dbe3759be..adadfd6ef1 100644 --- a/vlib/v/checker/tests/immutable_array_field_assign.vv +++ b/vlib/v/checker/tests/immutable_array_field_assign.vv @@ -1,9 +1,9 @@ -struct A { +struct Aaa { i []int } fn main() { - mut a := A{ + mut a := Aaa{ i: [0] } a.i[0] = 3 diff --git a/vlib/v/checker/tests/immutable_array_field_shift.out b/vlib/v/checker/tests/immutable_array_field_shift.out index 827f4b79f2..054d702b8a 100644 --- a/vlib/v/checker/tests/immutable_array_field_shift.out +++ b/vlib/v/checker/tests/immutable_array_field_shift.out @@ -1,5 +1,5 @@ -vlib/v/checker/tests/immutable_array_field_shift.v:14:4: error: field `a` of struct `B` is immutable - 12 | a: A{} +vlib/v/checker/tests/immutable_array_field_shift.v:14:4: error: field `a` of struct `Bbb` is immutable + 12 | a: Aaa{} 13 | } 14 | b.a.i << 3 | ^ diff --git a/vlib/v/checker/tests/immutable_array_field_shift.vv b/vlib/v/checker/tests/immutable_array_field_shift.vv index 9740edd3c5..f04054b8a6 100644 --- a/vlib/v/checker/tests/immutable_array_field_shift.vv +++ b/vlib/v/checker/tests/immutable_array_field_shift.vv @@ -1,15 +1,15 @@ -struct A { +struct Aaa { mut: i []int } -struct B { - a A +struct Bbb { + a Aaa } fn main() { - mut b := B{ - a: A{} + mut b := Bbb{ + a: Aaa{} } b.a.i << 3 } diff --git a/vlib/v/checker/tests/immutable_array_struct_assign.out b/vlib/v/checker/tests/immutable_array_struct_assign.out index 38ed297f25..dc14aff717 100644 --- a/vlib/v/checker/tests/immutable_array_struct_assign.out +++ b/vlib/v/checker/tests/immutable_array_struct_assign.out @@ -1,6 +1,6 @@ vlib/v/checker/tests/immutable_array_struct_assign.v:8:2: error: `a` is immutable, declare it with `mut` to make it mutable 6 | fn main() { - 7 | a := A{} + 7 | a := Aaa{} 8 | a.i[0] += 3 | ^ 9 | } diff --git a/vlib/v/checker/tests/immutable_array_struct_assign.vv b/vlib/v/checker/tests/immutable_array_struct_assign.vv index e7823eb8ec..b150d9d83e 100644 --- a/vlib/v/checker/tests/immutable_array_struct_assign.vv +++ b/vlib/v/checker/tests/immutable_array_struct_assign.vv @@ -1,9 +1,9 @@ -struct A { +struct Aaa { pub mut: i []int } fn main() { - a := A{} + a := Aaa{} a.i[0] += 3 } diff --git a/vlib/v/checker/tests/immutable_array_struct_shift.out b/vlib/v/checker/tests/immutable_array_struct_shift.out index cbb8119e50..b25cc8ef4d 100644 --- a/vlib/v/checker/tests/immutable_array_struct_shift.out +++ b/vlib/v/checker/tests/immutable_array_struct_shift.out @@ -1,6 +1,6 @@ vlib/v/checker/tests/immutable_array_struct_shift.v:8:2: error: `a` is immutable, declare it with `mut` to make it mutable 6 | fn main() { - 7 | a := []A{} + 7 | a := []Aaa{} 8 | a[0].i << 3 | ^ 9 | } diff --git a/vlib/v/checker/tests/immutable_array_struct_shift.vv b/vlib/v/checker/tests/immutable_array_struct_shift.vv index c89a5a7880..89e4d6c005 100644 --- a/vlib/v/checker/tests/immutable_array_struct_shift.vv +++ b/vlib/v/checker/tests/immutable_array_struct_shift.vv @@ -1,9 +1,9 @@ -struct A { +struct Aaa { pub mut: i []int } fn main() { - a := []A{} + a := []Aaa{} a[0].i << 3 } diff --git a/vlib/v/checker/tests/immutable_field.out b/vlib/v/checker/tests/immutable_field.out index 297bc88e74..616f879a6e 100644 --- a/vlib/v/checker/tests/immutable_field.out +++ b/vlib/v/checker/tests/immutable_field.out @@ -1,6 +1,6 @@ -vlib/v/checker/tests/immutable_field.v:8:4: error: field `i1` of struct `A` is immutable +vlib/v/checker/tests/immutable_field.v:8:4: error: field `i1` of struct `Aaa` is immutable 6 | fn main() { - 7 | a := A{1} + 7 | a := Aaa{1} 8 | a.i1 = 2 | ~~ 9 | } diff --git a/vlib/v/checker/tests/immutable_field.vv b/vlib/v/checker/tests/immutable_field.vv index 52fea4cd84..487d913e34 100644 --- a/vlib/v/checker/tests/immutable_field.vv +++ b/vlib/v/checker/tests/immutable_field.vv @@ -1,9 +1,9 @@ -struct A { +struct Aaa { pub: i1 int } fn main() { - a := A{1} + a := Aaa{1} a.i1 = 2 } diff --git a/vlib/v/checker/tests/immutable_field_postfix.out b/vlib/v/checker/tests/immutable_field_postfix.out index 00604f8123..886b3ca210 100644 --- a/vlib/v/checker/tests/immutable_field_postfix.out +++ b/vlib/v/checker/tests/immutable_field_postfix.out @@ -1,12 +1,12 @@ -vlib/v/checker/tests/immutable_field_postfix.v:7:4: error: field `i` of struct `A` is immutable +vlib/v/checker/tests/immutable_field_postfix.v:7:4: error: field `i` of struct `Aaa` is immutable 5 | fn main() { - 6 | mut a := A{} + 6 | mut a := Aaa{} 7 | a.i++ | ^ 8 | a.i-- 9 | } -vlib/v/checker/tests/immutable_field_postfix.v:8:4: error: field `i` of struct `A` is immutable - 6 | mut a := A{} +vlib/v/checker/tests/immutable_field_postfix.v:8:4: error: field `i` of struct `Aaa` is immutable + 6 | mut a := Aaa{} 7 | a.i++ 8 | a.i-- | ^ diff --git a/vlib/v/checker/tests/immutable_field_postfix.vv b/vlib/v/checker/tests/immutable_field_postfix.vv index 2dade72e4a..0689c70d69 100644 --- a/vlib/v/checker/tests/immutable_field_postfix.vv +++ b/vlib/v/checker/tests/immutable_field_postfix.vv @@ -1,9 +1,9 @@ -struct A { +struct Aaa { i int } fn main() { - mut a := A{} + mut a := Aaa{} a.i++ a.i-- } diff --git a/vlib/v/checker/tests/immutable_struct_postfix.out b/vlib/v/checker/tests/immutable_struct_postfix.out index d142e5a860..a05e2f8853 100644 --- a/vlib/v/checker/tests/immutable_struct_postfix.out +++ b/vlib/v/checker/tests/immutable_struct_postfix.out @@ -1,12 +1,12 @@ vlib/v/checker/tests/immutable_struct_postfix.v:8:2: error: `a` is immutable, declare it with `mut` to make it mutable 6 | fn main() { - 7 | a := A{} + 7 | a := Aaa{} 8 | a.i++ | ^ 9 | a.i-- 10 | } vlib/v/checker/tests/immutable_struct_postfix.v:9:2: error: `a` is immutable, declare it with `mut` to make it mutable - 7 | a := A{} + 7 | a := Aaa{} 8 | a.i++ 9 | a.i-- | ^ diff --git a/vlib/v/checker/tests/immutable_struct_postfix.vv b/vlib/v/checker/tests/immutable_struct_postfix.vv index 7bc4e31913..dbd3e789a0 100644 --- a/vlib/v/checker/tests/immutable_struct_postfix.vv +++ b/vlib/v/checker/tests/immutable_struct_postfix.vv @@ -1,10 +1,10 @@ -struct A { +struct Aaa { mut: i int } fn main() { - a := A{} + a := Aaa{} a.i++ a.i-- } diff --git a/vlib/v/checker/tests/minus_op_wrong_left_type_err_a.out b/vlib/v/checker/tests/minus_op_wrong_left_type_err_a.out index 2e7c7efbce..72c3384865 100644 --- a/vlib/v/checker/tests/minus_op_wrong_left_type_err_a.out +++ b/vlib/v/checker/tests/minus_op_wrong_left_type_err_a.out @@ -1,6 +1,6 @@ -vlib/v/checker/tests/minus_op_wrong_left_type_err_a.v:3:5: error: mismatched types `A` and `any_int` - 1 | struct A{} +vlib/v/checker/tests/minus_op_wrong_left_type_err_a.v:3:5: error: mismatched types `Aaa` and `any_int` + 1 | struct Aaa{} 2 | fn main() { - 3 | A{} - 10 - | ~~~ + 3 | Aaa{} - 10 + | ~~~~~ 4 | } diff --git a/vlib/v/checker/tests/minus_op_wrong_left_type_err_a.vv b/vlib/v/checker/tests/minus_op_wrong_left_type_err_a.vv index 3c1a5c0894..a4cbb0903e 100644 --- a/vlib/v/checker/tests/minus_op_wrong_left_type_err_a.vv +++ b/vlib/v/checker/tests/minus_op_wrong_left_type_err_a.vv @@ -1,4 +1,4 @@ -struct A{} +struct Aaa{} fn main() { - A{} - 10 + Aaa{} - 10 } diff --git a/vlib/v/checker/tests/minus_op_wrong_right_type_err_a.out b/vlib/v/checker/tests/minus_op_wrong_right_type_err_a.out index add2249e0c..68f30a760a 100644 --- a/vlib/v/checker/tests/minus_op_wrong_right_type_err_a.out +++ b/vlib/v/checker/tests/minus_op_wrong_right_type_err_a.out @@ -1,6 +1,6 @@ -vlib/v/checker/tests/minus_op_wrong_right_type_err_a.v:3:10: error: mismatched types `any_int` and `A` - 1 | struct A{} +vlib/v/checker/tests/minus_op_wrong_right_type_err_a.v:3:10: error: mismatched types `any_int` and `Aaa` + 1 | struct Aaa{} 2 | fn main() { - 3 | 10 - A{} - | ~~~ + 3 | 10 - Aaa{} + | ~~~~~ 4 | } diff --git a/vlib/v/checker/tests/minus_op_wrong_right_type_err_a.vv b/vlib/v/checker/tests/minus_op_wrong_right_type_err_a.vv index bce597e6d5..8a2d4511fc 100644 --- a/vlib/v/checker/tests/minus_op_wrong_right_type_err_a.vv +++ b/vlib/v/checker/tests/minus_op_wrong_right_type_err_a.vv @@ -1,4 +1,4 @@ -struct A{} +struct Aaa{} fn main() { - 10 - A{} + 10 - Aaa{} } diff --git a/vlib/v/checker/tests/mod_op_wrong_left_type_err_c.out b/vlib/v/checker/tests/mod_op_wrong_left_type_err_c.out index 99b5337694..04ac5bb156 100644 --- a/vlib/v/checker/tests/mod_op_wrong_left_type_err_c.out +++ b/vlib/v/checker/tests/mod_op_wrong_left_type_err_c.out @@ -1,6 +1,6 @@ -vlib/v/checker/tests/mod_op_wrong_left_type_err_c.v:4:2: error: mismatched types `A` and `any_int` +vlib/v/checker/tests/mod_op_wrong_left_type_err_c.v:4:2: error: mismatched types `Aaa` and `any_int` 2 | fn main() { - 3 | a := A{} + 3 | a := Aaa{} 4 | a % 1 | ^ 5 | } diff --git a/vlib/v/checker/tests/mod_op_wrong_left_type_err_c.vv b/vlib/v/checker/tests/mod_op_wrong_left_type_err_c.vv index 7f88eafd62..9042a6b574 100644 --- a/vlib/v/checker/tests/mod_op_wrong_left_type_err_c.vv +++ b/vlib/v/checker/tests/mod_op_wrong_left_type_err_c.vv @@ -1,5 +1,5 @@ -struct A{} +struct Aaa{} fn main() { - a := A{} + a := Aaa{} a % 1 } diff --git a/vlib/v/checker/tests/mod_op_wrong_right_type_err_c.out b/vlib/v/checker/tests/mod_op_wrong_right_type_err_c.out index 12dadd60be..29e91389f6 100644 --- a/vlib/v/checker/tests/mod_op_wrong_right_type_err_c.out +++ b/vlib/v/checker/tests/mod_op_wrong_right_type_err_c.out @@ -1,6 +1,6 @@ -vlib/v/checker/tests/mod_op_wrong_right_type_err_c.v:4:6: error: mismatched types `any_int` and `A` +vlib/v/checker/tests/mod_op_wrong_right_type_err_c.v:4:6: error: mismatched types `any_int` and `Aaa` 2 | fn main() { - 3 | a := A{} + 3 | a := Aaa{} 4 | 1 % a | ^ 5 | } diff --git a/vlib/v/checker/tests/mod_op_wrong_right_type_err_c.vv b/vlib/v/checker/tests/mod_op_wrong_right_type_err_c.vv index 15c4feddb8..2cea370b63 100644 --- a/vlib/v/checker/tests/mod_op_wrong_right_type_err_c.vv +++ b/vlib/v/checker/tests/mod_op_wrong_right_type_err_c.vv @@ -1,5 +1,5 @@ -struct A{} +struct Aaa{} fn main() { - a := A{} + a := Aaa{} 1 % a } diff --git a/vlib/v/checker/tests/mul_op_wrong_left_type_err_a.out b/vlib/v/checker/tests/mul_op_wrong_left_type_err_a.out index 6ae6aba93a..4f51e39b5d 100644 --- a/vlib/v/checker/tests/mul_op_wrong_left_type_err_a.out +++ b/vlib/v/checker/tests/mul_op_wrong_left_type_err_a.out @@ -1,6 +1,6 @@ -vlib/v/checker/tests/mul_op_wrong_left_type_err_a.v:3:5: error: mismatched types `A` and `any_int` - 1 | struct A{} +vlib/v/checker/tests/mul_op_wrong_left_type_err_a.v:3:5: error: mismatched types `Aaa` and `any_int` + 1 | struct Aaa{} 2 | fn main() { - 3 | A{} * 10 - | ~~~ + 3 | Aaa{} * 10 + | ~~~~~ 4 | } diff --git a/vlib/v/checker/tests/mul_op_wrong_left_type_err_a.vv b/vlib/v/checker/tests/mul_op_wrong_left_type_err_a.vv index a3afb73839..d5eb305ed8 100644 --- a/vlib/v/checker/tests/mul_op_wrong_left_type_err_a.vv +++ b/vlib/v/checker/tests/mul_op_wrong_left_type_err_a.vv @@ -1,4 +1,4 @@ -struct A{} +struct Aaa{} fn main() { - A{} * 10 + Aaa{} * 10 } diff --git a/vlib/v/checker/tests/mul_op_wrong_right_type_err_a.out b/vlib/v/checker/tests/mul_op_wrong_right_type_err_a.out index 96cec13c52..5c7a6358cd 100644 --- a/vlib/v/checker/tests/mul_op_wrong_right_type_err_a.out +++ b/vlib/v/checker/tests/mul_op_wrong_right_type_err_a.out @@ -1,6 +1,6 @@ -vlib/v/checker/tests/mul_op_wrong_right_type_err_a.v:3:10: error: mismatched types `any_int` and `A` - 1 | struct A{} +vlib/v/checker/tests/mul_op_wrong_right_type_err_a.v:3:10: error: mismatched types `any_int` and `Aaa` + 1 | struct Aaa{} 2 | fn main() { - 3 | 10 * A{} - | ~~~ + 3 | 10 * Aaa{} + | ~~~~~ 4 | } diff --git a/vlib/v/checker/tests/mul_op_wrong_right_type_err_a.vv b/vlib/v/checker/tests/mul_op_wrong_right_type_err_a.vv index 452d5b5cd2..19b900b19c 100644 --- a/vlib/v/checker/tests/mul_op_wrong_right_type_err_a.vv +++ b/vlib/v/checker/tests/mul_op_wrong_right_type_err_a.vv @@ -1,4 +1,4 @@ -struct A{} +struct Aaa{} fn main() { - 10 * A{} + 10 * Aaa{} } diff --git a/vlib/v/checker/tests/struct_field_name_duplicate_err.out b/vlib/v/checker/tests/struct_field_name_duplicate_err.out index 78b3ac23ba..0b8a8b6dc5 100644 --- a/vlib/v/checker/tests/struct_field_name_duplicate_err.out +++ b/vlib/v/checker/tests/struct_field_name_duplicate_err.out @@ -1,5 +1,5 @@ vlib/v/checker/tests/struct_field_name_duplicate_err.v:3:2: error: field name `a` duplicate - 1 | struct A { + 1 | struct Aaa { 2 | a int 3 | a string | ~~~~~~~~ diff --git a/vlib/v/checker/tests/struct_field_name_duplicate_err.vv b/vlib/v/checker/tests/struct_field_name_duplicate_err.vv index e1a30cb8a4..487b0a7a95 100644 --- a/vlib/v/checker/tests/struct_field_name_duplicate_err.vv +++ b/vlib/v/checker/tests/struct_field_name_duplicate_err.vv @@ -1,4 +1,4 @@ -struct A { +struct Aaa { a int a string } diff --git a/vlib/v/checker/tests/unknown_field.out b/vlib/v/checker/tests/unknown_field.out index 30be5fa32f..534a98d8d9 100644 --- a/vlib/v/checker/tests/unknown_field.out +++ b/vlib/v/checker/tests/unknown_field.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/unknown_field.v:7:12: error: unknown field `Test.sdd` +vlib/v/checker/tests/unknown_field.v:7:12: error: type `Test` has no field or method `sdd` 5 | fn main() { 6 | t := Test{} 7 | println(t.sdd) diff --git a/vlib/v/gen/js/tests/hello/hello.v b/vlib/v/gen/js/tests/hello/hello.v index 0369c062fa..d825694a7a 100644 --- a/vlib/v/gen/js/tests/hello/hello.v +++ b/vlib/v/gen/js/tests/hello/hello.v @@ -7,21 +7,21 @@ pub const ( ) */ -pub struct A { +pub struct Aaa { pub mut: foo string } -pub fn (mut a A) update(s string) { +pub fn (mut a Aaa) update(s string) { a.foo = s } -struct B {} +struct Bbb {} -pub enum C {} +pub enum Ccc {} pub fn debugger() string { - v := B{} + v := Bbb{} return 'Hello' } diff --git a/vlib/v/tests/inout/enum_print.vv b/vlib/v/tests/inout/enum_print.vv index 77bb301350..473a645a04 100644 --- a/vlib/v/tests/inout/enum_print.vv +++ b/vlib/v/tests/inout/enum_print.vv @@ -7,13 +7,13 @@ enum Color { yellow = 3 } -struct A{ +struct Aaa{ color Color } fn main() { col := Color.green - a := A{color: col} + a := Aaa{color: col} orange := Color.orange println(orange) println(Color.yellow) diff --git a/vlib/v/tests/inout/nested_structs.out b/vlib/v/tests/inout/nested_structs.out index 1ed5766aa7..89218c9f14 100644 --- a/vlib/v/tests/inout/nested_structs.out +++ b/vlib/v/tests/inout/nested_structs.out @@ -1,11 +1,11 @@ -A { +Aaa { test: false - b: B { + b: Bbb { pass: false name: '' } } -B { +Bbb { pass: false name: '' } \ No newline at end of file diff --git a/vlib/v/tests/inout/nested_structs.vv b/vlib/v/tests/inout/nested_structs.vv index 970351b410..b73aa177e3 100644 --- a/vlib/v/tests/inout/nested_structs.vv +++ b/vlib/v/tests/inout/nested_structs.vv @@ -1,22 +1,22 @@ module main -struct B { +struct Bbb { pass bool name string } -fn (b &B) print() { +fn (b &Bbb) print() { println(b) } -struct A { +struct Aaa { test bool - b B + b Bbb } fn main() { - a := A{} + a := Aaa{} println(a) - b := B{} + b := Bbb{} b.print() } diff --git a/vlib/v/tests/mut_test.v b/vlib/v/tests/mut_test.v index 6a81373e2f..3b3b4437b6 100644 --- a/vlib/v/tests/mut_test.v +++ b/vlib/v/tests/mut_test.v @@ -1,11 +1,11 @@ -struct A { +struct Aaa { pub mut: v []int } -struct B { +struct Bbb { pub mut: - a []A + a []Aaa } fn foo(b int, a mut []int) { @@ -32,8 +32,8 @@ fn test_mut() { fn test_mut_2() { zero := 0 - mut b := B{} - b.a << A{} + mut b := Bbb{} + b.a << Aaa{} b.a[0].v = [9, 8, 7] b.a[0].v << 6 b.a[zero].v << 5 diff --git a/vlib/v/tests/pointers_str_test.v b/vlib/v/tests/pointers_str_test.v index 101cdcbecb..47d7d301ea 100644 --- a/vlib/v/tests/pointers_str_test.v +++ b/vlib/v/tests/pointers_str_test.v @@ -1,8 +1,8 @@ -struct A { +struct Aaa { foo int } fn test_pointer_to_string() { - a := A{} + a := Aaa{} assert a.foo.str() != (&a.foo).str() } diff --git a/vlib/v/tests/repl/chained_fields/bd.repl.skip b/vlib/v/tests/repl/chained_fields/bd.repl.skip index 75cc56b917..8430f79c3e 100644 --- a/vlib/v/tests/repl/chained_fields/bd.repl.skip +++ b/vlib/v/tests/repl/chained_fields/bd.repl.skip @@ -1,17 +1,17 @@ -struct A { mut: v int } struct B { a A } struct C { mut: b B } struct D { mut: c C } -mut b := B{} b = B{A{2}} +struct Aaa { mut: v int } struct Bbb { a Aaa } struct Ccc { mut: b Bbb } struct Ddd { mut: c Ccc } +mut b := Bbb{} b = Bbb{Aaa{2}} b.a.v = 1 // Error (field a immutable) -b.a = A{} // Error (field a immutable) +b.a = Aaa{} // Error (field a immutable) ===output=== -cannot modify immutable field `a` (type `B`) +cannot modify immutable field `a` (type `Bbb`) declare the field with `mut:` -struct B { +struct Bbb { mut: - a A + a Aaa } -cannot modify immutable field `a` (type `B`) +cannot modify immutable field `a` (type `Bbb`) declare the field with `mut:` -struct B { +struct Bbb { mut: - a A + a Aaa } diff --git a/vlib/v/tests/repl/chained_fields/c.repl.skip b/vlib/v/tests/repl/chained_fields/c.repl.skip index 1919ff6f58..47cdde5695 100644 --- a/vlib/v/tests/repl/chained_fields/c.repl.skip +++ b/vlib/v/tests/repl/chained_fields/c.repl.skip @@ -1,17 +1,17 @@ -struct A { mut: v int } struct B { a A } struct C { mut: b B } struct D { mut: c C } -mut c := C{} c.b = B{} -c.b.a = A{} // Error (field a immutable) +struct Aaa { mut: v int } struct Bbb { a Aaa } struct Ccc { mut: b Bbb } struct Ddd { mut: c Ccc } +mut c := Ccc{} c.b = Bbb{} +c.b.a = Aaa{} // Error (field a immutable) c.b.a.v = 1 // Error (field a immutable) ===output=== -cannot modify immutable field `a` (type `B`) +cannot modify immutable field `a` (type `Bbb`) declare the field with `mut:` -struct B { +struct Bbb { mut: - a A + a Aaa } -cannot modify immutable field `a` (type `B`) +cannot modify immutable field `a` (type `Bbb`) declare the field with `mut:` -struct B { +struct Bbb { mut: - a A + a Aaa } diff --git a/vlib/v/tests/repl/chained_fields/c2.repl.skip b/vlib/v/tests/repl/chained_fields/c2.repl.skip index 1c477a589b..96e1da8ad0 100644 --- a/vlib/v/tests/repl/chained_fields/c2.repl.skip +++ b/vlib/v/tests/repl/chained_fields/c2.repl.skip @@ -1,5 +1,5 @@ -struct A { mut: v int } struct B { a A } struct C { mut: b B } struct D { mut: c C } -c2 := C{} -c2.b = B{} // Error (c2 immutable) +struct Aaa { mut: v int } struct Bbb { a Aaa } struct Ccc { mut: b Bbb } struct Ddd { mut: c Ccc } +c2 := Ccc{} +c2.b = Bbb{} // Error (c2 immutable) ===output=== `c2` is immutable diff --git a/vlib/v/tests/repl/chained_fields/d.repl.skip b/vlib/v/tests/repl/chained_fields/d.repl.skip index af7986ae18..cf33384c62 100644 --- a/vlib/v/tests/repl/chained_fields/d.repl.skip +++ b/vlib/v/tests/repl/chained_fields/d.repl.skip @@ -1,5 +1,5 @@ -struct A { mut: v int } struct B { a A } struct C { mut: b B } struct D { mut: c C } -mut d := D{} d.c.b = B{} +struct Aaa { mut: v int } struct Bbb { a Aaa } struct Ccc { mut: b Bbb } struct Ddd { mut: c Ccc } +mut d := Ddd{} d.c.b = Bbb{} 'OK' ===output=== OK diff --git a/vlib/v/tests/string_interpolation_test.v b/vlib/v/tests/string_interpolation_test.v index b57bb517d8..3b8a257258 100644 --- a/vlib/v/tests/string_interpolation_test.v +++ b/vlib/v/tests/string_interpolation_test.v @@ -126,17 +126,17 @@ fn test_utf8_string_interpolation() { assert '>${g:-13}<' == '>Πελοπόννησος <' } -struct S { +struct Sss { v1 int v2 f64 } -fn (s S) str() string { +fn (s Sss) str() string { return '[${s.v1}, ${s.v2:.3f}]' } fn test_string_interpolation_str_evaluation() { - mut x := S{17, 13.455893} + mut x := Sss{17, 13.455893} assert '$x' == '[17, 13.456]' }