Skip to content

Commit ff2507b

Browse files
author
Amritpan Kaur
committed
[ConstraintSystem] Convert TypeVariableOptions enum to String for use in printing.
1 parent 872d4ff commit ff2507b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

include/swift/Sema/ConstraintSystem.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,19 @@ class TypeVariableType::Implementation {
588588

589589
/// Print the type variable to the given output stream.
590590
void print(llvm::raw_ostream &OS);
591+
592+
private:
593+
StringRef getTypeVariableOptions(TypeVariableOptions TVO) const {
594+
#define ENTRY(Kind, String) case TypeVariableOptions::Kind: return String
595+
switch (TVO) {
596+
ENTRY(TVO_CanBindToLValue, "lvalue");
597+
ENTRY(TVO_CanBindToInOut, "inout");
598+
ENTRY(TVO_CanBindToNoEscape, "noescape");
599+
ENTRY(TVO_CanBindToHole, "hole");
600+
ENTRY(TVO_PrefersSubtypeBinding, "");
601+
}
602+
#undef ENTRY
603+
}
591604
};
592605

593606
namespace constraints {

0 commit comments

Comments
 (0)