Is it allowed to inherit a property wrapper class? Or should it be a final class?
@propertyWrapper
class Text<Value> {
var wrappedValue: Value
init(wrappedValue: Value) {
self.wrappedValue = wrappedValue
}
}
@propertyWrapper
class Text2<Value>: Text<Value> {
// this cannot compile
// Property wrapper type 'Text2' does not contain a non-static property named 'wrappedValue'
// Since Text2 inherits Text, it does have a property named 'wrappedValue'
}
// however this is OK.
@propertyWrapper
class Text2<Value>: Text<Value> {
override var wrappedValue: Value {
didSet {}
}
}