You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LocalDateTimeRange.Split(Period) still ends early when a nanosecond period's product overflows #255
area/rangesRange unions, variants and the shape enginesbugSomething isn't workingpackage/nodatimeAffects CodoMetis.ValueRanges.NodaTimeseverity/mediumInconsistency or failure in a narrow scenariosilentAnswers wrongly without throwing — fixes go in the next major, never deferred
#226 (fixing #219) missed a sibling. LocalDateTimeRange.Split(Period) still stops early, without an error, when the step product overflows. NodaPeriods.cs:28 computes checked(period.Nanoseconds * times), RangeSplitting.Steps reads the overflow as the end of the domain, and this call site (LocalDateTimeRange.cs:276) gets no afterPrevious fallback. PR #226 said "the temporal and NodaTime steps can't overflow on the product". That holds for Duration, ticks, days and months, but not for a Period's nanoseconds unit. Found by the final pre-release analysis on add665c (fix review, pass A).
LocalDateTimeRange.CreateFinite(0001-01-01T00:00, 9001-01-01T00:00).Split(Period.FromNanoseconds(1_000_000_000_000_000_000)) (a step of about 31.7 years) gives 10 pieces, the last [0286-03-14T16:00:00,9001-01-01T00:00:00), about 8,700 years wide. Expected: about 284 pieces, none wider than the step.
Change
Pass previous => RangeArithmetic.Checked(() => previous.Plus(step)) as the fallback. Then check every Split/Values(step) call site in core and NodaTime for a product that can overflow without a fallback.
Done when
RangeSplitOracleTests' half-domain case has a LocalDateTimeRange row with a nanosecond period, asserting every piece but the last is one step long, and it fails with the fallback removed.
area/rangesRange unions, variants and the shape enginesbugSomething isn't workingpackage/nodatimeAffects CodoMetis.ValueRanges.NodaTimeseverity/mediumInconsistency or failure in a narrow scenariosilentAnswers wrongly without throwing — fixes go in the next major, never deferred
Activity