diff --git a/vlib/v/checker/fn.v b/vlib/v/checker/fn.v index c479bf0362..33a37bba63 100644 --- a/vlib/v/checker/fn.v +++ b/vlib/v/checker/fn.v @@ -1517,8 +1517,8 @@ fn (mut c Checker) method_call(mut node ast.CallExpr) ast.Type { && method_name in ['clone', 'keys', 'values', 'move', 'delete'] { if left_sym.kind == .map { return c.map_builtin_method_call(mut node, left_type, c.table.sym(left_type)) - } else { - parent_type := (left_sym.info as ast.Alias).parent_type + } else if left_sym.info is ast.Alias { + parent_type := left_sym.info.parent_type return c.map_builtin_method_call(mut node, parent_type, c.table.final_sym(left_type)) } } else if left_sym.kind == .array && method_name in ['insert', 'prepend'] {