@@ -4845,8 +4845,8 @@ class ConstraintSystem {
48454845 // / Simplify a closure body element constraint by generating required
48464846 // / constraints to represent the given element in constraint system.
48474847 SolutionKind simplifyClosureBodyElementConstraint (
4848- ASTNode element, ContextualTypeInfo context, TypeMatchOptions flags ,
4849- ConstraintLocatorBuilder locator);
4848+ ASTNode element, ContextualTypeInfo context, bool isDiscarded ,
4849+ TypeMatchOptions flags, ConstraintLocatorBuilder locator);
48504850
48514851public: // FIXME: Public for use by static functions.
48524852 // / Simplify a conversion constraint with a fix applied to it.
@@ -5005,7 +5005,8 @@ class ConstraintSystem {
50055005 // / \param replaceInvalidRefsWithErrors Indicates whether it's allowed
50065006 // / to replace any discovered invalid member references with `ErrorExpr`.
50075007 static bool preCheckExpression (Expr *&expr, DeclContext *dc,
5008- bool replaceInvalidRefsWithErrors);
5008+ bool replaceInvalidRefsWithErrors,
5009+ bool leaveClosureBodiesUnchecked);
50095010
50105011 // / Solve the system of constraints generated from provided target.
50115012 // /
@@ -5236,6 +5237,16 @@ class ConstraintSystem {
52365237 // / imported from C/ObjectiveC.
52375238 bool isArgumentOfImportedDecl (ConstraintLocatorBuilder locator);
52385239
5240+ // / Check whether given closure should participate in inference e.g.
5241+ // / if it's a single-expression closure - it always does, but
5242+ // / multi-statement closures require special flags.
5243+ bool participatesInInference (ClosureExpr *closure) const ;
5244+
5245+ // / Visit each subexpression that will be part of the constraint system
5246+ // / of the given expression, including those in closure bodies that will be
5247+ // / part of the constraint system.
5248+ void forEachExpr (Expr *expr, llvm::function_ref<Expr *(Expr *)> callback);
5249+
52395250 SWIFT_DEBUG_DUMP;
52405251 SWIFT_DEBUG_DUMPER (dump(Expr *));
52415252
@@ -6059,18 +6070,6 @@ BraceStmt *applyResultBuilderTransform(
60596070 constraints::SolutionApplicationTarget)>
60606071 rewriteTarget);
60616072
6062- // / Determine whether the given closure expression should be type-checked
6063- // / within the context of its enclosing expression. Otherwise, it will be
6064- // / separately type-checked once its enclosing expression has determined all
6065- // / of the parameter and result types without looking at the body.
6066- bool shouldTypeCheckInEnclosingExpression (ClosureExpr *expr);
6067-
6068- // / Visit each subexpression that will be part of the constraint system
6069- // / of the given expression, including those in closure bodies that will be
6070- // / part of the constraint system.
6071- void forEachExprInConstraintSystem (
6072- Expr *expr, llvm::function_ref<Expr *(Expr *)> callback);
6073-
60746073// / Whether the given parameter requires an argument.
60756074bool parameterRequiresArgument (
60766075 ArrayRef<AnyFunctionType::Param> params,
0 commit comments