@@ -410,7 +410,7 @@ getSubstitutionsForCallee(SILModule &module, CanSILFunctionType baseCalleeType,
410
410
unsigned baseDepth = 0 ;
411
411
SubstitutionMap baseSubMap;
412
412
if (auto baseClassSig = baseClassDecl->getGenericSignatureOfContext ()) {
413
- baseDepth = baseClassSig.getGenericParams (). back ()-> getDepth () + 1 ;
413
+ baseDepth = baseClassSig.getNextDepth () ;
414
414
415
415
// Compute the type of the base class, starting from the
416
416
// derived class type and the type of the method's self
@@ -435,9 +435,7 @@ getSubstitutionsForCallee(SILModule &module, CanSILFunctionType baseCalleeType,
435
435
436
436
// Add generic parameters from the method itself, ignoring any generic
437
437
// parameters from the derived class.
438
- unsigned origDepth = 0 ;
439
- if (auto calleeClassSig = calleeClassDecl->getGenericSignatureOfContext ())
440
- origDepth = calleeClassSig.getGenericParams ().back ()->getDepth () + 1 ;
438
+ unsigned origDepth = calleeClassDecl->getGenericSignature ().getNextDepth ();
441
439
442
440
auto baseCalleeSig = baseCalleeType->getInvocationGenericSignature ();
443
441
@@ -927,10 +925,8 @@ getWitnessMethodSubstitutions(
927
925
// substitutions for the concrete type's generic parameters.
928
926
auto baseSubMap = conformance->getSubstitutionMap ();
929
927
930
- unsigned baseDepth = 0 ;
931
928
auto *rootConformance = conformance->getRootConformance ();
932
- if (auto conformingTypeSig = rootConformance->getGenericSignature ())
933
- baseDepth = conformingTypeSig.getGenericParams ().back ()->getDepth () + 1 ;
929
+ unsigned baseDepth = rootConformance->getGenericSignature ().getNextDepth ();
934
930
935
931
// witnessThunkSig begins with the optional class 'Self', followed by the
936
932
// generic parameters of the concrete conforming type, followed by the
0 commit comments