@@ -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
}
@@ -4378,6 +4378,7 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
4378
4378
auto baseType1 = getFixedTypeRecursive (*isArrayType (obj1), false , false );
4379
4379
auto baseType2 = getBaseTypeForPointer (*this , t2);
4380
4380
4381
+ increaseScore (ScoreKind::SK_ValueToPointerConversion);
4381
4382
return matchTypes (baseType1, baseType2,
4382
4383
ConstraintKind::BindToPointerType,
4383
4384
subflags, locator);
@@ -4397,7 +4398,7 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
4397
4398
// If we haven't resolved the element type, generate constraints.
4398
4399
if (baseType2->isTypeVariableOrMember ()) {
4399
4400
if (flags.contains (TMF_GenerateConstraints)) {
4400
- increaseScore (SK_StringToPointerConversion );
4401
+ increaseScore (ScoreKind::SK_ValueToPointerConversion );
4401
4402
4402
4403
auto int8Con = Constraint::create (*this , ConstraintKind::Bind,
4403
4404
baseType2, TC.getInt8Type (DC),
@@ -4421,7 +4422,7 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
4421
4422
return SolutionKind::Error;
4422
4423
}
4423
4424
4424
- increaseScore (SK_StringToPointerConversion );
4425
+ increaseScore (ScoreKind::SK_ValueToPointerConversion );
4425
4426
return SolutionKind::Solved;
4426
4427
}
4427
4428
@@ -4436,6 +4437,7 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
4436
4437
4437
4438
// Set up the disjunction for the array or scalar cases.
4438
4439
4440
+ increaseScore (ScoreKind::SK_ValueToPointerConversion);
4439
4441
return matchTypes (baseType1, baseType2,
4440
4442
ConstraintKind::BindToPointerType,
4441
4443
subflags, locator);
0 commit comments