Files
swift-mirror/test/Constraints/recursive_concrete_constraints.swift
Joe Pamer d91482ca66 Fix some issues with type parameter resolution.
In a couple of cases, we weren't properly extracting the correct archetype type from generic type parameters.  This was causing various crashes and strange errors throughout the system.  (See rdar://problem/16296421, rdar://problem/16273217, rdar://problem/16329242)

Swift SVN r15213
2014-03-18 23:52:07 +00:00

31 lines
639 B
Swift

// RUN: %swift -parse -verify %s
struct S<A: Collection where A.IndexType == Int> : Collection {
typealias Element = A.GeneratorType.Element
typealias IndexType = A.IndexType
init(base: A, baseRange: Range<IndexType>) {
self.base = base
self.baseRange = baseRange
}
var startIndex: IndexType {
return .from(0)
}
var endIndex: IndexType {
return Swift.count(baseRange)
}
subscript(i: IndexType) -> Element {
return base[baseRange.startIndex + i]
}
func generate() -> IndexingGenerator<S> {
return IndexingGenerator(self)
}
var base: A
var baseRange: Range<A.IndexType>
}