@@ -488,6 +488,9 @@ enum class FixKind : uint8_t {
488
488
// / the type it's attempting to bind to.
489
489
AllowInlineArrayLiteralCountMismatch,
490
490
491
+ // / Reached the limit of @dynamicMemberLookup depth.
492
+ TooManyDynamicMemberLookups,
493
+
491
494
// / Ignore that a conformance is isolated but is not allowed to be.
492
495
IgnoreIsolatedConformance,
493
496
};
@@ -3881,6 +3884,33 @@ class AllowInlineArrayLiteralCountMismatch final : public ConstraintFix {
3881
3884
}
3882
3885
};
3883
3886
3887
+ class TooManyDynamicMemberLookups : public ConstraintFix {
3888
+ DeclNameRef Name;
3889
+
3890
+ TooManyDynamicMemberLookups (ConstraintSystem &cs, DeclNameRef name,
3891
+ ConstraintLocator *locator)
3892
+ : ConstraintFix(cs, FixKind::TooManyDynamicMemberLookups, locator),
3893
+ Name (name) {}
3894
+
3895
+ public:
3896
+ std::string getName () const override {
3897
+ return " too many dynamic member lookups" ;
3898
+ }
3899
+
3900
+ bool diagnose (const Solution &solution, bool asNote = false ) const override ;
3901
+
3902
+ bool diagnoseForAmbiguity (CommonFixesArray commonFixes) const override {
3903
+ return diagnose (*commonFixes.front ().first );
3904
+ }
3905
+
3906
+ static TooManyDynamicMemberLookups *
3907
+ create (ConstraintSystem &cs, DeclNameRef name, ConstraintLocator *locator);
3908
+
3909
+ static bool classof (const ConstraintFix *fix) {
3910
+ return fix->getKind () == FixKind::TooManyDynamicMemberLookups;
3911
+ }
3912
+ };
3913
+
3884
3914
class IgnoreIsolatedConformance : public ConstraintFix {
3885
3915
ProtocolConformance *conformance;
3886
3916
0 commit comments