[ConstraintSystem] Print new type var assigned to generic in overload.

If overload choice has generic param, print type var assigned to generic param.
This commit is contained in:
Amritpan Kaur
2022-08-04 10:36:32 -07:00
parent 481a561df0
commit b44c948bcc

View File

@@ -3521,10 +3521,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()) {