Skip to content

Merge main into live - #55624

Open
dotnet-policy-service[bot] wants to merge 9 commits into
livefrom
main
Open

Merge main into live#55624
dotnet-policy-service[bot] wants to merge 9 commits into
livefrom
main

Conversation

@dotnet-policy-service

@dotnet-policy-service dotnet-policy-service Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Please don't squash-merge this PR.


Internal previews

Toggle expand/collapse
File Preview link
.openpublishing.redirection.csharp.json Preview published page
docs/azure/includes/dotnet-all.md Preview published page
docs/azure/includes/dotnet-new.md Preview published page
docs/core/compatibility/11.md Preview published page
docs/core/compatibility/core-libraries/11/assembly-getcallingassembly-stacktracesupport-disabled.md Preview published page
docs/core/compatibility/toc.yml Preview published page
docs/core/deploying/trimming/trimming-options.md Preview published page
docs/core/whats-new/dotnet-11/overview.md Preview published page
docs/csharp/fundamentals/expressions/equality.md Preview published page
docs/csharp/fundamentals/expressions/index.md Preview published page
docs/csharp/fundamentals/expressions/operators.md Preview published page
docs/csharp/fundamentals/expressions/snippets/equality/Program.cs Preview published page
docs/csharp/fundamentals/expressions/snippets/operators/Program.cs Preview published page
docs/csharp/fundamentals/null-safety/null-operators.md Preview published page
docs/csharp/fundamentals/object-oriented/objects.md Preview published page
docs/csharp/fundamentals/program-structure/index.md Preview published page
docs/csharp/fundamentals/statements/index.md Preview published page
docs/csharp/fundamentals/statements/selection.md Preview published page
docs/csharp/fundamentals/statements/snippets/selection-statements/Program.cs Preview published page
docs/csharp/fundamentals/statements/snippets/statements-overview/Program.cs Preview published page
docs/csharp/fundamentals/tutorials/nullable-reference-types.md Preview published page
docs/csharp/fundamentals/types/built-in-types.md Preview published page
docs/csharp/how-to/index.md Preview published page
docs/csharp/language-reference/compiler-messages/cs0201.md Preview published page
docs/csharp/language-reference/compiler-messages/expression-form-restrictions.md Preview published page
docs/csharp/language-reference/compiler-messages/overloaded-operator-errors.md Preview published page
docs/csharp/language-reference/compiler-messages/record-declaration-errors.md Preview published page
docs/csharp/language-reference/keywords/statement-keywords.md Preview published page
docs/csharp/language-reference/operators/default.md Preview published page
docs/csharp/language-reference/operators/equality-operators.md Preview published page

Note

This table shows the first 30 preview links (sorted alphabetically by file path) found in the OPS build report. For the full list, select OpenPublishing.Build Details within checks.

