-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Open
Description
User Defined Compound Assignment Test Plan
Championed proposal: dotnet/csharplang#9101
Speclet: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-14.0/user-defined-compound-assignment.md
Feature branch: https://github.com/dotnet/roslyn/tree/features/UserDefinedCompoundAssignment
- language version
- ref safety analysis
- public API review
-
SyntaxFacts.IsOverloadableCompoundAssignmentOperator(SyntaxKind) - IOperation
- CFG (CompoundAssignment_12, IncrementOrDecrementFlow_03)
- GetOperatorKind (CompoundAssignment_01480_GetOperatorKind)
- GetSymbolInfo on the operator
-
- VB Interop (Tests:
CompoundAssignment_01380_VisualBasic,CompoundAssignment_01390_VisualBasic,CompoundAssignment_01400_VisualBasic_Checked,CompoundAssignment_01410_VisualBasic,CompoundAssignment_01420_VisualBasic_Checked) - Partners
- F# heads up
- C++ heads up
- Docs team heads up
- Obsolete is reported (
Increment_087_Consumption_Obsolete,CompoundAssignment_00870_Consumption_Obsolete) - Accessibility
- Operator non-public (
CompoundAssignment_00022_MustBePublic_ExplicitAccessibility,CompoundAssignment_01440_MetadataValidation,Increment_002_MustBePublic_ExplicitAccessibility,Increment_144_MetadataValidation) - Operator public (
CompoundAssignment_00010,CompoundAssignment_00021_ImplicitlyPublicInInterface,Increment_001)
- Operator non-public (
- Modifiers
- New allowed - new/override/readonly (
Increment_0XX_AllowedInY, CompoundAssignment_0XX_AllowedInY`) - Disallowed - (
Increment_0XX_NotAllowedInY, CompoundAssignment_0XX_NotAllowedInY`)
- New allowed - new/override/readonly (
- Must return void (
Increment_003_MustReturnVoid,Increment_004_MustReturnVoid_Checked,CompoundAssignment_00030_MustReturnVoid,CompoundAssignment_00040_MustReturnVoid_Checked) - Operator in interface
- static - compound assignment disallowed (
CompoundAssignment_00013_Not_Static) - instance abstract (
Increment_009_AbstractAllowedInClassAndInterface,CompoundAssignment_00090_AbstractAllowedInClassAndInterface) - instance concrete (
Increment_001,CompoundAssignment_00010)
- static - compound assignment disallowed (
- operator in class/struct
-
static abstractnot allowed increment/decrement (Increment_018_AbstractNotAllowedInClass_OnStatic,Increment_019_AbstractNotAllowedInStruct) - instance implementation from interface (
Increment_012_AbstractCanBeImplementedExplicitlyInClassAndStruct,Increment_013_AbstractCanBeImplementedImplicitlyInClassAndStruct,CompoundAssignment_00120_AbstractCanBeImplementedExplicitlyInClassAndStruct,CompoundAssignment_00130_AbstractCanBeImplementedImplicitlyInClassAndStruct)
-
- parameter ref kinds (
CompoundAssignment_01431_MetadataValidation) - parameter defaults disallowed (
CompoundAssignment_00900_Consumption_BadOperator,CompoundAssignment_00910_Consumption_BadOperator) - use in expression trees (Increment_145_ExpressionTree, CompoundAssignment_01490_ExpressionTree)
- partial definition/implementation (Increment_146_Partial, CompoundAssignment_01500_Partial, CompoundAssignmentDeclaration_19_Partial, CompoundAssignmentDeclaration_20_Partial, IncrementDeclaration_01_Partial, IncrementDeclaration_02_Partial)
- instance overridding/hiding
- Overridding (
Increment_033_OverrideAllowedInClass,CompoundAssignment_00330_OverrideAllowedInClass,CompoundAssignment_00331_OverrideAllowedInClass)- Testing copying modopts from overridden operator (Increment_147_CopyModifiers, CompoundAssignment_01510_CopyModifiers, CompoundAssignment_01520_CopyModifiers)
- Hiding with/without
new(warnings) (Increment_054_NewAllowedInInterface_WRN_NewRequired,Increment_055_NewAllowedInClass_WRN_NewRequired,CompoundAssignment_00540_NewAllowedInInterface_WRN_NewRequired,CompoundAssignment_00550_NewAllowedInClass_WRN_NewRequired) - Nullable mismatch on override (CompoundAssignment_01530_NullableMismatchOnOverride)
- Overridding (
- Nullability mismatch on operands (
Increment_089_Consumption_NullableAnalysis,CompoundAssignment_00890_Consumption_NullableAnalysis,CompoundAssignment_00891_Consumption_NullableAnalysis,Increment_089_Consumption_NullableAnalysis) - Test instance operator in catch filter (Increment_148_Consumption_InCatchFilter, CompoundAssignment_01540_Consumption_InCatchFilter)
- Operator methods attributed with Unmanaged callers only (
CompoundAssignment_00880_Consumption_UnmanagedCallersOnly,Increment_088_Consumption_UnmanagedCallersOnly) - Use in
DebuggerDisplay - Consumption
- Both instance and static present for increment (
Increment_093_Consumption_RegularVsOperator,CompoundAssignment_00930_Consumption_RegularVsOperator) - Checked vs nonchecked (
CompoundAssignment_00800_Consumption_CheckedVersionInRegularContext,Increment_080_Consumption_CheckedVersionInRegularContext) - Reference safety (
CompoundAssignment_00740_Consumption_RefSafetythroughCompoundAssignment_00753_Consumption_RefSafety) - Bad operator detection (
CompoundAssignment_00900_Consumption_BadOperatorthroughCompoundAssignment_00912_Consumption_BadOperator,Increment_090_Consumption_BadOperator,Increment_091_Consumption_BadOperator) - Operator implementation (
CompoundAssignment_01030_Consumption_Implementation,Increment_103_Consumption_Implementation) - Operator overriding (
CompoundAssignment_01040_Consumption_Overriding,Increment_104_Consumption_Overriding) - Shadowing (
CompoundAssignment_00810_Consumption_ShadowingthroughCompoundAssignment_00830_Consumption_Shadowing,Increment_081_Consumption_ShadowingthroughIncrement_083_Consumption_Shadowing) - Ambiguity (
CompoundAssignment_00850_Consumption_Ambiguity,Increment_085_Consumption_Ambiguity) - Interpolated string handler (
CompoundAssignment_01470_InterpolatedStringHandlerArgument) - Overload resolution priority (
CompoundAssignment_01450_Consumption_OverloadResolutionPriority,CompoundAssignment_01460_Consumption_OverloadResolutionPriority_CheckedContext) - Interactions with the new
c?.Value += blahfeature (*_Consumption_ConditionalAccessTarget)
- Both instance and static present for increment (
Issue to reserve new operator names - dotnet/runtime#114930
Issues from IDE test pass:
- Unexpected/misleading IDE diagnostics for a user defined assignment operator declaration
- Unexpected/misleading IDE diagnostics for a user defined assignment operator usage
- Implement interface generator adds
staticmodifier for assignment operators - Implement abstract class fixer adds
staticand doesn't addoverridemodifier for an assignment operator - Override completion doesn't offer to override assignment operators
- Go-to-def and Find-refs
Reactions are currently unavailable