mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When converting a non-void-returning closure to a contextual function type that returns void, increase the function conversion score count. This ensures that, in the case of overload resolution, we don't accidentally favor a void-returning function over a better (or exact) fit. (rdar://problem/19776288)
Swift SVN r25140
This commit is contained in:
@@ -1957,6 +1957,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, TypeMatchKind kind,
|
||||
|
||||
while (!parts.empty()) {
|
||||
if (parts.back().getKind() == ConstraintLocator::ClosureResult) {
|
||||
increaseScore(SK_FunctionConversion);
|
||||
return SolutionKind::Solved;
|
||||
}
|
||||
parts.pop_back();
|
||||
|
||||
Reference in New Issue
Block a user