mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
change includes both the necessary protocol updates and the deprecation warnings suitable for migration. A future patch will remove the renamings and make this a hard error.
25 lines
476 B
Swift
25 lines
476 B
Swift
import Base
|
|
import Lib
|
|
|
|
// Instantiate Counter<Int>, relying on Counter's adoption of SimpleProto.
|
|
public struct OneToAThousand : ProtoUser {
|
|
public typealias Impl = Counter<Int>
|
|
|
|
public var start: Impl {
|
|
return Impl(value: 1)
|
|
}
|
|
|
|
public var end: Impl {
|
|
return Impl(value: 1001)
|
|
}
|
|
|
|
public subscript(i: Impl) -> Int {
|
|
return i.value
|
|
}
|
|
|
|
public init() {}
|
|
}
|
|
|
|
public protocol SpecialProto : ExpressibleByIntegerLiteral {}
|
|
extension Int : SpecialProto {}
|