Skip to content

Commit 5712ba5

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

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
@@ -346,8 +346,30 @@ StepResult ComponentStep::take(bool prevFailed) {
346346

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

352374
if (CS.shouldAttemptFixes()) {
353375
if ((bestBindings &&

0 commit comments

Comments
 (0)