[Mono-list] enum examples from TiC# don't compile with mcs

Miguel de Icaza miguel@ximian.com
19 Dec 2002 12:22:04 -0500


Hello

> using System;
> 
> class EnumTest {
>     enum Coin: short {
>         Penny = 1,
>         Nickel = 5,
>         Dime   = 10,
>         Quarter = 25,
>         Dollar = 100
>     }
> 
>     public static void Main ()
>     {
>         short change = (short)(Coin.Penny + Coin.Nickel);
>         Console.WriteLine (change);
>     }
> }
> 
> Question: is this a bug in mcs or a bug in the book? What does csc do?

It is a bug with the example.  Operator + is not defined for two
enumerations.

Miguel