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@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@swift.org
> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

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

Reply via email to