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

checker: remove already handled "undefined" errors

This commit is contained in:
Alexander Medvednikov 2022-04-25 16:53:29 +03:00
parent d799abd139
commit 501b293e84
2 changed files with 6 additions and 2 deletions

View File

@ -204,7 +204,9 @@ pub fn (mut c Checker) check_expected_call_arg(got ast.Type, expected_ ast.Type,
}
return
}
return error('cannot use `$got_typ_str` as `$expected_typ_str`')
if got != ast.void_type {
return error('cannot use `$got_typ_str` as `$expected_typ_str`')
}
}
// helper method to check if the type is of the same module.

View File

@ -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.using_new_err_struct = using_new_err_struct_save
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
}
node.expr_type = typ