Skip to content

Commit 0a8b22f

Browse files
authored
Merge pull request #60297 from amritpan/fix-attr-printing
[ConstraintSystem] Fix spacing issues with printing attributes.
2 parents 6a889c8 + e9f18fe commit 0a8b22f

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

lib/Sema/CSBindings.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,7 +1686,12 @@ void BindingSet::dump(llvm::raw_ostream &out, unsigned indent) const {
16861686

16871687
auto literalKind = getLiteralForScore();
16881688
if (literalKind != LiteralBindingKind::None) {
1689-
out << ", [literal: ";
1689+
if (!attributes.empty()) {
1690+
out << ", ";
1691+
} else {
1692+
out << "[attributes: ";
1693+
}
1694+
out << "[literal: ";
16901695
switch (literalKind) {
16911696
case LiteralBindingKind::Atom: {
16921697
if (auto atomKind = TypeVar->getImpl().getAtomicLiteralKind()) {
@@ -1708,9 +1713,14 @@ void BindingSet::dump(llvm::raw_ostream &out, unsigned indent) const {
17081713
out << getLiteralBindingKind(literalKind).str();
17091714
break;
17101715
}
1711-
out << "]";
1716+
if (attributes.empty()) {
1717+
out << "]] ";
1718+
} else {
1719+
out << "]";
1720+
}
17121721
}
1713-
out << "] ";
1722+
if (!attributes.empty())
1723+
out << "] ";
17141724

17151725
if (involvesTypeVariables()) {
17161726
out << "[involves_type_vars: ";

0 commit comments

Comments
 (0)