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:
parent
c3548c9413
commit
5cc9d7b347
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user