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

Release tracking analyzer doesn't recognize target-typed new #5828

Closed
sharwell opened this issue Jan 31, 2022 · 1 comment · Fixed by #6119
Closed

Release tracking analyzer doesn't recognize target-typed new #5828

sharwell opened this issue Jan 31, 2022 · 1 comment · Fixed by #6119

Comments

@sharwell
Copy link
Member

sharwell commented Jan 31, 2022

Analyzer

Diagnostic ID: RS2003

Analyzer source

SDK: 6.0.100

Version: SDK 6.0.100

Describe the bug

The following change breaks release tracking analyzer recognition of a diagnostic:

-public static readonly DiagnosticDescriptor InvalidShaderField = new DiagnosticDescriptor(
+public static readonly DiagnosticDescriptor InvalidShaderField = new(
     id: "CMPS0001",
     title: "Invalid shader field",
     messageFormat: "The compute shader of type {0} contains a field \"{1}\" of an invalid type {2}",
     category: typeof(IComputeShader).FullName,
     defaultSeverity: DiagnosticSeverity.Error,
     isEnabledByDefault: true,
     description: "A type representing a compute shader contains a field of a type that is not supported in HLSL.",
     helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");

Steps To Reproduce

Revert Sergio0694/ComputeSharp#207 and build ComputeSharp.SourceGenerators.

Expected behavior

Target-typed new works the same way as object creation.

Actual behavior

Target-typed new is not recognized by the analyzer.

Additional context

See Sergio0694/ComputeSharp#207

sharwell added a commit to sharwell/ComputeSharp that referenced this issue Jan 31, 2022
roji added a commit to roji/Npgsql that referenced this issue Feb 16, 2022
roji added a commit to npgsql/npgsql that referenced this issue Feb 16, 2022
roji added a commit to npgsql/npgsql that referenced this issue Feb 16, 2022
Sergio0694 added a commit to CommunityToolkit/dotnet that referenced this issue Feb 22, 2022
feO2x added a commit to Synnotech-AG/Synnotech.Migrations that referenced this issue Apr 12, 2022
acizmarik added a commit to riganti/dotvvm that referenced this issue Feb 3, 2023
@Paul77M
Copy link

Paul77M commented Jun 19, 2023

Note: This has been updated because my original statement was incorrect.
This also occurs when a rule is created by a method (this is being done as a means to make implementations more manageable by reducing the amount of repetitive code and encouraging consistency).

kzrnm added a commit to kzrnm/SourceExpander that referenced this issue Sep 12, 2023
protomorphine pushed a commit to protomorphine/ImmutableAnalyzer that referenced this issue Feb 19, 2024
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.

2 participants