Skip to content

Commit e128c24

Browse files
authored
Merge pull request #7788 from DougGregor/sr-4059
2 parents 122d101 + f74763d commit e128c24

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5011,6 +5011,10 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
50115011
return false;
50125012
if (func->isGeneric() != parentFunc->isGeneric())
50135013
return false;
5014+
} else if (auto ctor = dyn_cast<ConstructorDecl>(decl)) {
5015+
auto parentCtor = cast<ConstructorDecl>(parentDecl);
5016+
if (ctor->isGeneric() != parentCtor->isGeneric())
5017+
return false;
50145018
} else if (auto var = dyn_cast<VarDecl>(decl)) {
50155019
auto parentVar = cast<VarDecl>(parentDecl);
50165020
if (var->isStatic() != parentVar->isStatic())
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %target-swift-frontend %s -emit-ir
2+
3+
class Base {
4+
init<S: Sequence>(_ s: S) where S.Iterator.Element == UInt8 { }
5+
}
6+
7+
class Sub: Base {
8+
init(_ b: [UInt8]) { super.init(b) }
9+
}

0 commit comments

Comments
 (0)