79133846

Date: 2024-10-28 14:37:30
Score: 1
Natty:
Report link

Does the class even conform to P if it’s not Codable? E.g. would something like this work?

final class A<T> {}

extension A: Codable, P where T: Codable {
    func load() {
        let decoded = try? JSONDecoder().decode(Self.self, from: Data())
    }
}

The downside is you can’t add another conditional conformance to P if T is not Codable…

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Majd Koshakji