Skip to content

Commit

Permalink
style: Suppress IDE0078 where it is known to fail
Browse files Browse the repository at this point in the history
This inspection broke some of our code:
dotnet/roslyn#75122

On a side note, it turns out that all inspection-fixers can change
code meaning, so none of the inspections are safe.

IDE0078: Use pattern matching:
https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0078-ide0260
  • Loading branch information
shpaass committed Sep 18, 2024
1 parent 178d81a commit 7c2b103
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Yafc/Windows/ProjectPageSettingsPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ public static void LoadProjectPageFromClipboard() {
deflateStream.CopyTo(ms);
byte[] bytes = ms.GetBuffer();
int index = 0;

#pragma warning disable IDE0078 // Use pattern matching: False positive detection that changes code behavior
if (DataUtils.ReadLine(bytes, ref index) != "YAFC" || DataUtils.ReadLine(bytes, ref index) != "ProjectPage") {
#pragma warning restore IDE0078
throw new InvalidDataException();
}

Expand Down

0 comments on commit 7c2b103

Please # to comment.