Yeah, it's in frequently rejected proposals.
I guess like so:
do {
try load()
} catch let error as NetworkError {
...
} catch let error as OtherError {
...
}
Union types could be implemented as if they were written:
enum AnonymousUnionType_123 {
case case1(NetworkError)
case case2(DecodingError)
}
automatically wrapped / unwrapped by the compiler, so you won't see or use them as enum.