mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
30 lines
571 B
Swift
30 lines
571 B
Swift
// RUN: %target-swift-frontend -emit-ir %s
|
|
|
|
// https://github.com/apple/swift/issues/53454
|
|
|
|
struct MyText<V> {
|
|
let label: String
|
|
let value: V
|
|
}
|
|
|
|
extension MyText where V == Void {
|
|
init(_ label: String, defaulted: Int = 17) {
|
|
self.label = label
|
|
self.value = ()
|
|
}
|
|
}
|
|
|
|
struct ImagePulse {
|
|
@Inspectable(control: { MyText("duration") })
|
|
var test: Double = 0
|
|
}
|
|
|
|
@propertyWrapper
|
|
final class Inspectable<Value> {
|
|
var wrappedValue: Value
|
|
|
|
init<V>(wrappedValue initialValue: Value, control: @escaping () -> V) {
|
|
self.wrappedValue = initialValue
|
|
}
|
|
}
|