@propertyWrapper
public struct Noisy {
private var value: Int
public init(wrappedValue: Int) {
value = wrappedValue
}
public var wrappedValue: Int {
get { print("get!"); return value }
set { print("set!"); value = newValue }
}
}
class Test {
@Noisy var foo: Int = 0
func getAndSet() {
print("got: \(self.foo)")
self.foo = 42
print("done")
}
}
class Subclass: Test {
override var foo: Int {
get { print("subclass get"); return super.foo }
set { print("subclass set"); super.foo = newValue }
}
}
let x = Test()
x.getAndSet()
print("---")
let y = Subclass()
y.getAndSet()
Additional Detail from JIRA
md5: 48a06e1299be6c2c32b826a45becc35c
Issue Description:
This prints
Notice the lack of "subclass set".
The text was updated successfully, but these errors were encountered: