Skip to content

Commit bb24c02

Browse files
committed
[Proposal] SF-0010 Amend proposal to make types Hashable
Update the proposal to also make some of the recently introduced types Hashable.
1 parent 002921d commit bb24c02

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Proposals/0010-calendar-recurrence-rule-end-count-and-date.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Author(s): Hristo Staykov <[email protected]>
66
* Review Manager: [Tina Liu](https://github.com/itingliu)
77
* Status: **Implemented**
8-
* Bugs: <rdar://134294130>
8+
* Bugs: <rdar://134294130&136704624>
99
* Implementation: [apple/swift-foundation#888](https://github.com/apple/swift-foundation/pull/888)
1010
* Previous Proposal: [SF-0009](0009-calendar-recurrence-rule.md)
1111

@@ -14,6 +14,7 @@
1414
* **v1** Initial version
1515
* **v2** Added `CustomStringConvertible` conformance to `Calendar.RecurrenceRule.End`.
1616
* **v3** Renamed `count` to `occurrences`
17+
* **v4** Made `Calendar.RecurrenceRule` conform to `Hashable`
1718

1819
## Introduction
1920

@@ -41,6 +42,8 @@ This is de-facto an enum, but it was declared as struct to be future-proof. Howe
4142

4243
Additionally, we add `CustomStringConvertible` conformance to the struct. Previously, implementation details would be leaked when printing (`End(_guts: Foundation.Calendar.RecurrenceRule.End.(unknown context at $1a0a00afc)._End.never)`).
4344

45+
Lastly, we also make `Calendar.RecurrenceRule` and its subtypes conform to `Hashable`
46+
4447
## Detailed design
4548

4649
```swift
@@ -66,6 +69,15 @@ public extension Calendar.RecurrenceRule.End: CustomStringConvertible {
6669
}
6770
}
6871
}
72+
73+
@available(FoundationPreview 6.0.2, *)
74+
public extension Calendar.RecurrenceRule: Hashable { }
75+
76+
@available(FoundationPreview 6.0.2, *)
77+
public extension Calendar.RecurrenceRule.End: Hashable { }
78+
79+
@available(FoundationPreview 6.0.2, *)
80+
public extension Calendar.RecurrenceRule.Month: Hashable { }
6981
```
7082

7183
## Impact on existing code

0 commit comments

Comments
 (0)