Skip to content

UnionType Update - #117

Merged
virzak merged 4 commits into
zompinc:masterfrom
PetarIsakovic:union-types
Sep 12, 2026
Merged

UnionType Update#117
virzak merged 4 commits into
zompinc:masterfrom
PetarIsakovic:union-types

Conversation

@PetarIsakovic

Copy link
Copy Markdown
Contributor

fixes #116

@PetarIsakovic
PetarIsakovic marked this pull request as draft April 16, 2026 16:05
@PetarIsakovic
PetarIsakovic marked this pull request as ready for review April 16, 2026 18:55
PetarIsakovic and others added 4 commits September 12, 2026 10:28
.NET 11 RC1 settles unions as a union declaration backed by
UnionAttribute and IUnion in System.Runtime.CompilerServices, so
declare Operation with the keyword and polyfill both types for
netstandard2.0. A union converts implicitly from each case type, so
the call sites which build an Operation keep master's form.

The keyword needs an SDK of 10.0.300 or later. StyleCop predates
C# 15 and SA1649 throws on a union declaration, so it is off for that
one file. Also restores CRLF in Directory.Packages.props, lost while
resolving the rebase.

Generated with Claude Code
@virzak

virzak commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Rebased onto master and switched Operation to the union keyword, which .NET 11 RC1 supports, with IUnion polyfilled next to UnionAttribute. Needs SDK 10.0.300+; StyleCop's SA1649 crashes on unions, so it's off for Operation.cs.

@virzak
virzak merged commit ed21fb7 into zompinc:master Sep 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider replace N.SourceGenerators.UnionTypes with built-in union types introduced in C# 15

2 participants