Skip to content

Commit 54903d2

Browse files
committed
Remove unused PolymorphicFunctionType::substGenericArgs.
NFC.
1 parent 77b7180 commit 54903d2

File tree

2 files changed

+0
-36
lines changed

2 files changed

+0
-36
lines changed

include/swift/AST/Types.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2350,16 +2350,6 @@ class PolymorphicFunctionType : public AnyFunctionType {
23502350

23512351
GenericParamList &getGenericParams() const { return *Params; }
23522352

2353-
/// Substitute the given generic arguments into this polymorphic
2354-
/// function type and return the resulting non-polymorphic type.
2355-
FunctionType *substGenericArgs(ModuleDecl *M, ArrayRef<Type> args);
2356-
2357-
/// Substitute the given generic arguments into this polymorphic
2358-
/// function type and return the resulting non-polymorphic type.
2359-
///
2360-
/// The order of Substitutions must match the order of generic archetypes.
2361-
FunctionType *substGenericArgs(ModuleDecl *M, ArrayRef<Substitution> subs);
2362-
23632353
// Implement isa/cast/dyncast/etc.
23642354
static bool classof(const TypeBase *T) {
23652355
return T->getKind() == TypeKind::PolymorphicFunction;

lib/AST/Type.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,22 +2109,6 @@ PolymorphicFunctionType::getGenericParameters() const {
21092109
return Params->getParams();
21102110
}
21112111

2112-
FunctionType *PolymorphicFunctionType::substGenericArgs(Module *module,
2113-
ArrayRef<Type> args) {
2114-
TypeSubstitutionMap map;
2115-
for (auto &param : getGenericParams().getNestedGenericParams()) {
2116-
map.insert(std::make_pair(param->getArchetype(), args.front()));
2117-
args = args.slice(1);
2118-
}
2119-
2120-
assert(args.empty()
2121-
&& "number of args did not match number of generic params");
2122-
2123-
Type input = getInput().subst(module, map, SubstFlags::IgnoreMissing);
2124-
Type result = getResult().subst(module, map, SubstFlags::IgnoreMissing);
2125-
return FunctionType::get(input, result, getExtInfo());
2126-
}
2127-
21282112
TypeSubstitutionMap
21292113
GenericParamList::getSubstitutionMap(ArrayRef<swift::Substitution> Subs) const {
21302114
TypeSubstitutionMap map;
@@ -2140,16 +2124,6 @@ GenericParamList::getSubstitutionMap(ArrayRef<swift::Substitution> Subs) const {
21402124
return map;
21412125
}
21422126

2143-
FunctionType *PolymorphicFunctionType::substGenericArgs(Module *module,
2144-
ArrayRef<Substitution> subs) {
2145-
TypeSubstitutionMap map
2146-
= getGenericParams().getSubstitutionMap(subs);
2147-
2148-
Type input = getInput().subst(module, map, SubstFlags::IgnoreMissing);
2149-
Type result = getResult().subst(module, map, SubstFlags::IgnoreMissing);
2150-
return FunctionType::get(input, result, getExtInfo());
2151-
}
2152-
21532127
FunctionType *
21542128
GenericFunctionType::substGenericArgs(Module *M, ArrayRef<Type> args) const {
21552129
auto params = getGenericParams();

0 commit comments

Comments
 (0)