+1

I continually find the use of `as` for bridging between Objective-C and Swift 
types to be confusing, since they do not have a true place in the Swift type 
hierarchy and are not simple casts. The `catch let error as NSError` construct 
always implies that NSError is a true type that can be thrown, and this 
confusion gets worse in the places where NSError “leaks” out of APIs and you 
can’t actually cleanly bridge from an ErrorProtocol anyway.

One comment though:

Why is the errorDescription of LocalizedError an optional? Why would a type 
conform to this protocol, and then choose not to provide its only extension to 
ErrorProtocol?


Scott
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to