Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ f1_keywords:
- "CS8929"
- "CS8957" # ERR_NoImplicitConvTargetTypedConditional Conditional expression is not valid in language version {0} because a common type was not found between '{1}' and '{2}'
- "CS8912" # ERR_InheritingFromRecordWithSealedToString Inheriting from a record with a sealed 'Object.ToString' is not supported
- "CS9041" # ERR_UnsupportedCompilerFeature '{0}' requires compiler feature '{1}', which is not supported by this version of the C# compiler.
- "CS9014" # ERR_UseDefViolationPropertyUnsupportedVersion Use of possibly unassigned property
- "CS9015" # ERR_UseDefViolationFieldUnsupportedVersion Use of possibly unassigned field
- "CS9016" # WRN_UseDefViolationPropertyUnsupportedVersion Use of possibly unassigned property
Expand Down Expand Up @@ -98,6 +99,7 @@ helpviewer_keywords:
- "CS8912"
- "CS8919"
- "CS8929"
- "CS9041"
- "CS9014"
- "CS9015"
- "CS9016"
Expand Down Expand Up @@ -150,6 +152,7 @@ That's be design. The text closely matches the text of the compiler error / warn
- **CS8929**: *Method cannot implement interface member in type because the target runtime doesn't support static abstract members in interfaces.*
- **CS8957**: *Conditional expression is not valid in language version because a common type was not found between types.*
- **CS8967**: *Newlines inside a non-verbatim interpolated string are not supported in C#*
- **CS9041**: *Requires compiler feature, which is not supported by this version of the C# compiler.*
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- **CS9041**: *Requires compiler feature, which is not supported by this version of the C# compiler.*
- **CS9041**: *Requires a compiler feature that is not supported by this version of the C# compiler.*

- **CS9014**: *Error: Use of possibly unassigned property. Upgrade to auto-default the property.*
- **CS9015**: *Error: Use of possibly unassigned field. Upgrade to auto-default the field.*
- **CS9016**: *Warning: Use of possibly unassigned property. Upgrade to auto-default the property.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ helpviewer_keywords:
- "CS9023"
- "CS9024"
- "CS9025"
- "CS9027"
- "CS9308"
- "CS9310"
- "CS9311"
Expand Down Expand Up @@ -119,6 +120,7 @@ That's by design. The text closely matches the text of the compiler error / warn
- [**CS9023**](#checked-operators): *Operator cannot be made checked.*
- [**CS9024**](#checked-operators): *Operator cannot be made unchecked.*
- [**CS9025**](#checked-operators): *Operator requires a matching non-checked version to also be declared.*
- [**CS9027**](#checked-operators): *Unexpected keyword 'unchecked'*
- [**CS9308**](#operator-declaration-requirements): *User-defined operator must be declared public.*
- [**CS9310**](#operator-signature-requirements): *The return type for this operator must be void.*
- [**CS9311**](#interface-and-inheritance-requirements): *Type does not implement interface member. The type cannot implement member because one of them is not an operator.*
Expand Down Expand Up @@ -386,11 +388,13 @@ public class C4
- **CS9023**: *Operator can't be made checked*
- **CS9024**: *Operator can't be made unchecked*
- **CS9025**: *Checked operator requires a matching non-checked version to also be declared*
- **CS9027**: *Unexpected keyword 'unchecked'*

To use checked operators correctly, follow these requirements. For more information, see [Arithmetic operators](../operators/arithmetic-operators.md#user-defined-checked-operators) and [User-defined checked operators](~/_csharplang/proposals/csharp-11.0/checked-user-defined-operators.md).

- Apply `checked` or `unchecked` keywords only to supported arithmetic operators: `+`, `-`, `*`, `/`, `++`, `--`, and explicit conversions (**CS9023**, **CS9024**).
- Provide both checked and unchecked versions when declaring a checked operator (**CS9025**). The compiler needs both to handle different contexts.
- Use the `unchecked` keyword only in valid operator declaration contexts (**CS9027**). Don't place it in locations where it's syntactically unexpected.

## Interface and inheritance requirements

Expand Down
Loading
Loading