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

vfmt: alias type and sum type + sum type fix

This commit is contained in:
Delyan Angelov
2020-03-07 18:37:55 +02:00
committed by GitHub
parent fbf80dc315
commit 5e541e1f11
12 changed files with 125 additions and 32 deletions

View File

@@ -7,7 +7,7 @@ import (
strings
)
pub type TypeInfo = Array | ArrayFixed | Map | Struct |
pub type TypeInfo = Array | ArrayFixed | Map | Struct |
MultiReturn | Alias | Enum | SumType
pub struct TypeSymbol {
@@ -344,8 +344,18 @@ pub fn (k Kind) str() string {
.multi_return{
'multi_return'
}
.sum_type{
'sum_type'
}
.alias{
'alias'
}
.enum_{
'enum'
}
else {
'unknown'}
'unknown'
}
}
return k_str
}
@@ -405,6 +415,7 @@ pub mut:
}
pub struct SumType {
pub:
variants []Type
}