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 {
1239
1239
cs.increaseScore (SK_Hole);
1240
1240
1241
1241
ConstraintFix *fix = nullptr ;
1242
+ unsigned fixImpact = 1 ;
1243
+
1242
1244
if (auto *GP = TypeVar->getImpl ().getGenericParameter ()) {
1243
1245
// If it is represetative for a key path root, let's emit a more
1244
1246
// specific diagnostic.
@@ -1279,9 +1281,12 @@ bool TypeVariableBinding::attempt(ConstraintSystem &cs) const {
1279
1281
fix = SpecifyKeyPathRootType::create (cs, dstLocator);
1280
1282
} else if (dstLocator->directlyAt <NilLiteralExpr>()) {
1281
1283
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 ;
1282
1287
}
1283
1288
1284
- if (fix && cs.recordFix (fix))
1289
+ if (fix && cs.recordFix (fix, fixImpact ))
1285
1290
return true ;
1286
1291
}
1287
1292
}
You can’t perform that action at this time.
0 commit comments