[swift-corelibs-dev] #if __CORELIBS_FOUNDATION__

Tony Parker anthony.parker at apple.com
Mon Jan 4 15:09:02 CST 2016

Hi Drew,

This difference is a consequence of the lack of bridging between types like String and NSString.

If this API returned [String : AnyObject], then the dictionary could not contain String (because String is not an object).

This is something we will have to fix up in some comprehensive way in both Darwin and CoreLibs Foundation, but there is no answer yet.

In this particular case, how would you use the #if? Any should be source compatible with AnyObject, since Any is a superset of AnyObject, right?

- Tony

> On Jan 1, 2016, at 11:26 PM, Drew Crawford via swift-corelibs-dev <swift-corelibs-dev at swift.org> wrote:
> Hi folks,
> I notice that swift-corelibs-foundation is (apparently) deliberately incompatible with Darwin Foundation (https://github.com/apple/swift-corelibs-foundation/blame/master/Foundation/NSFileManager.swift#L324 <https://github.com/apple/swift-corelibs-foundation/blame/master/Foundation/NSFileManager.swift#L324>) at least for the immediate future.
> I'm wondering if we can get an #if that would let me write conditional code.
> Obviously the "real" answer is to fix the bugs, but (at least on my side) that will happen a lot faster if I "can" easily build the same codebase against corelibs-foundation and darwin-foundation.
> _______________________________________________
> swift-corelibs-dev mailing list
> swift-corelibs-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-corelibs-dev/attachments/20160104/8928ccbe/attachment.html>

More information about the swift-corelibs-dev mailing list