Files
swift-mirror/test/decl/protocol/indirectly_recursive_requirement.swift
Doug Gregor 3452dda95c [GSB] Stop warning about 'bare' associated type redeclarations.
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).
2017-10-26 14:58:00 -07:00

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
}
}