mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Type level lookups can fail because the lookup is on an existential metatype, like `MyProtocol.staticMethod(_:)` is invalid; however the error message is unclear: “static member 'staticMethod(_:)' cannot be used on instance of type ‘MyProtocol.Protocol’”. This fix checks the base of member lookups that failed with the reason UR_TypeMemberOnInstance for being existential metatypes. It produces the clearer message “static member ‘staticMethod(_:)’ cannot be used on protocol metatype ‘MyProtocol.Protocol’”. This change makes it clear that the use of a static member on the *existential* metatype is the problem.
214 KiB
214 KiB