File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed
validation-test/compiler_crashers_2_fixed Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-frontend -typecheck %s
2
+
3
+ protocol P {
4
+ associatedtype A
5
+ }
6
+
7
+ struct S1 : P {
8
+ typealias A = Int
9
+ }
10
+
11
+ struct S2 < G: P > : P {
12
+ typealias A = G . A
13
+ }
14
+
15
+ struct S3 < G: P > {
16
+ }
17
+
18
+ extension S3 where G == S2 < S1 > {
19
+ typealias B = G . A
20
+ }
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-frontend -typecheck %s
2
+
3
+ protocol Tuple {
4
+ associatedtype Head
5
+ associatedtype Tail : Tuple
6
+ }
7
+
8
+ extension Pair : Tuple where Second : Tuple {
9
+ typealias Head = First
10
+ typealias Tail = Second
11
+ }
12
+
13
+ protocol HomogeneousTuple : Tuple , Collection
14
+ where Tail : HomogeneousTuple , Head == Tail . Head { }
15
+
16
+ extension HomogeneousTuple {
17
+ typealias Element = Head
18
+ typealias Index = Int
19
+
20
+ var startIndex : Int { return 0 }
21
+ var endIndex : Int { return 0 }
22
+ func index( after i: Int ) -> Int { return i + 1 }
23
+
24
+ subscript( n: Int ) -> Head {
25
+ fatalError ( )
26
+ }
27
+ }
28
+
29
+ extension Pair : Sequence , Collection , HomogeneousTuple
30
+ where Second : HomogeneousTuple , First == Second . Head {
31
+ typealias Iterator = IndexingIterator < Pair < Head , Tail > >
32
+ }
33
+
34
+ struct Pair < First, Second> { }
You can’t perform that action at this time.
0 commit comments