[SR-1842] Introduce syntax for explicitly invoking extension methods. #44451
Labels
compiler
The Swift compiler in itself
feature
A feature request or implementation
swift evolution proposal needed
Flag → feature: A feature that warrants a Swift evolution proposal
Additional Detail from JIRA
md5: f177e287c5a900503259242832a8c778
relates to:
Issue Description:
There are two motivations for this:
1. Avoid future method name conflicts across modules. A helper extension within a user module might morph into a default implementation when the module defining the protocol is modified.
2. Introduce a declaration in the protocol implementation calls down to the original extension.
The first use case was a request from someone migrating to Swift. They were concerned about this case, and I didn't have a great answer:
Now, what if the 3rd party later does this:
That changes the behavior of the client code, and there's no way to prevent it.
<rdar://problem/26901464> Introduce syntax for explicitly invoking extension methods.
The second case relates to default protocol methods that we want to explicitly specialize. We need to provide a declaration of the protocol method inside of the concrete implementation. The problem is that there's no way for that implementation to override method and call the original implementation:
<rdar://problem/25495822> @_specialize that dispatches on associated types
The text was updated successfully, but these errors were encountered: