[swift-corelibs-dev] Implicit conversions between types will be disabled in Foundation

Philippe Hausler phausler at apple.com
Tue Dec 8 14:59:02 CST 2015


After seeing numerous failures in type conversions that work in the Mac OS X Xcode project target but don’t work in the Linux target, we have come to the conclusion that implicit conversions are going to have to be disabled for now.

I have a change incoming that will require all conversions such as `let dict: NSDictionary = [“foo” : “bar”]` to use the bridge method to convert. This is just an interim solution until we can get better support on the linux side from the compiler to enable implicit conversion between object types and struct types (which is handled by the protocol _ObjectiveCBridgeable). The change adds a new protocol `_ObjectTypeBridgeable` that still has the functionality so that once the compiler can support this feature on linux targets we can re-enable implicit conversions.

I would strongly suggest that anyone currently developing build against this change to ensure that any implicit conversions are made explicitly.


More information about the swift-corelibs-dev mailing list