Skip to content

Handle possible Overflow values on individual calendars#7795

Merged
Manishearth merged 4 commits intounicode-org:mainfrom
Manishearth:overflow-defaults-per-calendar
Mar 20, 2026
Merged

Handle possible Overflow values on individual calendars#7795
Manishearth merged 4 commits intounicode-org:mainfrom
Manishearth:overflow-defaults-per-calendar

Conversation

@Manishearth
Copy link
Member

Fixes #7794.

overflow takes three values: Constrain, Reject, and None. None is equivalent to Constrain, but we don't have a ResolvedOptions type to fix that distinction.

Almost all of overflow-consuming code is matching the Temporal spec, and the Temporal spec handles unset values correctly, so this is by and large not a problem.

However, calendar-specific code is not specced by Temporal, and any place where we handle overflows there needs to handle all cases.

@sffc and I discussed this and using match statements seemed to be the most straightforward option. We could in theory introduce ResolvedOptions or pre-handle the None but most of the code is written to match the spec so this would actually potentially make the spec-matching less clear.

Changelog

icu_calendar: Handle possible Overflow values on individual calendars

@Manishearth Manishearth force-pushed the overflow-defaults-per-calendar branch from d64a513 to af5f959 Compare March 19, 2026 22:03
Manishearth and others added 2 commits March 19, 2026 15:21
Co-authored-by: Shane F. Carr <shane@unicode.org>
@Manishearth Manishearth requested a review from sffc March 19, 2026 22:22
@Manishearth Manishearth enabled auto-merge (squash) March 19, 2026 22:23
@Manishearth Manishearth requested a review from sffc March 19, 2026 22:46
@Manishearth Manishearth merged commit 56afe56 into unicode-org:main Mar 20, 2026
34 checks passed
@Manishearth Manishearth deleted the overflow-defaults-per-calendar branch March 20, 2026 00:52
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.

Adding 1 year to Adar I fails in non-leap year

2 participants