Skip to content

Commit 56b61ba

Browse files
committed
Sema: Don't build ErrorTypes in simplifyType()
Instead, just build a new dependent member type with the simplified base type.
1 parent 1bd91de commit 56b61ba

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,17 +1700,17 @@ Type simplifyTypeImpl(ConstraintSystem &cs, Type type, Fn getFixedTypeFn) {
17001700
lookupBaseType = objectType;
17011701
}
17021702

1703-
if (!lookupBaseType->mayHaveMembers()) return type;
1704-
1705-
auto subs = lookupBaseType->getContextSubstitutionMap(
1703+
if (lookupBaseType->mayHaveMembers()) {
1704+
auto subs = lookupBaseType->getContextSubstitutionMap(
17061705
cs.DC->getParentModule(),
1707-
assocType->getDeclContext());
1708-
auto result = assocType->getDeclaredInterfaceType().subst(subs);
1706+
assocType->getDeclContext());
1707+
auto result = assocType->getDeclaredInterfaceType().subst(subs);
17091708

1710-
if (result)
1711-
return result;
1709+
if (result)
1710+
return result;
1711+
}
17121712

1713-
return DependentMemberType::get(ErrorType::get(newBase), assocType);
1713+
return DependentMemberType::get(lookupBaseType, assocType);
17141714
}
17151715

17161716
return type;

0 commit comments

Comments
 (0)