I'm trying to run a playground with some standard propertyWrapper code taken directly from the Swift Guide (5.1). I've just upgraded to Xcode 11.4.1. The code is straight from the book (Properties chapter) and it used to run fine.
@propertyWrapper struct TwelveOrLess {
private var number = 0
var wrappedValue: Int {
get { return number }
set { number = min(newValue, 12)}
}
}
Now, however, I'm getting this error:
error: private initializer 'init(number:)' cannot have more restrictive access than its enclosing property wrapper type 'TwelveOrLess' (which is internal)
@propertyWrapper struct TwelveOrLess {
^
Any ideas?
Thanks.