mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: check the fn decl for anon fns too (#7529)
This commit is contained in:
@@ -18,12 +18,6 @@ mut:
|
||||
}
|
||||
|
||||
pub fn dial_udp(laddr string, raddr string) ?&UdpConn {
|
||||
// Dont have to do this when its fixed
|
||||
// this just allows us to store this `none` optional in a struct
|
||||
resolve_wrapper := fn (raddr string) ?Addr {
|
||||
x := resolve_addr(raddr, .inet, .udp) or { return none }
|
||||
return x
|
||||
}
|
||||
local := resolve_addr(laddr, .inet, .udp) ?
|
||||
sbase := new_udp_socket(local.port) ?
|
||||
sock := UdpSocket{
|
||||
@@ -38,6 +32,13 @@ pub fn dial_udp(laddr string, raddr string) ?&UdpConn {
|
||||
}
|
||||
}
|
||||
|
||||
fn resolve_wrapper(raddr string) ?Addr {
|
||||
// Dont have to do this when its fixed
|
||||
// this just allows us to store this `none` optional in a struct
|
||||
x := resolve_addr(raddr, .inet, .udp) or { return none }
|
||||
return x
|
||||
}
|
||||
|
||||
pub fn (mut c UdpConn) write_ptr(b byteptr, len int) ? {
|
||||
remote := c.sock.remote() or { return err_no_udp_remote }
|
||||
return c.write_to_ptr(remote, b, len)
|
||||
|
||||
Reference in New Issue
Block a user