@@ -434,7 +434,7 @@ computeDesignatedInitOverrideSignature(ASTContext &ctx,
434
434
ClassDecl *classDecl,
435
435
Type superclassTy,
436
436
ConstructorDecl *superclassCtor) {
437
- auto *superclassDecl = superclassTy->getAnyNominal ();
437
+ auto *superclassDecl = superclassTy->getClassOrBoundGenericClass ();
438
438
439
439
auto classSig = classDecl->getGenericSignature ();
440
440
auto superclassCtorSig = superclassCtor->getGenericSignature ();
@@ -515,11 +515,6 @@ computeDesignatedInitOverrideSignature(ASTContext &ctx,
515
515
return ProtocolConformanceRef (proto);
516
516
};
517
517
518
- // Now form the substitution map that will be used to remap parameter
519
- // types.
520
- auto subMap = SubstitutionMap::get (superclassCtorSig,
521
- substFn, lookupConformanceFn);
522
-
523
518
SmallVector<Requirement, 2 > requirements;
524
519
525
520
// If the base initializer's generic signature is different
@@ -540,6 +535,11 @@ computeDesignatedInitOverrideSignature(ASTContext &ctx,
540
535
std::move (requirements));
541
536
}
542
537
538
+ // Now form the substitution map that will be used to remap parameter
539
+ // types.
540
+ auto subMap = SubstitutionMap::getOverrideSubstitutions (
541
+ superclassDecl, classDecl, superclassCtorSig, genericParams);
542
+
543
543
return DesignatedInitOverrideInfo{genericSig, genericParams, subMap};
544
544
}
545
545
0 commit comments