@@ -1669,25 +1669,39 @@ void BindingSet::dump(llvm::raw_ostream &out, unsigned indent) const {
1669
1669
attributes.push_back (" delayed" );
1670
1670
if (isSubtypeOfExistentialType ())
1671
1671
attributes.push_back (" subtype_of_existential" );
1672
+ if (!attributes.empty ()) {
1673
+ out << " [attributes: " ;
1674
+ interleave (attributes, out, " , " );
1675
+ }
1676
+
1672
1677
auto literalKind = getLiteralForScore ();
1673
1678
if (literalKind != LiteralBindingKind::None) {
1674
- std::string literalAttrStr ;
1675
- literalAttrStr. append ( " [literal: " );
1676
- if (literalKind == LiteralBindingKind::Atom) {
1679
+ out << " , [literal: " ;
1680
+ switch (literalKind) {
1681
+ case LiteralBindingKind::Atom: {
1677
1682
if (auto atomKind = TypeVar->getImpl ().getAtomicLiteralKind ()) {
1678
- literalAttrStr. append ( getAtomLiteralAsString (*atomKind) );
1683
+ out << getAtomLiteralAsString (*atomKind);
1679
1684
}
1680
- } else {
1681
- literalAttrStr.append (getLiteralBindingKind (literalKind).str ());
1685
+ break ;
1682
1686
}
1683
- literalAttrStr.append (" ]" );
1684
- attributes.push_back (std::move (literalAttrStr));
1685
- }
1686
- if (!attributes.empty ()) {
1687
- out << " [attributes: " ;
1688
- interleave (attributes, out, " , " );
1689
- out << " ] " ;
1687
+ case LiteralBindingKind::Collection: {
1688
+ std::vector<std::string> collectionLiterals;
1689
+ forEachLiteralRequirement ([&](KnownProtocolKind protocolKind) {
1690
+ collectionLiterals.push_back (
1691
+ getCollectionLiteralAsString (protocolKind));
1692
+ });
1693
+ interleave (collectionLiterals, out, " , " );
1694
+ break ;
1695
+ }
1696
+ case LiteralBindingKind::Float:
1697
+ case LiteralBindingKind::None:
1698
+ out << getLiteralBindingKind (literalKind).str ();
1699
+ break ;
1700
+ }
1701
+ out << " ]" ;
1690
1702
}
1703
+ out << " ] " ;
1704
+
1691
1705
if (involvesTypeVariables ()) {
1692
1706
out << " [involves_type_vars: " ;
1693
1707
interleave (AdjacentVars,
0 commit comments