diff --git a/vlib/v/checker/return.v b/vlib/v/checker/return.v index 16c0d8999e..7736c2d2d0 100644 --- a/vlib/v/checker/return.v +++ b/vlib/v/checker/return.v @@ -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 { diff --git a/vlib/v/checker/tests/fn_return_unsign_type_mismatch.out b/vlib/v/checker/tests/fn_return_unsign_type_mismatch.out index dd2014753c..a44dd3d55f 100644 --- a/vlib/v/checker/tests/fn_return_unsign_type_mismatch.out +++ b/vlib/v/checker/tests/fn_return_unsign_type_mismatch.out @@ -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 {