Likely we will have to change that signature to instead of being NSSet and Set<NSObject> respectively to be more compatible; however this will be an API change. It might be good to mock up a swift translation layer for these APIs to simulate what it would be like on Darwin if we altered these to be renamed in swift and presented with a better interface via the SDK overlays. Note: this will have to go through our evolution proposal system and be weighed in by the component owners of NSKeyedArchiver and the API teams associated with that to make such a change.
In my opinion since AnyClass should be unique it by nature should be Hashable - however I am not certain we can actually do that without language changes. Perhaps for the time being we could alter the signatures to be: public func decodeObjectOfClasses(classes: [AnyClass], forKey key: String) -> AnyObject? public var allowedClasses: [AnyClass]? > On Dec 25, 2015, at 2:01 AM, Luke Howard via swift-corelibs-dev > <[email protected]> wrote: > > Looking at decodeObjectOfClasses/allowedClasses – what is the element type in > the set of allowed classes? It seems like it should be AnyClass but that > can’t be added to a Set because it doesn’t implement Hashable (nor to an > NSSet because the initialiser unconditionally casts to NSObject). > > — Luke > _______________________________________________ > swift-corelibs-dev mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-corelibs-dev
_______________________________________________ swift-corelibs-dev mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-corelibs-dev
