Skip to content

Non-generic CompareTo's ArgumentException message breaks on a nested generic argument #273

Closed

Description

@CaffeinatedCoder

Part 1 of #258, split out so it can be closed by its own PR. Part 2 of #258, the YearMonthRange exclusive infinity) load, stays on #258.

Problem

RangeOrder.TypeName strips the arity from Type.Name at its backtick. A type nested inside a generic one, such as List<int>.Enumerator, is generic but has no backtick in its own name. So ((IComparable)range).CompareTo(new List<int>().GetEnumerator()) throws ArgumentOutOfRangeException: length ('-1') must be a non-negative value instead of the intended ArgumentException naming both types. Found by the final pre-release analysis on add665c.

Done when

A foreign nested generic argument gets the intended message, and a test holds it.

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/coreAffects CodoMetis.ValueRanges
    severity/lowCosmetic, message or documentation-level difference
    on Oct 19, 2026
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.ValueRangesseverity/lowCosmetic, message or documentation-level difference

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions