[swift-evolution] [Discussion] Can we make `.Type` Hashable?

L. Mihalkovic laurent.mihalkovic at gmail.com
Sat Jul 2 02:25:52 CDT 2016


This is IMHO a loophole in the type system today: '.Type' being a contextual keyword that is part of no protocol, there is no formal definition for what its return type and what can be done is purely driven by the compiler implementation. I used to have my oen bread of typeId until I ran into ObjectIdentifier. This part of te language could use some finishing touches.
Regards
(From mobile)

> On Jul 1, 2016, at 3:20 PM, Adrian Zubarev via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Additive question:
> 
> Can a type instance of a type SomeType.self SomeType.Type be Hashable?
> I really would want to use these in dictionaries or sets :)
> 
> [Any.Type: ValueType]
> 
> Set<Any.Type> // Union type universe
> 
> 
> -- 
> Adrian Zubarev
> Sent with Airmail
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160702/d3b0ba1a/attachment.html>


More information about the swift-evolution mailing list