mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #27436 from CodaFi/signed-sealed-delivered
[NFC] Adopt TypeBase-isms for GenericSignature
This commit is contained in:
@@ -597,7 +597,7 @@ static void checkNestedTypeConstraints(ConstraintSystem &cs, Type type,
|
||||
extension);
|
||||
}
|
||||
|
||||
if (auto *signature = decl->getGenericSignature()) {
|
||||
if (auto signature = decl->getGenericSignature()) {
|
||||
cs.openGenericRequirements(
|
||||
extension, signature, /*skipProtocolSelfConstraint*/ true, locator,
|
||||
[&](Type type) {
|
||||
@@ -675,7 +675,7 @@ FunctionType *ConstraintSystem::openFunctionType(
|
||||
OpenedTypeMap &replacements,
|
||||
DeclContext *outerDC) {
|
||||
if (auto *genericFn = funcType->getAs<GenericFunctionType>()) {
|
||||
auto *signature = genericFn->getGenericSignature();
|
||||
auto signature = genericFn->getGenericSignature();
|
||||
|
||||
openGenericParameters(outerDC, signature, replacements, locator);
|
||||
|
||||
@@ -1082,7 +1082,7 @@ static void bindArchetypesFromContext(
|
||||
}
|
||||
|
||||
// If it's not generic, there's nothing to do.
|
||||
auto *genericSig = parentDC->getGenericSignatureOfContext();
|
||||
auto genericSig = parentDC->getGenericSignatureOfContext();
|
||||
if (!genericSig)
|
||||
break;
|
||||
|
||||
@@ -1097,10 +1097,10 @@ static void bindArchetypesFromContext(
|
||||
|
||||
void ConstraintSystem::openGeneric(
|
||||
DeclContext *outerDC,
|
||||
GenericSignature *sig,
|
||||
GenericSignature sig,
|
||||
ConstraintLocatorBuilder locator,
|
||||
OpenedTypeMap &replacements) {
|
||||
if (sig == nullptr)
|
||||
if (!sig)
|
||||
return;
|
||||
|
||||
openGenericParameters(outerDC, sig, replacements, locator);
|
||||
@@ -1112,7 +1112,7 @@ void ConstraintSystem::openGeneric(
|
||||
}
|
||||
|
||||
void ConstraintSystem::openGenericParameters(DeclContext *outerDC,
|
||||
GenericSignature *sig,
|
||||
GenericSignature sig,
|
||||
OpenedTypeMap &replacements,
|
||||
ConstraintLocatorBuilder locator) {
|
||||
assert(sig);
|
||||
@@ -1137,7 +1137,7 @@ void ConstraintSystem::openGenericParameters(DeclContext *outerDC,
|
||||
}
|
||||
|
||||
void ConstraintSystem::openGenericRequirements(
|
||||
DeclContext *outerDC, GenericSignature *signature,
|
||||
DeclContext *outerDC, GenericSignature signature,
|
||||
bool skipProtocolSelfConstraint, ConstraintLocatorBuilder locator,
|
||||
llvm::function_ref<Type(Type)> substFn) {
|
||||
auto requirements = signature->getRequirements();
|
||||
@@ -1312,7 +1312,7 @@ ConstraintSystem::getTypeOfMemberReference(
|
||||
|
||||
// If the storage is generic, add a generic signature.
|
||||
FunctionType::Param selfParam(selfTy, Identifier(), selfFlags);
|
||||
if (auto *sig = innerDC->getGenericSignatureOfContext()) {
|
||||
if (auto sig = innerDC->getGenericSignatureOfContext()) {
|
||||
funcType = GenericFunctionType::get(sig, {selfParam}, refType);
|
||||
} else {
|
||||
funcType = FunctionType::get({selfParam}, refType);
|
||||
|
||||
Reference in New Issue
Block a user