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

checker: apply stricter type checks to function args and return types

This commit is contained in:
Uwe Krüger
2020-06-01 21:15:59 +02:00
committed by GitHub
parent a7c84834f4
commit 076089d3c5
26 changed files with 141 additions and 107 deletions

View File

@@ -240,7 +240,7 @@ fn cmp_f64s(a, b f64) int {
// Two integers are safe to multiply when their bit lengths
// sum up to less than 64 (conservative estimate).
fn safe_to_multiply(a, b i64) bool {
return (bits.len_64(abs(a)) + bits.len_64(abs(b))) < 64
return (bits.len_64(u64(abs(a))) + bits.len_64(u64(abs(b)))) < 64
}
fn cmp(f1, f2 Fraction) int {