Conversation
…coding The four facts the fork's #14445 investigation wrote against the defect this branch fixes: a pre-1601 instant round-trips, a present-day instant keeps its ticks and its UTC kind, a List element before 1601 round-trips through the collection arm, and a model beyond the DateTime range throws OverflowException naming the symbol. Environments are declared locally and name their symbol D, so the guard is pinned on a second name besides the X1 of SymbolTypeMarshallingTests. One adaptation to this branch: the beyond-range bound is captured into a local (as SymbolTypeMarshallingTests already does) because a static field member is not partial-evaluated away here. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked test PR from the downstream fork (MyIntelligenceAgency/Z3.Linq): the DateTime round-trip suite we wrote against the defect this PR fixes, ported onto this branch's harness — an independent double-check from the outside, with shapes chosen before we ever saw your fix.
What it adds
Four facts in
solutions/Z3.Linq.Tests/DateTimeRoundTripTests.cs, our #14445 investigation reduced to tests:Solve_DateTimeBefore1601_RoundTripsSolve_DateTime_RoundTripsAsUtcWithSameTicksDateTimeKind.Utc— the two asserted separately, so a local-time read cannot pass as a UTC one on any runnerSolve_DateTimeListBefore1601_RoundTripsEveryElementList<DateTime>— the collection arm (complements yourDateTime[]test with the List environment)Solve_DateTimeBeyondRange_ThrowsNamingTheSymbol> maxthrowsOverflowExceptionnaming the symbolThe environments are declared locally and name their symbol
D, so the guard's message is pinned on a second name besides theX1ofSymbolTypeMarshallingTests— the same guarantee with a different label.One adaptation
The beyond-range bound is captured into a local first (
DateTime max = DateTime.MaxValue;), exactly asSymbolTypeMarshallingTestsalready does: a static field member in the tree is not partial-evaluated away on this branch, and translation refuses it (NotSupportedException). Worth knowing if anyone writes the bound inline in a notebook later.Red on
feature/xml-docs(this PR's base), same suite, same machineThe fourth test (
RoundTripsAsUtcWithSameTicks) passes on the base as well — that is the #56 behaviour this PR deliberately preserves, and the port pins it so the fix cannot regress it in passing.Green on this branch
(254 from this PR's suite + the 4 ported;
dotnet runon the MTP project, net10.0, win-x64.)🤖 Generated with Claude Code