Skip to content

Commit 5c5598e

Browse files
authored
Merge pull request #65004 from xedin/log-failure-to-establish-binding
[CSBindings] NFC: Log binding attempt failures
2 parents 14a6b40 + 8f2a9a7 commit 5c5598e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/Sema/CSBindings.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2302,8 +2302,17 @@ bool TypeVariableBinding::attempt(ConstraintSystem &cs) const {
23022302
auto result =
23032303
cs.matchTypes(TypeVar, type, ConstraintKind::Bind, options, srcLocator);
23042304

2305-
if (result.isFailure())
2305+
if (result.isFailure()) {
2306+
if (cs.isDebugMode()) {
2307+
PrintOptions PO;
2308+
PO.PrintTypesForDebugging = true;
2309+
2310+
llvm::errs().indent(cs.solverState->getCurrentIndent())
2311+
<< "(failed to establish binding " << TypeVar->getString(PO)
2312+
<< " := " << type->getString(PO) << ")\n";
2313+
}
23062314
return false;
2315+
}
23072316

23082317
auto reportHole = [&]() {
23092318
if (cs.isForCodeCompletion()) {

0 commit comments

Comments
 (0)