mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v.parser: support imported enums as map keys (#10234)
This commit is contained in:
@@ -92,8 +92,8 @@ pub fn (mut p Parser) parse_map_type() ast.Type {
|
||||
return 0
|
||||
}
|
||||
key_type_supported := key_type in [ast.string_type_idx, ast.voidptr_type_idx]
|
||||
|| key_sym.kind == .enum_ || ((key_type.is_int() || key_type.is_float()
|
||||
|| is_alias) && !key_type.is_ptr())
|
||||
|| key_sym.kind == .enum_ || key_sym.kind == .placeholder
|
||||
|| ((key_type.is_int() || key_type.is_float() || is_alias) && !key_type.is_ptr())
|
||||
if !key_type_supported {
|
||||
if is_alias {
|
||||
p.error('cannot use the alias type as the parent type is unsupported')
|
||||
|
||||
Reference in New Issue
Block a user