From 256fc931e961b0fd74204d0448e0e0a44523be3e Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Fri, 15 Apr 2011 17:05:54 +0200 Subject: [PATCH] Show the numeric value when decompiling an enum member. Closes #126. --- ICSharpCode.Decompiler/Ast/AstBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/Ast/AstBuilder.cs b/ICSharpCode.Decompiler/Ast/AstBuilder.cs index 341984981..9c25c7fb4 100644 --- a/ICSharpCode.Decompiler/Ast/AstBuilder.cs +++ b/ICSharpCode.Decompiler/Ast/AstBuilder.cs @@ -857,7 +857,7 @@ namespace ICSharpCode.Decompiler.Ast initializer.Initializer = new NullReferenceExpression(); } else { TypeCode c = Type.GetTypeCode(fieldDef.Constant.GetType()); - if (c >= TypeCode.SByte && c <= TypeCode.UInt64) { + if (c >= TypeCode.SByte && c <= TypeCode.UInt64 && !fieldDef.DeclaringType.IsEnum) { initializer.Initializer = MakePrimitive((long)CSharpPrimitiveCast.Cast(TypeCode.Int64, fieldDef.Constant, false), fieldDef.FieldType); } else { initializer.Initializer = new PrimitiveExpression(fieldDef.Constant);