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

master
yuyi 2022-06-01 21:56:12 +08:00 committed by GitHub
parent bf70f0b436
commit 33a2d00445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
}