John,

  JE> This fails at compile-time:
  JE>
  JE>   public enum MyEnum : short {
  JE>     ValueOne = 0,
  JE>     ValueTwo = 1,
  JE>   }
  JE>
  JE>   Console.WriteLine((MyEnum)Int32.MaxValue);

What is exactly your point, here? C#'s short type is mapped to System.Int16.
Surely 2^32 - 1 exeeds the range of an enumerated type that's backed up by a
16-bit integer.

  short n = (short) System.Int32.MaxValue;

fails just as well.

Regards,

Stefan

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to