Skip to content

Commit aea8d24

Browse files
committed
[ConstraintSystem] Resolve dependent member as a hole if base is one
Instead of preserving unresolved dependent member types, let's resolve them as holes if their base has been determined to be one.
1 parent ff7fdc5 commit aea8d24

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4274,8 +4274,7 @@ bool ConstraintSystem::repairFailures(
42744274
// it's going to be diagnosed by specialized fix which deals
42754275
// with generic argument mismatches.
42764276
if (matchKind == ConstraintKind::BindToPointerType) {
4277-
auto *member = rhs->getAs<DependentMemberType>();
4278-
if (!(member && member->getBase()->hasPlaceholder()))
4277+
if (!rhs->isPlaceholder())
42794278
break;
42804279
}
42814280

lib/Sema/ConstraintSystem.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2958,6 +2958,10 @@ Type ConstraintSystem::simplifyTypeImpl(Type type,
29582958
// Simplify the base.
29592959
Type newBase = simplifyTypeImpl(depMemTy->getBase(), getFixedTypeFn);
29602960

2961+
if (newBase->isPlaceholder()) {
2962+
return PlaceholderType::get(getASTContext(), depMemTy);
2963+
}
2964+
29612965
// If nothing changed, we're done.
29622966
if (newBase.getPointer() == depMemTy->getBase().getPointer())
29632967
return type;

0 commit comments

Comments
 (0)