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

checker: remove too vague notice about signed expressions while returning unsigned number types

This commit is contained in:
Delyan Angelov 2022-09-25 11:02:46 +03:00
parent c3548c9413
commit 5cc9d7b347
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 0 additions and 11 deletions

View File

@ -122,11 +122,6 @@ pub fn (mut c Checker) return_stmt(mut node ast.Return) {
c.note('cannot use a negative value as value of type `${c.table.type_to_str(exp_type)}` in return argument',
pos)
}
} else {
if node.exprs[expr_idxs[i]] !is ast.Ident {
c.note('use signed type `${c.table.type_to_str(got_typ)}` as unsigned type `${c.table.type_to_str(exp_type)}` in return argument may cause unexpected',
pos)
}
}
}
} else {

View File

@ -1,9 +1,3 @@
vlib/v/checker/tests/fn_return_unsign_type_mismatch.vv:2:9: notice: use signed type `int literal` as unsigned type `u64` in return argument may cause unexpected
1 | fn foo() u64 {
2 | return -(3 - 1)
| ^
3 | }
4 |
vlib/v/checker/tests/fn_return_unsign_type_mismatch.vv:6:9: notice: cannot use a negative value as value of type `u64` in return argument
4 |
5 | fn bar() u64 {