Merge main into live - #55466
Open
dotnet-policy-service[bot] wants to merge 11 commits into
Open
Conversation
…w 7 behavior (#55444) * First pass: Fix #55322 Elaborate on the explanation for IUnionProviders. * Document C# 15 unsafe updates (#55330) Add unsafe(expression) coverage to What's new in C# 15 and to the Language Reference (unsafe-code.md and keywords/unsafe.md), including a field-initializer example and an await-with-unsafe-expression example verified against the .NET 11 Preview 6 SDK. Explain why the expression form is useful where an unsafe block can't appear syntactically (field initializers, constructor initializers, catch filters), without claiming await is permitted inside an unsafe context; it remains illegal (CS4004). Update keywords/safe.md: the compiler now recognizes the safe modifier on extern members and explicit-layout fields (verified against Preview 6), but caller-safety/requires-unsafe enforcement has no public opt-in and isn't active under ordinary preview settings. Align xmldoc/recommended-tags.md safety guidance with the same caveat so it doesn't imply caller obligations are already enforced. Fixes #55330 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4c0acfc3-7e62-4739-a09e-2dedc26b27af * Clarify C# 15 union pattern matching (#55330) Fix residual wording in operators/patterns.md and the "Non-boxing access pattern" section of builtin-types/union.md that conflated TryGetValue and HasValue as a single combined mechanism. State plainly that TryGetValue supports type-pattern checks without boxing and HasValue supports null-pattern checks; neither is a fallback for the other, and the compiler checks Value for the corresponding pattern when a member is omitted. Cross-link to the detailed "Union member providers" section (accepted in #55322) instead of duplicating its explanation. Fixes #55330 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4c0acfc3-7e62-4739-a09e-2dedc26b27af * Update C# 15 closed hierarchy docs (#55330) Remove the obsolete ClosedAttribute workaround from What's new and the shared snippet projects. The .NET 11 Preview 6 runtime already supplies System.Runtime.CompilerServices.IsClosedTypeAttribute (verified: the compiler synthesizes it automatically), so projects no longer need to declare a substitute attribute. Fix a discovered inaccuracy while validating snippets against the Preview 6 SDK: exhaustiveness checking for a switch governed by a type parameter constrained to a closed class isn't implemented yet, even though the specification defines it and the docs claimed it worked. Keep the example (it shows valid syntax from the specification) but add an accurate NOTE explaining the current compiler limitation in both closed.md and patterns.md, instead of leaving readers with example code whose "no warning" comment contradicts what the compiler actually reports. Fixes #55330 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4c0acfc3-7e62-4739-a09e-2dedc26b27af * Clarify C# 15 collection expression arguments (#55330) Add a restriction to operators/collection-expressions.md stating that with(...) arguments don't affect conversion, overload resolution, or type inference: only the presence of a with(...) element affects whether a conversion from the collection expression to a candidate target type exists, and the arguments themselves are ignored. This matches the resolved LDM decision in the collection expression arguments feature specification, verified against the .NET 11 Preview 6 SDK (overload resolution stays ambiguous and type arguments still can't be inferred when with(...) supplies them). Fixes #55330 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4c0acfc3-7e62-4739-a09e-2dedc26b27af * proofread Proofread and grammar check all changed files in this PR. * Validate against preview 7 * Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- 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: 4c0acfc3-7e62-4739-a09e-2dedc26b27af
* Initial plan * Clarify dotnet new NuGet source option Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com> * Address NuGet source wording feedback Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
* Add expressions overview fundamentals article (#55333) New article: docs/csharp/fundamentals/expressions/index.md - Beginner-friendly overview: what expressions are, value-producing vs void - Operator precedence taught as three memorable tiers (arithmetic, comparison, logical) - No full precedence table; links to language-reference/operators/index.md - Parentheses section with executable snippet - Short-circuit evaluation section with executable snippet - TOC entry added under 'Expressions and statements' Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2091fd4c-9f7b-4948-9282-a93f05502675 * Refine expressions overview: beginner-friendly examples and remove advanced details - Replace boolean &/| ParenthesesClarity snippet with &&/|| example that clearly shows parentheses changing the result (isAdmin/isOwner pattern) - Remove non-short-circuit &/| sentence from Short-circuit section - Trim Associativity to left-associative only; drop chained assignment - Replace (x++)+(x++) operand-order example with a clean arithmetic example Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2091fd4c-9f7b-4948-9282-a93f05502675 * Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Rewrite expressions overview as beginner learning material - Remove odd tip sentence 'Prefer standalone statements for clarity' - Intro now uses inline expressions (3 + 4 * 2, total > 10) instead of compilable statement snippets; adds expression-vs-statement comparison - New 'Combining expressions' section explains why precedence matters and notes readers can use parentheses instead of memorizing rules - Rewrites 'Operand evaluation order' around two clear rules: left-to-right evaluation and short-circuit operators; uses paper-and-pencil analogy - Adds StepByStep snippet showing interim-value computation - Expands short-circuit coverage to include ?:, ?., ?[], and ??= - Folds associativity into evaluation section as a small definition rather than a standalone heading - Fixes all review typos (comparision, short circut, Mayble) in polished prose Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9b155fe4-7996-4e57-ae91-d560587cc26d * Second-commit review: statement accuracy, precedence tier, paper-and-pencil walkthrough - Fix 'assignment statement' inaccuracy: explain int total = ... as a variable declaration statement whose initializer expression is evaluated and assigned - Add 'primary and unary first' tier to operator-precedence list, covering member access, method calls, indexing, null-conditional access, and unary operators; update tier count references throughout - Add explicit paper-and-pencil walkthrough using 3 + 6 / 2, showing each interim step (6/2 -> 3, then 3+3 -> 6) in both ASCII diagram and snippet Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9b155fe4-7996-4e57-ae91-d560587cc26d * Add range operator to precedence tier 1 The range operator (..) sits in its own precedence band between Unary and Multiplicative in the C# spec table — above arithmetic, not below it. Expand tier 1 to 'Primary, unary, and range', naming all three groups and explaining what range does (slice expressions like array[1..4]). Note that each group has its own band while all three precede arithmetic, which is technically accurate and satisfies the pedagogical request. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9b155fe4-7996-4e57-ae91-d560587cc26d * Fix increment example: show both prefix ++i and postfix i++ The previous wording said 'prefix/postfix increment (++i)' but ++i is only prefix. Separate them so each label matches its example. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9b155fe4-7996-4e57-ae91-d560587cc26d * Define binding, clarify precedence groups, restore 'Primary, unary, and range' - Restore heading 'Primary, unary, and range' (Bill's chosen wording), superseding the local edit that had changed it to 'Primary and unary' - Add opening paragraph to Operator precedence defining what 'binding' means: how operators claim operands in a combined expression, explicitly kept distinct from runtime operand evaluation order (cross-linked to How expressions are evaluated) - Note that C# has more precedence groups than the four in the summary; the additional groups enforce familiar rules like multiplication before addition - Expand tier 1 to sub-bullets clearly stating that primary, unary, and range are three distinct precedence groups combined here because all bind before arithmetic - Replace full-table sentence with natural 'For the complete hierarchy...' close - Remove stale 'four tiers' wording from Combining expressions intro and from parentheses subsection; transitions now flow without redundant reassurances Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9b155fe4-7996-4e57-ae91-d560587cc26d * Show parenthesized form of precedence example on line 44 After the prose walk-through of score + bonus > threshold && attempts < maxAttempts, add the same expression with explicit grouping parentheses: ((score + bonus) > threshold) && (attempts < maxAttempts) This reinforces the precedence explanation before the parentheses subsection without duplicating its distinct content (which uses different variables and focuses on cases where parentheses change the result). Preserves the minor prose tweaks already present as local edits. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9b155fe4-7996-4e57-ae91-d560587cc26d * Rewrite Operator precedence opening paragraph to remove confusing contrast The previous paragraph defined precedence via 'binding order' then immediately disclaimed that binding isn't runtime order — confusing for beginners. Rewrite uses only structural language: - Precedence determines how a combined expression *groups* into sub-expressions - 'Binds more tightly' means the expression is structured as if parenthesized - Concrete example: 3 + 4 * 2 groups as 3 + (4 * 2), not (3 + 4) * 2 No mention of runtime evaluation order in this paragraph. The 'How expressions are evaluated' section owns that concept. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9b155fe4-7996-4e57-ae91-d560587cc26d * One more proofread * Update docs/csharp/fundamentals/expressions/snippets/expressions/Program.cs Co-authored-by: Wade Pickett <wpickett@microsoft.com> * Update docs/csharp/fundamentals/expressions/snippets/expressions/Program.cs Co-authored-by: Wade Pickett <wpickett@microsoft.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Wade Pickett <wpickett@microsoft.com> Copilot-Session: 2091fd4c-9f7b-4948-9282-a93f05502675 Copilot-Session: 9b155fe4-7996-4e57-ae91-d560587cc26d
* Initial plan * Clarify SDK status check availability Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com> * Update NETSDK1238 article for .NET 11 Preview 5 Clarified applicability of NETSDK1238 warning to .NET 11 Preview 5 and later versions. * Update netsdk1239.md * Update NETSDK1240 documentation for clarity Clarified the availability of the check for .NET SDK version in the documentation. * Update netsdk1238.md --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
Co-authored-by: azure-sdk <azuresdk@microsoft.com>
Document RoutingChatClient and FailoverChatClient as experimental capabilities in docs/ai/ichatclient.md, mirroring the existing 'Chat reduction (experimental)' section: an IMPORTANT experimental note plus a concise description with xref links to RoutingChatClient, FailoverChatClient, OrderedFailoverChatClient, and SemanticRoutingChatClient, matching the API shape merged in dotnet/extensions#7662. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7f6512d2-cfbc-4df3-8401-acc729c949e6
|
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:
For more information about GitHub Code Scanning, check out the documentation. |
Co-authored-by: azure-sdk <azuresdk@microsoft.com>
Corrected the explanation regarding interface accessibility in derived interfaces.
* Document roslyn telemetry * Add AI usage tag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please don't squash-merge this PR.
Internal previews
Toggle expand/collapse