Repository navigation
Negated Types: Remove the concept of control-flow made "fresh" negations - #65286
Draft
Wesley Wigham (weswigham) wants to merge 25 commits into
Draft
Wesley Wigham (weswigham) wants to merge 25 commits into
Wesley Wigham (weswigham) wants to merge 25 commits into
Conversation
…t literal handling
Deduplicate fresh negations against their regular counterparts during union collection and intersection insertion. Preserve the first intersection position and ordered-set membership when replacing a fresh member, while leaving standalone fresh negations eligible for widening. Add compiler coverage for explicit exclusions, generic array narrowing, both union operand orders, and fresh-only widening.
…ntial structures, broaden negation reduction applicability
Wesley Wigham (weswigham)
force-pushed
the
weswigham/negated-types-nonfresh-control-flow
branch
from
November 3, 2026 21:14
4e31f35 to
bf68b75
Compare
…ble location assignment
This branch has not been deployed
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.
This change allows full negated types to be created in control flow, not just "fresh" ones that widen away when a position isn't contextually typed by something implying a need for a negation.
This is going to break any "exact" type matching (eg, DT) on locations where these negations are introduced, but logically shouldn't be too breaky otherwise. The other potential downside is possible performance costs - by unconditionally introducing negations, we're unconditionally growing the number of elements in control-flow produced types, in all branches.