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

Add more details on pattern binding #43574

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

BillWagner
Copy link
Member

@BillWagner BillWagner commented Nov 14, 2024

Fixes #43177

We've had feedback that indicates confusion on how C# parses patterns with multiple and, not, and or patterns. Add more examples that demonstrates the problems. Explain the binding order, and recommend using parentheses when the pattern can be misinterpreted.

Also, do a grammar check.


Internal previews

📄 File 🔗 Preview link
docs/csharp/language-reference/operators/patterns.md Pattern matching - the is and switch expressions, and operators and, or and not in patterns

Fixes dotnet#43177

We've had feedback that indicates confusion on how C# parses patterns with multiple `and`, `not`, and `or` patterns. Add more examples that demonstrates the problems. Explain the binding order, and recommend using parentheses when the pattern can be misinterpreted.

Also, do a grammar check.
@BillWagner BillWagner requested a review from a team as a code owner November 14, 2024 17:16
@dotnetrepoman dotnetrepoman bot added this to the November 2024 milestone Nov 14, 2024
@dotnet-policy-service dotnet-policy-service bot added the okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet-csharp/svc lang-reference/subsvc okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

This article should include a discussion of binding order and logical patterns
1 participant