Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to .NET SDK 8.0.400+ causes style warnings in generated code #1073

Closed
atifaziz opened this issue Sep 18, 2024 · 0 comments · Fixed by #1074
Closed

Updating to .NET SDK 8.0.400+ causes style warnings in generated code #1073

atifaziz opened this issue Sep 18, 2024 · 0 comments · Fixed by #1074

Comments

@atifaziz
Copy link
Member

Updating to .NET SDK 8.0.400 or later seems to cause a regression where style warnings are primarily flagged in the code generated by the docopt.net source generator.

Steps to reproduce

Change the version number in global.json to 8.0.400:

diff --git a/global.json b/global.json
index d031a763..db09cbbe 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
 {
   "sdk": {
-    "version": "8.0.200",
+    "version": "8.0.400",
     "rollForward": "latestPatch"
   }
 }

Build the solution:

dotnet build

The following errors are reported:

A:\MoreLINQ\main\bld\ExtensionsGenerator\ProgramArguments.cs(1,1,1,29): error IDE0240: Nullable directive is redundant (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0240)
A:\MoreLINQ\main\bld\ExtensionsGenerator\ProgramArguments.cs(45,17,45,23): error IDE0010: Populate switch (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0010)
A:\MoreLINQ\main\bld\ExtensionsGenerator\ProgramArguments.cs(69,21,69,27): error IDE0010: Populate switch (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0010)
A:\MoreLINQ\main\bld\ExtensionsGenerator\ProgramArguments.cs(81,37,81,43): error IDE0010: Populate switch (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0010)
A:\MoreLINQ\main\bld\ExtensionsGenerator\ProgramArguments.cs(86,45,86,112): error IDE0058: Expression value is never used (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0058)
A:\MoreLINQ\main\bld\ExtensionsGenerator\ProgramArguments.cs(92,45,92,112): error IDE0058: Expression value is never used (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0058)
A:\MoreLINQ\main\bld\ExtensionsGenerator\ProgramArguments.cs(98,45,98,121): error IDE0058: Expression value is never used (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0058)
A:\MoreLINQ\main\bld\ExtensionsGenerator\ProgramArguments.cs(104,45,104,113): error IDE0058: Expression value is never used (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0058)
A:\MoreLINQ\main\bld\ExtensionsGenerator\ProgramArguments.cs(113,33,113,49): error IDE0058: Expression value is never used (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0058)
A:\MoreLINQ\main\bld\ExtensionsGenerator\ProgramArguments.cs(119,29,119,45): error IDE0058: Expression value is never used (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0058)
A:\MoreLINQ\main\bld\ExtensionsGenerator\ProgramArguments.cs(133,37,133,108): error IDE0058: Expression value is never used (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0058)
A:\MoreLINQ\main\bld\ExtensionsGenerator\ProgramArguments.cs(139,33,139,49): error IDE0058: Expression value is never used (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0058)
A:\MoreLINQ\main\bld\ExtensionsGenerator\ProgramArguments.cs(145,29,145,45): error IDE0058: Expression value is never used (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0058)
A:\MoreLINQ\main\bld\ExtensionsGenerator\ProgramArguments.cs(155,33,155,96): error IDE0058: Expression value is never used (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0058)
A:\MoreLINQ\main\bld\ExtensionsGenerator\ProgramArguments.cs(161,29,161,45): error IDE0058: Expression value is never used (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0058)
A:\MoreLINQ\main\bld\ExtensionsGenerator\ProgramArguments.cs(170,17,170,33): error IDE0058: Expression value is never used (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0058)
A:\MoreLINQ\main\bld\ExtensionsGenerator\ProgramArguments.cs(176,13,176,36): error IDE0058: Expression value is never used (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0058)
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 a pull request may close this issue.

1 participant