Skip to content

Check language version for union matching and conversions#82617

Merged
AlekseyTs merged 2 commits into
dotnet:features/Unionsfrom
AlekseyTs:Unions_27
Mar 4, 2026
Merged

Check language version for union matching and conversions#82617
AlekseyTs merged 2 commits into
dotnet:features/Unionsfrom
AlekseyTs:Unions_27

Conversation

@AlekseyTs

Copy link
Copy Markdown
Contributor

No description provided.

@AlekseyTs

Copy link
Copy Markdown
Contributor Author

@RikkiGibson, @jjonescz, @dotnet/roslyn-compiler Please review

@AlekseyTs AlekseyTs changed the title Check language version for union matching Check language version for union matching and conversions Mar 4, 2026
");

comp = CreateCompilation([src, UnionAttributeSource], targetFramework: TargetFramework.NetCoreApp, options: TestOptions.ReleaseExe, parseOptions: TestOptions.RegularNext);
CompileAndVerify(comp, expectedOutput: ExecutionConditionUtil.IsMonoOrCoreClr ? "TrueFalseFalseFalse TrueFalseFalseFalseTrue FalseFalseTrue FalseTrueFalse TrueFalseFalseFalseFalse" : null, verify: Verification.FailsPEVerify).VerifyDiagnostics();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we extract the expected output into a variable to make it clearer it's expected to be the same between both CompileAndVerify calls?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we extract the expected output into a variable to make it clearer it's expected to be the same between both CompileAndVerify calls?

I do not think it is worth doing.

@AlekseyTs AlekseyTs merged commit fda4e9d into dotnet:features/Unions Mar 4, 2026
24 checks passed
333fred added a commit to 333fred/roslyn that referenced this pull request Mar 9, 2026
* upstream/main: (56 commits)
  [main] Source code updates from dotnet/dotnet (dotnet#82655)
  Update insert.yml to use roslyn-tools for insertions (dotnet#82615)
  Localized file check-in by OneLocBuild Task: Build definition ID 327: Build ID 2921538
  Localized file check-in by OneLocBuild Task: Build definition ID 327: Build ID 2921538
  Reduce allocations during source text diffing (dotnet#82462)
  Localized file check-in by OneLocBuild Task: Build definition ID 327: Build ID 2920904
  Localized file check-in by OneLocBuild Task: Build definition ID 327: Build ID 2920904
  Revert "Throw NotImplementedException when a build errorId is not supported" (dotnet#82638)
  [main] Source code updates from dotnet/dotnet (dotnet#82623)
  Revert System.ValueTuple version update (dotnet#82639)
  Pack enum values
  Track non-blocking PROTOTYPE comments for `Unions` feature in an issue (dotnet#82637)
  Update the build system errors instructions for Visual Studio 2026
  Don't log named pipe connection failures as errors in BuildServerConnection (dotnet#82609)
  Fix resx source generator for less common resx metadata and locations (dotnet#81994)
  Disallow `ref` modifier for a union declaration (dotnet#82632)
  Add IFSharpInlineHintsService2 for displayAllOverride support (dotnet#82629)
  Report errors for union members that are not permitted (dotnet#82626)
  Check language version for union matching and conversions (dotnet#82617)
  [main] Update dependencies from dotnet/arcade (dotnet#82618)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants