[Mono-list] C# question

dietmar dietmar@ximian.com
10 Jan 2003 20:46:41 +0100


Maybe someone can explain that behaviour?

- Dietmar

-----------------------------------
using System;

public class Test {

	public enum MyEnum {
		ZERO,
		ONE
	}

	public static int Main() {
		MyEnum en = MyEnum.ONE;
		IComparable ic;

		/* this works */
		ic = (IComparable)(object)en;
		
		/* compiler error ??*/
		ic = (IComparable)en;
				
		return 0;
	}
}