checker: remove already handled "undefined" errors
parent
1cc8072efa
commit
b81f06e369
|
@ -204,7 +204,9 @@ pub fn (mut c Checker) check_expected_call_arg(got ast.Type, expected_ ast.Type,
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if got != ast.void_type {
|
||||||
return error('cannot use `$got_typ_str` as `$expected_typ_str`')
|
return error('cannot use `$got_typ_str` as `$expected_typ_str`')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper method to check if the type is of the same module.
|
// helper method to check if the type is of the same module.
|
||||||
|
|
|
@ -1675,7 +1675,9 @@ pub fn (mut c Checker) selector_expr(mut node ast.SelectorExpr) ast.Type {
|
||||||
c.inside_selector_expr = old_selector_expr
|
c.inside_selector_expr = old_selector_expr
|
||||||
c.using_new_err_struct = using_new_err_struct_save
|
c.using_new_err_struct = using_new_err_struct_save
|
||||||
if typ == ast.void_type_idx {
|
if typ == ast.void_type_idx {
|
||||||
c.error('`void` type has no fields', node.pos)
|
// This means that the field has an undefined type.
|
||||||
|
// This error was handled before.
|
||||||
|
// c.error('`void` type has no fields', node.pos)
|
||||||
return ast.void_type
|
return ast.void_type
|
||||||
}
|
}
|
||||||
node.expr_type = typ
|
node.expr_type = typ
|
||||||
|
|
Loading…
Reference in New Issue