checker: remove already handled "undefined" errors
ci/woodpecker/push/vc Pipeline was successful Details
ci/woodpecker/push/docker Pipeline was successful Details
ci/woodpecker/push/arch Pipeline was successful Details

Alexander Medvednikov 2022-04-25 16:53:29 +03:00 committed by Jef Roosens
parent 1cc8072efa
commit b81f06e369
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
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