@@ -225,15 +225,24 @@ private ImmutableArray<Symbol> BindOperatorMemberCref(OperatorMemberCrefSyntax s
225
225
CrefParameterListSyntax ? parameterListSyntax = syntax . Parameters ;
226
226
bool isChecked = syntax . CheckedKeyword . IsKind ( SyntaxKind . CheckedKeyword ) ;
227
227
228
- // NOTE: Prefer binary to unary, unless there is exactly one parameter.
229
- // CONSIDER: we're following dev11 by never using a binary operator name if there's
230
- // exactly one parameter, but doing so would allow us to match single-parameter constructors.
231
228
SyntaxKind operatorTokenKind = syntax . OperatorToken . Kind ( ) ;
232
- string ? memberName = parameterListSyntax != null && parameterListSyntax . Parameters . Count == 1
233
- ? null
234
- : OperatorFacts . BinaryOperatorNameFromSyntaxKindIfAny ( operatorTokenKind , isChecked ) ;
229
+ string ? memberName ;
235
230
236
- memberName = memberName ?? OperatorFacts . UnaryOperatorNameFromSyntaxKindIfAny ( operatorTokenKind , isChecked : isChecked ) ;
231
+ if ( SyntaxFacts . IsOverloadableCompoundAssignmentOperator ( operatorTokenKind ) )
232
+ {
233
+ memberName = OperatorFacts . CompoundAssignmentOperatorNameFromSyntaxKind ( operatorTokenKind , isChecked ) ;
234
+ }
235
+ else
236
+ {
237
+ // NOTE: Prefer binary to unary, unless there is exactly one parameter.
238
+ // CONSIDER: we're following dev11 by never using a binary operator name if there's
239
+ // exactly one parameter, but doing so would allow us to match single-parameter constructors.
240
+ memberName = parameterListSyntax != null && parameterListSyntax . Parameters . Count == 1
241
+ ? null
242
+ : OperatorFacts . BinaryOperatorNameFromSyntaxKindIfAny ( operatorTokenKind , isChecked ) ;
243
+
244
+ memberName = memberName ?? OperatorFacts . UnaryOperatorNameFromSyntaxKindIfAny ( operatorTokenKind , isChecked : isChecked ) ;
245
+ }
237
246
238
247
if ( memberName == null ||
239
248
( isChecked && ! syntax . OperatorToken . IsMissing && ! SyntaxFacts . IsCheckedOperator ( memberName ) ) ) // the operator cannot be checked
0 commit comments