From d86304b7d0cc90f7f22a23158c8200a9a77cdeee Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 3 Jan 2021 19:42:51 +0200 Subject: [PATCH] v.table: use the user readable names inside type_to_str_using_aliases for `any_int` and `any_float` --- vlib/v/checker/tests/add_op_wrong_type_err.out | 12 ++++++------ vlib/v/checker/tests/cannot_cast_to_struct.out | 2 +- vlib/v/checker/tests/cast_string_err.out | 2 +- vlib/v/checker/tests/div_op_wrong_type_err.out | 12 ++++++------ vlib/v/checker/tests/fn_var.out | 2 +- vlib/v/checker/tests/for_in_index_type.out | 2 +- vlib/v/checker/tests/if_expr_mismatch.out | 2 +- vlib/v/checker/tests/in_mismatch_type.out | 10 +++++----- vlib/v/checker/tests/is_type_not_exist.out | 2 +- vlib/v/checker/tests/match_undefined_cond.out | 4 ++-- vlib/v/checker/tests/minus_op_wrong_type_err.out | 12 ++++++------ vlib/v/checker/tests/mod_op_wrong_type_err.out | 12 ++++++------ vlib/v/checker/tests/mul_op_wrong_type_err.out | 12 ++++++------ ...l_or_block_returns_value_of_incompatible_type.out | 2 +- vlib/v/checker/tests/ptr_assign.out | 2 +- vlib/v/table/types.v | 5 ++++- 16 files changed, 49 insertions(+), 46 deletions(-) diff --git a/vlib/v/checker/tests/add_op_wrong_type_err.out b/vlib/v/checker/tests/add_op_wrong_type_err.out index 1f8bff4a1c..1cc9c857e3 100644 --- a/vlib/v/checker/tests/add_op_wrong_type_err.out +++ b/vlib/v/checker/tests/add_op_wrong_type_err.out @@ -1,39 +1,39 @@ -vlib/v/checker/tests/add_op_wrong_type_err.vv:3:13: error: mismatched types `Aaa` and `any_int` +vlib/v/checker/tests/add_op_wrong_type_err.vv:3:13: error: mismatched types `Aaa` and `untyped int` 1 | struct Aaa{} 2 | fn main() { 3 | println(Aaa{} + 10) | ~~~~~ 4 | println(10 + Aaa{}) 5 | println([1,2,3] + 10) -vlib/v/checker/tests/add_op_wrong_type_err.vv:4:18: error: mismatched types `any_int` and `Aaa` +vlib/v/checker/tests/add_op_wrong_type_err.vv:4:18: error: mismatched types `untyped int` and `Aaa` 2 | fn main() { 3 | println(Aaa{} + 10) 4 | println(10 + Aaa{}) | ~~~~~ 5 | println([1,2,3] + 10) 6 | println(10 + [1,2,3]) -vlib/v/checker/tests/add_op_wrong_type_err.vv:5:13: error: mismatched types `[]int` and `any_int` +vlib/v/checker/tests/add_op_wrong_type_err.vv:5:13: error: mismatched types `[]int` and `untyped int` 3 | println(Aaa{} + 10) 4 | println(10 + Aaa{}) 5 | println([1,2,3] + 10) | ~~~~~~~ 6 | println(10 + [1,2,3]) 7 | a := map[string]int -vlib/v/checker/tests/add_op_wrong_type_err.vv:6:18: error: mismatched types `any_int` and `[]int` +vlib/v/checker/tests/add_op_wrong_type_err.vv:6:18: error: mismatched types `untyped int` and `[]int` 4 | println(10 + Aaa{}) 5 | println([1,2,3] + 10) 6 | println(10 + [1,2,3]) | ~~~~~~~ 7 | a := map[string]int 8 | println(a + 10) -vlib/v/checker/tests/add_op_wrong_type_err.vv:8:13: error: mismatched types `map[string]int` and `any_int` +vlib/v/checker/tests/add_op_wrong_type_err.vv:8:13: error: mismatched types `map[string]int` and `untyped int` 6 | println(10 + [1,2,3]) 7 | a := map[string]int 8 | println(a + 10) | ^ 9 | println(10 + a) 10 | } -vlib/v/checker/tests/add_op_wrong_type_err.vv:9:18: error: mismatched types `any_int` and `map[string]int` +vlib/v/checker/tests/add_op_wrong_type_err.vv:9:18: error: mismatched types `untyped int` and `map[string]int` 7 | a := map[string]int 8 | println(a + 10) 9 | println(10 + a) diff --git a/vlib/v/checker/tests/cannot_cast_to_struct.out b/vlib/v/checker/tests/cannot_cast_to_struct.out index 31ead0fa8e..d4e05f75a3 100644 --- a/vlib/v/checker/tests/cannot_cast_to_struct.out +++ b/vlib/v/checker/tests/cannot_cast_to_struct.out @@ -12,7 +12,7 @@ vlib/v/checker/tests/cannot_cast_to_struct.vv:12:6: error: cannot cast `Alphabet | ~~~~~~~~ 13 | _ = Xyz(5) 14 | s := Abc{} -vlib/v/checker/tests/cannot_cast_to_struct.vv:13:6: error: cannot cast `any_int` to struct +vlib/v/checker/tests/cannot_cast_to_struct.vv:13:6: error: cannot cast `untyped int` to struct 11 | sum := Alphabet(Xyz{}) 12 | _ = Xyz(sum) 13 | _ = Xyz(5) diff --git a/vlib/v/checker/tests/cast_string_err.out b/vlib/v/checker/tests/cast_string_err.out index efd606a1a7..73af881be9 100644 --- a/vlib/v/checker/tests/cast_string_err.out +++ b/vlib/v/checker/tests/cast_string_err.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/cast_string_err.vv:2:7: error: cannot cast type `any_int` to string, use `x.str()` instead +vlib/v/checker/tests/cast_string_err.vv:2:7: error: cannot cast type `untyped int` to string, use `x.str()` instead 1 | fn main() { 2 | a := string(1) | ~~~~~~~~~ diff --git a/vlib/v/checker/tests/div_op_wrong_type_err.out b/vlib/v/checker/tests/div_op_wrong_type_err.out index f50520e761..4e1356b916 100644 --- a/vlib/v/checker/tests/div_op_wrong_type_err.out +++ b/vlib/v/checker/tests/div_op_wrong_type_err.out @@ -1,39 +1,39 @@ -vlib/v/checker/tests/div_op_wrong_type_err.vv:3:13: error: mismatched types `Aaa` and `any_int` +vlib/v/checker/tests/div_op_wrong_type_err.vv:3:13: error: mismatched types `Aaa` and `untyped int` 1 | struct Aaa{} 2 | fn main() { 3 | println(Aaa{} / 10) | ~~~~~ 4 | println(10 / Aaa{}) 5 | println([1,2,3] / 10) -vlib/v/checker/tests/div_op_wrong_type_err.vv:4:18: error: mismatched types `any_int` and `Aaa` +vlib/v/checker/tests/div_op_wrong_type_err.vv:4:18: error: mismatched types `untyped int` and `Aaa` 2 | fn main() { 3 | println(Aaa{} / 10) 4 | println(10 / Aaa{}) | ~~~~~ 5 | println([1,2,3] / 10) 6 | println(10 / [1,2,3]) -vlib/v/checker/tests/div_op_wrong_type_err.vv:5:13: error: mismatched types `[]int` and `any_int` +vlib/v/checker/tests/div_op_wrong_type_err.vv:5:13: error: mismatched types `[]int` and `untyped int` 3 | println(Aaa{} / 10) 4 | println(10 / Aaa{}) 5 | println([1,2,3] / 10) | ~~~~~~~ 6 | println(10 / [1,2,3]) 7 | a := map[string]int -vlib/v/checker/tests/div_op_wrong_type_err.vv:6:18: error: mismatched types `any_int` and `[]int` +vlib/v/checker/tests/div_op_wrong_type_err.vv:6:18: error: mismatched types `untyped int` and `[]int` 4 | println(10 / Aaa{}) 5 | println([1,2,3] / 10) 6 | println(10 / [1,2,3]) | ~~~~~~~ 7 | a := map[string]int 8 | println(a / 10) -vlib/v/checker/tests/div_op_wrong_type_err.vv:8:13: error: mismatched types `map[string]int` and `any_int` +vlib/v/checker/tests/div_op_wrong_type_err.vv:8:13: error: mismatched types `map[string]int` and `untyped int` 6 | println(10 / [1,2,3]) 7 | a := map[string]int 8 | println(a / 10) | ^ 9 | println(10 / a) 10 | } -vlib/v/checker/tests/div_op_wrong_type_err.vv:9:18: error: mismatched types `any_int` and `map[string]int` +vlib/v/checker/tests/div_op_wrong_type_err.vv:9:18: error: mismatched types `untyped int` and `map[string]int` 7 | a := map[string]int 8 | println(a / 10) 9 | println(10 / a) diff --git a/vlib/v/checker/tests/fn_var.out b/vlib/v/checker/tests/fn_var.out index 6d244f9a4e..ef231cfaad 100644 --- a/vlib/v/checker/tests/fn_var.out +++ b/vlib/v/checker/tests/fn_var.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/fn_var.vv:2:5: error: cannot assign to `f`: expected `fn (int) byte`, not `any_int` +vlib/v/checker/tests/fn_var.vv:2:5: error: cannot assign to `f`: expected `fn (int) byte`, not `untyped int` 1 | mut f := fn(i int) byte {} 2 | f = 4 | ^ diff --git a/vlib/v/checker/tests/for_in_index_type.out b/vlib/v/checker/tests/for_in_index_type.out index b75614e626..29818b9d84 100644 --- a/vlib/v/checker/tests/for_in_index_type.out +++ b/vlib/v/checker/tests/for_in_index_type.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/for_in_index_type.vv: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 `untyped int` 1 | fn main() { 2 | for a in 52 { | ~~ diff --git a/vlib/v/checker/tests/if_expr_mismatch.out b/vlib/v/checker/tests/if_expr_mismatch.out index aa9b68d302..99835d662a 100644 --- a/vlib/v/checker/tests/if_expr_mismatch.out +++ b/vlib/v/checker/tests/if_expr_mismatch.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/if_expr_mismatch.vv:2:7: error: mismatched types `string` and `any_int` +vlib/v/checker/tests/if_expr_mismatch.vv:2:7: error: mismatched types `string` and `untyped int` 1 | fn main() { 2 | s := if true { '12' } else { 12 } | ~~ diff --git a/vlib/v/checker/tests/in_mismatch_type.out b/vlib/v/checker/tests/in_mismatch_type.out index 8c02b4376c..651968a02e 100644 --- a/vlib/v/checker/tests/in_mismatch_type.out +++ b/vlib/v/checker/tests/in_mismatch_type.out @@ -1,18 +1,18 @@ -vlib/v/checker/tests/in_mismatch_type.vv:10:7: error: left operand to `in` does not match the array element type: expected `string`, not `any_int` +vlib/v/checker/tests/in_mismatch_type.vv:10:7: error: left operand to `in` does not match the array element type: expected `string`, not `untyped int` 8 | } 9 | s := 'abcd' 10 | if 1 in a_s { | ~~ 11 | println('ok') 12 | } -vlib/v/checker/tests/in_mismatch_type.vv:13:7: error: left operand to `in` does not match the map key type: expected `string`, not `any_int` +vlib/v/checker/tests/in_mismatch_type.vv:13:7: error: left operand to `in` does not match the map key type: expected `string`, not `untyped int` 11 | println('ok') 12 | } 13 | if 2 in m { | ~~ 14 | println('yeah') 15 | } -vlib/v/checker/tests/in_mismatch_type.vv:16:7: error: left operand to `in` does not match: expected `string`, not `any_int` +vlib/v/checker/tests/in_mismatch_type.vv:16:7: error: left operand to `in` does not match: expected `string`, not `untyped int` 14 | println('yeah') 15 | } 16 | if 3 in s { @@ -54,7 +54,7 @@ vlib/v/checker/tests/in_mismatch_type.vv:31:9: error: left operand to `in` does | ~~ 32 | println('all right') 33 | } -vlib/v/checker/tests/in_mismatch_type.vv:34:7: error: left operand to `!in` does not match the array element type: expected `string`, not `any_int` +vlib/v/checker/tests/in_mismatch_type.vv:34:7: error: left operand to `!in` does not match the array element type: expected `string`, not `untyped int` 32 | println('all right') 33 | } 34 | if 1 !in a_s { @@ -68,7 +68,7 @@ vlib/v/checker/tests/in_mismatch_type.vv:37:9: error: left operand to `!in` does | ~~~ 38 | println('good') 39 | } -vlib/v/checker/tests/in_mismatch_type.vv:41:7: error: left operand to `!in` does not match the map key type: expected `string`, not `any_int` +vlib/v/checker/tests/in_mismatch_type.vv:41:7: error: left operand to `!in` does not match the map key type: expected `string`, not `untyped int` 39 | } 40 | 41 | if 5 !in m { diff --git a/vlib/v/checker/tests/is_type_not_exist.out b/vlib/v/checker/tests/is_type_not_exist.out index 2d0bc7421c..a7eed5ce06 100644 --- a/vlib/v/checker/tests/is_type_not_exist.out +++ b/vlib/v/checker/tests/is_type_not_exist.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/is_type_not_exist.vv:4:25: error: cannot use `any_int` as `Integer` in argument 1 to `fn_with_sum_type_param` +vlib/v/checker/tests/is_type_not_exist.vv:4:25: error: cannot use `untyped int` as `Integer` in argument 1 to `fn_with_sum_type_param` 2 | 3 | fn main() { 4 | fn_with_sum_type_param(1) diff --git a/vlib/v/checker/tests/match_undefined_cond.out b/vlib/v/checker/tests/match_undefined_cond.out index 2800eb3715..be30923f7c 100644 --- a/vlib/v/checker/tests/match_undefined_cond.out +++ b/vlib/v/checker/tests/match_undefined_cond.out @@ -5,14 +5,14 @@ vlib/v/checker/tests/match_undefined_cond.vv:4:15: error: undefined ident: `Asd` | ~~~ 5 | 1 { 'foo' } 6 | 2 { 'test' } -vlib/v/checker/tests/match_undefined_cond.vv:5:3: error: cannot match `any_int` with `void` condition +vlib/v/checker/tests/match_undefined_cond.vv:5:3: error: cannot match `untyped int` with `void` condition 3 | fn main() { 4 | res := match Asd { 5 | 1 { 'foo' } | ^ 6 | 2 { 'test' } 7 | else { '' } -vlib/v/checker/tests/match_undefined_cond.vv:6:3: error: cannot match `any_int` with `void` condition +vlib/v/checker/tests/match_undefined_cond.vv:6:3: error: cannot match `untyped int` with `void` condition 4 | res := match Asd { 5 | 1 { 'foo' } 6 | 2 { 'test' } diff --git a/vlib/v/checker/tests/minus_op_wrong_type_err.out b/vlib/v/checker/tests/minus_op_wrong_type_err.out index 5bb8cb4ba4..b255d8d76d 100644 --- a/vlib/v/checker/tests/minus_op_wrong_type_err.out +++ b/vlib/v/checker/tests/minus_op_wrong_type_err.out @@ -1,39 +1,39 @@ -vlib/v/checker/tests/minus_op_wrong_type_err.vv:3:13: error: mismatched types `Aaa` and `any_int` +vlib/v/checker/tests/minus_op_wrong_type_err.vv:3:13: error: mismatched types `Aaa` and `untyped int` 1 | struct Aaa{} 2 | fn main() { 3 | println(Aaa{} - 10) | ~~~~~ 4 | println(10 - Aaa{}) 5 | println([1,2,3] - 10) -vlib/v/checker/tests/minus_op_wrong_type_err.vv:4:18: error: mismatched types `any_int` and `Aaa` +vlib/v/checker/tests/minus_op_wrong_type_err.vv:4:18: error: mismatched types `untyped int` and `Aaa` 2 | fn main() { 3 | println(Aaa{} - 10) 4 | println(10 - Aaa{}) | ~~~~~ 5 | println([1,2,3] - 10) 6 | println(10 - [1,2,3]) -vlib/v/checker/tests/minus_op_wrong_type_err.vv:5:13: error: mismatched types `[]int` and `any_int` +vlib/v/checker/tests/minus_op_wrong_type_err.vv:5:13: error: mismatched types `[]int` and `untyped int` 3 | println(Aaa{} - 10) 4 | println(10 - Aaa{}) 5 | println([1,2,3] - 10) | ~~~~~~~ 6 | println(10 - [1,2,3]) 7 | a := map[string]int -vlib/v/checker/tests/minus_op_wrong_type_err.vv:6:18: error: mismatched types `any_int` and `[]int` +vlib/v/checker/tests/minus_op_wrong_type_err.vv:6:18: error: mismatched types `untyped int` and `[]int` 4 | println(10 - Aaa{}) 5 | println([1,2,3] - 10) 6 | println(10 - [1,2,3]) | ~~~~~~~ 7 | a := map[string]int 8 | println(a - 10) -vlib/v/checker/tests/minus_op_wrong_type_err.vv:8:13: error: mismatched types `map[string]int` and `any_int` +vlib/v/checker/tests/minus_op_wrong_type_err.vv:8:13: error: mismatched types `map[string]int` and `untyped int` 6 | println(10 - [1,2,3]) 7 | a := map[string]int 8 | println(a - 10) | ^ 9 | println(10 - a) 10 | } -vlib/v/checker/tests/minus_op_wrong_type_err.vv:9:18: error: mismatched types `any_int` and `map[string]int` +vlib/v/checker/tests/minus_op_wrong_type_err.vv:9:18: error: mismatched types `untyped int` and `map[string]int` 7 | a := map[string]int 8 | println(a - 10) 9 | println(10 - a) diff --git a/vlib/v/checker/tests/mod_op_wrong_type_err.out b/vlib/v/checker/tests/mod_op_wrong_type_err.out index d11eb2800f..8c8d9ed630 100644 --- a/vlib/v/checker/tests/mod_op_wrong_type_err.out +++ b/vlib/v/checker/tests/mod_op_wrong_type_err.out @@ -12,42 +12,42 @@ vlib/v/checker/tests/mod_op_wrong_type_err.vv:4:14: error: float modulo not allo | ~~~ 5 | println([1,2,3] % 1) 6 | println(1 % [1,2,3]) -vlib/v/checker/tests/mod_op_wrong_type_err.vv:5:10: error: mismatched types `[]int` and `any_int` +vlib/v/checker/tests/mod_op_wrong_type_err.vv:5:10: error: mismatched types `[]int` and `untyped int` 3 | println(0.5 % 1) 4 | println(1 % 0.5) 5 | println([1,2,3] % 1) | ~~~~~~~ 6 | println(1 % [1,2,3]) 7 | a := Aaa{} -vlib/v/checker/tests/mod_op_wrong_type_err.vv:6:14: error: mismatched types `any_int` and `[]int` +vlib/v/checker/tests/mod_op_wrong_type_err.vv:6:14: error: mismatched types `untyped int` and `[]int` 4 | println(1 % 0.5) 5 | println([1,2,3] % 1) 6 | println(1 % [1,2,3]) | ~~~~~~~ 7 | a := Aaa{} 8 | println(a % 1) -vlib/v/checker/tests/mod_op_wrong_type_err.vv:8:10: error: mismatched types `Aaa` and `any_int` +vlib/v/checker/tests/mod_op_wrong_type_err.vv:8:10: error: mismatched types `Aaa` and `untyped int` 6 | println(1 % [1,2,3]) 7 | a := Aaa{} 8 | println(a % 1) | ^ 9 | println(1 % a) 10 | b := map[string]int -vlib/v/checker/tests/mod_op_wrong_type_err.vv:9:14: error: mismatched types `any_int` and `Aaa` +vlib/v/checker/tests/mod_op_wrong_type_err.vv:9:14: error: mismatched types `untyped int` and `Aaa` 7 | a := Aaa{} 8 | println(a % 1) 9 | println(1 % a) | ^ 10 | b := map[string]int 11 | println(b % 1) -vlib/v/checker/tests/mod_op_wrong_type_err.vv:11:10: error: mismatched types `map[string]int` and `any_int` +vlib/v/checker/tests/mod_op_wrong_type_err.vv:11:10: error: mismatched types `map[string]int` and `untyped int` 9 | println(1 % a) 10 | b := map[string]int 11 | println(b % 1) | ^ 12 | println(1 % b) 13 | } -vlib/v/checker/tests/mod_op_wrong_type_err.vv:12:14: error: mismatched types `any_int` and `map[string]int` +vlib/v/checker/tests/mod_op_wrong_type_err.vv:12:14: error: mismatched types `untyped int` and `map[string]int` 10 | b := map[string]int 11 | println(b % 1) 12 | println(1 % b) diff --git a/vlib/v/checker/tests/mul_op_wrong_type_err.out b/vlib/v/checker/tests/mul_op_wrong_type_err.out index db7194c143..654e9e9bcc 100644 --- a/vlib/v/checker/tests/mul_op_wrong_type_err.out +++ b/vlib/v/checker/tests/mul_op_wrong_type_err.out @@ -1,39 +1,39 @@ -vlib/v/checker/tests/mul_op_wrong_type_err.vv:5:13: error: mismatched types `Aaa` and `any_int` +vlib/v/checker/tests/mul_op_wrong_type_err.vv:5:13: error: mismatched types `Aaa` and `untyped 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` +vlib/v/checker/tests/mul_op_wrong_type_err.vv:6:18: error: mismatched types `untyped 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` +vlib/v/checker/tests/mul_op_wrong_type_err.vv:7:13: error: mismatched types `[]int` and `untyped 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` +vlib/v/checker/tests/mul_op_wrong_type_err.vv:8:18: error: mismatched types `untyped 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` +vlib/v/checker/tests/mul_op_wrong_type_err.vv:10:13: error: mismatched types `map[string]int` and `untyped 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` +vlib/v/checker/tests/mul_op_wrong_type_err.vv:11:18: error: mismatched types `untyped int` and `map[string]int` 9 | a := map[string]int 10 | println(a * 10) 11 | println(10 * a) diff --git a/vlib/v/checker/tests/optional_or_block_returns_value_of_incompatible_type.out b/vlib/v/checker/tests/optional_or_block_returns_value_of_incompatible_type.out index c8ced1d94d..0c71a32091 100644 --- a/vlib/v/checker/tests/optional_or_block_returns_value_of_incompatible_type.out +++ b/vlib/v/checker/tests/optional_or_block_returns_value_of_incompatible_type.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/optional_or_block_returns_value_of_incompatible_type.vv:13:3: error: the default expression type in the `or` block should be `string`, instead you gave a value of type `any_int` +vlib/v/checker/tests/optional_or_block_returns_value_of_incompatible_type.vv:13:3: error: the default expression type in the `or` block should be `string`, instead you gave a value of type `untyped int` 11 | // must be of the same type of the return 12 | // type of the `test_optional` function 13 | 123 diff --git a/vlib/v/checker/tests/ptr_assign.out b/vlib/v/checker/tests/ptr_assign.out index a8675578c6..4f1a66c744 100644 --- a/vlib/v/checker/tests/ptr_assign.out +++ b/vlib/v/checker/tests/ptr_assign.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/ptr_assign.vv:3:5: error: cannot assign to `p`: expected `&int`, not `any_int` +vlib/v/checker/tests/ptr_assign.vv:3:5: error: cannot assign to `p`: expected `&int`, not `untyped int` 1 | mut v := 43 2 | mut p := &v 3 | p = 4 diff --git a/vlib/v/table/types.v b/vlib/v/table/types.v index e32a1131ba..3d31970256 100644 --- a/vlib/v/table/types.v +++ b/vlib/v/table/types.v @@ -713,7 +713,10 @@ pub fn (table &Table) type_to_str_using_aliases(t Type, import_aliases map[strin sym := table.get_type_symbol(t) mut res := sym.name match sym.kind { - .any_int, .i8, .i16, .int, .i64, .byte, .u16, .u32, .u64, .any_float, .f32, .f64, .char, .rune, .string, .bool, .none_, .byteptr, .voidptr, .charptr { + .any_int, .any_float { + res = sym.name + } + .i8, .i16, .int, .i64, .byte, .u16, .u32, .u64, .f32, .f64, .char, .rune, .string, .bool, .none_, .byteptr, .voidptr, .charptr { // primitive types res = sym.kind.str() }