dotnet/roslyn

Red squiggly line in VS when diagnostic is suppressed

オープン

#57,041 opened on 2021/10/08

 (4 件のコメント) (2 件のリアクション) (0 人の担当者)C# (4,257 件のフォーク)batch import
Area-AnalyzersBughelp wanted

Repository metrics

Stars
 (20,414 個のスター)
PR merge metrics
 (平均マージ 6d 17h) (30d で 256 merged PRs)

説明

Version Used:

Microsoft Visual Studio Enterprise 2019 Version 16.11.3 Microsoft.CodeAnalysis Version 3.11.0

Steps to Reproduce:

This solution reproduces the issue: https://github.com/dotnet/roslyn/files/7303368/DUTester.zip It's using TreatWarningsAsErrors, meaning the reported CS8509 would fail the build.

  1. At line 14 in Program.cs there is a switch expression which reports a CS8509 warning. The warning is suppressed by another analyzer because it's a discriminated union, where the other analyzer checked that all cases are handled.

Expected Behavior: No squiggly lines on the switch expression

Actual Behavior: Squiggly lines on the switch expression. The build still succeeds, so it appears to be a visualization issue in VS.

コントリビューターガイド