Avatar
protocol Foo { associatedtype Bar func foo<T: HasB>(t: T) where T.B == Bar } protocol HasB { associatedtype B } struct C<E>: Foo { typealias Bar = [E] } この状態でCにfooを補完させると func foo<T>(t: T) where T : HasB, [E] == T.B { } というコンパイルの通らないコードが補完される