[ConstraintSystem] Limit new implicit conversion to only Double <-> CGFloat

This commit is contained in:
Pavel Yaskevich
2020-10-21 16:47:50 -07:00
parent b7fcae4822
commit 8c6017687a
8 changed files with 53 additions and 27 deletions

View File

@@ -4488,8 +4488,8 @@ ConstraintSystem::getArgumentInfo(ConstraintLocator *locator) {
.castTo<LocatorPathElt::ImplicitConversion>()
.getConversionKind();
if (conversion == ConversionRestrictionKind::TypeToCGFloat ||
conversion == ConversionRestrictionKind::CGFloatToType) {
if (conversion == ConversionRestrictionKind::DoubleToCGFloat ||
conversion == ConversionRestrictionKind::CGFloatToDouble) {
// TODO: This is not very efficient, long term we should just
// save a single `ArgumentInfo` and use it for all of
// the locations where conversion is needed.
@@ -4902,8 +4902,8 @@ ConstraintSystem::isConversionEphemeral(ConversionRestrictionKind conversion,
case ConversionRestrictionKind::HashableToAnyHashable:
case ConversionRestrictionKind::CFTollFreeBridgeToObjC:
case ConversionRestrictionKind::ObjCTollFreeBridgeToCF:
case ConversionRestrictionKind::CGFloatToType:
case ConversionRestrictionKind::TypeToCGFloat:
case ConversionRestrictionKind::CGFloatToDouble:
case ConversionRestrictionKind::DoubleToCGFloat:
// @_nonEphemeral has no effect on these conversions, so treat them as all
// being non-ephemeral in order to allow their passing to an @_nonEphemeral
// parameter.