File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
validation-test/compiler_crashers_2_fixed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: not %target-swift-frontend %s -typecheck
2
+ protocol VectorIndex {
3
+ associatedtype Vector8 : Vector where Vector8. Index == Self , Vector8. Element == UInt8
4
+ }
5
+ enum VectorIndex1 : VectorIndex {
6
+ case i0
7
+ typealias Vector8 = Vector1 < UInt8 >
8
+ }
9
+ protocol Vector {
10
+ associatedtype Index : VectorIndex
11
+ associatedtype Element
12
+ init ( elementForIndex: ( Index ) -> Element )
13
+ subscript( index: Index ) -> Element { get set }
14
+ }
15
+ struct Vector1 < Element> : Vector {
16
+ //typealias Index = VectorIndex1 // Uncomment this line to workaround bug.
17
+ var e0 : Element
18
+ init ( elementForIndex: ( VectorIndex1 ) -> Element ) {
19
+ e0 = elementForIndex ( . i0)
20
+ }
21
+ subscript( index: Index ) -> Element {
22
+ get { return e0 }
23
+ set { e0 = newValue }
24
+ }
25
+ }
26
+ extension Vector where Index == VectorIndex1 {
27
+ init ( _ e0: Element ) { fatalError ( ) }
28
+ }
You can’t perform that action at this time.
0 commit comments