diff --git a/ICSharpCode.Decompiler/IL/Instructions/CompoundAssignmentInstruction.cs b/ICSharpCode.Decompiler/IL/Instructions/CompoundAssignmentInstruction.cs index ab6c10f6f..1c9753620 100644 --- a/ICSharpCode.Decompiler/IL/Instructions/CompoundAssignmentInstruction.cs +++ b/ICSharpCode.Decompiler/IL/Instructions/CompoundAssignmentInstruction.cs @@ -56,7 +56,7 @@ namespace ICSharpCode.Decompiler.IL } } - public partial class NumericCompoundAssign : CompoundAssignmentInstruction + public partial class NumericCompoundAssign : CompoundAssignmentInstruction, ILiftableInstruction { /// /// Gets whether the instruction checks for overflow. @@ -195,13 +195,12 @@ namespace ICSharpCode.Decompiler.IL public partial class UserDefinedCompoundAssign : CompoundAssignmentInstruction { public readonly IMethod Method; - public readonly bool IsLifted; + public bool IsLifted => false; // TODO: implement ILi - public UserDefinedCompoundAssign(IMethod method, CompoundAssignmentType compoundAssignmentType, ILInstruction target, ILInstruction value, bool isLifted) + public UserDefinedCompoundAssign(IMethod method, CompoundAssignmentType compoundAssignmentType, ILInstruction target, ILInstruction value) : base(OpCode.UserDefinedCompoundAssign, compoundAssignmentType, target, value) { this.Method = method; - this.IsLifted = isLifted; Debug.Assert(Method.IsOperator); Debug.Assert(compoundAssignmentType == CompoundAssignmentType.EvaluatesToNewValue || (Method.Name == "op_Increment" || Method.Name == "op_Decrement")); Debug.Assert(IsValidCompoundAssignmentTarget(Target)); diff --git a/ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs b/ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs index c7e4a8bc7..25a398df8 100644 --- a/ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs +++ b/ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs @@ -292,7 +292,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms return false; // TODO: add tests and think about whether nullables need special considerations context.Step($"Compound assignment (user-defined binary)", compoundStore); newInst = new UserDefinedCompoundAssign(operatorCall.Method, CompoundAssignmentType.EvaluatesToNewValue, - operatorCall.Arguments[0], rhs, operatorCall.IsLifted); + operatorCall.Arguments[0], rhs); } else { return false; } @@ -539,7 +539,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms } else { Call operatorCall = (Call)value; block.Instructions[pos] = new StLoc(stloc.Variable, new UserDefinedCompoundAssign( - operatorCall.Method, CompoundAssignmentType.EvaluatesToOldValue, stloc.Value, new LdcI4(1), operatorCall.IsLifted)); + operatorCall.Method, CompoundAssignmentType.EvaluatesToOldValue, stloc.Value, new LdcI4(1))); } return true; } @@ -587,7 +587,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms return false; // TODO: add tests and think about whether nullables need special considerations context.Step("TransformPostIncDecOperator (user-defined)", inst); inst.Value = new UserDefinedCompoundAssign(operatorCall.Method, - CompoundAssignmentType.EvaluatesToOldValue, inst.Value, new LdcI4(1), operatorCall.IsLifted); + CompoundAssignmentType.EvaluatesToOldValue, inst.Value, new LdcI4(1)); } else { return false; }