Skip to content

Commit 8abf693

Browse files
committed
all: more test fixes
1 parent f7b6a5e commit 8abf693

6 files changed

Lines changed: 14 additions & 10 deletions

File tree

‎vlib/builtin/chan_option_result.v‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ pub fn (err IError) str() string {
5959
if err is None__ {
6060
return 'none'
6161
}
62+
c := err.code()
63+
if c > 0 {
64+
return err.msg() + '; code: ' + c.str()
65+
}
6266
return err.msg()
6367
}
6468

‎vlib/v/gen/c/cgen.v‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4403,7 +4403,7 @@ fn (mut g Gen) typeof_expr(node ast.TypeOf) {
44034403
if sym.kind == .sum_type {
44044404
// When encountering a .sum_type, typeof() should be done at runtime,
44054405
// because the subtype of the expression may change:
4406-
g.write('builtin__charptr_vstring_literal(v_typeof_sumtype_${sym.cname}( (')
4406+
g.write('builtin__tos3(v_typeof_sumtype_${sym.cname}( (')
44074407
if typ.nr_muls() > 0 {
44084408
g.write('*'.repeat(typ.nr_muls()))
44094409
}

‎vlib/v/gen/c/fn.v‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ fn (mut g Gen) method_call(node ast.CallExpr) {
16921692
match node.kind {
16931693
.type_name {
16941694
if left_sym.kind in [.sum_type, .interface] {
1695-
g.conversion_function_call('builtin__charptr_vstring_literal(v_typeof_${prefix_name}_${typ_sym.cname}',
1695+
g.conversion_function_call('builtin__tos3(v_typeof_${prefix_name}_${typ_sym.cname}',
16961696
')', node)
16971697
return
16981698
}

‎vlib/v/gen/wasm/tests/arith.vv‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ fn mul(a i64, unsigned u32) f64 {
33

44
one *= 2 / unsigned
55

6-
return one
6+
return f64(one)
77
}
88

99
fn typ(a int) i64 {
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
vlib/v/parser/tests/prohibit_redeclaration_of_builtin_types.vv:1:8: error: cannot register struct `Option`, another type with this name exists
22
1 | struct Option {}
33
| ~~~~~~
4-
Details: vlib/builtin/chan_option_result.v:133:8: details: another declaration was found here
5-
131 |
6-
132 | // Option is the base of V's internal option return system.
7-
133 | struct Option {
4+
Details: vlib/builtin/chan_option_result.v:137:8: details: another declaration was found here
5+
135 |
6+
136 | // Option is the base of V's internal option return system.
7+
137 | struct Option {
88
| ~~~~~~
9-
134 | state u8 // 0 - ok; 2 - none; 1 - ?
10-
135 | err IError = none__
9+
138 | state u8 // 0 - ok; 2 - none; 1 - ?
10+
139 | err IError = none__

‎vlib/v/pref/pref_test.v‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn test_version_flag() {
3838
}
3939

4040
fn test_cross_compile_keeps_explicit_cc() {
41-
target_os := if pref.get_host_os() == .windows { 'linux' } else { 'windows' }
41+
target_os := if pref.get_host_os() == .linux { 'macos' } else { 'linux' }
4242
custom_cc := 'cosmocc'
4343

4444
first, _ := pref.parse_args_and_show_errors(['help'], ['', '-cc', custom_cc, '-os', target_os],

0 commit comments

Comments
 (0)