cgen: use typ() for array type

pull/5050/head
Emily Hudson 2020-05-26 13:11:59 +01:00 committed by GitHub
parent 145b125155
commit 748b1d3381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -3216,8 +3216,8 @@ fn c_name(name_ string) string {
fn (g Gen) type_default(typ table.Type) string {
sym := g.table.get_type_symbol(typ)
if sym.kind == .array {
elem_sym := g.table.get_type_symbol(sym.array_info().elem_type)
mut elem_type_str := elem_sym.name.replace('.', '__')
elem_sym := g.typ(sym.array_info().elem_type)
mut elem_type_str := elem_sym.replace('.', '__')
if elem_type_str.starts_with('C__') {
elem_type_str = elem_type_str[3..]
}