[swift-evolution] [Accepted] SE-0131: Add AnyHashable to the standard library

Karl razielim at gmail.com
Tue Jul 26 18:37:22 CDT 2016


> On 26 Jul 2016, at 19:52, Chris Lattner via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Proposal Link: https://github.com/apple/swift-evolution/blob/master/proposals/0131-anyhashable.md
> 
> The review of "SE-0131: Add AnyHashable to the standard library" ran from Active review July 23…25. The proposal has been *accepted*.
> 
> The feedback on this proposal was quite positive.  A few questions were raised, but were answered on-thread.  Thank you to Dmitri Gribenko for writing this proposal and driving this discussion forward.
> 
> -Chris Lattner
> Review Manager
> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

I didn’t get an answer about making the wrapping implicit. Is something like that at all possible?

When I look at the changes required, this looks like a massive readability regression - especially given that AnyHashable is pretty much a hack around incomplete existential support anyway:

>    let _ = NSError(domain: "myDomain", code: 4, 
> -                  userInfo: ["a":1,"b":2,"c":3])
> +                  userInfo: [AnyHashable("a"):1,
> +                             AnyHashable("b"):2,
> +                             AnyHashable("c"):3])

The proposal itself claims that "AnyHashable itself is additive. Source-breaking changes are discussed in SE-0116.”, but that is not true. I don’t see any discussion of these source-breaking changes in SE-0116 - which in fact delegates discussion of the specific AnyHashable design back to this proposal.

Karl

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160727/fe8cb4de/attachment.html>


More information about the swift-evolution mailing list