<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">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.</div><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">Perhaps for the time being we could alter the signatures to be:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(195, 34, 117);" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(195, 34, 117);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> decodeObjectOfClasses(classes: [</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">AnyClass</span><span style="font-variant-ligatures: no-common-ligatures;" class="">], forKey key: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">String</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) -> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(97, 34, 174);" class="">AnyObject</span><span style="font-variant-ligatures: no-common-ligatures;" class="">?</span></div></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #c32275" class="">public</span> <span style="font-variant-ligatures: no-common-ligatures; color: #c32275" class="">var</span> allowedClasses: [<span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">AnyClass</span>]?</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 25, 2015, at 2:01 AM, Luke Howard via swift-corelibs-dev <<a href="mailto:swift-corelibs-dev@swift.org" class="">swift-corelibs-dev@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">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).<br class=""><br class="">— Luke<br class="">_______________________________________________<br class="">swift-corelibs-dev mailing list<br class=""><a href="mailto:swift-corelibs-dev@swift.org" class="">swift-corelibs-dev@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-corelibs-dev<br class=""></div></div></blockquote></div><br class=""></body></html>