mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Refactoring] Skip failed witness decls in "add codable implementation"
When there are problems in the properties in the target type, witness methods may not be synthesized. Don't try to add such methods. https://github.com/apple/swift/issues/72387
This commit is contained in:
@@ -133,7 +133,7 @@ class AddCodableContext {
|
||||
kind == KnownProtocolKind::Decodable) {
|
||||
for (auto requirement : protocol->getProtocolRequirements()) {
|
||||
auto witness = conformance->getWitnessDecl(requirement);
|
||||
if (witness->isSynthesized()) {
|
||||
if (witness && witness->isSynthesized()) {
|
||||
Printer.printNewline();
|
||||
witness->print(Printer, Options);
|
||||
Printer.printNewline();
|
||||
|
||||
Reference in New Issue
Block a user