Skip to content

Commit f9d1f70

Browse files
committed
[SR-12236] Commit a regression test
This is technically a source break, but it was always a circularity issue. It will compile fine in isolation, but all attempts to lookup nested type via qualified lookup (e.g. witness matching) will re-enter themselves and potentially produce inconsistent results. Commit a regression test so we nail down this behavior to see if we can revisit this.
1 parent 9e8d65f commit f9d1f70

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/decl/circularity.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,11 @@ class D4 : C4, P1 { // expected-note 2 {{through reference here}}
102102
super.init(x: x)
103103
}
104104
}
105+
106+
// SR-12236
107+
// N.B. This used to compile in 5.1.
108+
protocol SR12236 { }
109+
class SR12236_A { // expected-note {{through reference here}}
110+
typealias Nest = SR12236 // expected-error {{circular reference}} expected-note {{through reference here}}
111+
}
112+
extension SR12236_A: SR12236_A.Nest { }

0 commit comments

Comments
 (0)