Skip to content

Conversation

@BillWagner
Copy link
Member

@BillWagner BillWagner commented Jan 30, 2026

Fixes dotnet#50888

Readers had misinterpreted the list of operator precedence as an absolute list, rather than a list of groups.

Clarify that within the same group, operators are evaluated in lexical order. Clarify that each list is a group with the same precedence.
@dotnetrepoman dotnetrepoman bot added this to the January 2026 milestone Jan 30, 2026
@BillWagner BillWagner marked this pull request as ready for review January 30, 2026 17:53
@BillWagner BillWagner requested a review from a team as a code owner January 30, 2026 17:53
Copilot AI review requested due to automatic review settings January 30, 2026 17:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR clarifies operator precedence documentation in response to issue #50888, where readers misinterpreted flat lists as implying different precedence for each operator. The changes restructure precedence information to explicitly show groupings and add a statement about evaluation order for operators with the same precedence.

Changes:

  • Added clarification in index.md that operators with the same precedence are evaluated in lexical order
  • Restructured precedence lists in five operator documentation files to explicitly show precedence groups with links to the main precedence table
  • Changed list introductions from "orders operators from highest to lowest" to "orders operators in groups from highest to lowest"

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
docs/csharp/language-reference/operators/index.md Added statement about lexical order evaluation for same-precedence operators
docs/csharp/language-reference/operators/boolean-logical-operators.md Restructured logical operator precedence list into linked groups
docs/csharp/language-reference/operators/bitwise-and-shift-operators.md Restructured bitwise operator precedence list into linked groups
docs/csharp/language-reference/operators/arithmetic-operators.md Restructured arithmetic operator precedence list into linked groups
docs/csharp/language-reference/operators/pointer-related-operators.md Restructured pointer operator precedence list into linked groups

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The list of precedence implies different precedence for each operator

2 participants