@@ -235,12 +235,15 @@ enum class FixKind : uint8_t {
235
235
// / Closure return type has to be explicitly specified because it can't be
236
236
// / inferred in current context e.g. because it's a multi-statement closure.
237
237
SpecifyClosureReturnType,
238
-
238
+
239
239
// / Object literal type coudn't be infered because the module where
240
240
// / the default type that implements the associated literal protocol
241
241
// / is declared was not imported.
242
242
SpecifyObjectLiteralTypeImport,
243
243
244
+ // / Member shadows a top-level name, such a name could only be accessed by
245
+ // / prefixing it with a module name.
246
+ AddQualifierToAccessTopLevelName,
244
247
};
245
248
246
249
class ConstraintFix {
@@ -1652,7 +1655,22 @@ class SpecifyObjectLiteralTypeImport final : public ConstraintFix {
1652
1655
1653
1656
static SpecifyObjectLiteralTypeImport *create (ConstraintSystem &cs,
1654
1657
ConstraintLocator *locator);
1658
+ };
1659
+
1660
+ class AddQualifierToAccessTopLevelName final : public ConstraintFix {
1661
+ AddQualifierToAccessTopLevelName (ConstraintSystem &cs,
1662
+ ConstraintLocator *locator)
1663
+ : ConstraintFix(cs, FixKind::AddQualifierToAccessTopLevelName, locator) {}
1664
+
1665
+ public:
1666
+ std::string getName () const {
1667
+ return " qualify reference to access top-level function" ;
1668
+ }
1655
1669
1670
+ bool diagnose (bool asNote = false ) const ;
1671
+
1672
+ static AddQualifierToAccessTopLevelName *create (ConstraintSystem &cs,
1673
+ ConstraintLocator *locator);
1656
1674
};
1657
1675
1658
1676
} // end namespace constraints
0 commit comments