Skip to content

test: map each translator operand from its declared type, and sweep for it, on 10.x (port of #295, #433) - #435

Merged
CaffeinatedCoder merged 1 commit into
release/10.xfrom
test/433-translator-dispatch-10.x
Oct 25, 2026
Merged

CaffeinatedCoder merged 1 commit into
release/10.xfrom
test/433-translator-dispatch-10.x

Conversation

@CaffeinatedCoder

@CaffeinatedCoder CaffeinatedCoder commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Closes #433

Port of #295 (PR #432, merged into main as 9caa202) to release/10.x, for 10.3.0 (#408). It goes ahead of the 10.x picks of #405, #406 and #191. Fixed only on this branch, so #433 is closed by hand after the merge. #326 (the port of #320) is stacked on this PR.

Problem

On this line the EF translators recognized an overload by its name and argument count, and some mapped an operand from what it wasn't:

  • RangeSet calls: anything that wasn't the multirange or the element became a range.
  • Value set calls: the second operand was always a set.
  • Factories: the bounds were assumed to be the element type.
  • Aggregates: anything that wasn't a multirange source was treated as ranges.

That's right for every overload that exists. An overload added later with another operand type would have been translated as one of them, without an error, and nothing on this line would have noticed.

Change

  • db609eb: cherry-pick of aae116e (-x):
  • The only conflict was the conventions line in AGENTS.md: 10.x's version mentions the NuGet release notes and main's doesn't. I kept 10.x's line and added the translator-dispatch phrase.

No answer changes for any existing overload, and no public API change, so there's no changelog row.

Tests

Run on release/10.x with SDK 10.0.402:

  • TranslatorDispatchSweepTests passes, and MissingArmTests 7/7.
  • Seed applied: the sweep fails with "RangeSet<DateRange, DateOnly>.Contains(StringSet) has no translation for an operand of type StringSet", while all 319 EF translation tests pass.
  • The four translators reverted to release/10.x: all 7 MissingArmTests fail.
  • 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

…erload does not declare (#295)

The translators recognized an overload by its name and argument count, and
mapped an operand from what it was not: a RangeSet operand that was neither
the multirange nor the element became a range, a value set call's second
operand a set, a factory's bounds the element, an aggregate's source ranges.
Every answer was right for the overloads that exist, but one added later
with another operand type would have been translated as one of them, without
an error: RangeSet.Contains(StringSet) became @> over a value set mapped as
a range.

TranslatorDispatchSweepTests (conventions, no database) hands every public
query member over every discovered type to the translator providers of a
real context, one operand per declared parameter type, and requires each
operand mapped as its declared type and the member's own result type. The
translators now map an operand from its declared parameter type and throw
MissingArm, naming the overload, for any other; MissingArmTests holds each
arm with an overload that does not exist. QueryMembers.Close moves from the
translation-support probe so both share it.

(cherry picked from commit aae116e)

Ported to release/10.x for #433.

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 tests Adds or changes tests only (oracles, harnesses); no library code area/ranges Range unions, variants and the shape engines area/range-set RangeSet and multirange algebra area/value-sets Value set families and wrapper arities package/efcore Affects CodoMetis.ValueRanges.EFCore.PostgreSQL package/efcore-nodatime Affects CodoMetis.ValueRanges.EFCore.PostgreSQL.NodaTime labels Oct 25, 2026
@CaffeinatedCoder
CaffeinatedCoder merged commit 893c632 into release/10.x Oct 25, 2026
11 of 13 checks passed
@CaffeinatedCoder
CaffeinatedCoder deleted the test/433-translator-dispatch-10.x branch October 25, 2026 14:28
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 area/ranges Range unions, variants and the shape engines area/value-sets Value set families and wrapper arities package/efcore Affects CodoMetis.ValueRanges.EFCore.PostgreSQL package/efcore-nodatime Affects CodoMetis.ValueRanges.EFCore.PostgreSQL.NodaTime tests Adds or changes tests only (oracles, harnesses); no library code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant