Avatar
Avatar
koher
Nothing in this proposal precludes introducing generic protocols in the future under a different syntax
このプロポーザルの提案が将来的に異なる構文でジェネリックプロトコルを導入することを不可能にするわけではない くらいの感じ?で、例として↓のような構文が挙げられていると。 protocol Convertible(from: Self, to: Other) { static func convert(_: Self) -> Other } extension Convertible(from: String, to: Int) { static func convert(_: String) -> Int } extension Convertible(from: String, to: Double) { static func convert(_: String) -> Int }
omochimetaru 3/13/2022 3:59 AM
あー、その構文がよくわからなかったんですが、プロトコル名の後ろに丸括弧でパラメータを与えているんですね