Avatar
↓ Swifty じゃなくないですか?引数の型は Encoder でなく T: Encoder であるべきでは? public protocol Encodable { /// Encodes `self` into the given encoder. /// /// If `self` fails to encode anything, `encoder` will encode an empty keyed container in its place. /// /// - parameter encoder: The encoder to write data to. /// - throws: An error if any values are invalid for `encoder`'s format. func encode(to encoder: Encoder) throws }
3:08 AM
↓じゃダメ? public protocol Encodable { func encode<T: Encoder>(to encoder: T) throws }