Skip to content

Commit 0f232b3

Browse files
committed
CHANGELOG entry for SE-0091
1 parent ab3a15c commit 0f232b3

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,33 @@ Note: This is in reverse chronological order, so newer entries are added to the
33
Swift 3.0
44
---------
55

6+
* [SE-0091](https://github.com/apple/swift-evolution/blob/master/proposals/0091-improving-operators-in-protocols.md):
7+
Operators can now be defined within types or extensions thereof. For example:
8+
9+
```swift
10+
struct Foo: Equatable {
11+
let value: Int
12+
13+
static func ==(lhs: Foo, rhs: Foo) -> Bool {
14+
return lhs.value == rhs.value
15+
}
16+
}
17+
```
18+
19+
Such operators must be declared as `static` (or, within a class, `class
20+
final`), and have the same signature as their global counterparts. As part of
21+
this change, operator requirements declared in protocols must also be
22+
explicitly declared `static`:
23+
24+
```swift
25+
protocol Equatable {
26+
static func ==(lhs: Self, rhs: Self) -> Bool
27+
}
28+
```
29+
30+
Note that the type checker performance optimization described by SE-0091 is
31+
not yet implemented.
32+
633
* [SE-0099](https://github.com/apple/swift-evolution/blob/master/proposals/0099-conditionclauses.md):
734
Condition clauses in `if`, `guard`, and `while` statements now use a more
835
regular syntax. Each pattern or optional binding must be prefixed with `case`

0 commit comments

Comments
 (0)