Skip to content

Commit 49a74dd

Browse files
authored
Merge pull request #72915 from tshortli/lazy-conformance-silgen-take-2-6.0
[6.0] SILGen: Ignore placeholders and missing methods during conformance emission
2 parents c329718 + e110221 commit 49a74dd

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

lib/SILGen/SILGenType.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -554,11 +554,7 @@ class SILGenConformance : public SILGenWitnessTable<SILGenConformance> {
554554
PrettyStackTraceConformance trace("generating SIL witness table",
555555
Conformance);
556556

557-
// Check whether the conformance is valid first.
558557
Conformance->resolveValueWitnesses();
559-
if (Conformance->isInvalid())
560-
return nullptr;
561-
562558
auto *proto = Conformance->getProtocol();
563559
visitProtocolDecl(proto);
564560

@@ -619,13 +615,12 @@ class SILGenConformance : public SILGenWitnessTable<SILGenConformance> {
619615
return Conformance->getWitness(decl);
620616
}
621617

622-
void addPlaceholder(MissingMemberDecl *placeholder) {
623-
llvm_unreachable("generating a witness table with placeholders in it");
624-
}
625-
626-
void addMissingMethod(SILDeclRef requirement) {
627-
llvm_unreachable("generating a witness table with placeholders in it");
628-
}
618+
// Treat placeholders and missing methods as no-ops. These may be encountered
619+
// during lazy typechecking when SILGen triggers witness resolution and
620+
// discovers and invalid conformance. The diagnostics emitted during witness
621+
// resolution should cause compilation to fail.
622+
void addPlaceholder(MissingMemberDecl *placeholder) {}
623+
void addMissingMethod(SILDeclRef requirement) {}
629624

630625
void addMethodImplementation(SILDeclRef requirementRef,
631626
SILDeclRef witnessRef,

0 commit comments

Comments
 (0)