[Mono-list] enum broken

Jonathan Stowe gellyfish@gellyfish.com
Sun, 7 Apr 2002 10:12:12 +0100 (BST)


On Sun, 7 Apr 2002, Jonathan Stowe wrote:

> This really doesn't do what it should :
>

On further inspection it appears that it is something that WriteLine() is
doing:

   class Test
   {
     enum Zub :int
     {
        Foo = 99,
        Bar,
        Baz
      }


      static void Main()
      {
         int foo = 0 + Zub.Foo;
         System.Console.WriteLine("Foo : {0}", foo);

       }
   }

Works as expected.  Interestingly however direct initialization of foo
from Zub.Foo fails to compile with:

(process:13688): ** WARNING **: unhandled exception
System.FormatException: "The specified format is invalid"


/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |