mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Allow implicit conversion constraint to bridge String to NSString even
when it is the favored constraint of a disjunction. This allows 'ns ?? "str" as String as String' to typecheck where ns is an NSString. This does not regress the relevant test for 17962491. <rdar://problem/20029786> Swift compiler sometimes suggests changing "as!" to "as?!" Swift SVN r25910
This commit is contained in:
@@ -1749,9 +1749,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, TypeMatchKind kind,
|
||||
TC.Context.Id_CVarArgType;
|
||||
}
|
||||
|
||||
if (isBridgeableTargetType && TC.getBridgedToObjC(DC, true, type1) &&
|
||||
(kind == TypeMatchKind::ExplicitConversion ||
|
||||
!HandlingFavoredConstraint)) {
|
||||
if (isBridgeableTargetType && TC.getBridgedToObjC(DC, true, type1)) {
|
||||
conversionsOrFixes.push_back(ConversionRestrictionKind::BridgeToObjC);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user