Skip to content

Commit 57f7f07

Browse files
authored
Merge pull request #28066 from hamishknight/cyclic-screaming
2 parents 13b0fa9 + 31570f3 commit 57f7f07

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/decl/circularity.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,20 @@ class C3: G1<A>, P {
8585
override func run(a: A) {}
8686
// expected-error@-1 {{method does not override any method from its superclass}}
8787
}
88+
89+
// Another case that triggers circular override checking.
90+
protocol P1 {
91+
associatedtype X = Int // expected-note {{through reference here}}
92+
init(x: X)
93+
}
94+
95+
class C4 {
96+
required init(x: Int) {}
97+
}
98+
99+
class D4 : C4, P1 { // expected-note {{through reference here}}
100+
required init(x: X) { // expected-error {{circular reference}}
101+
// expected-note@-1 2{{through reference here}}
102+
super.init(x: x)
103+
}
104+
}

0 commit comments

Comments
 (0)