mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: variadic for in loop
This commit is contained in:
@@ -414,7 +414,11 @@ pub fn (t mut Table) add_placeholder_type(name string) int {
|
||||
[inline]
|
||||
pub fn (t &Table) value_type(typ Type) Type {
|
||||
typ_sym := t.get_type_symbol(typ)
|
||||
if typ_sym.kind == .array {
|
||||
if type_is_variadic(typ) {
|
||||
// ...string => string
|
||||
return type_clear_extra(typ)
|
||||
}
|
||||
else if typ_sym.kind == .array {
|
||||
// Check index type
|
||||
info := typ_sym.info as Array
|
||||
return info.elem_type
|
||||
@@ -435,10 +439,6 @@ pub fn (t &Table) value_type(typ Type) Type {
|
||||
// bytes[0] is a byte, not byte*
|
||||
return type_deref(typ)
|
||||
}
|
||||
else if type_is_variadic(typ) {
|
||||
// ...string => string
|
||||
return type_clear_extra(typ)
|
||||
}
|
||||
else {
|
||||
// TODO: remove when map_string is removed
|
||||
if typ_sym.name == 'map_string' {
|
||||
|
||||
Reference in New Issue
Block a user