Merge pull request #11045 from itaiferber/codable-class-fixes

Codable Class Fixes
This commit is contained in:
Itai Ferber
2017-07-24 15:42:45 -07:00
committed by GitHub
10 changed files with 559 additions and 130 deletions

View File

@@ -343,8 +343,9 @@ static bool canSynthesizeRawRepresentable(TypeChecker &tc, Decl *parentDecl,
auto parentDC = cast<DeclContext>(parentDecl);
rawType = parentDC->mapTypeIntoContext(rawType);
if (!enumDecl->getInherited().empty() &&
enumDecl->getInherited().front().isError())
auto inherited = enumDecl->getInherited();
if (!inherited.empty() && inherited.front().wasValidated() &&
inherited.front().isError())
return false;
// The raw type must be Equatable, so that we have a suitable ~= for