Hi,
I'm trying to declare a type alias in Dictionary
I declared a struct
struct FullDictionary<Key, Value> where Key : Hashable & CaseIterable
and I'd like to access it from Dictionary
so I did the following
extension Dictionary where Key : CaseIterable {
typealias Full = FullDictionary<Key, Value>
}
struct Test {
var x: Dictionary<MyEnum, String>.Full
var y: [MyEnum: String].Full
}
x compiles but y doesn't
After some investigations, I found out that it's a limitation of Swift Grammar
Yes I agree, Iβve always found this limitation weird. Same thing with Array.
Made extra counter-intuitive by the fact that we have a linting community (SwiftLint) enforcing use if sugar syntax [Element] instead of Array<Element>.
Hi Sajjon,
I'm new to this forum so I don't know what I should do now
Is there some kind of process I need to go through to submit this to Swift Evolution?
Yes, it seems to be known with multiple duplicates. However, all of them seem "stuck", is there a mechanism to "upvote" certain bugs? What can I do to help get it fixed?