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

cgen: avoid generating typedef generic array type (#12407)

This commit is contained in:
yuyi 2021-11-08 03:24:30 +08:00 committed by GitHub
parent c8ff9e39b5
commit 1211029926
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1105,7 +1105,7 @@ pub fn (mut g Gen) write_typedef_types() {
.array {
info := typ.info as ast.Array
elem_sym := g.table.get_type_symbol(info.elem_type)
if elem_sym.kind != .placeholder {
if elem_sym.kind != .placeholder && !info.elem_type.has_flag(.generic) {
g.type_definitions.writeln('typedef array $typ.cname;')
}
}