@@ -2080,15 +2080,15 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
2080
2080
// Favor an UnsafeMutablePointer-to-UnsafeMutablePointer
2081
2081
// conversion.
2082
2082
if (type1PointerKind != pointerKind)
2083
- increaseScore (ScoreKind::SK_ScalarPointerConversion );
2083
+ increaseScore (ScoreKind::SK_ValueToPointerConversion );
2084
2084
conversionsOrFixes.push_back (
2085
2085
ConversionRestrictionKind::PointerToPointer);
2086
2086
}
2087
2087
// UnsafeMutableRawPointer -> UnsafeRawPointer
2088
2088
else if (type1PointerKind == PTK_UnsafeMutableRawPointer &&
2089
2089
pointerKind == PTK_UnsafeRawPointer) {
2090
2090
if (type1PointerKind != pointerKind)
2091
- increaseScore (ScoreKind::SK_ScalarPointerConversion );
2091
+ increaseScore (ScoreKind::SK_ValueToPointerConversion );
2092
2092
conversionsOrFixes.push_back (
2093
2093
ConversionRestrictionKind::PointerToPointer);
2094
2094
}
@@ -4379,6 +4379,7 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
4379
4379
auto baseType1 = getFixedTypeRecursive (*isArrayType (obj1), false , false );
4380
4380
auto baseType2 = getBaseTypeForPointer (*this , t2);
4381
4381
4382
+ increaseScore (ScoreKind::SK_ValueToPointerConversion);
4382
4383
return matchTypes (baseType1, baseType2,
4383
4384
ConstraintKind::BindToPointerType,
4384
4385
subflags, locator);
@@ -4398,7 +4399,7 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
4398
4399
// If we haven't resolved the element type, generate constraints.
4399
4400
if (baseType2->isTypeVariableOrMember ()) {
4400
4401
if (flags.contains (TMF_GenerateConstraints)) {
4401
- increaseScore (SK_StringToPointerConversion );
4402
+ increaseScore (ScoreKind::SK_ValueToPointerConversion );
4402
4403
4403
4404
auto int8Con = Constraint::create (*this , ConstraintKind::Bind,
4404
4405
baseType2, TC.getInt8Type (DC),
@@ -4422,7 +4423,7 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
4422
4423
return SolutionKind::Error;
4423
4424
}
4424
4425
4425
- increaseScore (SK_StringToPointerConversion );
4426
+ increaseScore (ScoreKind::SK_ValueToPointerConversion );
4426
4427
return SolutionKind::Solved;
4427
4428
}
4428
4429
@@ -4437,6 +4438,7 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
4437
4438
4438
4439
// Set up the disjunction for the array or scalar cases.
4439
4440
4441
+ increaseScore (ScoreKind::SK_ValueToPointerConversion);
4440
4442
return matchTypes (baseType1, baseType2,
4441
4443
ConstraintKind::BindToPointerType,
4442
4444
subflags, locator);
0 commit comments