mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
fix <rdar://problem/21244068> QoI: IUO prevents specific diagnostic + fixit about non-implicitly converted bridge types
Swift SVN r29910
This commit is contained in:
@@ -2040,9 +2040,14 @@ commit_to_conversions:
|
||||
conversionsOrFixes.push_back(Fix::getForcedDowncast(*this, type2));
|
||||
}
|
||||
|
||||
// Look through IUO's.
|
||||
auto type1WithoutIUO = objectType1;
|
||||
if (auto elt = type1WithoutIUO->getImplicitlyUnwrappedOptionalObjectType())
|
||||
type1WithoutIUO = elt;
|
||||
|
||||
// If we could perform a bridging cast, try it.
|
||||
if (isArrayDictionarySetOrString(TC.Context, type2) &&
|
||||
TC.getDynamicBridgedThroughObjCClass(DC, true, objectType1, type2)) {
|
||||
TC.getDynamicBridgedThroughObjCClass(DC, true, type1WithoutIUO, type2)){
|
||||
conversionsOrFixes.push_back(Fix::getForcedDowncast(*this, type2));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user