Browse Source

Fixed bug that caused redundant casts.

pull/100/head
Daniel Grunwald 15 years ago
parent
commit
5c45d4c700
  1. 2
      ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs
  2. 1
      ICSharpCode.Decompiler/Tests/Types/TypeTests.cs

2
ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs

@ -739,6 +739,8 @@ namespace ICSharpCode.Decompiler.Ast @@ -739,6 +739,8 @@ namespace ICSharpCode.Decompiler.Ast
}
if (actualIsIntegerOrEnum && requiredIsIntegerOrEnum) {
if (actualType.FullName == reqType.FullName)
return expr;
return expr.CastTo(AstBuilder.ConvertType(reqType));
}
return expr;

1
ICSharpCode.Decompiler/Tests/Types/TypeTests.cs

@ -6,6 +6,7 @@ using NUnit.Framework; @@ -6,6 +6,7 @@ using NUnit.Framework;
namespace ICSharpCode.Decompiler.Tests.Types
{
[TestFixture]
public class TypeTests : DecompilerTestBase
{
[Test]

Loading…
Cancel
Save