mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
ast: fix vtl compile error of generic array type cname (#12555)
This commit is contained in:
parent
87f7a6d99f
commit
e42db5bee2
@ -812,8 +812,13 @@ pub fn (t &Table) array_cname(elem_type Type) string {
|
||||
if elem_type.is_ptr() {
|
||||
res = '_ptr'.repeat(elem_type.nr_muls())
|
||||
}
|
||||
if elem_type_sym.cname.contains('<') {
|
||||
type_name := elem_type_sym.cname.replace_each(['<', '_T_', ', ', '_', '>', ''])
|
||||
return 'Array_$type_name' + res
|
||||
} else {
|
||||
return 'Array_$elem_type_sym.cname' + res
|
||||
}
|
||||
}
|
||||
|
||||
// array_fixed_source_name generates the original name for the v source.
|
||||
// e. g. [16][8]int
|
||||
|
Loading…
Reference in New Issue
Block a user