Skip to content

Commit 7429222

Browse files
committed
[Sema] Remove an isInvalid check
This check was added in 38e305c, and was used to detect whether there may be something invalid about the members that were necessary for conformance derivation. However this is no longer the case, a nominal should only ever be marked invalid these days if it is either in an unsupported DeclContext, or it's a redeclaration. The synthesis logic ought to be resilient against invalid members. Additionally, this check wasn't even necessarily looking at the nominal, it could have been looking at an ExtensionDecl. In that case, we could have still attempted to synthesize with invalid members. As such, it seems unlikely this check is providing any real benefit, let's remove it.
1 parent 5e95ae6 commit 7429222

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4511,11 +4511,6 @@ deriveProtocolRequirement(const NormalProtocolConformance *Conformance,
45114511
if (!derivableKind)
45124512
return nullptr;
45134513

4514-
auto *DC = Conformance->getDeclContext();
4515-
const auto Decl = DC->getInnermostDeclarationDeclContext();
4516-
if (Decl->isInvalid())
4517-
return nullptr;
4518-
45194514
DerivedConformance derived(Conformance, TypeDecl, protocol);
45204515

45214516
switch (*derivableKind) {

0 commit comments

Comments
 (0)