mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
36 lines
621 B
Swift
36 lines
621 B
Swift
// RUN: %target-parse-verify-swift
|
|
|
|
protocol Incrementable {
|
|
func successor() -> Self
|
|
}
|
|
|
|
protocol _ForwardIndex {
|
|
associatedtype Distance = MyInt
|
|
}
|
|
|
|
protocol ForwardIndex : _ForwardIndex {
|
|
}
|
|
|
|
protocol _BidirectionalIndex : _ForwardIndex {
|
|
func predecessor() -> Self
|
|
}
|
|
|
|
protocol BidirectionalIndex : ForwardIndex, _BidirectionalIndex {
|
|
}
|
|
|
|
protocol _RandomAccessIndex : _BidirectionalIndex {
|
|
associatedtype Distance
|
|
}
|
|
|
|
protocol RandomAccessIndex
|
|
: BidirectionalIndex, _RandomAccessIndex {}
|
|
|
|
struct MyInt : RandomAccessIndex
|
|
{
|
|
typealias Distance = MyInt
|
|
|
|
func predecessor() -> MyInt {
|
|
return self
|
|
}
|
|
}
|