diff --git a/.openpublishing.redirection.csharp.json b/.openpublishing.redirection.csharp.json index 2a4cc85d877fe..2bb0d2841eed1 100644 --- a/.openpublishing.redirection.csharp.json +++ b/.openpublishing.redirection.csharp.json @@ -343,6 +343,10 @@ "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0260.md", "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1112.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, { "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1683.md", "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references" @@ -1818,14 +1822,50 @@ "source_path_from_root": "/docs/csharp/misc/cs1020.md", "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" }, + { + "source_path_from_root": "/docs/csharp/misc/cs1100.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1101.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1102.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1103.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, { "source_path_from_root": "/docs/csharp/misc/cs1104.md", "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" }, + { + "source_path_from_root": "/docs/csharp/misc/cs1105.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1106.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, { "source_path_from_root": "/docs/csharp/misc/cs1007.md", "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" }, + { + "source_path_from_root": "/docs/csharp/misc/cs1109.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1110.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1113.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, { "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1502.md", "redirect_url": "/dotnet/csharp/misc/cs1503" diff --git a/docs/csharp/language-reference/compiler-messages/assembly-references.md b/docs/csharp/language-reference/compiler-messages/assembly-references.md index a19067f8af1c0..3bc1212c8d194 100644 --- a/docs/csharp/language-reference/compiler-messages/assembly-references.md +++ b/docs/csharp/language-reference/compiler-messages/assembly-references.md @@ -20,6 +20,7 @@ f1_keywords: - "CS7079" - "CS8090" - "CS8203" + - "CS9286" helpviewer_keywords: - "CS0012" - "CS0234" @@ -39,7 +40,8 @@ helpviewer_keywords: - "CS7079" - "CS8090" - "CS8203" -ms.date: 02/28/2024 + - "CS9286" +ms.date: 05/27/2025 --- # Resolve errors and warnings related to assembly references @@ -64,6 +66,7 @@ That's by design. The text closely matches the text of the compiler error / warn - [**CS7079**](#invalid-assembly-reference): *The type is defined in a module that has not been added. You must add the module.* - [**CS8090**](#invalid-assembly-reference): *There is an error in a referenced assembly.* - [**CS8203**](#invalid-assembly-reference): *Invalid assembly name.* +- [**CS9286**](#missing-references): *Type does not contain a definition and no accessible extension member for receiver type could be found (are you missing a using directive or an assembly reference?)* In addition, the following warnings are covered in this article: @@ -76,6 +79,7 @@ The following errors and warnings indicate that you're missing an assembly refer - **CS0012**: *The type 'type' is defined in an assembly that is not referenced. You must add a reference to assembly 'assembly'.* - **CS0234**: *The type or namespace name does not exist in the namespace (are you missing an assembly reference?)* - **CS0246**: *The type or namespace name could not be found (are you missing a using directive or an assembly reference?)* +- **CS9286**: *Type does not contain a definition and no accessible extension member for receiver type could be found (are you missing a using directive or an assembly reference?)* These compiler errors indicate one of these problems in your code: @@ -83,6 +87,7 @@ These compiler errors indicate one of these problems in your code: - You misspelled the name of a type. Check the name of the type. - You used a variable name where the name of a was expected, such as in the [`typeof` operator](../operators/type-testing-and-cast.md#the-typeof-operator) or the [`is` operator](../operators/type-testing-and-cast.md#the-is-operator). - You used the [global scope operator, (`::`)](../operators/namespace-alias-qualifier.md) when the type isn't in the global namespace. +- You're accessing an extension member and either the namespace isn't specified in a `using` directive, or you're not referencing the assembly that contains the extension. ## Type forwarding diff --git a/docs/csharp/language-reference/compiler-messages/cs1112.md b/docs/csharp/language-reference/compiler-messages/cs1112.md deleted file mode 100644 index 8ac3b76e79fb0..0000000000000 --- a/docs/csharp/language-reference/compiler-messages/cs1112.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -description: "Compiler Error CS1112" -title: "Compiler Error CS1112" -ms.date: 07/20/2015 -f1_keywords: - - "CS1112" -helpviewer_keywords: - - "CS1112" -ms.assetid: 72c5f497-8572-41c7-8243-0d5670daca3f ---- -# Compiler Error CS1112 - -Do not use 'System.Runtime.CompilerServices.ExtensionAttribute'. Use the 'this' keyword instead. - - This error is generated when the is used on a non-static class that contains extension methods. If this attribute is used on a static class, another error, such as CS0708: "Cannot declare instance members in a static class," might occur. - - In C#, extension methods must be defined in a static class and the first parameter of the method is modified with the `this` keyword. Do not use the attribute at all in the source code. For more information, see [Extension Methods](../../programming-guide/classes-and-structs/extension-methods.md). - -## To correct this error - -1. Remove the attribute and apply the `this` modifier to the first parameter of the method. - -## Example - - The following example generates CS1112: - -```csharp -// cs1112.cs -[System.Runtime.CompilerServices.ExtensionAttribute] // CS1112 -public class Extensions -{ - public bool A(bool b) { return b; } -} - -class A { } -``` diff --git a/docs/csharp/language-reference/compiler-messages/expression-tree-restrictions.md b/docs/csharp/language-reference/compiler-messages/expression-tree-restrictions.md index 96a5ea98e6c2a..c1b1c00fb00e9 100644 --- a/docs/csharp/language-reference/compiler-messages/expression-tree-restrictions.md +++ b/docs/csharp/language-reference/compiler-messages/expression-tree-restrictions.md @@ -47,6 +47,8 @@ f1_keywords: - "CS9170" - "CS9175" - "CS9226" + - "CS9296" + - "CS9307" helpviewer_keywords: - "CS0765" - "CS0831" @@ -94,7 +96,9 @@ helpviewer_keywords: - "CS9170" - "CS9175" - "CS9226" -ms.date: 09/06/2023 + - "CS9296" + - "CS9307" +ms.date: 05/27/2025 --- # Resolve errors and warnings generated from expressions prohibited in expression trees @@ -149,6 +153,8 @@ That's by design. The text closely matches the text of the compiler error / warn - **CS9170** - *An expression tree may not contain an inline array access or conversion.* - **CS9175** - *An expression tree may not contain a collection expression.* - **CS9226** - *An expression tree may not contain an expanded form of non-array params collection parameter.* +- **CS9296** - *An expression tree may not contain an extension property access*. +- **CS9307** - *An expression tree may not contain a named argument specification out of position*. ## Expression tree restrictions @@ -184,6 +190,7 @@ The following expressions are prohibited: Other restrictions are: +- Extension properties can't be accessed as extensions. - Attributes can't be applied to the lambda expression, its parameters or return. - The lambda expression must be convertible to a type derived from whose type parameter is a delegate type. - [named and optional parameters](../../programming-guide/classes-and-structs/named-and-optional-arguments.md) are restricted. The expression can't call a method specifying named arguments, and it can't use the default value of an optional parameter. diff --git a/docs/csharp/language-reference/compiler-messages/extension-declarations.md b/docs/csharp/language-reference/compiler-messages/extension-declarations.md new file mode 100644 index 0000000000000..4185b5634e9fb --- /dev/null +++ b/docs/csharp/language-reference/compiler-messages/extension-declarations.md @@ -0,0 +1,175 @@ +--- +title: "Errors and warnings related to extension declarations" +description: "These errors and warnings indicate that you need to modify the declaration of an extension method using the `this` modifier on the first parameter, or an extension declaration" +ms.date: 05/23/2025 +f1_keywords: + - "CS1100" + - "CS1101" + - "CS1102" + - "CS1103" + - "CS1105" + - "CS1106" + - "CS1109" + - "CS1110" + - "CS1112" + - "CS1113" + - "CS1743" + - "CS9281" + - "CS9282" + - "CS9283" + - "CS9284" + - "CS9285" + - "CS9287" + - "CS9288" + - "CS9289" + - "CS9290" + - "CS9292" + - "CS9293" + - "CS9295" + - "CS9300" + - "CS9301" + - "CS9302" + - "CS9303" + - "CS9304" + - "CS9305" +helpviewer_keywords: + - "CS1100" + - "CS1101" + - "CS1102" + - "CS1103" + - "CS1105" + - "CS1106" + - "CS1109" + - "CS1110" + - "CS1112" + - "CS1113" + - "CS1743" + - "CS9281" + - "CS9282" + - "CS9283" + - "CS9284" + - "CS9285" + - "CS9287" + - "CS9288" + - "CS9289" + - "CS9290" + - "CS9291" + - "CS9292" + - "CS9293" + - "CS9294" + - "CS9295" + - "CS9300" + - "CS9301" + - "CS9302" + - "CS9303" + - "CS9304" + - "CS9305" +--- +# Errors and warnings related to extension methods declared with `this` parameters or `extension` blocks + +- [**CS1100**](#errors-related-to-this-parameter-extension-methods): *Method has a parameter modifier '`this`' which is not on the first parameter* +- [**CS1101**](#errors-related-to-this-parameter-extension-methods): *The parameter modifier '`ref`' cannot be used with '`this`'.* +- [**CS1102**](#common-errors-on-extension-declarations): *The parameter modifier '`out`' cannot be used with '`this`'.* +- [**CS1103**](#common-errors-on-extension-declarations): *The first parameter of an extension method cannot be of a pointer type.* +- [**CS1105**](#errors-related-to-this-parameter-extension-methods): *Extension methods must be static.* +- [**CS1106**](#common-errors-on-extension-declarations): *Extension methods must be defined in a non generic static class.* +- [**CS1109**](#common-errors-on-extension-declarations): *Extension Methods must be defined on top level static classes, 'name' is a nested class.* +- [**CS1110**](#errors-related-to-this-parameter-extension-methods): *Cannot define a new extension because the compiler required type cannot be found. Are you missing a reference to System.Core.dll?* +- [**CS1112**](#errors-related-to-this-parameter-extension-methods): *Do not use ''. Use the '`this`' keyword instead.* +- [**CS1113**](#errors-related-to-this-parameter-extension-methods): *Extension method defined on a value type cannot be used to create delegates.* +- [**CS1743**](#common-errors-on-extension-declarations): *Cannot specify a default value for the 'this' parameter.* +- [**CS9281**](#errors-related-to-extension-block-declarations): *Extension declarations may not have a name.* +- [**CS9282**](#errors-related-to-extension-block-declarations): *Extension declarations can include only methods or properties.* +- [**CS9283**](#common-errors-on-extension-declarations): *Extensions must be declared in a top-level, non-generic, static class.* +- [**CS9284**](#common-errors-on-extension-declarations): *The receiver parameter of an extension cannot have a default value.* +- [**CS9285**](#common-errors-on-extension-declarations): *An extension container can have only one receiver parameter.* +- [**CS9287**](#errors-related-to-extension-block-declarations): *A receiver parameter cannot have the same name as an extension container type parameter.* +- [**CS9288**](#errors-related-to-extension-block-declarations): *A parameter, local variable, or local function cannot have the same name as an extension container type parameter.* +- [**CS9289**](#errors-related-to-extension-block-declarations): *Member type parameter has the same name as an extension container type parameter.* +- [**CS9290**](#errors-related-to-extension-block-declarations): *A parameter, local variable, or local function cannot have the same name as an extension parameter.* +- [**CS9291**](#errors-related-to-extension-block-declarations): *'`value`': an automatically-generated parameter name conflicts with an extension parameter name.* +- [**CS9292**](#errors-related-to-extension-block-declarations): *A type parameter has the same name as an extension parameter.* +- [**CS9293**](#errors-related-to-extension-block-declarations): *Cannot use an extension parameter in this context.* +- [**CS9294**](#errors-related-to-extension-block-declarations): *'`value`': an automatically-generated parameter name conflicts with an extension type parameter name.* +- [**CS9295**](#errors-related-to-extension-block-declarations): *The extended type must reference all the type parameters declared by the extension, but a type parameter is not referenced.* +- [**CS9300**](#errors-related-to-extension-block-declarations): *The '`ref`' receiver parameter of an extension block must be a value type or a generic type constrained to struct.* +- [**CS9301**](#errors-related-to-extension-block-declarations): *The '`in`' or '`ref readonly`' receiver parameter of extension must be a concrete (non-generic) value type.* +- [**CS9302**](#errors-related-to-extension-block-declarations): *new protected member declared in an extension block.* +- [**CS9303**](#errors-related-to-extension-block-declarations): *Cannot declare instance members in an extension block with an unnamed receiver parameter.* +- [**CS9304**](#errors-related-to-extension-block-declarations): *Cannot declare init-only accessors in an extension block.* +- [**CS9305**](#errors-related-to-extension-block-declarations): *Cannot use modifiers on the unnamed receiver parameter of extension block.* + +## Common errors on extension declarations + +The compiler emits these errors when you violate rules that apply to all extension member declarations, regardless of the syntax chosen: + +- **CS1102**: *The parameter modifier '`out`' cannot be used with '`this`'.* +- **CS1106**: *Extension methods must be defined in a non generic static class.* +- **CS1103**: *The first parameter of an extension method cannot be of a pointer type.* +- **CS1109**: *Extension Methods must be defined on top level static classes, 'name' is a nested class.* +- **CS1113**: *Extension method defined on a value type cannot be used to create delegates.* +- **CS1743**: *Cannot specify a default value for the 'this' parameter.* +- **CS9283**: *Extensions must be declared in a top-level, non-generic, static class.* +- **CS9284**: *The receiver parameter of an extension cannot have a default value.* +- **CS9285**: *An extension container can have only one receiver parameter.* + +Any extension declaration must follow these rules: + +- Its containing type (`class` or `struct`) must be non-generic and `static`. +- Its containing type must be a top-level type. It can't be nested in another type. +- Members that extend an instance of a value type can't be converted to delegates. +- The receiver parameter can't include the `out` parameter modifier. +- The receiver parameter can't have a default argument value. +- Pointer types can't be extended. In other words, the parameter you apply the `this` modifier to can't be a pointer type. + +## Errors related to extension block declarations + +These errors are specific to extension blocks, a C# 14 feature. Extension blocks are declared using the `extension` keyword in a static class. The `extension` declares the type and name of the receiver. All members inside the block declared with `extension` are extension members for that receiver: + +- **CS9281**: *Extension declarations may not have a name.* +- **CS9282**: *Extension declarations can include only methods or properties.* +- **CS9287**: *A receiver parameter cannot have the same name as an extension container type parameter.* +- **CS9288**: *A parameter, local variable, or local function cannot have the same name as an extension container type parameter.* +- **CS9289**: *Member type parameter has the same name as an extension container type parameter.* +- **CS9290**: *A parameter, local variable, or local function cannot have the same name as an extension parameter.* +- **CS9291**: *'`value`': an automatically-generated parameter name conflicts with an extension parameter name.* +- **CS9292**: *A type parameter has the same name as an extension parameter.* +- **CS9293**: *Cannot use an extension parameter in this context.* +- **CS9294**: *'`value`': an automatically-generated parameter name conflicts with an extension type parameter name.* +- **CS9295**: *The extended type must reference all the type parameters declared by the extension, but a type parameter is not referenced.* +- **CS9300**: *The '`ref`' receiver parameter of an extension block must be a value type or a generic type constrained to struct.* +- **CS9301**: *The '`in`' or '`ref readonly`' receiver parameter of extension must be a concrete (non-generic) value type.* +- **CS9302**: *new protected member declared in an extension block.* +- **CS9303**: *Cannot declare instance members in an extension block with an unnamed receiver parameter.* +- **CS9304**: *Cannot declare init-only accessors in an extension block.* +- **CS9305**: *Cannot use modifiers on the unnamed receiver parameter of extension block.* + +Extension declarations must follow these rules: + +- The extension can't include a name token. The extension declares the receiver only. +- The receiver parameter can't have a default value. + +Extension members declared in an extension block must follow these rules, in addition to the [common rules](#common-errors-on-extension-declarations): + +- Only methods and properties are valid extension member types. Extension members can extend an instance, or a type. +- The extension must provide a parameter name for the receiver in order to contain members that extend an instance. +- The receiver parameter name must be unique in that extension block. +- All extension members must use all type parameters declared on the extension. They can add more type parameters. + +## Errors related to `this` parameter extension methods + +These errors are specific to extension methods where you declare the receiver by adding the `this` modifier to the first parameter of the method: + +- **CS1100**: *Method has a parameter modifier '`this`' which is not on the first parameter* +- **CS1101**: *The parameter modifier '`ref`' cannot be used with '`this`'.* +- **CS1105**: *Extension methods must be static.* +- **CS1110**: *Cannot define a new extension because the compiler required type cannot be found. Are you missing a reference to System.Core.dll?* +- **CS1112**: *Do not use ''. Use the '`this`' keyword instead.* + +An extension method where the receiver instance includes the `this` modifier must follow these rules, in addition to the [common rules](#common-errors-on-extension-declarations): + +- The method must have the `static` modifier. +- The `this` parameter modifier must be applied to the first parameter. It can't be applied to any other parameters on the method. +- The `ref` `out` parameter modifier can't be applied to the first parameter. To apply `ref`, you need to convert to an extension block. +- In .NET Framework apps, `System.Core.dll` must be added as a reference. +- You must specify the `this` modifier on the first parameter. You can't directly use the attribute instead. diff --git a/docs/csharp/language-reference/compiler-messages/feature-version-errors.md b/docs/csharp/language-reference/compiler-messages/feature-version-errors.md index 1292bf4b1062e..2f2ace8407605 100644 --- a/docs/csharp/language-reference/compiler-messages/feature-version-errors.md +++ b/docs/csharp/language-reference/compiler-messages/feature-version-errors.md @@ -55,6 +55,9 @@ f1_keywords: - "CS9211" - "CS9240" - "CS9260" + - "CS9268" + - "CS9269" + - "CS9271" helpviewer_keywords: - "CS0171" - "CS0188" @@ -109,7 +112,10 @@ helpviewer_keywords: - "CS9211" - "CS9240" - "CS9260" -ms.date: 11/06/2024 + - "CS9268" + - "CS9269" + - "CS9271" +ms.date: 05/23/2025 --- # Resolve warnings related to language features and versions @@ -152,6 +158,9 @@ That's be design. The text closely matches the text of the compiler error / warn - **CS9211**: *The diagnosticId argument to the 'Experimental' attribute must be a valid identifier.* - **CS9240**: *Target runtime doesn't support by-ref-like generics.* - **CS9260**: *Feature is not available in C# 13.0. Please use newer language version** +- **CS9268**: *Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.* +- **CS9269**: *UnscopedRefAttribute is only valid in C# 11 or later or when targeting net7.0 or later.* +- [**CS9271**](#implementation-specific-attributes): *The type '`Microsoft.CodeAnalysis.EmbeddedAttribute`' must be non-generic, internal, sealed, non-static, have a parameterless constructor, inherit from System.Attribute, and be able to be applied to any type.* In addition, the following errors and warnings relate to struct initialization changes in recent versions: @@ -224,3 +233,9 @@ class Test } } ``` + +## Implementation specific attributes + +- **CS9271**: *The type '`Microsoft.CodeAnalysis.EmbeddedAttribute`' must be non-generic, internal, sealed, non-static, have a parameterless constructor, inherit from System.Attribute, and be able to be applied to any type.* + +The compiler generates the source for this attribute when needed for your source code. You shouldn't declare this type. diff --git a/docs/csharp/language-reference/compiler-messages/partial-declarations.md b/docs/csharp/language-reference/compiler-messages/partial-declarations.md index 18daadb9e82cc..6563d19b8e1c5 100644 --- a/docs/csharp/language-reference/compiler-messages/partial-declarations.md +++ b/docs/csharp/language-reference/compiler-messages/partial-declarations.md @@ -49,6 +49,13 @@ f1_keywords: - "CS9263" - "CS9264" - "CS9266" + - "CS9273" + - "CS9275" + - "CS9276" + - "CS9277" + - "CS9278" + - "CS9279" + - "CS9280" helpviewer_keywords: - "CS0260" - "CS0261" @@ -96,7 +103,14 @@ helpviewer_keywords: - "CS9258" - "CS9263" - "CS9266" -ms.date: 11/06/2024 + - "CS9273" + - "CS9275" + - "CS9276" + - "CS9277" + - "CS9278" + - "CS9279" + - "CS9280" +ms.date: 05/23/2025 --- # Errors and warnings related to `partial` type and `partial` member declarations @@ -150,11 +164,18 @@ That's by design. The text closely matches the text of the compiler error / warn - [**CS9257**](#partial-properties): *Both partial property declarations must be required or neither may be required* - [**CS9258**](#field-backed-properties): *In this language version, the '`field`' keyword binds to a synthesized backing field for the property. To avoid generating a synthesized backing field, and to refer to the existing member, use '`this.field`' or '`@field`' instead.* - [**CS9263**](#field-backed-properties): *A partial property cannot have an initializer on both the definition and implementation.* +- [**CS9275**](#partial-members): *Partial member must have an implementation part.* +- [**CS9276**](#partial-members): *Partial member must have a definition part.* +- [**CS9277**](#partial-members): *Partial member may not have multiple defining declarations.* +- [**CS9278**](#partial-members): *Partial member may not have multiple implementing declarations.* +- [**CS9279**](#partial-events-and-constructors): *Partial event cannot have initializer.* +- [**CS9280**](#partial-events-and-constructors): *Only the implementing declaration of a partial constructor can have an initializer.* The following warnings can be generated for field backed properties: - [**CS9264**](#field-backed-properties): *Non-nullable property must contain a non-null value when exiting constructor. Consider adding the 'required' modifier, or declaring the property as nullable, or adding '`[field: MaybeNull, AllowNull]`' attributes.** - [**CS9266**](#field-backed-properties): *One accessor of property should use '`field`' because the other accessor is using it.* +- [**CS9273**](#field-backed-properties): *In this language version, '`field`' is a keyword within a property accessor. Rename the variable or use the identifier '`@field`' instead.* The following sections explain the cause and fixes for these errors and warnings. @@ -202,8 +223,12 @@ The compiler warns you if you have multiple fields declared in multiple files fo - **CS8800**: *Both partial member declarations must have identical combinations of `virtual`, `override`, `sealed`, and `new` modifiers.* - **CS8818**: *Partial member declarations must have matching `ref` return values.* - **CS8988**: *The `scoped` modifier of parameter doesn't match partial definition.* +- **CS9275**: *Partial member must have an implementation part.* +- **CS9276**: *Partial member must have a definition part.* +- **CS9277**: *Partial member may not have multiple defining declarations.* +- **CS9278**: *Partial member may not have multiple implementing declarations.* -Partial members have two declarations. The declaration without an implementation is the *declaring declaration*. The declaration with the implementation is the *implementing declaration*. Partial members are allowed only in a `partial` type. Partial members can't be `abstract`. Partial members can't explicitly implement an interface. Both declarations of a partial member must have identical signatures. For example, either both or neither declarations can include the `static` or `unsafe` modifiers. +Partial members must have two declarations. The declaration without an implementation is the *defining declaration*. The declaration with the implementation is the *implementing declaration*. Both declarations are required. Partial members are allowed only in a `partial` type. Partial members can't be `abstract`. Partial members can't explicitly implement an interface. Both declarations of a partial member must have identical signatures. For example, either both or neither declarations can include the `static` or `unsafe` modifiers. ## Partial methods @@ -249,15 +274,23 @@ A partial property or indexer must have both a *declaring declaration* and an *i public partial int ImplementingDeclaration { get => field; set; } ``` +## Partial events and constructors + +- **CS9279**: *Partial event cannot have initializer.* +- **CS9280**: *Only the implementing declaration of a partial constructor can have an initializer.* + +You've declared an initializer on the defining declaration of a partial constructor or on a partial event declaration. You must remove it. + ## field backed properties - **CS9258**: *In this language version, the '`field`' keyword binds to a synthesized backing field for the property. To avoid generating a synthesized backing field, and to refer to the existing member, use '`this.field`' or '`@field`' instead.* - **CS9263**: *A partial property cannot have an initializer on both the definition and implementation.* - **CS9264**: *Non-nullable property must contain a non-null value when exiting constructor. Consider adding the 'required' modifier, or declaring the property as nullable, or adding '`[field: MaybeNull, AllowNull]`' attributes.** - **CS9266**: *One accessor of property should use '`field`' because the other accessor is using it.* +- **CS9273**: *In this language version, '`field`' is a keyword within a property accessor. Rename the variable or use the identifier '`@field`' instead.* [!INCLUDE[field-preview](../../includes/field-preview.md)] -Beginning with C# 13, the preview feature, `field` backed properties allows you to access the compiler synthesized backing field for a property. **CS9258** indicates that you have a variable named `field`, which can be hidden by the contextual keyword `field`. +Beginning with C# 13, the preview feature, `field` backed properties allows you to access the compiler synthesized backing field for a property. **CS9258** or **CS9273** indicate that you have a variable named `field`, which can be hidden by the contextual keyword `field`. **CS9263** indicates that your declaring declaration includes an implementation. That implementation might be accessing the compiler synthesized backing field for that property. **CS9264** indicates that the your use of `field` assumes a non-nullable backing field while the property declaration is nullable. The compiler assumes both the backing field and the property have the same nullability. You need to add the `[field:MaybeNull, AllowNull]` attribute to the property declaration to indicate that the `field` value should be considered nullable. **CS9266** indicates that one of a properties accessors uses the `field` keyword, but the other uses a hand-declared backing field. The warning indicates you may have done that by accident. diff --git a/docs/csharp/language-reference/compiler-messages/source-generator-errors.md b/docs/csharp/language-reference/compiler-messages/source-generator-errors.md index cb20061e8ea8b..005d8200a791a 100644 --- a/docs/csharp/language-reference/compiler-messages/source-generator-errors.md +++ b/docs/csharp/language-reference/compiler-messages/source-generator-errors.md @@ -31,6 +31,7 @@ f1_keywords: - "CS9178" - "CS9206" - "CS9207" + - "CS9270" helpviewer_keywords: - "CS9137" - "CS9138" @@ -61,7 +62,8 @@ helpviewer_keywords: - "CS9178" - "CS9206" - "CS9207" -ms.date: 11/02/2023 + - "CS9270" +ms.date: 05/23/2025 --- # Errors and warnings associated with source generators and interceptors @@ -99,6 +101,7 @@ The following warnings are generated when source generators or interceptors are - [**CS9154**](#signature-mismatch): *Intercepting a call to `M` with interceptor `V`, but the signatures do not match.* - [**CS9158**](#signature-mismatch): *Nullability of reference types in return type doesn't match interceptable method.* - [**CS9159**](#signature-mismatch): *Nullability of reference types in type of parameter doesn't match interceptable method.* +- [**CS9270**](#signature-mismatch): *'`InterceptsLocationAttribute(string, int, int)`' is not supported. Move to 'InterceptableLocation'-based generation of these attributes instead. [(https://github.com/dotnet/roslyn/issues/72133)](https://github.com/dotnet/roslyn/issues/72133)* These errors and warnings follow these themes: @@ -129,6 +132,7 @@ In addition, the following warnings indicate a mismatch in the signatures of the - **CS9154**: *Intercepting a call to `M` with interceptor `V`, but the signatures do not match.* - **CS9158**: *Nullability of reference types in return type doesn't match interceptable method.* - **CS9159**: *Nullability of reference types in type of parameter doesn't match interceptable method.* +- **CS9270**: *'`InterceptsLocationAttribute(string, int, int)`' is not supported. Move to 'InterceptableLocation'-based generation of these attributes instead. [(https://github.com/dotnet/roslyn/issues/72133)](https://github.com/dotnet/roslyn/issues/72133)* The interceptor method must be compatible with the interceptable method. You must follow these rules: @@ -136,6 +140,7 @@ The interceptor method must be compatible with the interceptable method. You mus - The method signatures for the interceptor and the interceptable method must match: They must have the same parameters with the same modifiers in the same order. The return types must also match. - The ref safe contexts must match. In other words, corresponding `ref` parameters must be either `scoped` or not `scoped`. - They methods must both be non-generic, or both must have the same number of type parameters. +- An updated `InterceptorLocationAttribute` constructor signature is preferred. ## Incorrect mapping diff --git a/docs/csharp/language-reference/compiler-messages/string-literal.md b/docs/csharp/language-reference/compiler-messages/string-literal.md new file mode 100644 index 0000000000000..be7f5e5466a0d --- /dev/null +++ b/docs/csharp/language-reference/compiler-messages/string-literal.md @@ -0,0 +1,23 @@ +--- +title: Errors and warnings for string literal declarations +description: This article helps you diagnose and correct compiler errors and warnings when you declare string literals as constants or variables. +f1_keywords: + - "CS9274" +helpviewer_keywords: + - "CS9274" +ms.date: 05/23/2025 +--- +# Errors and warnings for string literal declarations + +There are a few *errors* related to declaring string constants or string literals. + + +- [**CS9274**](#constant-declarations): *Cannot emit this string literal into the data section because it has XXHash128 collision with another string literal.* + +## Constant declarations + +- [**CS9274**](#constant-declarations): *Cannot emit this string literal into the data section because it has XXHash128 collision with another string literal.* + +These errors indicate that your declaration can't be emitted in the data section. Turn this feature off for your application. diff --git a/docs/csharp/language-reference/toc.yml b/docs/csharp/language-reference/toc.yml index a04a064bdd8a9..18c0269b8e81a 100644 --- a/docs/csharp/language-reference/toc.yml +++ b/docs/csharp/language-reference/toc.yml @@ -466,12 +466,12 @@ items: CS0171, CS0188, CS0843, CS8904, CS1738, CS8022, CS8023, CS8024, CS8025, CS8026, CS8058, CS8059, CS8107, CS8192, CS8302, CS8303, CS8304, CS8305, CS8306, CS8314, CS8320, CS8370, CS8371, CS8400, CS8401, CS8511, CS8627, CS8630, CS8652, CS8703, CS8704, CS8706, CS8773, CS8912, CS8919, CS8929, CS8936, CS8957, CS8967, CS9014, CS9015, CS9016, CS9017, CS9058, CS9064, - CS9103, CS9171, CS9194, CS9202, CS9204, CS9240, CS9260 + CS9103, CS9171, CS9194, CS9202, CS9204, CS9240, CS9260, CS9268, CS9269, CS9271 - name: Assembly references href: ./compiler-messages/assembly-references.md displayName: > CS0012, CS0234, CS0246, CS0400, CS1068, CS1069, CS1070, CS1704, CS1683, CS1714, CS1760, CS7008, CS7068, CS7069, - CS7071, CS7079, CS8090, CS8203 + CS7071, CS7079, CS8090, CS8203, CS9286 - name: Constructor declarations href: ./compiler-messages/constructor-errors.md displayName: > @@ -503,6 +503,12 @@ items: displayName: > yield return, yield break, CS1622, CS1624, CS1625, CS1626, CS1627, CS1629, CS1631, CS1637, CS4013, CS8154, CS8176, CS9237, CS9238, CS9239 + - name: Extension declarations + href: ./compiler-messages/extension-declarations.md + displayName: > + CS1100, CS1101, CS1102, CS1103, CS1105, CS1106, CS1109, CS1110, CS1113, CS1112, CS1100, CS1101, CS1102, CS1103, + CS1105, CS1106, CS1109, CS1110, CS1112, CS1113, CS1754, CS9281, CS9282, CS9283, CS9284, CS9285, CS9287, CS9288, + CS9289, CS9290, CS9292, CS9293, CS9295, CS9300, CS9301, CS9302, CS9303, CS9304, CS9305 - name: Partial declarations href: ./compiler-messages/partial-declarations.md displayName: > @@ -510,11 +516,12 @@ items: CS0260, CS0261, CS0262, CS0263, CS0264, CS0265, CS0267, CS0282, CS0501, CS0750, CS0751, CS0754, CS0755, CS0756, CS0757, CS0759, CS0761, CS0762, CS0763, CS0764, CS1067, CS8142, CS8663, CS8795, CS8796, CS8797, CS8798, CS8799, CS8800, CS8817, CS8818, CS8863, CS8988, CS9248, CS9249, CS9250, CS9251, CS9252, CS9253, CS9254, CS9255, CS9256, CS9257, CS9258, CS9263, - CS9264, CS9266 + CS9264, CS9266, CS9273, CS9275, CS9276, CS9277, CS9278, CS9279, CS9280 - name: Params modifier href: ./compiler-messages/params-arrays.md displayName: > - CS0225, CS0231, CS0466, CS0674, CS0758, CS1104, CS1611, CS1670, CS1751, CS9218, CS9223, CS9224, CS9225, CS9227, CS9228 + CS0225, CS0231, CS0466, CS0674, CS0758, CS1104, CS1611, CS1670, CS1751, CS9218, CS9223, CS9224, CS9225, CS9227, CS9228, + CS9272 - name: Nullable warnings href: ./compiler-messages/nullable-warnings.md displayName: > @@ -525,6 +532,9 @@ items: - name: Pattern matching warnings href: ./compiler-messages/pattern-matching-warnings.md displayName: CS8509, CS9134, CS9135 + - name: String literal declarations + href: ./compiler-messages/string-literal.md + displayName: CS9274 - name: Array declarations href: ./compiler-messages/array-declaration-errors.md displayName: > @@ -560,7 +570,7 @@ items: href: ./compiler-messages/source-generator-errors.md displayName: > CS9137, CS9138, CS9139, CS9140, CS9141, CS9142, CS9143, CS9144, CS9145, CS9146, CS9147, CS9148, CS9149, CS9150, CS9151, - CS9152, CS9153, CS9154, CS9155, CS9156, CS9157, CS9158, CS9159, CS9160, CS9161, CS9177, CS9178, CS9206, CS9207 + CS9152, CS9153, CS9154, CS9155, CS9156, CS9157, CS9158, CS9159, CS9160, CS9161, CS9177, CS9178, CS9206, CS9207, CS9270 - name: static abstract interface members href: ./compiler-messages/static-abstract-interfaces.md displayName: CS8920, CS8921, CS8922, CS8923, CS8924, CS8925, CS8926, CS8928, CS8930, 8931, 8932 @@ -1466,30 +1476,10 @@ items: href: ./compiler-messages/cs1061.md - name: CS1065 href: ./compiler-messages/cs1065.md - - name: CS1100 - href: ../misc/cs1100.md - - name: CS1101 - href: ../misc/cs1101.md - - name: CS1102 - href: ../misc/cs1102.md - - name: CS1103 - href: ../misc/cs1103.md - - name: CS1105 - href: ../misc/cs1105.md - - name: CS1106 - href: ../misc/cs1106.md - name: CS1107 href: ../misc/cs1107.md - name: CS1108 href: ../misc/cs1108.md - - name: CS1109 - href: ../misc/cs1109.md - - name: CS1110 - href: ../misc/cs1110.md - - name: CS1112 - href: ./compiler-messages/cs1112.md - - name: CS1113 - href: ../misc/cs1113.md - name: CS1502 href: ../misc/cs1503.md - name: CS1503 diff --git a/docs/csharp/misc/cs1100.md b/docs/csharp/misc/cs1100.md deleted file mode 100644 index 51cf96cb1c4d6..0000000000000 --- a/docs/csharp/misc/cs1100.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -description: "Compiler Error CS1100" -title: "Compiler Error CS1100" -ms.date: 07/20/2015 -f1_keywords: - - "CS1100" -helpviewer_keywords: - - "CS1100" -ms.assetid: ea233371-36b6-49ae-a98c-a00ee3b79e53 ---- -# Compiler Error CS1100 - -Method 'name' has a parameter modifier 'this' which is not on the first parameter. - - The `this` modifier is allowed only on the first parameter of a method, which indicates to the compiler that the method is an extension method. - -## To correct this error - -1. Remove the `this` modifier from all except the first parameter of the method. - -## Example - - The following code generates CS1100 because a `this` parameter is modifying the second parameter: - -```csharp -// cs1100.cs -static class Test -{ - static void ExtMethod(int i, this Test c) // CS1100 - { - } -} -``` - -## See also - -- [Extension Methods](../programming-guide/classes-and-structs/extension-methods.md) diff --git a/docs/csharp/misc/cs1101.md b/docs/csharp/misc/cs1101.md deleted file mode 100644 index 78ee3f3615ba9..0000000000000 --- a/docs/csharp/misc/cs1101.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -description: "Compiler Error CS1101" -title: "Compiler Error CS1101" -ms.date: 07/20/2015 -f1_keywords: - - "CS1101" -helpviewer_keywords: - - "CS1101" -ms.assetid: d6fc8834-eadf-4497-b442-0751895e6764 ---- -# Compiler Error CS1101 - -The parameter modifier 'ref' cannot be used with 'this'. - - When the `this` keyword modifies the first parameter of a static method, it signals to the compiler that the method is an extension method. With C# version 7.1 and below, no other modifiers are needed or allowed on the first parameter of an extension method. Since C# version 7.2, `ref` extension methods are allowed, take a look at [extension methods](../programming-guide/classes-and-structs/extension-methods.md) for more details. - -## Example - - The following example generates CS1101: - -```csharp -// cs1101.cs -// Compile with: /target:library -public static class Extensions -{ - public static void Test(ref this int i) {} // CS1101 -} -``` - -## See also - -- [this](../language-reference/keywords/this.md) -- [ref](../language-reference/keywords/ref.md) diff --git a/docs/csharp/misc/cs1102.md b/docs/csharp/misc/cs1102.md deleted file mode 100644 index 07bb4d7271add..0000000000000 --- a/docs/csharp/misc/cs1102.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -description: "Compiler Error CS1102" -title: "Compiler Error CS1102" -ms.date: 07/20/2015 -f1_keywords: - - "CS1102" -helpviewer_keywords: - - "CS1102" -ms.assetid: 7de798d4-1b4b-4842-ae43-9bc83e6dc9a3 ---- -# Compiler Error CS1102 - -The parameter modifier 'out' cannot be used with 'this'. - - When the `this` keyword modifies the first parameter of a static method, it signals to the compiler that the method is an extension method. No other modifiers are needed or allowed on the first parameter of an extension method. - -## To correct this error - -1. Remove the unauthorized modifiers from the first parameter. - -## Example - - The following example generates CS1102: - -```csharp -// cs1102.cs -// Compile with: /target:library. -public static class Extensions -{ - // No type parameters. - public static void Test(this out int i) {} // CS1102 - - //Single type parameter - public static void Test(this out T t) {}// CS1102 - - //Multiple type parameters - public static void Test(this out U u) {}// CS1102 -} -``` - -## See also - -- [Extension Methods](../programming-guide/classes-and-structs/extension-methods.md) -- [this](../language-reference/keywords/this.md) -- [out](../language-reference/keywords/out.md) diff --git a/docs/csharp/misc/cs1103.md b/docs/csharp/misc/cs1103.md deleted file mode 100644 index a6697ca0e0b2b..0000000000000 --- a/docs/csharp/misc/cs1103.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -description: "Compiler Error CS1103" -title: "Compiler Error CS1103" -ms.date: 07/20/2015 -f1_keywords: - - "CS1103" -helpviewer_keywords: - - "CS1103" -ms.assetid: 513a26ea-9d66-4dc3-b3e6-d709c3089b1a ---- -# Compiler Error CS1103 - -The first parameter of an extension method cannot be of type 'type'. - - The first parameter of an extension method cannot be a pointer type. - -## Example - - The following example generates CS1103: - -```csharp -// cs1103.cs -public static class Extensions -{ - public unsafe static char* Test(this char* charP) { return charP; } // CS1103 -} -``` - -## See also - -- [Extension Methods](../programming-guide/classes-and-structs/extension-methods.md) -- [unsafe](../language-reference/keywords/unsafe.md) diff --git a/docs/csharp/misc/cs1105.md b/docs/csharp/misc/cs1105.md deleted file mode 100644 index 95d658be9056a..0000000000000 --- a/docs/csharp/misc/cs1105.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -description: "Compiler Error CS1105" -title: "Compiler Error CS1105" -ms.date: 07/20/2015 -f1_keywords: - - "CS1105" -helpviewer_keywords: - - "CS1105" -ms.assetid: fcbd91ad-a76a-4b22-868d-16824fa96f85 ---- -# Compiler Error CS1105 - -Extension methods must be static. - - Extension methods must be declared as static methods in a non-generic static class. - -## Example - - The following example generates CS1105 because `Test` is not static: - -```csharp -// cs1105.cs -// Compile with: /target:library -public class Extensions -{ - - // Single type parameter. - public void Test(this System.String s) {} //CS1105 - -} -``` - -## See also - -- [Extension Methods](../programming-guide/classes-and-structs/extension-methods.md) -- [static](../language-reference/keywords/static.md) diff --git a/docs/csharp/misc/cs1106.md b/docs/csharp/misc/cs1106.md deleted file mode 100644 index e973dfadf2afc..0000000000000 --- a/docs/csharp/misc/cs1106.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -description: "Compiler Error CS1106" -title: "Compiler Error CS1106" -ms.date: 07/20/2015 -f1_keywords: - - "CS1106" -helpviewer_keywords: - - "CS1106" -ms.assetid: 3585600a-6b2c-47aa-a418-ef049f07c107 ---- -# Compiler Error CS1106 - -Extension methods must be defined in a non generic static class. - - Extension methods must be defined as static methods in a non-generic static class. - -## Example - - The following example generates CS1106: - -```csharp -// CS1106.cs -public class NonStaticClass // CS1106 -{ - public static void ExtensionMethod1(this int num) {} -} - -public static class StaticGenericClass // CS1106 -{ - public static void ExtensionMethod2(this int num) {} -} - -public static class StaticClass // OK -{ - public static void ExtensionMethod3(this int num) {} -} -``` - -## See also - -- [Extension Methods](../programming-guide/classes-and-structs/extension-methods.md) -- [Generic Classes](../programming-guide/generics/generic-classes.md) -- [static](../language-reference/keywords/static.md) diff --git a/docs/csharp/misc/cs1109.md b/docs/csharp/misc/cs1109.md deleted file mode 100644 index db9e36df5e561..0000000000000 --- a/docs/csharp/misc/cs1109.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -description: "Compiler Error CS1109" -title: "Compiler Error CS1109" -ms.date: 07/20/2015 -f1_keywords: - - "CS1109" -helpviewer_keywords: - - "CS1109" -ms.assetid: bebe56b8-3831-4ebb-a49e-e0364b4c11a7 ---- -# Compiler Error CS1109 - -Extension Methods must be defined on top level static classes, 'name' is a nested class. - - Extension methods cannot be defined in nested classes. - -## Example - - The following example generates CS1109 because the class `Extension` is nested inside the class `Out`: - -```csharp -// cs1109.cs -public class Test -{ -} -static class Out -{ - static class Extension - { - static void ExtMethod(this Test c) // CS1109 - { - } - } -} -``` - -## See also - -- [Extension Methods](../programming-guide/classes-and-structs/extension-methods.md) diff --git a/docs/csharp/misc/cs1110.md b/docs/csharp/misc/cs1110.md deleted file mode 100644 index e3bb4eee5dfd1..0000000000000 --- a/docs/csharp/misc/cs1110.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -description: "Compiler Error CS1110" -title: "Compiler Error CS1110" -ms.date: 07/20/2015 -f1_keywords: - - "CS1110" -helpviewer_keywords: - - "CS1110" -ms.assetid: 5b571a76-1891-4f33-b23d-7c4cc654a05f ---- -# Compiler Error CS1110 - -Cannot use 'this' modifier on first parameter of method declaration without a reference to System.Core.dll. Add a reference to System.Core.dll or remove 'this' modifier from the method declaration. - - Extension methods are supported on version 3.5 and later of .NET Framework. Extension methods generate metadata which marks the method with an attribute. The attribute class is in system.core.dll. - -## To correct this error - -1. As the message states, add a reference to System.Core.dll or remove the `this` modifier from the method declaration. - -## Example - - The following example generates CS1110 if the file is not compiled with a reference to System.Core.dll: - -```csharp -// cs1110.cs -// CS1110 -// Compile with: /target:library -public static class Extensions -{ - public static bool Test(this bool b) { return b; } -} -``` - -## See also - -- [Extension Methods](../programming-guide/classes-and-structs/extension-methods.md) diff --git a/docs/csharp/misc/cs1113.md b/docs/csharp/misc/cs1113.md deleted file mode 100644 index 52c181480e340..0000000000000 --- a/docs/csharp/misc/cs1113.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -description: "Compiler Error CS1113" -title: "Compiler Error CS1113" -ms.date: 07/20/2015 -f1_keywords: - - "CS1113" -helpviewer_keywords: - - "CS1113" -ms.assetid: ef2d828f-b5ee-4be9-ba2e-36df5502cc5a ---- -# Compiler Error CS1113 - -Extension methods 'name' defined on value type 'name' cannot be used to create delegates. - - Extension methods that are defined for class types can be used to create delegates. Extension methods that are defined for value types cannot. - -## To correct this error - -1. Associate the extension method with a class type. - -2. Make the method a regular method on the struct. - -## Example - - The following example generates CS1113: - -```csharp -// cs1113.cs -using System; -public static class Extensions -{ - public static S ExtMethod(this S s) - { - return s; - } -} - -public struct S -{ -} - -public class Test -{ - static int Main() - { - Func f = new S().ExtMethod; // CS1113 - return 1; - } -} -``` - -## See also - -- [Extension Methods](../programming-guide/classes-and-structs/extension-methods.md) diff --git a/docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md b/docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md index 54771c4384058..74ef235c58606 100644 --- a/docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md +++ b/docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md @@ -1,7 +1,7 @@ --- title: "Sorry, we don't have specifics on this error" description: "List of possible resources for compiler errors and warnings that haven't been documented yet." -ms.date: 02/20/2025 +ms.date: 05/23/2025 f1_keywords: - "CS0190" - "CS0224" @@ -18,7 +18,6 @@ f1_keywords: - "CS1669" - "CS1734" - "CS1735" - - "CS1743" - "CS1745" - "CS1747" - "CS1748" @@ -621,14 +620,23 @@ f1_keywords: - "CS9234" - "CS9235" - "CS9236" -# C# 13 errors begin here - - "CS9268" - - "CS9269" - - "CS9270" - - "CS9271" # C# 14 errors begin here - - "CS9273" - - "CS9274" +## Shebang + - "CS9297" + - "CS9298" + - "CS9299" +## using `extension` as type name. (valid identifiers). + - "CS9306" +## User defined operators + - "CS9308" + - "CS9310" + - "CS9311" + - "CS9312" + - "CS9313" +## Shebang + - "CS9314" +## Strings in the data section: + - "CS9315" helpviewer_keywords: - "errors [C#], additional information" --- diff --git a/docs/csharp/specification/toc.yml b/docs/csharp/specification/toc.yml index 59272a001807a..9ed58622e0955 100644 --- a/docs/csharp/specification/toc.yml +++ b/docs/csharp/specification/toc.yml @@ -205,7 +205,7 @@ items: href: ../../../_csharplang/proposals/csharp-13.0/partial-properties.md - name: Partial events and constructors href: ../../../_csharplang/proposals/partial-events-and-constructors.md - - name: Field backed properties (preview) + - name: Field backed properties href: ../../../_csharplang/proposals/field-keyword.md - name: Covariant return types href: ../../../_csharplang/proposals/csharp-9.0/covariant-returns.md