[CSSimplify] Mark all type variables in member type as holes if base is a hole

Even if the member type variable is partially resolved, we still need
to mark inner type variables (if any) as holes because they might not
be connected to anything that could provide contextual type(s).

Resolves: rdar://124549952
This commit is contained in:
Pavel Yaskevich
2024-03-15 09:56:59 -07:00
parent a24539171c
commit b6ba3fead8
2 changed files with 11 additions and 2 deletions

View File

@@ -10739,8 +10739,7 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyMemberConstraint(
// reason to perform a lookup because it wouldn't return any results.
if (shouldAttemptFixes()) {
auto markMemberTypeAsPotentialHole = [&](Type memberTy) {
if (auto *typeVar = memberTy->getAs<TypeVariableType>())
recordPotentialHole(typeVar);
recordAnyTypeVarAsPotentialHole(simplifyType(memberTy));
};
// If this is an unresolved member ref e.g. `.foo` and its contextual base