Browse Source

Use correct annotation to detect custom operators.

pull/728/merge
Siegfried Pammer 9 years ago
parent
commit
b6cd1f3ccb
  1. 2
      ICSharpCode.Decompiler/CSharp/Transforms/ReplaceMethodCallsWithOperators.cs

2
ICSharpCode.Decompiler/CSharp/Transforms/ReplaceMethodCallsWithOperators.cs

@ -255,7 +255,7 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms @@ -255,7 +255,7 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms
// detect increment/decrement
if (assignment.Right.IsMatch(new PrimitiveExpression(1))) {
// only if it's not a custom operator
if (assignment.Annotation<MethodReference>() == null) {
if (assignment.Annotation<IL.CallInstruction>() == null) {
UnaryOperatorType type;
// When the parent is an expression statement, pre- or post-increment doesn't matter;
// so we can pick post-increment which is more commonly used (for (int i = 0; i < x; i++))

Loading…
Cancel
Save