1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
|
public protocol Prot {
associatedtype Element
var p : Int { get }
func foo()
func foo1()
}
public class C1 : Prot {
public typealias Element = Int
public var p : Int = 0
public func foo() {}
public __consuming func foo1(i0: __owned Int, i1: __shared Int) {}
public subscript(index: Int) -> Int { return 0 }
public subscript(index i: Float) -> Int { return 0 }
}
public func genfoo<T1 : Prot, T2 : C1>(x ix: T1, y iy: T2) where T1.Element == Int, T2.Element == T1.Element {}
public extension Prot where Self.Element == Int {
func extfoo() {}
}
public enum MyEnum : Int {
case Blah
}
protocol Prot1 {}
typealias C1Alias = C1
extension C1Alias : Prot1 {}
public extension Prot {
public func foo1() {}
}
public struct S1 {
public enum SE {
case a
case b
case c
}
}
public extension S1 {
public func foo1() {}
public struct S2 {
public let b = 1
}
}
@objc
public protocol P2 {
@objc optional func foo1()
}
public protocol P3 {
associatedtype T
}
public struct S2 : P3 {
public typealias T = S2
}
public extension C1 {
public enum C1Cases : Int {
case case1
}
}
public class C2 : C1 {
public func C2foo() {}
}
public extension Prot {
subscript(index: Int) -> Int { return 0 }
}
public protocol P4 {}
extension C1 : P4 {
public func C1foo() {}
public struct C1S1{
public func C1S1foo(a : P4) {}
}
}
// rdar://problem/36553066
public protocol P5 {
associatedtype Element
}
public protocol P6: P5 {}
extension P6 {
public var null: Element? { return nil }
}
public struct S3<Wrapped: P5>: P5 {
public typealias Element = Wrapped.Element
}
extension S3: P6 where Wrapped: P6 {}
/**
some comments
*/
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
public extension C1 {
func addition() {}
}
public struct Box<Wrapped> {
public func boxes() -> [Box<Wrapped.Element>] where Wrapped: Sequence { fatalError() }
}
public protocol P {
func foo()
}
public extension P {
func bar() where Self: Equatable {}
}
public func shouldPrintAnyAsKeyword(x: Any) {}
|