You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is a subsection of a program pulled from the swift test suite.
@propertyWrapper
struct State {
var wrappedValue: Int {
get { 0 }
nonmutating set {}
}
}
struct MutatingDidSet {
@State private var value: Int {
mutating didSet {}
}
mutating func test() {
value = 10
}
}
struct MutatingWillSet {
@State private var value: Int {
mutating willSet {}
}
mutating func test() {
value = 10
}
}
The important things to look at in this program are:
@State private var value: Int {
mutating didSet {}
}
and
@State private var value: Int {
mutating willSet {}
}
More specifically, the mutating keyword in front of the respective didSet/willSet.
This is not derivable in the current grammar due to mutation-modifier missing from the willSet/didSet-clause productions respectively.
Location
https://github.com/apple/swift-book/blob/main/TSPL.docc/ReferenceManual/Declarations.md?plain=1#L568
Description
Below is a subsection of a program pulled from the swift test suite.
The important things to look at in this program are:
and
More specifically, the
mutating
keyword in front of the respective didSet/willSet.This is not derivable in the current grammar due to
mutation-modifier
missing from the willSet/didSet-clause productions respectively.Current grammar:
Correction
Proposed change:
The text was updated successfully, but these errors were encountered: