Skip to content

Add .count and .date properties to Calendar.RecurrenceRule.End #888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

hristost
Copy link
Contributor

Calendar.RecurrenceRule.End is de-facto an enum, but has been implemented as a struct so we can more easily extend it in the future without breaking ABI. Sadly the current API only provides a way to construct the struct, and does not let us introspect the associated values. This change adds a couple read-only properties to the struct to address this.

@hristost
Copy link
Contributor Author

hristost commented Aug 28, 2024

Pending approval of #893

@hristost hristost force-pushed the hs/calendar-recurrence-rule-update-end-impl branch 2 times, most recently from 49879f1 to 348227a Compare September 11, 2024 01:57
@hristost hristost marked this pull request as ready for review September 11, 2024 01:57
@hristost
Copy link
Contributor Author

@swift-ci run

@hristost
Copy link
Contributor Author

@swift-ci please test

`Calendar.RecurrenceRule.End` is de-facto an enum, but has been implemented as a
struct so we can more easily extend it in the future without breaking ABI. Sadly
the current API only provides a way to construct the struct, and does not let us
introspect the associated values. This change adds a couple read-only properties
to the struct to address this.

While at it, we also make the struct conform to `CustomStringConvertible`, so it
doesn't leak implementation details when it's printed in the debugger.
@hristost hristost force-pushed the hs/calendar-recurrence-rule-update-end-impl branch from 348227a to f0af6cf Compare September 11, 2024 19:11
@hristost
Copy link
Contributor Author

@swift-ci please test

@jmschonfeld
Copy link
Contributor

@swift-ci please test

@hristost hristost merged commit 79dc309 into swiftlang:main Sep 14, 2024
3 checks passed
cthielen pushed a commit to cthielen/swift-foundation that referenced this pull request Nov 8, 2024
…wiftlang#888)

`Calendar.RecurrenceRule.End` is de-facto an enum, but has been implemented as a
struct so we can more easily extend it in the future without breaking ABI. Sadly
the current API only provides a way to construct the struct, and does not let us
introspect the associated values. This change adds a couple read-only properties
to the struct to address this.

While at it, we also make the struct conform to `CustomStringConvertible`, so it
doesn't leak implementation details when it's printed in the debugger.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants