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

checker: add error for fn f() Struct { return &Struct{} } (#6019)

This commit is contained in:
Delyan Angelov
2020-07-29 22:40:43 +03:00
committed by GitHub
parent 81f8e910e6
commit 9c9533dad9
12 changed files with 44 additions and 18 deletions

View File

@ -6,7 +6,7 @@ module math
// with the sign bit of f and the result in the same bit position.
// f32_bits(f32_from_bits(x)) == x.
pub fn f32_bits(f f32) u32 {
p := &u32(&f)
p := *(&u32(&f))
return p
}
@ -15,7 +15,7 @@ pub fn f32_bits(f f32) u32 {
// and the result in the same bit position.
// f32_from_bits(f32_bits(x)) == x.
pub fn f32_from_bits(b u32) f32 {
p := &f32(&b)
p := *(&f32(&b))
return p
}
@ -23,7 +23,7 @@ pub fn f32_from_bits(b u32) f32 {
// with the sign bit of f and the result in the same bit position,
// and f64_bits(f64_from_bits(x)) == x.
pub fn f64_bits(f f64) u64 {
p := &u64(&f)
p := *(&u64(&f))
return p
}
@ -32,7 +32,7 @@ pub fn f64_bits(f f64) u64 {
// and the result in the same bit position.
// f64_from_bits(f64_bits(x)) == x.
pub fn f64_from_bits(b u64) f64 {
p := &f64(&b)
p := *(&f64(&b))
return p
}