azure-sdk-automation Bot and others added 5 commits August 20, 2026 12:32
Co-authored-by: azure-sdk <azuresdk@microsoft.com>
* Add Expressions: operators article (issue #55334)

Create docs/csharp/fundamentals/expressions/operators.md covering
arithmetic, unary, increment/decrement, relational, equality survey,
conditional-logical, conditional (?:), simple and compound assignment.

- Add operators snippets project (net10.0, nullable, implicit usings)
  with 9 region-marked examples; 0 warnings, 0 errors
- Add operators.md TOC node under Expressions and statements
- Add reciprocal link in expressions/index.md
- Add reciprocal link in expressions/equality.md
- Link excluded operators (shift/bitwise, checked/unchecked) to
  existing Language Reference pages

Closes #55334

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f5acfb15-adff-4860-a307-213196efda1c

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* 2nd draft

- Add negative integer division example (-7/2 = -3) to clarify truncation toward zero
- Add negative-operand remainder examples (-7%3 = -1, 7%-3 = 1) with sign rule explanation
- Explain char relational comparison uses Unicode code point values (tied to grade example)
- Update != comment to explicitly say 'true when values are not equal'
- Remove invalid commented-out code from EqualityOps snippet; move === example to NOTE callout in article prose as fenced code block
- Remove nested conditional example and related prose from ConditionalOp section
- Add Console.WriteLine after each compound assignment step (hp progression: 100 -> 120 -> 110 -> 220 -> 73 -> 3)
- Rename 'Operators not covered here' to 'Other C# operators'; expand bullets with concise definitions
- Add displayName to toc.yml entry for operators.md with all covered operators

Copilot-Session: f5acfb15-adff-4860-a307-213196efda1c
Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com>

* A few small repairs

Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com>

* Retire Programming Guide equality articles; migrate to Fundamentals (#55334)

Retire the three Programming Guide equality articles and preserve their
unique content in docs/csharp/fundamentals/expressions/equality.md:

- equality-comparisons.md
- how-to-test-for-reference-equality-identity.md
- how-to-define-value-equality-for-a-type.md

Content migrated into equality.md:
- Equivalence contract (5 rules: reflexive, symmetric, transitive,
  consistent, null behavior) added to the manual-implementation section.
- New section: 'Records with reference-type members' — explains that
  synthesized record equality uses each member's own equality semantics,
  so List<T>/array members compare by reference; shows custom IEquatable
  override with SequenceEqual as the recommended fix.
- New section: 'Polymorphic equality in unsealed class hierarchies' —
  explains the compile-time dispatch hazard with IEquatable<T>, the
  GetType() guard and virtual Equals pattern for correct unsealed-class
  equality, and notes that sealed classes and records avoid the problem.

Snippet additions to snippets/equality/Program.cs:
- RecordWithCollectionProblem / RecordWithCollectionFixed regions
- PlaylistFixedDefinition type (custom IEquatable record)
- PolymorphicEqualityDefinition (Shape/Circle hierarchy with GetType() guard)
- PolymorphicEqualityUsage region

Intentionally omitted: string-interning note (per Bill's explicit decision).

Retirement wiring:
- 3 redirects added to .openpublishing.redirection.csharp.json
- TOC entries and empty parent node removed from toc.yml
- All 5 inbound links updated: objects.md, how-to/index.md,
  overloaded-operator-errors.md, record-declaration-errors.md,
  equality-operators.md
- Orphaned snippet projects deleted

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f5acfb15-adff-4860-a307-213196efda1c

* restructure equality article.

Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com>

* Add 'Equality in class hierarchies' section to Language Reference operators.

Implements the persisted plan from PR #55469 equality restructuring:
- Add ## Equality in class hierarchies before ## Operator overloadability
  in equality-operators.md; covers declared/runtime-type dispatch hazards,
  GetType() guard, virtual Equals, derived-class augmentation, GetHashCode
  with GetType(), sealed-class simplification, and records guidance.
- Create net10.0 snippet project at
  docs/csharp/language-reference/operators/snippets/EqualityHierarchies/
  with HierarchyShapeDefinition, HierarchyCircleDefinition, HierarchyUsage
  regions (all build-verified, 0 warnings/errors).
- Update metadata: description, ms.date, helpviewer_keywords.
- Add reciprocal Fundamentals link in new section.

Cray item 3 (relocate polymorphic equality to Language Reference) implemented.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f5acfb15-adff-4860-a307-213196efda1c

* Simplify Fundamentals equality article; add byte-range note to operators.

Implements remaining Cray review items for PR #55469:

Cray item 1 (Records with reference-type members):
- Remove PlaylistFixed/IEquatable implementation code; replace rendered
  code blocks with brief named-strategy list; keep RecordWithCollectionProblem
  surprise example intact.

Cray item 2 (Implement equality yourself):
- Lead with code (ColorDefinition first); shorten IMPORTANT callout to
  2 sentences; consolidate member-list description into commentary after the
  code; compact equivalence contract intro; demote IEquatable<T> footnote.
- Retain IEquatableUsage region to show identity-vs-value contrast.

Cray item 3 (Polymorphic section bridge):
- Replace full polymorphic implementation in Fundamentals with a 3-sentence
  hazard summary + link to Language Reference ## Equality in class hierarchies.
- Preserve ## Polymorphic equality in unsealed class hierarchies heading.

Cray item 4 (operators.md byte-range):
- Add byte-range clarification: 'the result, 210, fits within the byte
  range of 0-255'; beginner-safe, no checked/unchecked discussion.

Cray item 5 (hash-loop): auto-resolved by PlaylistFixed removal.

Snippets:
- Remove PlaylistFixedDefinition, RecordWithCollectionFixed regions and
  PlaylistFixed type from Fundamentals Program.cs.
- Remove PolymorphicEqualityDefinition, PolymorphicEqualityUsage regions
  (Shape/Circle now live in LR EqualityHierarchies project).
- Fundamentals snippet builds 0 warnings/errors (net10.0).

Links/redirects:
- All three Programming Guide redirect targets unchanged (anchors verified).
- Add reciprocal LR link in equality.md See also.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f5acfb15-adff-4860-a307-213196efda1c

* Polish: improve equality documentation formatting and clarity

- Add blank line before 'Polymorphic equality in unsealed class hierarchies' section heading in equality.md
- Clarify 'declared type' with parenthetical '(the type written in the variable declaration)' in equality-operators.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f5acfb15-adff-4860-a307-213196efda1c

* Final review

Do a final review pass of all the changed content.

* Fix build warnings.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot-Session: f5acfb15-adff-4860-a307-213196efda1c
* docs: consolidate expression-form context restriction diagnostics (CS8115, CS8185, CS8209, CS8310, CS8312)

This article consolidates five compiler diagnostics related to invalid expression contexts:
- CS8115: Throw expressions in restricted contexts
- CS8185: Declaration expressions in restricted contexts
- CS8209: Void-returning expression restrictions
- CS8310: Operator binding for null/default/new
- CS8312: Default literal target type requirements

Content organized by remediation strategy. Codes removed from catch-all.
CS8188 preserved in expression-tree-restrictions.md per issue guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: expand expression-form diagnostics to eight codes with keyword context restrictions (CS0175, CS0186, CS1547)

Consolidate three standalone diagnostic articles (CS0175, CS0186, CS1547)
into expression-form-restrictions.md, broadening the article scope from 5
to 8 codes while maintaining thematic coherence:

MERGED CODES:
- CS0175: Use of keyword 'base' is not valid in this context
- CS0186: Use of null is not valid in this context
- CS1547: Keyword 'void' cannot be used in this context

CHANGES:
- Updated expression-form-restrictions.md with new 'Keyword and literal
  context restrictions' section containing substantive guidance from the
  three deleted standalone articles
- Merged all unique remediation information and examples
- Updated front matter f1_keywords and helpviewer_keywords (8 codes)
- Updated master error list with all 8 codes and exact Roslyn messages
- Updated TOC displayName with all 8 codes
- Removed old TOC entries for CS0175, CS0186, CS1547
- Created three redirects from old paths to new destination anchors
- Deleted three now-retired standalone files

FOOTPRINT REDUCTION: 3 standalone files → 1 consolidated article

VERIFICATION:
- YAML front matter valid
- All 8 codes present in f1_keywords/helpviewer_keywords
- No trailing whitespace
- Redirect JSON valid (1415 total entries)
- Exact Roslyn messages preserved per Bill's requirements

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: remove duplicated legacy displayName tail from expression-form TOC entry

The displayName folded scalar contained a duplicated five-code tail
(CS8115, CS8185, CS8209, CS8310, CS8312 with associated phrases) left
over from the original commit after the eight-code expansion appended
new content without removing the old suffix.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: restructure expression-form-restrictions with single H2 section and bullet-point remediation

Consolidate five separate H2/H3 subsections into one unified 'Invalid expression
contexts' H2 section with scannable bullet-point remediation guidance. All eight
diagnostic codes (CS0175, CS0186, CS1547, CS8115, CS8185, CS8209, CS8310, CS8312)
now appear as cohesive remedy bullets, preserving all substantive examples and
guidance while following prevailing style in delegate-function-pointer-diagnostics.md
and foreach-diagnostics.md.

Changes:
- Removed old H2/H3 headers (Base keyword, Null iteration, Void keyword, Throw
  expressions, Declaration expressions, Target type required, Void-returning)
- Created unified 'Invalid expression contexts' H2 with all anchors consolidated
- Restructured master error list to link all codes to single #invalid-expression-contexts
- Updated redirects for cs0175.md, cs0186.md, cs1547.md to point to unified anchor
- Preserved all code examples, remediation patterns, and guidance from original

Validation: 8 codes in front matter, 8 bullet items, 2 code examples, 3 redirects
updated, no trailing whitespace, single H2 anchor.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Proofread and finalize.

* Update docs/csharp/language-reference/compiler-messages/expression-form-restrictions.md

Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: azure-sdk <azuresdk@microsoft.com>
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@dotnetrepoman dotnetrepoman Bot added this to the August 2026 milestone Aug 21, 2026
BillWagner and others added 4 commits August 21, 2026 09:42
* Slim conditional operator coverage in selection statements (#55335)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* rebase and update links.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Consolidate C# statements documentation (#55336)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Revise C# statements learning flow (#55336)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* proofread and finalize

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: azure-sdk <azuresdk@microsoft.com>
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.

4 participants