When using the .enableUpcomingFeature("ExistentialAny") for building a package the generated Macro code does not compile.
@Codable
struct Test {
var test: String
}
Is expanded to:
extension Test: Decodable {
init(from decoder: Decoder) throws { //<- Error: Use of protocol 'Decoder' as a type must be written 'any Decoder'
let container = try decoder.container(keyedBy: CodingKeys.self)
self.test = try container.decode(String.self, forKey: CodingKeys.test)
}
}
extension Test: Encodable {
func encode(to encoder: Encoder) throws { // <- Error: Use of protocol 'Decoder' as a type must be written 'any Decoder'
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self.test, forKey: CodingKeys.test)
}
}
extension Test {
enum CodingKeys: String, CodingKey {
case test = "test"
}
}
When using the
.enableUpcomingFeature("ExistentialAny")
for building a package the generated Macro code does not compile.Is expanded to: