mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user