@@ -55,6 +55,24 @@ using namespace constraints;
55
55
56
56
void TypeVariableType::Implementation::print (llvm::raw_ostream &OS) {
57
57
getTypeVariable ()->print (OS, PrintOptions ());
58
+
59
+ SmallVector<TypeVariableOptions, 4 > bindingOptions;
60
+ if (canBindToLValue ())
61
+ bindingOptions.push_back (TypeVariableOptions::TVO_CanBindToLValue);
62
+ if (canBindToInOut ())
63
+ bindingOptions.push_back (TypeVariableOptions::TVO_CanBindToInOut);
64
+ if (canBindToNoEscape ())
65
+ bindingOptions.push_back (TypeVariableOptions::TVO_CanBindToNoEscape);
66
+ if (canBindToHole ())
67
+ bindingOptions.push_back (TypeVariableOptions::TVO_CanBindToHole);
68
+ if (!bindingOptions.empty ()) {
69
+ OS << " [allows bindings to: " ;
70
+ interleave (bindingOptions, OS,
71
+ [&](TypeVariableOptions option) {
72
+ (OS << getTypeVariableOptions (option));},
73
+ " , " );
74
+ OS << " ]" ;
75
+ }
58
76
}
59
77
60
78
SavedTypeVariableBinding::SavedTypeVariableBinding (TypeVariableType *typeVar)
@@ -1415,24 +1433,7 @@ void ConstraintSystem::print(raw_ostream &out) const {
1415
1433
});
1416
1434
for (auto tv : typeVariables) {
1417
1435
out.indent (2 );
1418
- Type (tv).print (out, PO);
1419
- SmallVector<TypeVariableOptions, 4 > bindingOptions;
1420
- if (tv->getImpl ().canBindToLValue ())
1421
- bindingOptions.push_back (TypeVariableOptions::TVO_CanBindToLValue);
1422
- if (tv->getImpl ().canBindToInOut ())
1423
- bindingOptions.push_back (TypeVariableOptions::TVO_CanBindToInOut);
1424
- if (tv->getImpl ().canBindToNoEscape ())
1425
- bindingOptions.push_back (TypeVariableOptions::TVO_CanBindToNoEscape);
1426
- if (tv->getImpl ().canBindToHole ())
1427
- bindingOptions.push_back (TypeVariableOptions::TVO_CanBindToHole);
1428
- if (!bindingOptions.empty ()) {
1429
- out << " [allows bindings to: " ;
1430
- interleave (bindingOptions, out,
1431
- [&](TypeVariableOptions option) {
1432
- (out << tv->getImpl ().getTypeVariableOptions (option));},
1433
- " , " );
1434
- out << " ]" ;
1435
- }
1436
+ tv->getImpl ().print (out);
1436
1437
auto rep = getRepresentative (tv);
1437
1438
if (rep == tv) {
1438
1439
if (auto fixed = getFixedType (tv)) {
0 commit comments