Skip to content

Commit b5fe792

Browse files
committed
Add regression test for rdar://25412647.
1 parent b332321 commit b5fe792

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/Interpreter/classes.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,23 @@ print((b as Bank).transferMoney(Account(owner: "A"), to: Account(owner: "B")))
170170
print((b as Bank).transferMoney(nil, to: nil))
171171
print((b as Bank).deposit(Account(owner: "Cyberdyne Systems")))
172172
print((b as Bank).deposit(Account(owner: "A")))
173+
174+
// rdar://25412647
175+
176+
private class Parent <T> {
177+
func doSomething() {
178+
overriddenMethod()
179+
}
180+
181+
func overriddenMethod() {
182+
fatalError("You should override this method in child class")
183+
}
184+
}
185+
186+
private class Child: Parent<String> {
187+
override func overriddenMethod() {
188+
print("Heaven!")
189+
}
190+
}
191+
192+
Child().doSomething() // CHECK: Heaven!

0 commit comments

Comments
 (0)