From 04501847a8255570ea06ec003cab3dc86b7f60b8 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 31 May 2026 22:41:45 +0300 Subject: [PATCH] ci: fix Windows master failures --- vlib/v/gen/c/cgen.v | 7 ++++++- vlib/v/pref/default.v | 3 +++ .../tests/comptime/comptime_for_in_field_typeof_test.v | 5 ++--- vlib/v/tests/comptime/comptime_map_test.v | 10 ++++++++-- vlib/v/tests/generics/generic_resolve_test.v | 5 ++--- 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v index 81d1f1d13..20020128d 100644 --- a/vlib/v/gen/c/cgen.v +++ b/vlib/v/gen/c/cgen.v @@ -9748,10 +9748,15 @@ fn (mut g Gen) cast_expr(node ast.CastExpr) { */ } mut cast_label := '' + alias_parent_type := if sym.info is ast.Alias { + g.table.fully_unaliased_type(sym.info.parent_type) + } else { + ast.void_type + } // `ast.string_type` is done for MSVC's bug if sym.kind != .alias || (sym.info is ast.Alias && !sym.info.parent_type.has_flag(.option) - && sym.info.parent_type !in [expr_type, ast.string_type]) { + && alias_parent_type !in [expr_type, ast.string_type]) { if sym.kind == .string && !node_typ.is_ptr() { cast_label = '*(string*)&' } else if !((g.is_cc_msvc && (g.styp(node_typ) == g.styp(expr_type) diff --git a/vlib/v/pref/default.v b/vlib/v/pref/default.v index 06c0e7a49..871b1c3a1 100644 --- a/vlib/v/pref/default.v +++ b/vlib/v/pref/default.v @@ -589,6 +589,9 @@ fn resolve_vexe_path(vexe string) string { if os.is_abs_path(vexe) { return os.real_path(vexe) } + if vexe.contains('/') || vexe.contains('\\') { + return os.real_path(os.abs_path(vexe)) + } if found_vexe := os.find_abs_path_of_executable(vexe) { return os.real_path(found_vexe) } diff --git a/vlib/v/tests/comptime/comptime_for_in_field_typeof_test.v b/vlib/v/tests/comptime/comptime_for_in_field_typeof_test.v index 6eec1234c..e48b8925f 100644 --- a/vlib/v/tests/comptime/comptime_for_in_field_typeof_test.v +++ b/vlib/v/tests/comptime/comptime_for_in_field_typeof_test.v @@ -32,10 +32,9 @@ fn test_typeof_in_comptime_for_in_fields() { fn encode_struct[T](val T) []string { mut out := []string{} $for field in T.fields { - value := val.$(field.name) out << field.name - out << typeof(value).idx.str() - out << typeof(value).name + out << typeof(val.$(field.name)).idx.str() + out << typeof(val.$(field.name)).name } return out } diff --git a/vlib/v/tests/comptime/comptime_map_test.v b/vlib/v/tests/comptime/comptime_map_test.v index e39b6caf3..e8d317146 100644 --- a/vlib/v/tests/comptime/comptime_map_test.v +++ b/vlib/v/tests/comptime/comptime_map_test.v @@ -57,8 +57,14 @@ fn test_comptime_var_map_different_types() { mut vals := []string{} $for field in Data.fields { - $if field.typ is $map { - gg := data.$(field.name) + $if field.typ is map[string]StructType { + gg := data.$(field.name).clone() + for k, v in gg { + keys << k.str() + vals << v.str() + } + } $else $if field.typ is map[string]map[string]int { + gg := data.$(field.name).clone() for k, v in gg { keys << k.str() vals << v.str() diff --git a/vlib/v/tests/generics/generic_resolve_test.v b/vlib/v/tests/generics/generic_resolve_test.v index d4a03d926..6c8732df3 100644 --- a/vlib/v/tests/generics/generic_resolve_test.v +++ b/vlib/v/tests/generics/generic_resolve_test.v @@ -7,11 +7,10 @@ mut: fn (e &Encoder) encode_struct[U](val U) ! { $for field in U.fields { - value := val.$(field.name) $if field.typ is $struct { - e.encode_struct(value)! + e.encode_struct(val.$(field.name))! } $else $if field.typ is $map { - e.encode_map(value)! + e.encode_map(val.$(field.name))! } } } -- 2.39.5