cgen: fix fixed array of aliases struct (#14583)

yuyi 2022-06-01 21:56:12 +08:00 committed by Chewing_Bever
parent 8cd891c9b6
commit 9459fb549f
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
2 changed files with 12 additions and 1 deletions

View File

@ -5070,7 +5070,7 @@ fn (mut g Gen) sort_structs(typesa []&ast.TypeSymbol) []&ast.TypeSymbol {
mut field_deps := []string{}
match sym.info {
ast.ArrayFixed {
dep := g.table.sym(sym.info.elem_type).name
dep := g.table.final_sym(sym.info.elem_type).name
if dep in type_names {
field_deps << dep
}

View File

@ -0,0 +1,11 @@
type Sfxinfo_t = Sfxinfo_struct
struct Sfxinfo_struct {
name [9]i8
}
fn test_fixed_array_of_alias_struct() {
a := [5]Sfxinfo_t{}
println(a)
assert true
}