Sure. I just wonder if the same thing might not be accomplished by composing public protocols, but using one private or internal conformance. What I have in mind is,
// Module A
public protocol X { ... }
public protocol EasyXImpl {}
extension X where Self: EasyXImpl {
// implementations of X requirements in terms of EasyXImpl requirements
}
// Module B
import A
public struct Y: X private EasyXImpl {
// EasyXImpl requirements
}
That would have a few advantages:
- The protocol system would retain its simplicity
- A protocol would have a single, well-understood meaning that doesn't change across access levels
- We'd avoid adding another language feature, since I believe we need scoped conformances anyway.
- You'd still have the option to create
Xconformance withoutEasyXImpl. In fact there might be severalEasyXImplvariants for different means of achieving that conformance.