AST: Move checkGenericArguments() to AST and rename to checkRequirements()

This commit is contained in:
Slava Pestov
2024-01-16 14:37:58 -05:00
parent a48dc87f86
commit 1e950b1725
11 changed files with 117 additions and 136 deletions

View File

@@ -740,14 +740,14 @@ createDesignatedInitOverride(ClassDecl *classDecl,
// requirements on the base class's own generic parameters that are not
// satisfied by the derived class. In this case, we don't want to inherit
// this initializer; there's no way to call it on the derived class.
auto checkResult = TypeChecker::checkGenericArguments(
auto checkResult = checkRequirements(
classDecl->getParentModule(),
superclassCtorSig.getRequirements(),
[&](Type type) -> Type {
auto substType = type.subst(subMap);
return GenericEnvironment::mapTypeIntoContext(genericEnv, substType);
});
if (checkResult != CheckGenericArgumentsResult::Success)
if (checkResult != CheckRequirementsResult::Success)
return nullptr;
}