@@ -298,9 +298,9 @@ enum class FixKind : uint8_t {
298298 // / Ignore `ErrorExpr` or `ErrorType` during pre-check.
299299 IgnoreInvalidASTNode,
300300
301- // / Ignore a named pattern whose type we couldn't infer. This issue should
302- // / already have been diagnosed elsewhere.
303- IgnoreInvalidNamedPattern ,
301+ // / Ignore a named or `_` pattern whose type we couldn't infer.
302+ // / This issue should already have been diagnosed elsewhere.
303+ IgnoreUnresolvedPatternVar ,
304304
305305 // / Resolve type of `nil` by providing a contextual type.
306306 SpecifyContextualTypeForNil,
@@ -2287,6 +2287,10 @@ class UseRawValue final : public ConstraintFix {
22872287
22882288 bool diagnose (const Solution &solution, bool asNote = false ) const override ;
22892289
2290+ bool diagnoseForAmbiguity (CommonFixesArray commonFixes) const override {
2291+ return diagnose (*commonFixes.front ().first );
2292+ }
2293+
22902294 static UseRawValue *create (ConstraintSystem &cs, Type rawReprType,
22912295 Type expectedType, ConstraintLocator *locator);
22922296
@@ -2746,10 +2750,10 @@ class IgnoreInvalidASTNode final : public ConstraintFix {
27462750 }
27472751};
27482752
2749- class IgnoreInvalidNamedPattern final : public ConstraintFix {
2750- IgnoreInvalidNamedPattern (ConstraintSystem &cs, NamedPattern *pattern,
2751- ConstraintLocator *locator)
2752- : ConstraintFix(cs, FixKind::IgnoreInvalidNamedPattern , locator) {}
2753+ class IgnoreUnresolvedPatternVar final : public ConstraintFix {
2754+ IgnoreUnresolvedPatternVar (ConstraintSystem &cs, Pattern *pattern,
2755+ ConstraintLocator *locator)
2756+ : ConstraintFix(cs, FixKind::IgnoreUnresolvedPatternVar , locator) {}
27532757
27542758public:
27552759 std::string getName () const override {
@@ -2762,12 +2766,11 @@ class IgnoreInvalidNamedPattern final : public ConstraintFix {
27622766 return diagnose (*commonFixes.front ().first );
27632767 }
27642768
2765- static IgnoreInvalidNamedPattern *create (ConstraintSystem &cs,
2766- NamedPattern *pattern,
2767- ConstraintLocator *locator);
2769+ static IgnoreUnresolvedPatternVar *
2770+ create (ConstraintSystem &cs, Pattern *pattern, ConstraintLocator *locator);
27682771
27692772 static bool classof (ConstraintFix *fix) {
2770- return fix->getKind () == FixKind::IgnoreInvalidNamedPattern ;
2773+ return fix->getKind () == FixKind::IgnoreUnresolvedPatternVar ;
27712774 }
27722775};
27732776
0 commit comments