mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Don't offer incorrect fixit for NSString? -> String? conversion.
Update the locator when matching optional types in parallel fashion. This causes the simplifyLocator() call to fail to simplify the locator completely, and avoids the bogus diagnostic. <rdar://problem/19836341> Incorrect fixit for NSString? to String? conversions Swift SVN r25596
This commit is contained in:
@@ -3684,7 +3684,9 @@ ConstraintSystem::simplifyRestrictedConstraint(ConversionRestrictionKind restric
|
||||
assert(generic2->getDecl()->classifyAsOptionalType());
|
||||
return matchTypes(generic1->getGenericArgs()[0],
|
||||
generic2->getGenericArgs()[0],
|
||||
matchKind, subFlags, locator);
|
||||
matchKind, subFlags,
|
||||
locator.withPathElement(
|
||||
LocatorPathElt::getGenericArgument(0)));
|
||||
}
|
||||
|
||||
// T <c U ===> T! <c U
|
||||
@@ -3705,7 +3707,9 @@ ConstraintSystem::simplifyRestrictedConstraint(ConversionRestrictionKind restric
|
||||
Type valueType1 = boundGenericType1->getGenericArgs()[0];
|
||||
increaseScore(SK_ForceUnchecked);
|
||||
return matchTypes(valueType1, type2,
|
||||
matchKind, subFlags, locator);
|
||||
matchKind, subFlags,
|
||||
locator.withPathElement(
|
||||
LocatorPathElt::getGenericArgument(0)));
|
||||
}
|
||||
|
||||
case ConversionRestrictionKind::ClassMetatypeToAnyObject:
|
||||
|
||||
Reference in New Issue
Block a user