File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1239,6 +1239,8 @@ bool TypeVariableBinding::attempt(ConstraintSystem &cs) const {
12391239 cs.increaseScore (SK_Hole);
12401240
12411241 ConstraintFix *fix = nullptr ;
1242+ unsigned fixImpact = 1 ;
1243+
12421244 if (auto *GP = TypeVar->getImpl ().getGenericParameter ()) {
12431245 // If it is represetative for a key path root, let's emit a more
12441246 // specific diagnostic.
@@ -1279,9 +1281,12 @@ bool TypeVariableBinding::attempt(ConstraintSystem &cs) const {
12791281 fix = SpecifyKeyPathRootType::create (cs, dstLocator);
12801282 } else if (dstLocator->directlyAt <NilLiteralExpr>()) {
12811283 fix = SpecifyContextualTypeForNil::create (cs, dstLocator);
1284+ // This is a dramatic event, it means that there is absolutely
1285+ // no contextual information to resolve type of `nil`.
1286+ fixImpact = 10 ;
12821287 }
12831288
1284- if (fix && cs.recordFix (fix))
1289+ if (fix && cs.recordFix (fix, fixImpact ))
12851290 return true ;
12861291 }
12871292 }
You can’t perform that action at this time.
0 commit comments