Hi,
it's the first time I come with an error I have not the slightest idea on how to fix.
I just started implementing an Apache Avro Encoder and Decoder in Swift and I'm stuck in the first 5 minutes.
private struct AvroKeyedEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol {
typealias Key = K
var codingPath: [any CodingKey]
mutating func encodeNil(forKey key: K) throws {
fatalError("Not implemented")
}
mutating func nestedContainer<NestedKey>(keyedBy keyType: NestedKey.Type, forKey key: K) -> KeyedEncodingContainer<NestedKey> where NestedKey : CodingKey {
fatalError("Not implemented")
}
mutating func nestedUnkeyedContainer(forKey key: K) -> any UnkeyedEncodingContainer {
fatalError("Not implemented")
}
mutating func superEncoder(forKey key: K) -> any Encoder {
fatalError("Not implemented")
}
mutating func superEncoder() -> any Encoder {
fatalError("Not implemented")
}
}
I immediatley get the error Type 'AvroKeyedEncodingContainer<K>' does not conform to protocol 'KeyedEncodingContainerProtocol
and get infos from Xcode that Candidate has non-matching type '<Self> (Int128, forKey: Self.Key) throws -> ()' (Swift.KeyedEncodingContainerProtocol)
and Candidate has non-matching type '<Self> (UInt128, forKey: Self.Key) throws -> ()' (Swift.KeyedEncodingContainerProtocol)
.
I tried constraining my struct to macOS 15+ but this didn't change anything.
I checked the proposal as well as the protocol implementations and it looks exactly like the other implications for Int** so I have no idea what to do there.
Thanks for your help!