On Apr 29, 2016, at 3:00 PM, Joe Groff via swift-evolution 
<swift-evolution@swift.org> wrote:
> I’d like to propose the following changes:
> 
> Dynamic casts as?, as! and is should no longer perform bridging conversions 
> between value types and Cocoa classes.
> Coercion syntax as should no longer be used to explicitly force certain 
> bridging conversions.
> To replace this functionality, we should add initializers to bridged value 
> types and classes that perform the value-preserving bridging operations.
+1.  I think that this will lead to a much cleaner and more predictable set of 
rules.  It will probably also define away a ton of bugs in the compiler and 
runtime.



> NSError bridging can also be extracted from the runtime, and the same 
> functionality exposed as a factory initializer on NSError:
> 

I think that this proposal is overall really great, but what does it do to the 
“catch let x as NSError” pattern?  What is the replacement?  If the result is 
ugly, we may have to subset out NSError out of this pass, and handle it 
specifically with improvements to the error bridging story.
 
-Chris

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to