@@ -648,20 +648,27 @@ createDesignatedInitOverride(ClassDecl *classDecl,
648
648
// Determine the initializer parameters.
649
649
650
650
// Create the initializer parameter patterns.
651
- OptionSet<ParameterList::CloneFlags> options = ParameterList::Implicit;
652
- options |= ParameterList::Inherited;
653
- auto *bodyParams = superclassCtor->getParameters ()->clone (ctx, options);
651
+ OptionSet<ParameterList::CloneFlags> options
652
+ = (ParameterList::Implicit |
653
+ ParameterList::Inherited |
654
+ ParameterList::WithoutTypes);
655
+ auto *superclassParams = superclassCtor->getParameters ();
656
+ auto *bodyParams = superclassParams->clone (ctx, options);
654
657
655
658
// If the superclass is generic, we need to map the superclass constructor's
656
659
// parameter types into the generic context of our class.
657
660
//
658
661
// We might have to apply substitutions, if for example we have a declaration
659
662
// like 'class A : B<Int>'.
660
- for (auto *decl : *bodyParams) {
661
- auto paramTy = decl->getInterfaceType ();
663
+ for (unsigned idx : range (superclassParams->size ())) {
664
+ auto *superclassParam = superclassParams->get (idx);
665
+ auto *bodyParam = bodyParams->get (idx);
666
+
667
+ auto paramTy = superclassParam->getInterfaceType ();
662
668
auto substTy = paramTy.subst (subMap, SubstFlags::UseErrorType);
663
- decl->setInterfaceType (substTy);
664
- decl->getTypeLoc () = TypeLoc::withoutLoc (substTy);
669
+
670
+ bodyParam->setInterfaceType (substTy);
671
+ bodyParam->getTypeLoc () = TypeLoc::withoutLoc (substTy);
665
672
}
666
673
667
674
// Create the initializer declaration, inheriting the name,
0 commit comments