[CS] Increase the score for implicit global actor function conversion

This commit is contained in:
Luciano Almeida
2022-12-11 23:58:07 -03:00
parent 45cd83d73e
commit 187cf81d16
2 changed files with 14 additions and 0 deletions

View File

@@ -3020,6 +3020,13 @@ ConstraintSystem::matchFunctionTypes(FunctionType *func1, FunctionType *func2,
return getTypeMatchFailure(locator);
} else if (kind < ConstraintKind::Subtype) {
return getTypeMatchFailure(locator);
} else {
// It is possible to convert from a function without a global actor to a
// similar function type that does have a global actor. But, since there
// is a function conversion going on here, let's increase the score to
// avoid ambiguity when solver can also match a global actor matching
// function type.
increaseScore(SK_FunctionConversion);
}
}