Skip to content

Commit 590e5ef

Browse files
author
Amritpan Kaur
committed
[CSStep] Add disjunction and conjunction printing to initial state displayed during component step.
1 parent cc75752 commit 590e5ef

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

lib/Sema/CSStep.cpp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,30 @@ StepResult ComponentStep::take(bool prevFailed) {
342342

343343
/// Try to figure out what this step is going to be,
344344
/// after the scope has been established.
345-
auto *disjunction = CS.selectDisjunction();
346345
auto bestBindings = CS.determineBestBindings();
346+
auto *disjunction = CS.selectDisjunction();
347+
auto *conjunction = CS.selectConjunction();
348+
349+
if (CS.isDebugMode() && !IsSingle) {
350+
PrintOptions PO;
351+
PO.PrintTypesForDebugging = true;
352+
if (disjunction) {
353+
auto &log = getDebugLogger();
354+
log.indent(2);
355+
log << "Disjunctions = [";
356+
auto constraints = disjunction->getNestedConstraints();
357+
log << constraints[0]->getFirstType()->getString(PO);
358+
log << "])\n";
359+
}
360+
if (conjunction) {
361+
auto &log = getDebugLogger();
362+
log.indent(2);
363+
log << "Conjunction = [";
364+
auto constraints = conjunction->getNestedConstraints();
365+
log << constraints[0]->getFirstType()->getString(PO);
366+
log << "])\n";
367+
}
368+
}
347369

348370
if (CS.shouldAttemptFixes()) {
349371
if ((bestBindings &&

0 commit comments

Comments
 (0)