Merge 'Unions' into main#82640
Merged
Merged
Conversation
Relates to test plan dotnet#81074
Relates to test plan: dotnet#81074
First commit is a change that hopefully could be shared with "Closed Hierarchies" feature.
- Null pattern for classes - TryGetValue nullable analysis
Supporting: - ```union <name> ... ```
Align implementation with recent design changes: - Case types are not nullable types (constructor parameter types are unwrapped) - Default nullability of the `Value` property is no longer inferred from constructors. Annotations on the property declaration itself are used as for any regular property.
Contributor
Author
|
@RikkiGibson, @jcouv, @dotnet/roslyn-compiler For a second review |
RikkiGibson
approved these changes
Mar 5, 2026
phil-allen-msft
approved these changes
Mar 7, 2026
This was referenced Mar 16, 2026
mich4xD
pushed a commit
to JohannesMoersch/Functional
that referenced
this pull request
Mar 17, 2026
…n from dotnet/roslyn#82640 Adding Custom roslyn compiler version via csp files Adding performance benchmarks for difference between functional union, new version using native union, and just simple switch using native union
mich4xD
pushed a commit
to JohannesMoersch/Functional
that referenced
this pull request
Mar 17, 2026
…n from dotnet/roslyn#82640 Adding Custom roslyn compiler version via csp files Adding performance benchmarks for difference between functional union, new version using native union, and just simple switch using native union
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.
Championed proposal: dotnet/csharplang#9662
Speclet: https://github.com/dotnet/csharplang/blob/main/proposals/unions.md
Test plan: #81074
The last commit packs enum values
[jcouv notes:] This should make it into .NET 11 SDK Preview 3 and VS 2026 18.6