Skip to content

Add some simple PrettyStackTraces for conformance checking #17912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/Sema/TypeCheckProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "swift/AST/GenericSignature.h"
#include "swift/AST/NameLookup.h"
#include "swift/AST/ParameterList.h"
#include "swift/AST/PrettyStackTrace.h"
#include "swift/AST/ProtocolConformance.h"
#include "swift/AST/ReferencedNameTracker.h"
#include "swift/AST/TypeMatcher.h"
Expand Down Expand Up @@ -4103,6 +4104,10 @@ void TypeChecker::useBridgedNSErrorConformances(DeclContext *dc, Type type) {
}

void TypeChecker::checkConformance(NormalProtocolConformance *conformance) {
PrettyStackTraceType trace1(Context, "checking conformance of",
conformance->getType());
PrettyStackTraceDecl trace2("...to", conformance->getProtocol());

MultiConformanceChecker checker(*this);
checker.addConformance(conformance);
checker.checkAllConformances();
Expand All @@ -4114,6 +4119,10 @@ void TypeChecker::checkConformanceRequirements(
if (conformance->isInvalid())
return;

PrettyStackTraceType trace1(Context, "checking conformance requirements of",
conformance->getType());
PrettyStackTraceDecl trace2("...to", conformance->getProtocol());

conformance->setSignatureConformances({ });

llvm::SetVector<ValueDecl *> globalMissingWitnesses;
Expand Down