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

React to compiler analyzer warning/error #12837

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ViktorHofer
Copy link
Member

@ViktorHofer ViktorHofer commented Jan 24, 2025

src\System.Private.Windows.Core\src\System\Private\Windows\Core\Nrbf\SerializationRecordExtensions.cs(352,74): error IDE0082: 'typeof' can be converted to 'nameof' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0082) [D:\a_work\1\vmr\src\winforms\src\System.Private.Windows.Core\src\System.Private.Windows.Core.csproj::TargetFramework=net10.0]

Noticed in https://dev.azure.com/dnceng-public/public/_build/results?buildId=927853&view=logs&jobId=4c84be64-8e15-55fe-7f7c-5d9633177e7b&j=4c84be64-8e15-55fe-7f7c-5d9633177e7b&t=d42f7fa6-7dc2-51df-d615-9cb71676e73c

Microsoft Reviewers: Open in CodeFlow

src\System.Private.Windows.Core\src\System\Private\Windows\Core\Nrbf\SerializationRecordExtensions.cs(352,74): error IDE0082: 'typeof' can be converted to 'nameof' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0082) [D:\a\_work\1\vmr\src\winforms\src\System.Private.Windows.Core\src\System.Private.Windows.Core.csproj::TargetFramework=net10.0]
@Tanya-Solyanik
Copy link
Member

Tanya-Solyanik commented Jan 24, 2025

@ViktorHofer - these are not identical. I suppose this is a bug in the analyzer, but it could be suppressed to unblock your build
nameof(List<>) - List
typeof(List<>).Name - List`1

Analyzer had intended to skip generic types - https://github.com/dotnet/roslyn/blob/a0f2e9d81a99b076e8add011704d5ab89267fa59/src/Analyzers/Core/Analyzers/ConvertTypeofToNameof/AbstractConvertTypeOfToNameOfDiagnosticAnalyzer.cs#L63C1-L75C1

@Tanya-Solyanik
Copy link
Member

@ViktorHofer - this change should not be needed after this fix - https://github.com/dotnet/roslyn/pull/76920/files

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.

2 participants