dotnet / dotnet/winforms

Possible incorrect use of "NOT ... OR ..." pattern

Open
#14,072 6 comments 0 reactions 1 assignee Claimed by @LeafShi1 View on GitHub
area-VSDesigner
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

Our internal tools are flagging these blocks of code as potentially improper use of the `not ... or ...` pattern matching syntax.

https://github.com/dotnet/winforms/blob/2f677f9560b5258212c721c17f1e8803581608d7/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/ByteViewer.cs#L173-L177

See https://github.com/dotnet/roslyn/issues/75506 for more information on why this pattern is being flagged. If this logic is correct, consider restructuring it to use clarifying `()` parentheses.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.