[swift-evolution] [Pitch] Moving where Clauses Out Of Parameter Lists
pyry.jahkola at iki.fi
Wed Apr 6 13:42:36 CDT 2016
> The same would work for generic types too:
> public struct Dictionary<Key, Value>
> where Key : Hashable
And I'm not sure if people feel the same as me, but I haven't been happy with the current way generic arguments (such as Key and Value above) magically appear in type extensions but are inaccessible from anywhere else and can't be made public (`public typealias Key = Key` is an error).
The above syntax would make it possible to use whatever identifiers locally so that it's clear what they are:
extension Dictionary<K, V>
// (unclear if `where K : Hashable` should be repeated here, though)
where T : Comparable
where T == String
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution