Skip to content

A YearMonthRange column can't load an exclusive infinity) #258

Closed

Description

@CaffeinatedCoder

Problem

Two small findings from the final pre-release analysis on add665c (pass A):

  1. The non-generic CompareTo's error message breaks on a nested generic type. RangeOrder.cs:58 strips the arity from Type.Name via its backtick, but the name of a nested type inside a generic, such as List<int>.Enumerator, has none. So ((IComparable)range).CompareTo(new List<int>().GetEnumerator()) throws ArgumentOutOfRangeException: length ('-1')… instead of the intended ArgumentException naming both types. It still derives from ArgumentException, so the contract holds, but the message is garbage. Guard on IndexOf being -1.
  2. A YearMonthRange column holding an exclusive infinity) can't be loaded. daterange '[2026-01-01,infinity)' in a YearMonthRange column throws InvalidOperationException ("9999-12-30 is not the last day of a month"). This is older than 10.0.0 and fails loudly. R42 deliberately uses infinity], and the docs/efcore.md advice on open-ended rows names DateRange and LocalDateRange but not YearMonthRange. Document it beside them, or read infinity) as an unbounded month end if the month-alignment rule allows.

Done when

A foreign nested generic argument gives the intended message (test), and docs/efcore.md says what a YearMonthRange column does with an exclusive infinity) (with a claim held by a live test).

Activity

  1. added this to the 10.0.0 milestone on Oct 19, 2026
  2. added
    bugSomething isn't working
    area/rangesRange unions, variants and the shape engines
    package/nodatimeAffects CodoMetis.ValueRanges.NodaTime
    package/efcoreAffects CodoMetis.ValueRanges.EFCore.PostgreSQL
    package/coreAffects CodoMetis.ValueRanges
    severity/lowCosmetic, message or documentation-level difference
    on Oct 19, 2026
  3. CaffeinatedCoder commented on Oct 19, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Part 2 is in #271. It documents the failure rather than reading infinity) as an unbounded month end. [x,infinity) ends on 9999-12-30, part-way through a month, and either month reading changes the row: [x,9999-12] saves back as infinity], and [x,9999-11] drops days. That is the same guess #117 declined for dates. A live test holds all five spellings (absent and inclusive forms load, both exclusive forms throw), and E63 claims it.

  4. changed the title [-]Non-generic CompareTo's message breaks on a nested generic argument; YearMonthRange can't load an exclusive infinity)[/-] [+]A YearMonthRange column can't load an exclusive infinity)[/+] on Oct 19, 2026
  5. CaffeinatedCoder commented on Oct 19, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Split 2026-10-19: part 1 (the non-generic CompareTo message on a nested generic argument) moved to #273, closed by #274. This issue now holds part 2 only, the YearMonthRange exclusive infinity) load, and #271 closes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/rangesRange unions, variants and the shape enginesbugSomething isn't workingpackage/coreAffects CodoMetis.ValueRangespackage/efcoreAffects CodoMetis.ValueRanges.EFCore.PostgreSQLpackage/nodatimeAffects CodoMetis.ValueRanges.NodaTimeseverity/lowCosmetic, message or documentation-level difference

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions