Swift 5 migration: Fix switch warnings
We now get a warning when switching over enums from system frameworks even when we handle all public cases because there can be future cases that aren't handled. When such a future case is introduced, we'll get a warning.
This commit is contained in:
parent
40fc23432b
commit
283462dc9b
|
@ -36,6 +36,8 @@ extension Endpoint {
|
||||||
return "\(address):\(port)"
|
return "\(address):\(port)"
|
||||||
case .ipv6(let address):
|
case .ipv6(let address):
|
||||||
return "[\(address)]:\(port)"
|
return "[\(address)]:\(port)"
|
||||||
|
@unknown default:
|
||||||
|
fatalError()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,6 +80,8 @@ extension Endpoint {
|
||||||
return true
|
return true
|
||||||
case .ipv6:
|
case .ipv6:
|
||||||
return true
|
return true
|
||||||
|
@unknown default:
|
||||||
|
fatalError()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,6 +93,8 @@ extension Endpoint {
|
||||||
return nil
|
return nil
|
||||||
case .ipv6:
|
case .ipv6:
|
||||||
return nil
|
return nil
|
||||||
|
@unknown default:
|
||||||
|
fatalError()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,8 @@ import NetworkExtension
|
||||||
self = .reasserting
|
self = .reasserting
|
||||||
case .invalid:
|
case .invalid:
|
||||||
self = .inactive
|
self = .inactive
|
||||||
|
@unknown default:
|
||||||
|
fatalError()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,6 +56,8 @@ extension NEVPNStatus: CustomDebugStringConvertible {
|
||||||
case .disconnecting: return "disconnecting"
|
case .disconnecting: return "disconnecting"
|
||||||
case .reasserting: return "reasserting"
|
case .reasserting: return "reasserting"
|
||||||
case .invalid: return "invalid"
|
case .invalid: return "invalid"
|
||||||
|
@unknown default:
|
||||||
|
fatalError()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,6 +117,8 @@ extension Endpoint {
|
||||||
hostname = "\(address)"
|
hostname = "\(address)"
|
||||||
case .ipv6(let address):
|
case .ipv6(let address):
|
||||||
hostname = "\(address)"
|
hostname = "\(address)"
|
||||||
|
@unknown default:
|
||||||
|
fatalError()
|
||||||
}
|
}
|
||||||
|
|
||||||
var resultPointer = UnsafeMutablePointer<addrinfo>(OpaquePointer(bitPattern: 0))
|
var resultPointer = UnsafeMutablePointer<addrinfo>(OpaquePointer(bitPattern: 0))
|
||||||
|
|
Loading…
Reference in New Issue