Browse Source

Show the numeric value when decompiling an enum member. Closes #126.

pull/129/head
Daniel Grunwald 15 years ago
parent
commit
256fc931e9
  1. 2
      ICSharpCode.Decompiler/Ast/AstBuilder.cs

2
ICSharpCode.Decompiler/Ast/AstBuilder.cs

@ -857,7 +857,7 @@ namespace ICSharpCode.Decompiler.Ast @@ -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);

Loading…
Cancel
Save