Avatar
@Taketo Sano Parameterized Extension が使えるようになるまで↓でごまかすのはダメですか? extension Matrix { func foo<A: Ring>() -> Foo where B == DefaultMatrixImpl<A> { ... } } (edited)
9:27 AM
@swift-5.4.3 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() } }