mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Associated type redeclarations occasionally occur to push around associated type witness inference. Suppress the warning about redeclarations that add no requirements (i.e., have neither an inheritance nor a where clause).
36 lines
625 B
Swift
36 lines
625 B
Swift
// RUN: %target-typecheck-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
|
|
}
|
|
}
|