File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
validation-test/compiler_crashers_2 Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ // https://github.com/swiftlang/swift/issues/84884
2+ // RUN: not --crash %target-swift-frontend -typecheck %s
3+
4+ protocol Proto < Assoc> {
5+ associatedtype Assoc
6+ }
7+
8+ struct Generic < Assoc> : Proto {
9+ static func foo( _: Generic < Assoc > ) -> Generic < Assoc > { }
10+ static func bar( _: some Proto < Assoc > ) -> Generic < Assoc > { }
11+ }
12+
13+ struct S1 { }
14+ struct S2 { }
15+
16+ extension Proto {
17+ func overload( ) -> some Proto < S1 > where Assoc == S1 {
18+ Generic ( )
19+ }
20+ func overload( ) -> some Proto < S1 > where Assoc == Generic < Generic < S1 > > {
21+ Generic ( )
22+ }
23+ }
24+
25+ struct Struct : Proto {
26+ typealias Assoc = Generic < Generic < S2 > >
27+ init ( _: Int ) { }
28+ }
29+
30+ func test( ) {
31+ let _ = Generic . foo ( Generic . bar ( Struct ( 0 ) . overload ( ) )
32+ }
You can’t perform that action at this time.
0 commit comments