Skip to content

Commit b44c948

Browse files
author
Amritpan Kaur
committed
[ConstraintSystem] Print new type var assigned to generic in overload.
If overload choice has generic param, print type var assigned to generic param.
1 parent 481a561 commit b44c948

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3521,10 +3521,28 @@ void ConstraintSystem::resolveOverload(ConstraintLocator *locator,
35213521
if (isDebugMode()) {
35223522
PrintOptions PO;
35233523
PO.PrintTypesForDebugging = true;
3524-
llvm::errs().indent(solverState ? solverState->getCurrentIndent() : 2)
3525-
<< "(overload set choice binding "
3526-
<< boundType->getString(PO) << " := "
3527-
<< adjustedRefType->getString(PO) << ")\n";
3524+
3525+
auto &log = llvm::errs();
3526+
log.indent(solverState ? solverState->getCurrentIndent() : 2);
3527+
log << "(overload set choice binding ";
3528+
boundType->print(log, PO);
3529+
log << " := ";
3530+
adjustedRefType->print(log, PO);
3531+
3532+
auto openedAtLoc = getOpenedTypes(locator);
3533+
if (!openedAtLoc.empty()) {
3534+
log << " [";
3535+
llvm::interleave(
3536+
openedAtLoc.begin(), openedAtLoc.end(),
3537+
[&](OpenedType opened) {
3538+
opened.second->getImpl().getGenericParameter()->print(log, PO);
3539+
log << " := ";
3540+
Type(opened.second).print(log, PO);
3541+
},
3542+
[&]() { log << ", "; });
3543+
log << "]";
3544+
}
3545+
log << ")\n";
35283546
}
35293547

35303548
if (auto *decl = choice.getDeclOrNull()) {

0 commit comments

Comments
 (0)