Files
swift-mirror/test/Serialization/Inputs/inherited-conformance-user.swift
Jordan Rose 65bd8536bc [serialization] Look for underlying conformances in refined protocol adopters.
That is, if we need a type MyIndex<T> to be a valid ForwardIndex, we should
be able to find it in the conformance for BidirectionalIndex, which inherits
from ForwardIndex.

<rdar://problem/15484898>

Swift SVN r11270
2013-12-13 21:42:51 +00:00

20 lines
389 B
Swift

import Base
// Instantiate Counter<Int>, relying on Counter's adoption of ForwardIndex.
struct OneToAThousand : Indexable {
typealias Element = Int
typealias IndexType = Counter<Int>
func startIndex() -> IndexType {
return IndexType(1)
}
func endIndex() -> IndexType {
return IndexType(1001)
}
func __getitem__(i: IndexType) -> Element {
return i.value
}
}