Sema: Don't build ErrorTypes in simplifyType()

Instead, just build a new dependent member type with the
simplified base type.
This commit is contained in:
Slava Pestov
2017-06-05 21:43:34 -07:00
parent 1bd91dee5c
commit 56b61ba758

View File

@@ -1700,17 +1700,17 @@ Type simplifyTypeImpl(ConstraintSystem &cs, Type type, Fn getFixedTypeFn) {
lookupBaseType = objectType;
}
if (!lookupBaseType->mayHaveMembers()) return type;
auto subs = lookupBaseType->getContextSubstitutionMap(
if (lookupBaseType->mayHaveMembers()) {
auto subs = lookupBaseType->getContextSubstitutionMap(
cs.DC->getParentModule(),
assocType->getDeclContext());
auto result = assocType->getDeclaredInterfaceType().subst(subs);
assocType->getDeclContext());
auto result = assocType->getDeclaredInterfaceType().subst(subs);
if (result)
return result;
if (result)
return result;
}
return DependentMemberType::get(ErrorType::get(newBase), assocType);
return DependentMemberType::get(lookupBaseType, assocType);
}
return type;