Skip to content

Commit a082972

Browse files
committed
---
yaml --- r: 315325 b: refs/heads/master-next c: 2eb31fa h: refs/heads/master i: 315323: 4f71789
1 parent 000c68a commit a082972

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 3fe9333052029c114ef816ea805c335eb1ee8a99
3-
refs/heads/master-next: a06e5d0d2eb9d9883da6230df7a04ea7cde0b34f
3+
refs/heads/master-next: 2eb31facf7c56fbdf1eb0edd2d7ec325592d22c3
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/lib/Sema/CodeSynthesis.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -648,20 +648,27 @@ createDesignatedInitOverride(ClassDecl *classDecl,
648648
// Determine the initializer parameters.
649649

650650
// 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);
654657

655658
// If the superclass is generic, we need to map the superclass constructor's
656659
// parameter types into the generic context of our class.
657660
//
658661
// We might have to apply substitutions, if for example we have a declaration
659662
// 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();
662668
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);
665672
}
666673

667674
// Create the initializer declaration, inheriting the name,

0 commit comments

Comments
 (0)