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

cgen: generate typeof for functions

This commit is contained in:
Enzo Baldisserri
2020-04-16 21:04:27 +02:00
committed by GitHub
parent dee64347e0
commit 051cc732bb
5 changed files with 36 additions and 6 deletions

View File

@@ -204,6 +204,13 @@ pub fn (t &Table) get_type_symbol(typ Type) &TypeSymbol {
panic('get_type_symbol: invalid type (typ=$typ idx=${idx}). This should never happen')
}
[inline]
pub fn (t &Table) get_type_name(typ Type) string {
typ_sym := t.get_type_symbol(typ)
return typ_sym.name
}
// this will override or register builtin type
// allows prexisitng types added in register_builtins
// to be overriden with their real type info