There are already many ways to cause that to happen in Swift. Here's one I whipped up in a few minutes; just add a conformance of X
to P
. I don't know what you mean by “breaking”; this one causes a compilation error, but causing a semantic change is even easier.
protocol P {}
extension P {
func foo(_: Int?) { }
}
protocol Q {}
extension Q {
func foo(_: String?) { }
}
struct X : Q {}
// ============== Downstream ============
X().foo(nil)