From b89b039a4e352abd70b77f1f413ab11d73893951 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 11 Mar 2026 12:31:07 +0300 Subject: [PATCH] parser: error: ';' expected (got "main__V4") (fixes #26422) --- vlib/v/gen/c/cgen.v | 3 +++ .../fns/unused_fn_aliased_fixed_array_ret_test.v | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 vlib/v/tests/fns/unused_fn_aliased_fixed_array_ret_test.v diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v index ae4cf0b2c..426ea3a9a 100644 --- a/vlib/v/gen/c/cgen.v +++ b/vlib/v/gen/c/cgen.v @@ -2152,6 +2152,9 @@ pub fn (mut g Gen) write_array_fixed_return_types() { g.type_definitions.writeln('\n// BEGIN_array_fixed_return_structs') for sym in fixed_arr_rets { + if g.pref.skip_unused && sym.idx !in g.table.used_features.used_syms { + continue + } info := sym.info as ast.ArrayFixed if info.size <= 0 { // unresolved sizes e.g. [unknown_const]int diff --git a/vlib/v/tests/fns/unused_fn_aliased_fixed_array_ret_test.v b/vlib/v/tests/fns/unused_fn_aliased_fixed_array_ret_test.v new file mode 100644 index 000000000..ea48e4540 --- /dev/null +++ b/vlib/v/tests/fns/unused_fn_aliased_fixed_array_ret_test.v @@ -0,0 +1,12 @@ +type V4 = [4]f32 +type M4 = [4]V4 + +fn unused_make_matrix() M4 { + mut c := M4{} + c[0][0] = f32(1.234) + return c +} + +fn test_unused_fn_aliased_fixed_array_ret() { + assert true +} -- 2.39.5