Skip to content

Commit 935904d

Browse files
author
Amritpan Kaur
committed
[CSStep] Add disjunction and conjunction printing to initial state displayed during component step.
1 parent 88e38f2 commit 935904d

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

lib/Sema/CSStep.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,31 @@ 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()) {
354+
PrintOptions PO;
355+
PO.PrintTypesForDebugging = true;
356+
357+
if (disjunction) {
358+
auto &log = getDebugLogger();
359+
log.indent(2);
360+
log << "Disjunction(s) = [";
361+
auto constraints = disjunction->getNestedConstraints();
362+
log << constraints[0]->getFirstType()->getString(PO);
363+
log << "])\n";
364+
}
365+
if (conjunction) {
366+
auto &log = getDebugLogger();
367+
log.indent(2);
368+
log << "Conjunction(s) = [";
369+
auto constraints = conjunction->getNestedConstraints();
370+
log << constraints[0]->getFirstType()->getString(PO);
371+
log << "])\n";
372+
}
373+
}
351374

352375
if (CS.shouldAttemptFixes()) {
353376
if ((bestBindings &&

0 commit comments

Comments
 (0)