markused: fix CI (for failing compilation of vlib/v/tests/skip_unused/array_init_from_sumtype.vv) (#25274)

This commit is contained in:
Felipe Pena 2025-09-10 03:00:34 -03:00 committed by GitHub
parent bae7684276
commit 49e77546c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -42,6 +42,7 @@ mut:
// dependencies finding flags // dependencies finding flags
uses_atomic bool // has atomic uses_atomic bool // has atomic
uses_array bool // has array uses_array bool // has array
uses_array_sumtype bool // has array on sumtype init
uses_channel bool // has chan dep uses_channel bool // has chan dep
uses_lock bool // has mutex dep uses_lock bool // has mutex dep
uses_ct_fields bool // $for .fields uses_ct_fields bool // $for .fields
@ -1178,7 +1179,9 @@ pub fn (mut w Walker) mark_by_sym(isym ast.TypeSymbol) {
if typ.has_flag(.option) { if typ.has_flag(.option) {
w.used_option++ w.used_option++
} }
w.mark_by_type(typ) sym := w.table.sym(typ)
w.mark_by_sym(sym)
w.uses_array_sumtype = w.uses_array_sumtype || sym.kind == .array
} }
} }
ast.Map { ast.Map {
@ -1477,6 +1480,9 @@ fn (mut w Walker) mark_resource_dependencies() {
w.fn_by_name(int(ast.array_type.ref()).str() + '.set') w.fn_by_name(int(ast.array_type.ref()).str() + '.set')
w.fn_by_name('clone_static_to_depth') w.fn_by_name('clone_static_to_depth')
} }
if w.uses_array_sumtype {
w.fn_by_name('__new_array')
}
if w.uses_fixed_arr_int { if w.uses_fixed_arr_int {
w.fn_by_name('v_fixed_index') w.fn_by_name('v_fixed_index')
} }