@@ -488,6 +488,9 @@ enum class FixKind : uint8_t {
488488 // / the type it's attempting to bind to.
489489 AllowInlineArrayLiteralCountMismatch,
490490
491+ // / Reached the limit of @dynamicMemberLookup depth.
492+ TooManyDynamicMemberLookups,
493+
491494 // / Ignore that a conformance is isolated but is not allowed to be.
492495 IgnoreIsolatedConformance,
493496};
@@ -3881,6 +3884,33 @@ class AllowInlineArrayLiteralCountMismatch final : public ConstraintFix {
38813884 }
38823885};
38833886
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+
38843914class IgnoreIsolatedConformance : public ConstraintFix {
38853915 ProtocolConformance *conformance;
38863916
0 commit comments