1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vfmt: hot fix to allow separate array_d_gcboehm_opt.v (#10413)

This commit is contained in:
Uwe Krüger
2021-06-11 11:00:18 +02:00
committed by GitHub
parent f26626117d
commit daeeaef030
4 changed files with 275 additions and 271 deletions

View File

@ -875,9 +875,12 @@ pub fn (t &Table) type_to_str_using_aliases(typ Type, import_aliases map[string]
if typ.has_flag(.variadic) {
res = t.type_to_str_using_aliases(t.value_type(typ), import_aliases)
} else {
info := sym.info as Array
elem_str := t.type_to_str_using_aliases(info.elem_type, import_aliases)
res = '[]$elem_str'
if sym.info is Array {
elem_str := t.type_to_str_using_aliases(sym.info.elem_type, import_aliases)
res = '[]$elem_str'
} else {
res = 'array'
}
}
}
.array_fixed {

View File

@ -353,7 +353,7 @@ fn (mut p Parser) fn_decl() ast.FnDecl {
// we could also check if kind is .array, .array_fixed, .map instead of mod.len
mut is_non_local := type_sym.mod.len > 0 && type_sym.mod != p.mod && type_sym.language == .v
// check maps & arrays, must be defined in same module as the elem type
if !is_non_local && type_sym.kind in [.array, .map] {
if !is_non_local && !(p.builtin_mod && p.pref.is_fmt) && type_sym.kind in [.array, .map] {
elem_type_sym := p.table.get_type_symbol(p.table.value_type(rec.typ))
is_non_local = elem_type_sym.mod.len > 0 && elem_type_sym.mod != p.mod
&& elem_type_sym.language == .v