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

cgen: use typ() for array type

This commit is contained in:
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

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..]
}