Browse Source

Test case for operator "is" on reference types with result used as a boolean.

pull/205/head
Pent Ploompuu 15 years ago
parent
commit
26d903efd5
  1. 2
      ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs
  2. 6
      ICSharpCode.Decompiler/Tests/TypeAnalysisTests.cs

2
ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs

@ -463,7 +463,7 @@ namespace ICSharpCode.Decompiler.Ast
case ILCode.Cge_Un: case ILCode.Cge_Un:
case ILCode.Cge: return new Ast.BinaryOperatorExpression(arg1, BinaryOperatorType.GreaterThanOrEqual, arg2); case ILCode.Cge: return new Ast.BinaryOperatorExpression(arg1, BinaryOperatorType.GreaterThanOrEqual, arg2);
case ILCode.Clt_Un: case ILCode.Clt_Un:
case ILCode.Clt: return new Ast.BinaryOperatorExpression(arg1, BinaryOperatorType.LessThan, arg2); case ILCode.Clt: return new Ast.BinaryOperatorExpression(arg1, BinaryOperatorType.LessThan, arg2);
#endregion #endregion
#region Logical #region Logical
case ILCode.LogicNot: return new Ast.UnaryOperatorExpression(UnaryOperatorType.Not, arg1); case ILCode.LogicNot: return new Ast.UnaryOperatorExpression(UnaryOperatorType.Not, arg1);

6
ICSharpCode.Decompiler/Tests/TypeAnalysisTests.cs

@ -114,4 +114,10 @@ public class TypeAnalysisTests
Console.WriteLine(); Console.WriteLine();
} }
} }
public void OperatorIs(object o)
{
Console.WriteLine(o is Random);
Console.WriteLine(!(o is Random));
}
} }

Loading…
Cancel
Save