Hi,
Experimenting with init accessors I ran into the issue of not beeing able to use them from Xcode playgrounds. A simple newly created playground containing only the Angle struct example from the init accessors proposal triggers an expression failed to parse (no further compiler diagnostics) console error when being run. I tried with Xcode 16.3 and Swift 6 as the version playground setting. There are no issues when using this struct in an Xcode project or with Swift REPL, so not sure if this a compiler issue or a playgrounds issue?
struct Angle {
var degrees: Double
var radians: Double {
@storageRestrictions(initializes: degrees)
init(initialValue) {
degrees = initialValue * 180 / .pi
}
get { degrees * .pi / 180 }
set { degrees = newValue * 180 / .pi }
}
init(degrees: Double) {
self.degrees = degrees
}
init(radiansParam: Double) {
self.radians = radiansParam
}
}