This article should include a discussion of binding order and logical patterns #43177
Labels
doc-bug
Problem with the content; needs to be fixed [org][type][category]
dotnet-csharp/svc
in-pr
This issue will be closed (fixed) by an active pull request.
lang-reference/subsvc
okr-quality
Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.
Pri1
High priority, do before Pri2 and Pri3
📌 seQUESTered
Identifies that an issue has been imported into Quest.
Type of issue
Missing information
Description
See dotnet/roslyn#75506 for details.
Developers have written patterns like
is not a or b
thinking it meansis not (a or b)
. However, the binding means this is interpreted asis (not a) or b
.This was discussed in #33397, but that didn't result in changes in this article because the description was about operator precedence not binding order. (Yeah, that's on me, I should have connected those dots. I didn't at the time).
This article should include the information that
not
binds first,and
second, andor
is last. It should include examples, and the general guidance that parentheses can improve the clarity of any pattern matching expression.Page URL
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/patterns
Content source URL
https://github.com/dotnet/docs/blob/main/docs/csharp/language-reference/operators/patterns.md
Document Version Independent Id
312e9c81-ee2a-1d84-64d7-bcaa71d7eab8
Article author
@BillWagner
Metadata
Associated WorkItem - 330547
The text was updated successfully, but these errors were encountered: