mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #28275 from slavapestov/check-where-clause-non-generic-type
Check generic requirements of parent context when realizing non-generic types
This commit is contained in:
@@ -677,8 +677,6 @@ Type ConstraintSystem::openUnboundGenericType(
|
||||
Type type, ConstraintLocatorBuilder locator) {
|
||||
assert(!type->getCanonicalType()->hasTypeParameter());
|
||||
|
||||
checkNestedTypeConstraints(*this, type, locator);
|
||||
|
||||
if (!type->hasUnboundGenericType())
|
||||
return type;
|
||||
|
||||
@@ -1036,6 +1034,8 @@ ConstraintSystem::getTypeOfReference(ValueDecl *value,
|
||||
TypeResolverContext::InExpression,
|
||||
/*isSpecialized=*/false);
|
||||
|
||||
checkNestedTypeConstraints(*this, type, locator);
|
||||
|
||||
// Open the type.
|
||||
type = openUnboundGenericType(type, locator);
|
||||
|
||||
@@ -1289,6 +1289,9 @@ ConstraintSystem::getTypeOfMemberReference(
|
||||
|
||||
auto memberTy = TypeChecker::substMemberTypeWithBase(DC->getParentModule(),
|
||||
typeDecl, baseObjTy);
|
||||
|
||||
checkNestedTypeConstraints(*this, memberTy, locator);
|
||||
|
||||
// Open the type if it was a reference to a generic type.
|
||||
memberTy = openUnboundGenericType(memberTy, locator);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user