Skip to content

Commit fe14b0f

Browse files
committed
[Changelog] Remove workaround for SR-11298
1 parent 528558d commit fe14b0f

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

CHANGELOG.md

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -80,40 +80,6 @@ Swift 5.2
8080
}
8181
}
8282
```
83-
84-
As a result, this could lead to code that currently compiles today to throw an error.
85-
86-
```swift
87-
protocol Foo {
88-
var someProperty: Int { get set }
89-
}
90-
91-
class Bar: Foo {
92-
var someProperty = 0
93-
}
94-
95-
extension Foo where Self: Bar {
96-
var anotherProperty1: Int {
97-
get { return someProperty }
98-
// This will now error, because the protocol requirement
99-
// is implicitly mutating and the setter is implicitly
100-
// nonmutating.
101-
set { someProperty = newValue } // Error
102-
}
103-
}
104-
```
105-
106-
**Workaround**: Define a new mutable variable inside the setter that has a reference to `self`:
107-
108-
```swift
109-
var anotherProperty1: Int {
110-
get { return someProperty }
111-
set {
112-
var mutableSelf = self
113-
mutableSelf.someProperty = newValue // Okay
114-
}
115-
}
116-
```
11783

11884
* [SE-0253][]:
11985

0 commit comments

Comments
 (0)