From 299887e3f23aa21cccf9db95f51bb63f6e7d113d Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 31 May 2026 13:44:03 +0300 Subject: [PATCH] v2: vfmt --- vlib/v/tests/aliases/chained_alias_test.v | 2 +- vlib/v2/transformer/struct.v | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/vlib/v/tests/aliases/chained_alias_test.v b/vlib/v/tests/aliases/chained_alias_test.v index 9830c84e3..ebcff275c 100644 --- a/vlib/v/tests/aliases/chained_alias_test.v +++ b/vlib/v/tests/aliases/chained_alias_test.v @@ -46,7 +46,7 @@ type ItemPair = [2]Item type ItemPairAlias = ItemPair fn test_chain_through_fixed_array_of_non_builtin() { - a := ItemPair([Item{v: 1}, Item{v: 2}]!) + a := ItemPair([Item{ v: 1 }, Item{ v: 2 }]!) b := ItemPairAlias(a) assert b[0].v == 1 assert b[1].v == 2 diff --git a/vlib/v2/transformer/struct.v b/vlib/v2/transformer/struct.v index ee6ea196b..09a30bdf3 100644 --- a/vlib/v2/transformer/struct.v +++ b/vlib/v2/transformer/struct.v @@ -266,8 +266,7 @@ fn (mut t Transformer) apply_smartcast_field_access_ctx(sumtype_expr ast.Expr, f // For native backends (arm64/x64): _data is a plain i64 (void pointer) in the SSA struct. // No union variant sub-field exists, so just use _data directly. // For C backends: _data is a union, so access _data._variant for the specific member. - is_native_backend := t.pref != unsafe { nil } - && t.is_native_be + is_native_backend := t.pref != unsafe { nil } && t.is_native_be data_access := t.synth_selector(transformed_base, '_data', types.Type(types.voidptr_)) variant_access := if is_native_backend { data_access @@ -292,8 +291,7 @@ fn (mut t Transformer) transform_array_init_expr(expr ast.ArrayInitExpr) ast.Exp if !expr_array_has_valid_data(expr.exprs) { return ast.Expr(expr) } - is_native_backend := t.pref != unsafe { nil } - && t.is_native_be + is_native_backend := t.pref != unsafe { nil } && t.is_native_be native_interface_elem_type := if is_native_backend { t.get_interface_array_init_concrete_type(&expr) or { '' } } else { -- 2.39.5