[Mono-devel-list] Path for monop and enums

Ben Maurer bmaurer at ximian.com
Wed Dec 29 22:11:45 EST 2004


On Wed, 2004-12-29 at 20:10 -0600, Carlos Alberto Cortez wrote:
> +               if (t.IsEnum) {
> +                       FieldInfo value__ = t.GetField ("value__");
> +                       if (value__ != null) {
This will always be true. The ECMA spec requires this field.

Really, though, you should use:

[benm at omega benm]$ monop enum
public class Enum : IComparable, IConvertible, IFormattable {
    ...
    public static Type GetUnderlyingType (Type enumType);


> +                               o.Write (" : {0}", FormatType
> (value__.FieldType));

If the type is `int' you should not write this, as it is done by
default.

-- Ben




More information about the Mono-devel-list mailing list