mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Don't allow bridging conversions when we're processing favored constraints.
This is another instance where we choose a favored constraint that only type checks because we're bridging through NSNumber, causing awful problems. Fixes rdar://problem/17962491. Swift SVN r21445
This commit is contained in:
@@ -1675,7 +1675,8 @@ ConstraintSystem::matchTypes(Type type1, Type type2, TypeMatchKind kind,
|
||||
TC.Context.Id_CVarArgType;
|
||||
}
|
||||
|
||||
if (isBridgeableTargetType && TC.getBridgedToObjC(DC, type1)) {
|
||||
if (isBridgeableTargetType && TC.getBridgedToObjC(DC, type1) &&
|
||||
!HandlingFavoredConstraint) {
|
||||
conversionsOrFixes.push_back(ConversionRestrictionKind::BridgeToObjC);
|
||||
}
|
||||
}
|
||||
@@ -1686,7 +1687,8 @@ ConstraintSystem::matchTypes(Type type1, Type type2, TypeMatchKind kind,
|
||||
if (type1->mayHaveSuperclass() && type2->isPotentiallyBridgedValueType() &&
|
||||
type2->getAnyNominal()
|
||||
!= TC.Context.getImplicitlyUnwrappedOptionalDecl() &&
|
||||
TC.getBridgedToObjC(DC, type2)) {
|
||||
TC.getBridgedToObjC(DC, type2) &&
|
||||
!HandlingFavoredConstraint) {
|
||||
conversionsOrFixes.push_back(ConversionRestrictionKind::BridgeFromObjC);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user