diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.cs index 619540157..7811ffe01 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.cs @@ -394,6 +394,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty //++a; DynamicTests.Casts(-a); DynamicTests.Casts(+a); + DynamicTests.Casts(~a); } private static void Loops(dynamic list) diff --git a/ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs b/ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs index 0b6b87504..f07420fb4 100644 --- a/ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs +++ b/ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs @@ -4540,6 +4540,8 @@ namespace ICSharpCode.Decompiler.CSharp return CreateUnaryOperator(UnaryOperatorType.Minus, isChecked: true); case ExpressionType.UnaryPlus: return CreateUnaryOperator(UnaryOperatorType.Plus, isChecked: inst.BinderFlags.HasFlag(CSharpBinderFlags.CheckedContext)); + case ExpressionType.OnesComplement: + return CreateUnaryOperator(UnaryOperatorType.BitNot); case ExpressionType.IsTrue: var operand = TranslateDynamicArgument(inst.Operand, inst.OperandArgumentInfo); Expression expr;