Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion Proposals/0010-calendar-recurrence-rule-end-count-and-date.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Author(s): Hristo Staykov <[email protected]>
* Review Manager: [Tina Liu](https://github.com/itingliu)
* Status: **Implemented**
* Bugs: <rdar://134294130>
* Bugs: <rdar://134294130&136704624>
* Implementation: [apple/swift-foundation#888](https://github.com/apple/swift-foundation/pull/888)
* Previous Proposal: [SF-0009](0009-calendar-recurrence-rule.md)

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

## Introduction

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

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)`).

Lastly, we also make `Calendar.RecurrenceRule` and its subtypes conform to `Hashable`

## Detailed design

```swift
Expand All @@ -66,6 +69,18 @@ public extension Calendar.RecurrenceRule.End: CustomStringConvertible {
}
}
}

@available(FoundationPreview 6.0.2, *)
public extension Calendar.RecurrenceRule: Hashable { }

@available(FoundationPreview 6.0.2, *)
public extension Calendar.RecurrenceRule.End: Hashable { }

@available(FoundationPreview 6.0.2, *)
public extension Calendar.RecurrenceRule.Month: Hashable { }

@available(FoundationPreview 6.0.2, *)
public extension Calendar.RecurrenceRule.Weekday: Hashable { }
```

## Impact on existing code
Expand Down