File tree Expand file tree Collapse file tree 2 files changed +4
-19
lines changed Expand file tree Collapse file tree 2 files changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -4282,7 +4282,7 @@ void ProtocolDecl::createGenericParamsIfMissing() {
4282
4282
auto selfDecl = new (ctx) GenericTypeParamDecl (
4283
4283
this , selfId,
4284
4284
SourceLoc (),
4285
- GenericTypeParamDecl::InvalidDepth , /* index=*/ 0 );
4285
+ /* depth= */ getGenericContextDepth () + 1 , /* index=*/ 0 );
4286
4286
auto protoType = getDeclaredType ();
4287
4287
TypeLoc selfInherited[1 ] = { TypeLoc::withoutLoc (protoType) };
4288
4288
selfDecl->setInherited (ctx.AllocateCopy (selfInherited));
Original file line number Diff line number Diff line change @@ -7490,29 +7490,14 @@ GenericSignature *GenericSignatureBuilder::computeGenericSignature(
7490
7490
return sig;
7491
7491
}
7492
7492
7493
- // / Add all of the generic parameters from the given parameter list (and it's
7494
- // / outer generic parameter lists) to the given generic signature builder.
7495
- static void addAllGenericParams (GenericSignatureBuilder &builder,
7496
- GenericParamList *genericParams) {
7497
- if (!genericParams) return ;
7498
-
7499
- addAllGenericParams (builder, genericParams->getOuterParameters ());
7500
- for (auto gp : *genericParams)
7501
- builder.addGenericParameter (gp);
7502
- }
7503
-
7504
7493
GenericSignature *GenericSignatureBuilder::computeRequirementSignature (
7505
7494
ProtocolDecl *proto) {
7506
7495
GenericSignatureBuilder builder (proto->getASTContext ());
7507
7496
7508
- if (!proto->hasInterfaceType ()) {
7509
- // FIXME: Overkill.
7510
- if (auto lazyResolver = proto->getASTContext ().getLazyResolver ())
7511
- lazyResolver->resolveDeclSignature (proto);
7512
- }
7513
-
7514
7497
// Add all of the generic parameters.
7515
- addAllGenericParams (builder, proto->getGenericParams ());
7498
+ proto->createGenericParamsIfMissing ();
7499
+ for (auto gp : *proto->getGenericParams ())
7500
+ builder.addGenericParameter (gp);
7516
7501
7517
7502
// Add the conformance of 'self' to the protocol.
7518
7503
auto selfType =
You can’t perform that action at this time.
0 commit comments