Skip to content

Commit 90e4cac

Browse files
authored
Add some simple PrettyStackTraces for conformance checking (#17912)
1 parent 85115dd commit 90e4cac

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "swift/AST/GenericSignature.h"
3636
#include "swift/AST/NameLookup.h"
3737
#include "swift/AST/ParameterList.h"
38+
#include "swift/AST/PrettyStackTrace.h"
3839
#include "swift/AST/ProtocolConformance.h"
3940
#include "swift/AST/ReferencedNameTracker.h"
4041
#include "swift/AST/TypeMatcher.h"
@@ -4103,6 +4104,10 @@ void TypeChecker::useBridgedNSErrorConformances(DeclContext *dc, Type type) {
41034104
}
41044105

41054106
void TypeChecker::checkConformance(NormalProtocolConformance *conformance) {
4107+
PrettyStackTraceType trace1(Context, "checking conformance of",
4108+
conformance->getType());
4109+
PrettyStackTraceDecl trace2("...to", conformance->getProtocol());
4110+
41064111
MultiConformanceChecker checker(*this);
41074112
checker.addConformance(conformance);
41084113
checker.checkAllConformances();
@@ -4114,6 +4119,10 @@ void TypeChecker::checkConformanceRequirements(
41144119
if (conformance->isInvalid())
41154120
return;
41164121

4122+
PrettyStackTraceType trace1(Context, "checking conformance requirements of",
4123+
conformance->getType());
4124+
PrettyStackTraceDecl trace2("...to", conformance->getProtocol());
4125+
41174126
conformance->setSignatureConformances({ });
41184127

41194128
llvm::SetVector<ValueDecl *> globalMissingWitnesses;

0 commit comments

Comments
 (0)