@@ -4009,16 +4009,7 @@ void TypeChecker::validateDecl(ValueDecl *D) {
4009
4009
}
4010
4010
}
4011
4011
4012
- // If we have generic parameters, check the generic signature now.
4013
- if (FD->getGenericParams () || !isa<AccessorDecl>(FD)) {
4014
- validateGenericFuncSignature (FD);
4015
- } else {
4016
- // We've inherited all of the type information already.
4017
- FD->setGenericEnvironment (
4018
- FD->getDeclContext ()->getGenericEnvironmentOfContext ());
4019
-
4020
- FD->computeType ();
4021
- }
4012
+ validateGenericFuncOrSubscriptSignature (FD, FD, FD);
4022
4013
4023
4014
if (!isa<AccessorDecl>(FD) || cast<AccessorDecl>(FD)->isGetter ()) {
4024
4015
auto *TyR = getTypeLocForFunctionResult (FD).getTypeRepr ();
@@ -4132,7 +4123,7 @@ void TypeChecker::validateDecl(ValueDecl *D) {
4132
4123
}
4133
4124
}
4134
4125
4135
- validateGenericFuncSignature ( CD);
4126
+ validateGenericFuncOrSubscriptSignature (CD, CD, CD);
4136
4127
4137
4128
// We want the constructor to be available for name lookup as soon
4138
4129
// as it has a valid interface type.
@@ -4156,7 +4147,7 @@ void TypeChecker::validateDecl(ValueDecl *D) {
4156
4147
4157
4148
checkDeclAttributesEarly (DD);
4158
4149
4159
- validateGenericFuncSignature ( DD);
4150
+ validateGenericFuncOrSubscriptSignature (DD, DD, DD);
4160
4151
4161
4152
DD->setSignatureIsValidated ();
4162
4153
@@ -4169,7 +4160,7 @@ void TypeChecker::validateDecl(ValueDecl *D) {
4169
4160
4170
4161
DeclValidationRAII IBV (SD);
4171
4162
4172
- validateGenericSubscriptSignature ( SD);
4163
+ validateGenericFuncOrSubscriptSignature (SD, SD, SD);
4173
4164
4174
4165
SD->setSignatureIsValidated ();
4175
4166
0 commit comments