Skip to content

Commit 38b4d3c

Browse files
Merge pull request #43382 from dotnet/main
Merge main into live
2 parents 53ca0ab + 1e08e84 commit 38b4d3c

File tree

10 files changed

+45
-33
lines changed

10 files changed

+45
-33
lines changed

docfx.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -791,9 +791,9 @@
791791
"_csharplang/proposals/csharp-13.0/ref-struct-interfaces.md": "This proposal provides features that enable interface authors to allow `ref struct` types to implement a particular interface",
792792
"_csharplang/proposals/csharp-13.0/partial-properties.md": "This proposal provides for partial properties and indexers, allowing the definition of a property or indexer to be split across multiple parts.",
793793
"_csharplang/proposals/csharp-13.0/overload-resolution-priority.md": "This proposal introduces a new attribute, `OverloadResolutionPriorityAttribute`, that can be applied to methods to influence overload resolution.",
794-
"_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 7.md": "Learn about any breaking changes since the initial release of C# 10",
795-
"_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 8.md": "Learn about any breaking changes since the initial release of C# 11",
796-
"_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 9.md": "Learn about any breaking changes since the initial release of C# 12",
794+
"_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 7.md": "Learn about any breaking changes since the initial release of C# 10 and included in C# 11",
795+
"_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 8.md": "Learn about any breaking changes since the initial release of C# 11 and included in C# 12",
796+
"_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 9.md": "Learn about any breaking changes since the initial release of C# 12 and included in C# 13",
797797
"_vblang/spec/introduction.md": "This chapter provides and introduction to the Visual Basic language.",
798798
"_vblang/spec/lexical-grammar.md": "This chapter defines the lexical grammar for Visual Basic.",
799799
"_vblang/spec/preprocessing-directives.md": "This chapter defines the preprocessing directives allowed in Visual Basic",

