mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Most tests were using %swift or similar substitutions, which did not include the target triple and SDK. The driver was defaulting to the host OS. Thus, we could not run the tests when the standard library was not built for OS X. Swift SVN r24504
38 lines
679 B
Swift
38 lines
679 B
Swift
// RUN: %target-parse-verify-swift
|
|
|
|
protocol P1 {
|
|
func foo() -> Int
|
|
}
|
|
|
|
protocol P2 : P1 {
|
|
func foo() -> Int
|
|
}
|
|
|
|
func f<C : P2> (elements: C) {
|
|
var x: Int = elements.foo() // should not error
|
|
}
|
|
|
|
protocol _CollectionType {
|
|
typealias Index
|
|
|
|
typealias _Element
|
|
subscript(i: Index) -> _Element {get}
|
|
}
|
|
|
|
protocol CollectionType : _CollectionType, SequenceType {
|
|
subscript(i: Index) -> Generator.Element {get}
|
|
}
|
|
|
|
protocol MutableCollectionType : CollectionType {
|
|
subscript(i: Index) -> Generator.Element {get set}
|
|
}
|
|
|
|
func insertionSort<
|
|
C: MutableCollectionType
|
|
>(
|
|
inout elements: C,
|
|
i: C.Index
|
|
) {
|
|
var x: C.Generator.Element = elements[i] // should not error
|
|
}
|