This kind of shadowing comes to mind:
/// module X
protocol P { }
extension P { typealias B = String }
/// module Y
protocol Q { }
extension Q { typealias B = Int }
/// module Z
func f<T: P & Q>(_: T) {
var x: T.B // type is ???
}
That said, this issue can happen with everything in a single module too, so using module for disambiguation won’t necessarily work. With some experiment (keeping everything in the same module) it looks like the compiler resolves this by picking the first protocol with a B
type in it, in alphabetical order of the protocol name.