docs/azure/includes/dotnet-all.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@
366366
| Unknown Display Name | NuGet [1.0.0](https://www.nuget.org/packages/Azure.AI.ContentSafety.Extension.Embedded.Text/1.0.0)<br>NuGet [1.0.1-beta.3](https://www.nuget.org/packages/Azure.AI.ContentSafety.Extension.Embedded.Text/1.0.1-beta.3) | | |
367367
| Unknown Display Name | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/1.0.0-beta.2) | | |
368368
| Unknown Display Name | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/1.0.0-beta.2) | | |
369-
| Unknown Display Name | NuGet [1.0.3-preview](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.MySql/1.0.3-preview) | | |
370-
| Unknown Display Name | NuGet [1.0.3-preview](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.MySql/1.0.3-preview) | | |
369+
| Unknown Display Name | NuGet [1.0.4-preview](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.MySql/1.0.4-preview) | | |
370+
| Unknown Display Name | NuGet [1.0.4-preview](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.MySql/1.0.4-preview) | | |
371371
| Unknown Display Name | NuGet [1.41.1](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.CLI/1.41.1) | | |
372372
| Unknown Display Name | NuGet [1.41.1](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.Extension.Embedded.SR/1.41.1) | | |
373373
| Unknown Display Name | NuGet [1.41.1](https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech.Extension.Embedded.TTS/1.41.1) | | |
@@ -571,8 +571,8 @@
571571
| Hyak Common - Tracing Etw | NuGet [1.0.2](https://www.nuget.org/packages/Hyak.Common.Tracing.Etw/1.0.2) | | |
572572
| Hyak Common - Tracing Log4Net | NuGet [1.0.2](https://www.nuget.org/packages/Hyak.Common.Tracing.Log4Net/1.0.2) | | |
573573
| Microsoft.Azure.SignalR.Emulator | NuGet [1.4.0](https://www.nuget.org/packages/Microsoft.Azure.SignalR.Emulator/1.4.0)<br>NuGet [1.0.0-preview1-10809](https://www.nuget.org/packages/Microsoft.Azure.SignalR.Emulator/1.0.0-preview1-10809) | | |
574-
| MSBuild | NuGet [0.30.0](https://www.nuget.org/packages/Microsoft.TypeSpec.MSBuild/0.30.0) | | |
575-
| ProviderHub Controller | NuGet [0.16.0](https://www.nuget.org/packages/Microsoft.TypeSpec.ProviderHub.Controller/0.16.0) | | |
576-
| ProviderHub Templates | NuGet [1.8.0](https://www.nuget.org/packages/Microsoft.TypeSpec.ProviderHub.Templates/1.8.0) | | |
574+
| MSBuild | NuGet [0.31.0](https://www.nuget.org/packages/Microsoft.TypeSpec.MSBuild/0.31.0) | | |
575+
| ProviderHub Controller | NuGet [0.17.0](https://www.nuget.org/packages/Microsoft.TypeSpec.ProviderHub.Controller/0.17.0) | | |
576+
| ProviderHub Templates | NuGet [1.9.0](https://www.nuget.org/packages/Microsoft.TypeSpec.ProviderHub.Templates/1.9.0) | | |
577577
| Template | NuGet [1.0.2-preview1](https://www.nuget.org/packages/Microsoft.Azure.Template/1.0.2-preview1) | | |
578578
| Test HttpRecorder | NuGet [1.13.3](https://www.nuget.org/packages/Microsoft.Azure.Test.HttpRecorder/1.13.3) | | GitHub [1.13.3](https://github.com/Azure/azure-sdk-for-net/tree/mgmt-legacy/sdk/mgmtcommon/TestFramework/Microsoft.Azure.Test.HttpRecorder) |

docs/csharp/language-reference/compiler-messages/feature-version-errors.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ f1_keywords:
5454
- "CS9202"
5555
- "CS9211"
5656
- "CS9240"
57+
- "CS9260"
5758
helpviewer_keywords:
5859
- "CS0171"
5960
- "CS0188"
@@ -107,7 +108,8 @@ helpviewer_keywords:
107108
- "CS9202"
108109
- "CS9211"
109110
- "CS9240"
110-
ms.date: 11/02/2023
111+
- "CS9260"
112+
ms.date: 11/06/2024
111113
---
112114
# Resolve warnings related to language features and versions
113115

@@ -149,6 +151,7 @@ That's be design. The text closely matches the text of the compiler error / warn
149151
- **CS9202**: *Feature is not available in C# 12.0. Please use newer language version*
150152
- **CS9211**: *The diagnosticId argument to the 'Experimental' attribute must be a valid identifier.*
151153
- **CS9240**: *Target runtime doesn't support by-ref-like generics.*
154+
- **CS9260**: *Feature is not available in C# 13.0. Please use newer language version**
152155

153156
In addition, the following errors and warnings relate to struct initialization changes in recent versions:
154157

docs/csharp/language-reference/compiler-messages/inline-array-errors.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ f1_keywords:
1616
- "CS9183"
1717
- "CS9184"
1818
- "CS9189"
19+
- "CS9259"
1920
helpviewer_keywords:
2021
- "CS9164"
2122
- "CS9165"
@@ -31,7 +32,8 @@ helpviewer_keywords:
3132
- "CS9183"
3233
- "CS9184"
3334
- "CS9189"
34-
ms.date: 11/02/2023
35+
- "CS9259"
36+
ms.date: 11/06/2024
3537
---
3638
# Resolve errors and warnings with inline array declarations
3739

@@ -54,6 +56,7 @@ That's by design. The text closely matches the text of the compiler error / warn
5456
- [**CS9183**](#conversions-to-span): *Inline array conversion operator will not be used for conversion from expression of the declaring type.*
5557
- [**CS9184**](#inline-array-declaration): *'Inline arrays' language feature is not supported for inline array types with element field which is either a '`ref`' field, or has type that is not valid as a type argument.*
5658
- [**CS9189**](#element-access): *`foreach` statement on an inline array of type is not supported*
59+
- [**CS9259**](#inline-array-declaration): *Attribute <xref:System.Runtime.CompilerServices.InlineArrayAttribute?displayProperty=fullName> cannot be applied to a record struct.*
5760

5861
## Inline array declaration
5962

@@ -64,6 +67,7 @@ You declare inline arrays as a `struct` type with a single field, and an attribu
6467
- **CS9169**: *Inline array struct must declare one and only one instance field which must not be a ref field.*
6568
- **CS9180**: *Inline array element field cannot be declared as required, readonly, volatile, or as a fixed size buffer.*
6669
- **CS9184**: *'Inline arrays' language feature is not supported for inline array types with element field which is either a '`ref`' field, or has type that is not valid as a type argument.*
70+
- **CS9259**: *Attribute <xref:System.Runtime.CompilerServices.InlineArrayAttribute?displayProperty=fullName> cannot be applied to a record struct.*
6771

6872
To fix these arrays, ensure the following are true:
6973

@@ -72,6 +76,7 @@ To fix these arrays, ensure the following are true:
7276
- The enclosing `struct` has a single instance field, and that instance field is not a `ref` field.
7377
- The single instance field is not a fixed size buffer.
7478
- The single instance field doesn't include the `required`, `volatile`, or `readonly` modifiers.
79+
- Remove the `record` modifier from your inline array declaration.
7580

7681
## Element access
7782

docs/csharp/language-reference/compiler-messages/ref-modifiers-errors.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ f1_keywords:
6666
- "CS9199"
6767
- "CS9200"
6868
- "CS9201"
69+
- "CS9265"
6970
helpviewer_keywords:
7071
- "CS0192"
7172
- "CS0199"
@@ -131,7 +132,8 @@ helpviewer_keywords:
131132
- "CS9199"
132133
- "CS9200"
133134
- "CS9201"
134-
ms.date: 11/02/2023
135+
- "CS9265"
136+
ms.date: 11/06/2024
135137
---
136138
# Errors and warnings associated with reference parameters, variables, and returns
137139

@@ -207,6 +209,7 @@ The following warnings are generated when reference variables are used incorrect
207209
- [**CS9198**](#reference-variable-restrictions): *Reference kind modifier of parameter doesn't match the corresponding parameter in target.*
208210
- [**CS9200**](#reference-variable-restrictions): *A default value is specified for `ref readonly` parameter, but `ref readonly` should be used only for references. Consider declaring the parameter as `in`.*
209211
- [**CS9201**](#reference-variable-restrictions): *Ref field should be ref-assigned before use.*
212+
- [**CS9265**](#reference-variable-restrictions): *Field is never ref-assigned to, and will always have its default value (null reference)*
210213

211214
These errors and warnings follow these themes:
212215

@@ -261,6 +264,7 @@ The following warnings indicate that a reference variable shouldn't be used, and
261264
- **CS9198**: *Reference kind modifier of parameter doesn't match the corresponding parameter in target.*
262265
- **CS9200**: *A default value is specified for `ref readonly` parameter, but `ref readonly` should be used only for references. Consider declaring the parameter as `in`.*
263266
- **CS9201**: *Ref field should be ref-assigned before use.*
267+
- **CS9265**: *Field is never ref-assigned to, and will always have its default value (null reference)*
264268

265269
To fix the error, remove the reference variable where it isn't allowed:
266270

@@ -277,6 +281,7 @@ To fix the error, remove the reference variable where it isn't allowed:
277281
- Methods attributed with <xref:System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute?displayProperty=nameWithType> can't use reference parameters.
278282
- A Windows runtime event can't be passed as a reference variable.
279283
- A `ref readonly` parameter can't have the <xref:System.Runtime.InteropServices.OutAttribute?displayProperty=nameWithType> applied to it in remoting API.
284+
- Initialize a `ref` field in the constructor or as a field initializer.
280285

281286
## `unscoped ref` restrictions
282287

docs/csharp/language-reference/compiler-messages/ref-struct-errors.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ f1_keywords:
1515
- "CS9245"
1616
- "CS9246"
1717
- "CS9247"
18+
- "CS9267"
1819
helpviewer_keywords:
1920
- "CS8343"
2021
- "CS8344"
@@ -29,7 +30,8 @@ helpviewer_keywords:
2930
- "CS9245"
3031
- "CS9246"
3132
- "CS9247"
32-
ms.date: 07/30/2024
33+
- "CS9267"
34+
ms.date: 11/06/2024
3335
---
3436
# Errors and warnings associated with `ref struct` types
3537

@@ -46,6 +48,7 @@ ms.date: 07/30/2024
4648
- [**CS9245**](#ref-struct-interface-implementations): *Type cannot implement interface member for `ref struct` type.*
4749
- [**CS9246**](#ref-struct-interface-implementations): *A non-virtual instance interface member cannot be accessed on a type parameter that allows ref struct.*
4850
- [**CS9247**](#ref-struct-interface-implementations): *foreach statement cannot operate on enumerators of type because it is a type parameter that allows ref struct and it is not known at compile time to implement `IDisposable`.*
51+
- [**CS9267**](#ref-struct-interface-implementations): *Element type of an iterator may not be a ref struct or a type parameter allowing ref structs*
4952

5053
## ref safety violations
5154

@@ -74,6 +77,7 @@ Violating any of these rules produces one of the listed errors. If you intended
7477
- **CS9245**: *Type cannot implement interface member for `ref struct` type.*
7578
- **CS9246**: *A non-virtual instance interface member cannot be accessed on a type parameter that allows ref struct.*
7679
- **CS9247**: *foreach statement cannot operate on enumerators of type because it is a type parameter that allows ref struct and it is not known at compile time to implement `IDisposable`.*
80+
- **CS9267**: *Element type of an iterator may not be a ref struct or a type parameter allowing ref structs*
7781

7882
Prior to C# 13, [`ref struct`](../builtin-types/ref-struct.md) types can't implement interfaces; the compiler generates *CS8343*. Beginning with C# 13, `ref struct` types can implement interfaces, subject to the following rules:
7983

@@ -84,3 +88,4 @@ Beginning with C# 13, a `ref struct` can be used as a type argument for a generi
8488

8589
- A `ref struct` is used as a type argument, the type parameter *must* have the `allows ref struct` anti-constraint.- The `allows ref struct` anti-constraint must be last in the `where` clause for that parameter
8690
- Uses of instances the type parameter must obey ref safety rules.
91+
- A `ref struct` or a type argument that can be a `ref struct` type can't be used as the element type for an [iterator method](../statements/yield.md).

docs/csharp/language-reference/toc.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ items:
437437
CS0171, CS0188, CS0843, CS8904, CS1738, CS8022, CS8023, CS8024, CS8025, CS8026, CS8058, CS8059, CS8107, CS8192, CS8302,
438438
CS8303, CS8304, CS8305, CS8306, CS8314, CS8320, CS8370, CS8371, CS8400, CS8401, CS8511, CS8627, CS8630, CS8652, CS8703,
439439
CS8704, CS8706, CS8773, CS8912, CS8919, CS8929, CS8936, CS8957, CS8967, CS9014, CS9015, CS9016, CS9017, CS9058, CS9064,
440-
CS9103, CS9171, CS9194, CS9202, CS9204, CS9240
440+
CS9103, CS9171, CS9194, CS9202, CS9204, CS9240, CS9260
441441
- name: Assembly references
442442
href: ./compiler-messages/assembly-references.md
443443
displayName: >
@@ -463,12 +463,12 @@ items:
463463
CS7084, CS8166, CS8167, CS8168, CS8169. CS8325, CS8326, CS8327, CS8329, CS8330, CS8331, CS8332, CS8337, CS8338, CS8351,
464464
CS8373, CS8374, CS8388, CS8977, CS9072, CS9077, CS9078, CS9079, CS9085, CS9086, CS9087, CS9089, CS9091, CS9092, CS9093,
465465
CS9094, CS9095, CS9096, CS9097, CS9101, CS9102, CS9104, CS9190, CS9191, CS9192, CS9193, CS9195, CS9196, CS9197, CS9198,
466-
CS9199, CS9200, CS9201
466+
CS9199, CS9200, CS9201, CS9265
467467
- name: "`ref struct` types"
468468
href: ./compiler-messages/ref-struct-errors.md
469469
displayName: >
470470
ref struct,
471-
CS8343, CS8344, CS8345, CS9048, CS9050, CS9059, CS9241, CS9242, CS9243, CS9244, CS9245, CS9246, CS9247
471+
CS8343, CS8344, CS8345, CS9048, CS9050, CS9059, CS9241, CS9242, CS9243, CS9244, CS9245, CS9246, CS9247, CS9267
472472
- name: Iterator methods
473473
href: ./compiler-messages/iterator-yield.md
474474
displayName: >
@@ -503,7 +503,7 @@ items:
503503
CS9188, CS9203, CS9208, CS9209, CS9210
504504
- name: Inline arrays
505505
href: ./compiler-messages/inline-array-errors.md
506-
displayName: CS9164, CS9165, CS9166, CS9167, CS9168, CS9169, CS9172, CS9173, CS9180, CS9181, CS9182, CS9183, CS9184
506+
displayName: CS9164, CS9165, CS9166, CS9167, CS9168, CS9169, CS9172, CS9173, CS9180, CS9181, CS9182, CS9183, CS9184, CS9259
507507
- name: Lambda expressions
508508
href: ./compiler-messages/lambda-expression-errors.md
509509
displayName: >

docs/csharp/misc/cs0077.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ However, using [pattern matching](../fundamentals/functional/pattern-matching.md
2121
```csharp
2222
// CS0077.cs
2323
using System;
24-
25-
class C
26-
{
27-
}
28-
24+
2925
struct S
3026
{
3127
}
@@ -34,17 +30,15 @@ class M
3430
{
3531
public static void Main()
3632
{
37-
object o1, o2;
38-
C c;
33+
object o;
3934
S s;
35+
36+
o = new S();
4037

41-
o1 = new C();
42-
o2 = new S();
43-
44-
s = o2 as S; // CS0077, S is not a reference type
38+
s = o as S; // CS0077, S is not a reference type
4539
4640
// Use pattern matching instead of as
47-
if (o2 is S sValue)
41+
if (o is S sValue)
4842
{
4943
s = sValue;
5044
}

docs/csharp/toc.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,19 +149,19 @@ items:
149149
- name: C# 13
150150
displayName: what's New
151151
href: whats-new/csharp-13.md
152-
- name: Breaking changes in C# 13
152+
- name: Breaking changes since C# 12
153153
href: ../../_roslyn/docs/compilers/CSharp/Compiler%20Breaking%20Changes%20-%20DotNet%209.md
154154
- name: C# 12
155155
displayName: what's New
156156
href: whats-new/csharp-12.md
157-
- name: Breaking changes in C# 12
157+
- name: Breaking changes since C# 11
158158
href: ../../_roslyn/docs/compilers/CSharp/Compiler%20Breaking%20Changes%20-%20DotNet%208.md
159159
- name: C# 11
160160
items:
161161
- name: New features
162162
displayName: what's new
163163
href: whats-new/csharp-11.md
164-
- name: Breaking changes in C# 11
164+
- name: Breaking changes since C# 10
165165
href: ../../_roslyn/docs/compilers/CSharp/Compiler%20Breaking%20Changes%20-%20DotNet%207.md
166166
- name: C# 10
167167
href: whats-new/csharp-10.md

docs/fsharp/whats-new/fsharp-9.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ Example:
120120
type Foo() =
121121
member val X : int = 0 with get, set
122122
123-
[&ltExtension>]
123+
[<Extension>]
124124
type FooExt =
125-
[&ltExtension>]
125+
[<Extension>]
126126
static member X (f: Foo, i: int) = f.X <- i; f
127127
128128
let f = Foo()

0 commit comments

Comments
 (0)