mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Implicitly look through UncheckedOptional<T> when it's the
base of a member access or subscript. Swift SVN r12345
This commit is contained in:
@@ -1328,6 +1328,11 @@ ConstraintSystem::simplifyMemberConstraint(const Constraint &constraint) {
|
||||
Type baseTy = simplifyType(constraint.getFirstType());
|
||||
Type baseObjTy = baseTy->getRValueType();
|
||||
|
||||
// Try to look through UncheckedOptional<T>; the result is always an r-value.
|
||||
if (auto objTy = lookThroughUncheckedOptionalType(baseObjTy)) {
|
||||
baseTy = baseObjTy = objTy;
|
||||
}
|
||||
|
||||
// Dig out the instance type.
|
||||
bool isMetatype = false;
|
||||
Type instanceTy = baseObjTy;
|
||||
|
||||
Reference in New Issue
Block a user