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…