diff --git a/csharp/extractor/Semmle.Extraction.CSharp.Util/SymbolExtensions.cs b/csharp/extractor/Semmle.Extraction.CSharp.Util/SymbolExtensions.cs
index 92d7ecfad6b..50604e2404e 100644
--- a/csharp/extractor/Semmle.Extraction.CSharp.Util/SymbolExtensions.cs
+++ b/csharp/extractor/Semmle.Extraction.CSharp.Util/SymbolExtensions.cs
@@ -52,6 +52,13 @@ namespace Semmle.Extraction.CSharp.Util
{ "op_False", "false" }
});
+ ///
+ /// The operatorname for user-defined increment and decrement operators are "op_IncrementAssignment" and
+ /// "op_DecrementAssignment" respectively.
+ /// Thus we need to handle this explicitly to avoid postfixing them with an "=".
+ ///
+ private static bool isIncrementOrDecrement(string operatorName) => operatorName == "++" || operatorName == "--";
+
///
/// Convert an operator method name in to a symbolic name.
/// A return value indicates whether the conversion succeeded.
@@ -72,7 +79,7 @@ namespace Semmle.Extraction.CSharp.Util
if (match.Success && methodToOperator.TryGetValue($"op_{match.Groups[2]}", out var rawOperatorName))
{
var prefix = match.Groups[1].Success ? "checked " : "";
- var postfix = match.Groups[3].Success ? "=" : "";
+ var postfix = match.Groups[3].Success && !isIncrementOrDecrement(rawOperatorName) ? "=" : "";
operatorName = $"{prefix}{rawOperatorName}{postfix}";
return true;
}