Drop the implicit Entity[] to Entity conversion as well - #866
Merged
Conversation
Closes #861. #853 removed the conversion from List<Entity> because it made three params overloads uncallable, and kept the one from Entity[] on the narrow ground that it never produced that ambiguity -- an array binds to the params overload in its normal form by an identity conversion, which wins outright. True, and beside the point, as Happypig375 pointed out on the issue: an array carries an order and can repeat an element, a set has neither, so the conversion silently discarded part of what it was handed. That disqualifies it on its own. The question to ask of an implicit conversion is what it loses, not whether it breaks an overload today, and set types are built explicitly nearly everywhere for this reason. Measured before writing anything: removing it broke exactly one place in the repository, which was the test pinning it. Nothing in the library, no other test, no sample. That test now says the opposite, and still earns its keep the same way -- the file compiling is what says the conversion has not come back. Verified: 6084 C# tests and 130 F# tests pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Rafael-SOWNet
added a commit
that referenced
this pull request
Aug 10, 2026
* Drop the implicit Entity[] to Entity conversion as well Closes #861. #853 removed the conversion from List<Entity> because it made three params overloads uncallable, and kept the one from Entity[] on the narrow ground that it never produced that ambiguity -- an array binds to the params overload in its normal form by an identity conversion, which wins outright. True, and beside the point, as Happypig375 pointed out on the issue: an array carries an order and can repeat an element, a set has neither, so the conversion silently discarded part of what it was handed. That disqualifies it on its own. The question to ask of an implicit conversion is what it loses, not whether it breaks an overload today, and set types are built explicitly nearly everywhere for this reason. Measured before writing anything: removing it broke exactly one place in the repository, which was the test pinning it. Nothing in the library, no other test, no sample. That test now says the opposite, and still earns its keep the same way -- the file compiling is what says the conversion has not come back. Verified: 6084 C# tests and 130 F# tests pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Drop the implicit pair to Interval conversion Closes #867. A two-element tuple became an Interval with both endpoints included. A tuple says nothing about whether either endpoint is in, so the conversion had to supply that, and it chose the reading opposite to the notation: (1, 5) is the open interval in ordinary mathematical writing, and this produced the closed one. A caller writing what looks like an open interval got a closed one, with 1 a member of it, and nothing said so. Where the array conversion removed in #866 dropped information that was there, this one produced information that was not. Same fault from the other side, and the same remedy -- ask for the interval by name, which makes the choice visible instead of assumed: MathS.Interval(1, 5) closed MathS.Interval(1, false, 5, false) open Measured before writing anything: nothing in the library, the tests, the F# wrapper or the utilities used it. Zero compile errors on removal, where #866 had one. The other pairs in the API are left alone, and checked rather than assumed: an integration Range, the arguments of Substitute, the cases of MathS.Piecewise and ToProvided are all ordered pairs whose halves have distinct stated roles. None of them has to guess what it was handed. Verified: 6085 C# tests and 130 F# tests pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <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.
Closes #861.
#853 removed the implicit conversion from
List<Entity>because it made threeparamsoverloads uncallable, and kept the one fromEntity[]on the narrow ground that it never produced that ambiguity — an array binds to theparamsoverload in its normal form by an identity conversion, which wins outright.True, and beside the point. As @Happypig375 put it on the issue:
An array carries an order and can repeat an element; a set has neither. The conversion silently discarded part of what it was handed, and that disqualifies it on its own — the question to ask of an implicit conversion is what it loses, not whether it breaks an overload today.
Blast radius, measured before writing anything
Removing the conversion broke exactly one place in the repository: the test from #853 that pinned it. Nothing in the library, no other test, no sample, no wrapper.
That test now asserts the opposite and still earns its keep the same way — the file compiling is what says the conversion has not come back, which no runtime assertion could catch.
PublicApi.txtupdated, and theBREAKING-CHANGES.mdentry from #853 is widened to cover both conversions as one story, including why keeping this one was the wrong call.Verification
PublicApiSurfaceTestgreenBreaking, so it wants the 2.0 window — which is the whole reason the question was filed rather than left as a comment.
🤖 Generated with Claude Code