Dear All, I started a small project to play with the new propertyWrapper feature.
I used a simple sample found to start and got the build error : "Undefined symbol: propwrapper2.counter.getter : Swift.Int" (from the linker)
I cannot figure out how to solve this.
Thank you.
I started a new command line tool project, and please find here is the simple code which is failing at build:
import Foundation
@propertyWrapper
struct Constrained {
private let defaultValue : Value
init ( defaultValue: Value ) {
self.defaultValue = defaultValue
self.wrappedValue = defaultValue
}
var wrappedValue: Value {
didSet {
if self.wrappedValue == 0 {
self.wrappedValue = self.defaultValue
}
}
}
}
@Constrained ( defaultValue: 1)
var counter: Int
counter = 14
print (counter)
counter = 0
print (counter)
counter = 4
print (counter)