Skip to content

Commit 9f73620

Browse files
authored
Merge pull request #18611 from slavapestov/new-test-old-fix
Add regression test for https://bugs.swift.org/browse/SR-5056
2 parents ef04112 + 6459333 commit 9f73620

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/decl/inherit/initializer.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,22 @@ func testClassInGenericFunc<T>(t: T) {
110110
_ = B(t: t)
111111
}
112112

113+
114+
// <https://bugs.swift.org/browse/SR-5056> Required convenience init inhibits inheritance
115+
116+
class SR5056A {
117+
required init(a: Int) {}
118+
}
119+
120+
class SR5056B : SR5056A {
121+
required convenience init(b: Int) {
122+
self.init(a: b)
123+
}
124+
}
125+
126+
class SR5056C : SR5056B {}
127+
128+
func useSR5056C() {
129+
_ = SR5056C(a: 0)
130+
_ = SR5056C(b: 0)
131+
}

0 commit comments

Comments
 (0)