mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
25 lines
568 B
Swift
25 lines
568 B
Swift
// RUN: %target-swift-frontend %s -emit-ir
|
|
|
|
// https://github.com/apple/swift/issues/43107
|
|
|
|
enum Value {
|
|
case IntValue(Int)
|
|
}
|
|
|
|
protocol Storable {
|
|
associatedtype Representation
|
|
|
|
static var storageKey : String? { get }
|
|
var representation : Representation { get }
|
|
}
|
|
|
|
protocol RawProducable {
|
|
var rawValueForType : Int16 { get }
|
|
init<T: Storable>(value: T) where T.Representation == Self
|
|
}
|
|
|
|
extension Int : Storable {
|
|
static var storageKey : String? { return "int64Value" }
|
|
var representation : Value { return Value.IntValue(self) }
|
|
}
|