File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -1045,13 +1045,6 @@ bool TypeVariableBinding::attempt(ConstraintSystem &cs) const {
1045
1045
cs.DefaultedConstraints .push_back (srcLocator);
1046
1046
1047
1047
if (type->isHole ()) {
1048
- if (auto * OLE = dyn_cast<ObjectLiteralExpr>(srcLocator->getAnchor ())) {
1049
- auto *fix = SpecifyObjectLiteralTypeImport::create (
1050
- cs, TypeVar->getImpl ().getLocator ());
1051
- if (cs.recordFix (fix))
1052
- return true ;
1053
- }
1054
-
1055
1048
if (auto *GP = TypeVar->getImpl ().getGenericParameter ()) {
1056
1049
auto path = dstLocator->getPath ();
1057
1050
// Drop `generic parameter` locator element so that all missing
@@ -1066,6 +1059,12 @@ bool TypeVariableBinding::attempt(ConstraintSystem &cs) const {
1066
1059
cs, TypeVar->getImpl ().getLocator ());
1067
1060
if (cs.recordFix (fix))
1068
1061
return true ;
1062
+ } else if (auto *OLE = dyn_cast_or_null<ObjectLiteralExpr>(
1063
+ srcLocator->getAnchor ())) {
1064
+ auto *fix = SpecifyObjectLiteralTypeImport::create (
1065
+ cs, TypeVar->getImpl ().getLocator ());
1066
+ if (cs.recordFix (fix))
1067
+ return true ;
1069
1068
}
1070
1069
}
1071
1070
}
Original file line number Diff line number Diff line change @@ -1645,7 +1645,7 @@ class SpecifyObjectLiteralTypeImport final : public ConstraintFix {
1645
1645
1646
1646
public:
1647
1647
std::string getName () const {
1648
- return " specify object literal protocol type import " ;
1648
+ return " import required module to gain access to a default literal type " ;
1649
1649
}
1650
1650
1651
1651
bool diagnose (bool asNote = false ) const ;
You can’t perform that action at this time.
0 commit comments