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

checker: add int signedness mismatch checking for function call arguments (#16750)

This commit is contained in:
Felipe Pena
2022-12-24 01:28:35 -03:00
committed by GitHub
parent 0128d2dd1c
commit 6a179a2926
6 changed files with 67 additions and 9 deletions

View File

@@ -267,10 +267,10 @@ fn test_write_raw_at() {
fn test_write_raw_at_negative_pos() {
mut f := os.open_file(tfile, 'w')!
if _ := f.write_raw_at(another_point, -1) {
if _ := f.write_raw_at(another_point, u64(-1)) {
assert false
}
f.write_raw_at(another_point, -234) or { assert err.msg() == 'Invalid argument' }
f.write_raw_at(another_point, u64(-1)) or { assert err.msg() == 'Invalid argument' }
f.close()
}
@@ -322,10 +322,10 @@ fn test_read_raw_at() {
fn test_read_raw_at_negative_pos() {
mut f := os.open_file(tfile, 'r')!
if _ := f.read_raw_at[Point](-1) {
if _ := f.read_raw_at[Point](u64(-1)) {
assert false
}
f.read_raw_at[Point](-234) or { assert err.msg() == 'Invalid argument' }
f.read_raw_at[Point](u64(-1)) or { assert err.msg() == 'Invalid argument' }
f.close()
}