extension Matrix { func foo<A: Ring>() -> Foo where B == DefaultMatrixImpl<A> { ... } }
(edited)protocol Ring {} protocol MatrixImpl { associatedtype BaseRing: Ring } struct SomeRing: Ring {} struct Matrix<B: MatrixImpl> {} struct DefaultMatrixImpl<A: Ring>: MatrixImpl { typealias BaseRing = A } struct Foo {} extension Matrix { func foo<A: Ring>() -> Foo where B == DefaultMatrixImpl<A> { Foo() } }