mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ConstraintSystem] De-prioritize solutions with Swift -> C pointer conversions
Just like other implicit conversions - always prefer solutions with the lowest possible number of them.
This commit is contained in:
@@ -11385,6 +11385,10 @@ ConstraintSystem::SolutionKind
|
||||
ConstraintSystem::simplifyPointerToCPointerRestriction(
|
||||
Type type1, Type type2, TypeMatchOptions flags,
|
||||
ConstraintLocatorBuilder locator) {
|
||||
// Make sure that solutions with implicit pointer conversions
|
||||
// are always worse than the ones without them.
|
||||
increaseScore(SK_ImplicitValueConversion);
|
||||
|
||||
auto &ctx = getASTContext();
|
||||
|
||||
PointerTypeKind swiftPtrKind, cPtrKind;
|
||||
|
||||
Reference in New Issue
Block a user