|
24 | 24 | #include "ConstraintGraphScope.h" |
25 | 25 | #include "ConstraintLocator.h" |
26 | 26 | #include "OverloadChoice.h" |
27 | | -#include "TypeChecker.h" |
| 27 | +#include "SolutionResult.h" |
| 28 | +#include "swift/AST/ASTContext.h" |
28 | 29 | #include "swift/AST/ASTNode.h" |
29 | 30 | #include "swift/AST/ASTVisitor.h" |
30 | 31 | #include "swift/AST/ASTWalker.h" |
| 32 | +#include "swift/AST/AnyFunctionRef.h" |
| 33 | +#include "swift/AST/DiagnosticsSema.h" |
31 | 34 | #include "swift/AST/NameLookup.h" |
32 | 35 | #include "swift/AST/PropertyWrappers.h" |
33 | 36 | #include "swift/AST/Types.h" |
34 | 37 | #include "swift/Basic/Debug.h" |
35 | 38 | #include "swift/Basic/LLVM.h" |
36 | 39 | #include "swift/Basic/OptionSet.h" |
| 40 | +#include "llvm/ADT/MapVector.h" |
37 | 41 | #include "llvm/ADT/PointerUnion.h" |
38 | 42 | #include "llvm/ADT/STLExtras.h" |
39 | 43 | #include "llvm/ADT/SetOperations.h" |
|
49 | 53 | namespace swift { |
50 | 54 |
|
51 | 55 | class Expr; |
| 56 | +class FuncDecl; |
| 57 | +class BraseStmt; |
| 58 | +enum class TypeCheckExprFlags; |
52 | 59 |
|
53 | 60 | namespace constraints { |
54 | 61 |
|
55 | 62 | class ConstraintGraph; |
56 | 63 | class ConstraintGraphNode; |
57 | 64 | class ConstraintSystem; |
| 65 | +class SolutionApplicationTarget; |
58 | 66 |
|
59 | 67 | } // end namespace constraints |
60 | 68 |
|
| 69 | +// Forward declare some TypeChecker related functions |
| 70 | +// so they could be made friends of ConstraintSystem. |
| 71 | +namespace TypeChecker { |
| 72 | + |
| 73 | +Optional<BraceStmt *> applyFunctionBuilderBodyTransform(FuncDecl *func, |
| 74 | + Type builderType); |
| 75 | + |
| 76 | +Optional<constraints::SolutionApplicationTarget> |
| 77 | +typeCheckExpression(constraints::SolutionApplicationTarget &target, |
| 78 | + OptionSet<TypeCheckExprFlags> options); |
| 79 | + |
| 80 | +} // end namespace TypeChecker |
| 81 | + |
61 | 82 | } // end namespace swift |
62 | 83 |
|
63 | 84 | /// Allocate memory within the given constraint system. |
@@ -2730,9 +2751,10 @@ class ConstraintSystem { |
2730 | 2751 | friend Optional<BraceStmt *> |
2731 | 2752 | swift::TypeChecker::applyFunctionBuilderBodyTransform(FuncDecl *func, |
2732 | 2753 | Type builderType); |
| 2754 | + |
2733 | 2755 | friend Optional<SolutionApplicationTarget> |
2734 | | - swift::TypeChecker::typeCheckExpression(SolutionApplicationTarget &target, |
2735 | | - TypeCheckExprOptions options); |
| 2756 | + swift::TypeChecker::typeCheckExpression( |
| 2757 | + SolutionApplicationTarget &target, OptionSet<TypeCheckExprFlags> options); |
2736 | 2758 |
|
2737 | 2759 | /// Emit the fixes computed as part of the solution, returning true if we were |
2738 | 2760 | /// able to emit an error message, or false if none of the fixits worked out. |
|
0 commit comments