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

module caching: generate type aliases

This commit is contained in:
Alexander Medvednikov
2019-10-12 04:09:37 +03:00
parent 4cd9099f74
commit 4c91a5c94b
4 changed files with 12 additions and 2 deletions

View File

@@ -172,6 +172,10 @@ fn (v &V) generate_vh() {
if typ.name.contains('__') {
name = typ.name.all_after('__')
}
// type alias
if typ.parent != '' && typ.cat == .alias {
file.writeln('type $typ.name $typ.parent')
}
if typ.cat in [TypeCategory.struct_, .c_struct] {
c := if typ.is_c { 'C.' } else { '' }
file.writeln('struct ${c}$name {')