mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #60443 from amritpan/improve-solver-step-printing
[ConstraintSystem] Improve solver step printing in the type inference algorithm debug output
This commit is contained in:
@@ -3547,10 +3547,28 @@ void ConstraintSystem::resolveOverload(ConstraintLocator *locator,
|
||||
if (isDebugMode()) {
|
||||
PrintOptions PO;
|
||||
PO.PrintTypesForDebugging = true;
|
||||
llvm::errs().indent(solverState ? solverState->getCurrentIndent() : 2)
|
||||
<< "(overload set choice binding "
|
||||
<< boundType->getString(PO) << " := "
|
||||
<< adjustedRefType->getString(PO) << ")\n";
|
||||
|
||||
auto &log = llvm::errs();
|
||||
log.indent(solverState ? solverState->getCurrentIndent() : 2);
|
||||
log << "(overload set choice binding ";
|
||||
boundType->print(log, PO);
|
||||
log << " := ";
|
||||
adjustedRefType->print(log, PO);
|
||||
|
||||
auto openedAtLoc = getOpenedTypes(locator);
|
||||
if (!openedAtLoc.empty()) {
|
||||
log << " [";
|
||||
llvm::interleave(
|
||||
openedAtLoc.begin(), openedAtLoc.end(),
|
||||
[&](OpenedType opened) {
|
||||
opened.second->getImpl().getGenericParameter()->print(log, PO);
|
||||
log << " := ";
|
||||
Type(opened.second).print(log, PO);
|
||||
},
|
||||
[&]() { log << ", "; });
|
||||
log << "]";
|
||||
}
|
||||
log << ")\n";
|
||||
}
|
||||
|
||||
if (auto *decl = choice.getDeclOrNull()) {
|
||||
|
||||
Reference in New Issue
Block a user