mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Responses to feedback
* Use `isSpecificProtocol` instead of `==` * Synthesize Encodable implementation lazily * Don’t mark conformances as Used when they don’t need to be * Avoid creating explicit one-element arrays * Use lookupDirect instead of walking AST manually * Produce diagnostic for Decodable classes whose non-Decodable superclass has a failable init * Filter lazy vars manually since getStoredProperties() does not always do so * Amend Decodable class diagnostic text * Check for enum RawType errors only if the type was already validated * Update unit tests to match changes
This commit is contained in:
@@ -408,8 +408,9 @@ static bool canSynthesizeCodingKey(TypeChecker &tc, Decl *parentDecl,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!enumDecl->getInherited().empty() &&
|
||||
enumDecl->getInherited().front().isError())
|
||||
auto inherited = enumDecl->getInherited();
|
||||
if (!inherited.empty() && inherited.front().wasValidated() &&
|
||||
inherited.front().isError())
|
||||
return false;
|
||||
|
||||
// If it meets all of those requirements, we can synthesize CodingKey
|
||||
|
||||
Reference in New Issue
Block a user