Thanks for the feedback, everyone!
I'd like to reiterate that we fully agree that this is not the ideal solution for the SwiftUI example. This motivates the purposefully minimal approach being proposed here, in order to maximize our flexibility to pursue better solutions in the future.
In that spirit, I'd recommend separating concerns with the specific changes being proposed to the language (which would likely be permanent), apart from the wisdom of leveraging those changes to improve a framework like SwiftUI (which can be changed in the future, if necessary). We're interested in hearing both, but separating those will help with evaluating the feedback. Many responses have already done this — thank you!
Yes, this is a known caveat, and we agree that this should be explicitly called out in the proposal. We'll amend the text of the proposal to include that, thank you for drawing attention to it.
This is likely the approach that a framework like SwiftUI would take, to minimize the proliferation of these symbols.
We fully agree this is not ideal, but it's worth nothing that this is significantly more approachable than a StaticMember-like solution, both for API authors and for clients. API authors always have a greater burden to understand how to design a good API, but StaticMember was rejected specifically because of the confusion it caused for clients, making it a bad API.
Clients would have a significantly better experience with the proposed approach over both the status quo and a StaticMember-like solution.
I don't think the discoverability benefit should be minimized; I'd say the main benefit instead is discoverability with a side of reduced repetition.
The primary goal here is not to improve aesthetics (that's a bonus), but to solve a real issue impeding developers from fully utilizing our APIs. We've received a significant amount of real-world feedback over several years citing the subpar developer experience that comes from the lack of discoverability for these types. Further, these practical issues end up influencing API design, as authors try to avoid generic, protocol-oriented solutions to circumvent these issues, which we think is worse than the tradeoffs proposed here.
This is an interesting idea, which could be implemented additively on top of what is proposed here.
Our current feeling is that the most intuitive long-term solution would be to allow extensions on the protocol's metatype and include those in the lookup. What do you think?
If that is the right future direction, our concern with your suggestion is that it would be adding additional magic to the compiler that would ultimately become obsolete, and is a little less straightforward to an API author or client developer in terms of how it works. With the proposed solution, the location of the static member declaration has less-than-ideal implications, but it has the benefit of being where most developers intuitively expect these declarations to live.