Greg,

Your code is intuitively correct. But instead of being at the mercy of
compiler and trying to contort ( distord ) that code,
recalim control by using something like this:

    public class MyEnum
    {
        public bool Foo { get; set; }
        public bool Bar { get; set; }
        public bool Bang { get; set; }
    }


    void PassEnumToMethod(MyEnum[] enums)
        {

        }


Regards

Arjang

On 6 November 2011 10:33, Greg Keogh <[email protected]> wrote:
> Folks, I thought this would be valid:
>
>
>
> public enum MyEnum { Foo, Bar, Whizz, Bang };
>
> :
>
> PassEnumToMethod(MyEnum[] enums)
>
> :
>
> Void PassEnumToMethod(Enum[] enums)
>
> {
>
>     // Generic code for any type of Enum here
>
> }
>
>
>
> The C# compiler says it can’t convert from MyEnum to System.Enum. It may be
> early on Sunday morning, but what am I forgetting?
>
>
>
> Cheers,
>
> Greg

Reply via email to