@@ -61,29 +61,11 @@ Type QuerySubstitutionMap::operator()(SubstitutableType *type) const {
61
61
FunctionType *
62
62
GenericFunctionType::substGenericArgs (SubstitutionMap subs,
63
63
SubstOptions options) {
64
- return substGenericArgs (
65
- [=](Type t) { return t.subst (subs, options); });
66
- }
67
-
68
- FunctionType *GenericFunctionType::substGenericArgs (
69
- llvm::function_ref<Type(Type)> substFn) const {
70
- llvm::SmallVector<AnyFunctionType::Param, 4 > params;
71
- params.reserve (getNumParams ());
72
-
73
- llvm::transform (getParams (), std::back_inserter (params),
74
- [&](const AnyFunctionType::Param ¶m) {
75
- return param.withType (substFn (param.getPlainType ()));
76
- });
77
-
78
- auto resultTy = substFn (getResult ());
79
-
80
- Type thrownError = getThrownError ();
81
- if (thrownError)
82
- thrownError = substFn (thrownError);
83
-
84
- // Build the resulting (non-generic) function type.
85
- return FunctionType::get (params, resultTy,
86
- getExtInfo ().withThrows (isThrowing (), thrownError));
64
+ // FIXME: Before dropping the signature, we should assert that
65
+ // subs.getGenericSignature() is equal to this function type's
66
+ // generic signature.
67
+ Type fnType = FunctionType::get (getParams (), getResult (), getExtInfo ());
68
+ return fnType.subst (subs, options)->castTo <FunctionType>();
87
69
}
88
70
89
71
CanFunctionType
0 commit comments