Skip to content

Commit 15467ac

Browse files
committed
Merge pull request #1958 from apple/add-test-for-rdar21775089
Add a test for rdar://21775089, which is fixed now
2 parents f7c27ae + 7b03d9c commit 15467ac

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// RUN: %target-swift-frontend %s -emit-ir
2+
3+
struct MySlice<Base : MyIndexableType> : MyCollectionType {}
4+
struct MyMutableSlice<Base : MyMutableCollectionType> : MyMutableCollectionType {}
5+
6+
protocol MySequenceType {}
7+
protocol MyIndexableType {}
8+
9+
protocol MyCollectionType : MySequenceType, MyIndexableType {
10+
typealias SubSequence = MySlice<Self>
11+
func makeSubSequence() -> SubSequence
12+
}
13+
extension MyCollectionType {
14+
func makeSubSequence() -> MySlice<Self> {
15+
typealias S = Self
16+
return MySlice<S>()
17+
}
18+
}
19+
20+
protocol MyMutableCollectionType : MyCollectionType {
21+
typealias SubSequence = MyMutableSlice<Self>
22+
}
23+
extension MyMutableCollectionType {
24+
func makeSubSequence() -> MyMutableSlice<Self> {
25+
typealias S = Self
26+
return MyMutableSlice<S>()
27+
}
28+
}
29+

0 commit comments

Comments
 (0)