@@ -3939,16 +3939,7 @@ void TypeChecker::validateDecl(ValueDecl *D) {
3939
3939
}
3940
3940
}
3941
3941
3942
- // If we have generic parameters, check the generic signature now.
3943
- if (FD->getGenericParams () || !isa<AccessorDecl>(FD)) {
3944
- validateGenericFuncSignature (FD);
3945
- } else {
3946
- // We've inherited all of the type information already.
3947
- FD->setGenericEnvironment (
3948
- FD->getDeclContext ()->getGenericEnvironmentOfContext ());
3949
-
3950
- FD->computeType ();
3951
- }
3942
+ validateGenericFuncOrSubscriptSignature (FD, FD, FD);
3952
3943
3953
3944
if (!isa<AccessorDecl>(FD) || cast<AccessorDecl>(FD)->isGetter ()) {
3954
3945
auto *TyR = getTypeLocForFunctionResult (FD).getTypeRepr ();
@@ -4079,7 +4070,7 @@ void TypeChecker::validateDecl(ValueDecl *D) {
4079
4070
}
4080
4071
}
4081
4072
4082
- validateGenericFuncSignature ( CD);
4073
+ validateGenericFuncOrSubscriptSignature (CD, CD, CD);
4083
4074
4084
4075
// We want the constructor to be available for name lookup as soon
4085
4076
// as it has a valid interface type.
@@ -4103,7 +4094,7 @@ void TypeChecker::validateDecl(ValueDecl *D) {
4103
4094
4104
4095
checkDeclAttributesEarly (DD);
4105
4096
4106
- validateGenericFuncSignature ( DD);
4097
+ validateGenericFuncOrSubscriptSignature (DD, DD, DD);
4107
4098
4108
4099
DD->setSignatureIsValidated ();
4109
4100
@@ -4116,7 +4107,7 @@ void TypeChecker::validateDecl(ValueDecl *D) {
4116
4107
4117
4108
DeclValidationRAII IBV (SD);
4118
4109
4119
- validateGenericSubscriptSignature ( SD);
4110
+ validateGenericFuncOrSubscriptSignature (SD, SD, SD);
4120
4111
4121
4112
SD->setSignatureIsValidated ();
4122
4113
0 commit comments