@@ -234,6 +234,10 @@ enum class FixKind : uint8_t {
234
234
// / inferred and has to be specified explicitly.
235
235
SpecifyBaseTypeForContextualMember,
236
236
237
+ // / Type of the closure parameter used in the body couldn't be inferred
238
+ // / and has to be specified explicitly.
239
+ SpecifyClosureParameterType,
240
+
237
241
// / Closure return type has to be explicitly specified because it can't be
238
242
// / inferred in current context e.g. because it's a multi-statement closure.
239
243
SpecifyClosureReturnType,
@@ -253,7 +257,7 @@ enum class FixKind : uint8_t {
253
257
254
258
// / A warning fix that allows a coercion to perform a force-cast.
255
259
AllowCoercionToForceCast,
256
-
260
+
257
261
// / Allow key path root type mismatch when applying a key path that has a
258
262
// / root type not convertible to the type of the base instance.
259
263
AllowKeyPathRootTypeMismatch,
@@ -1712,6 +1716,19 @@ class SpecifyBaseTypeForContextualMember final : public ConstraintFix {
1712
1716
create (ConstraintSystem &cs, DeclNameRef member, ConstraintLocator *locator);
1713
1717
};
1714
1718
1719
+ class SpecifyClosureParameterType final : public ConstraintFix {
1720
+ SpecifyClosureParameterType (ConstraintSystem &cs, ConstraintLocator *locator)
1721
+ : ConstraintFix(cs, FixKind::SpecifyClosureParameterType, locator) {}
1722
+
1723
+ public:
1724
+ std::string getName () const ;
1725
+
1726
+ bool diagnose (const Solution &solution, bool asNote = false ) const ;
1727
+
1728
+ static SpecifyClosureParameterType *create (ConstraintSystem &cs,
1729
+ ConstraintLocator *locator);
1730
+ };
1731
+
1715
1732
class SpecifyClosureReturnType final : public ConstraintFix {
1716
1733
SpecifyClosureReturnType (ConstraintSystem &cs, ConstraintLocator *locator)
1717
1734
: ConstraintFix(cs, FixKind::SpecifyClosureReturnType, locator) {}
0 commit comments