Avatar
Avatar
Iceman
@swift-main import Foundation @propertyWrapper struct WrapperValue<Value> { var value: Value init(wrappedValue: Value) { self.value = wrappedValue } var projectedValue: Self { return self } var wrappedValue: Value { get { self.value } set { self.value = newValue } } func printValue() { print(value) } } class Test { static func test() { (0..<100).map { _ in @WrapperValue var value: Bool = false if value { $value.printValue() // .. compile error on 5.7 } } } }
swiftNightly BOT 6/7/2022 8:18 AM
exit status: 1 with stderr:<stdin>:35:9: error: cannot reference invalid declaration '$value' $value.printValue() // .. compile error on 5.7 ^ <stdin>:32:25: note: '$value' declared here @WrapperValue var value: Bool = false ^