@@ -66,12 +66,6 @@ class SolutionApplicationTarget;
66
66
67
67
} // end namespace constraints
68
68
69
- namespace unittest {
70
-
71
- class SemaTest ;
72
-
73
- } // end namespace unittest
74
-
75
69
// Forward declare some TypeChecker related functions
76
70
// so they could be made friends of ConstraintSystem.
77
71
namespace TypeChecker {
@@ -2026,8 +2020,6 @@ enum class SolutionApplicationToFunctionResult {
2026
2020
class ConstraintSystem {
2027
2021
ASTContext &Context;
2028
2022
2029
- friend class swift ::unittest::SemaTest;
2030
-
2031
2023
public:
2032
2024
DeclContext *DC;
2033
2025
ConstraintSystemOptions Options;
@@ -4625,7 +4617,8 @@ class ConstraintSystem {
4625
4617
ConstraintKind bodyResultConstraintKind,
4626
4618
ConstraintLocatorBuilder locator);
4627
4619
4628
- private:
4620
+ public: // binding inference logic is public for unit testing.
4621
+
4629
4622
// / The kind of bindings that are permitted.
4630
4623
enum class AllowedBindingKind : uint8_t {
4631
4624
// / Only the exact type.
@@ -4763,7 +4756,6 @@ class ConstraintSystem {
4763
4756
bool viableAsBinding () const { return !isCovered () && hasDefaultType (); }
4764
4757
};
4765
4758
4766
- private:
4767
4759
struct PotentialBindings {
4768
4760
using BindingScore =
4769
4761
std::tuple<bool , bool , bool , bool , bool , unsigned char , int >;
@@ -5157,7 +5149,6 @@ class ConstraintSystem {
5157
5149
Optional<Type> checkTypeOfBinding (TypeVariableType *typeVar, Type type) const ;
5158
5150
Optional<PotentialBindings> determineBestBindings ();
5159
5151
5160
- public:
5161
5152
// / Infer bindings for the given type variable based on current
5162
5153
// / state of the constraint system.
5163
5154
PotentialBindings inferBindingsFor (TypeVariableType *typeVar,
0 commit comments