Skip to content

fix: RangeSetContains.Equivalent refuses a Contains overload it has no static form for, on 10.x (port of #320, #326) - #436

Merged
CaffeinatedCoder merged 2 commits into
release/10.xfrom
chore/326-rangeset-contains-equivalent-10.x
Oct 25, 2026
Merged

CaffeinatedCoder merged 2 commits into
release/10.xfrom
chore/326-rangeset-contains-equivalent-10.x

Conversation

@CaffeinatedCoder

@CaffeinatedCoder CaffeinatedCoder commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Closes #326

Port of #320 (PR #434, merged into main as 8b32901) to release/10.x, for 10.3.0 (#408). It follows #433's PR #435, merged as 893c632: the refusal is #295's MissingArm, which reached this line with it. Fixed only on this branch, so #326 is closed by hand after the merge.

Problem

RangeSetContains.Equivalent, the copy 10.1.0 ships for #288, sends any one-argument RangeSet.Contains whose operand is neither the set nor an IRange<> to the value overload. An overload added later would fail in the interceptor's Expression.Call with an ArgumentException that names neither the overload nor the missing arm.

Change

  • 99962fe: cherry-pick of d48da78 (-x), unchanged.
    • Equivalent matches each overload by its exact operand type (the set, IRange<T> over the set's element, or T), and throws MissingArm for any other.
    • MissingArm's wording now covers the interceptor too, and so does the AGENTS.md rule.
    • Two tests in MissingArmTests.

Internal, with no answer changes, so there's no changelog row.

Tests

Run on release/10.x with SDK 10.0.402:

  • The four RangeSetContains tests pass (the reflection test over RangeSet of DateRange, Int32Range and TimeRange, plus the refusal).
  • Fix reverted: the refusal test fails, and the reflection test passes on the three existing overloads.
  • Fix reverted, seed applied: the reflection test fails too, with "Contains(StringSet) maps to ValueDateRange,DateOnly".
  • Full runs, on the 10.x: RangeSetContains.Equivalent hands any other one-argument Contains to the value overload (port of #320) #326 branch (which holds both commits), SDK 10.0.402: core 1,399, NodaTime 239, conventions 420, EF translation 323, NodaTime EF translation 91, ASP.NET Core 92, and on the EF floor both integration projects on PostgreSQL 16 and 18 (296 and 4 each), all passing. The newest-patch leg (EF Core 10.0.13, Npgsql EF 10.0.3) could not be run locally: restore fails intermittently on this machine with MSB4181 ("RestoreTask returned false but did not log an error"), and the test hosts kept the floor (deps.json checked), so I did not count those runs. CI ran it: both "EF Core 10.0.13" integration legs pass on this PR, after the step that checks each EF test host resolved 10.0.13.

🤖 Generated with Claude Code

…o static form for (#320)

Equivalent mapped a RangeSet.Contains instance method to its static form by
operand type, and sent every operand that was neither the set nor an IRange<>
to the value form. An overload added later, such as Contains(StringSet), would
then fail in Expression.Call with an ArgumentException naming neither the
overload nor the missing arm. Each overload is now matched by its exact
operand type (the set, IRange<T> over the set's element, or T), and any other
throws MissingArm naming it, as the translators do since #295.

MissingArmTests holds it with a reflection test over every public
one-argument Contains, which a new overload fails, and with an overload that
does not exist.

(cherry picked from commit d48da78)

Ported to release/10.x for #326.

Found-By: RV
Defect-Class: SQL
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@CaffeinatedCoder CaffeinatedCoder added this to the 10.3.0 milestone Oct 25, 2026
@CaffeinatedCoder CaffeinatedCoder added chore Build, CI, packaging, refactoring with no behaviour change area/range-set RangeSet and multirange algebra package/efcore Affects CodoMetis.ValueRanges.EFCore.PostgreSQL stacked Base is another open PR; merge in order, CI does not run until it targets main labels Oct 25, 2026
Base automatically changed from test/433-translator-dispatch-10.x to release/10.x October 25, 2026 14:28
@CaffeinatedCoder CaffeinatedCoder removed the stacked Base is another open PR; merge in order, CI does not run until it targets main label Oct 25, 2026
@CaffeinatedCoder
CaffeinatedCoder merged commit 2dfa587 into release/10.x Oct 25, 2026
10 of 12 checks passed
@CaffeinatedCoder
CaffeinatedCoder deleted the chore/326-rangeset-contains-equivalent-10.x branch October 25, 2026 14:31
@CaffeinatedCoder CaffeinatedCoder mentioned this pull request Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/range-set RangeSet and multirange algebra chore Build, CI, packaging, refactoring with no behaviour change package/efcore Affects CodoMetis.ValueRanges.EFCore.PostgreSQL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant