R
Rene
If variance/covariance is not allowed in array of value types, why is the
expression on the "Main" method run successfully (see snippet below)? I am
missing something?
Thank you.
---------------------
class Program
{
enum Foo
{
a, b, c
}
enum Bar
{
x, y, z
}
static void Main(string[] args)
{
Bar[] barArray = (Bar[])System.Enum.GetValues(typeof(Foo));
}
}
---------------------
expression on the "Main" method run successfully (see snippet below)? I am
missing something?
Thank you.
---------------------
class Program
{
enum Foo
{
a, b, c
}
enum Bar
{
x, y, z
}
static void Main(string[] args)
{
Bar[] barArray = (Bar[])System.Enum.GetValues(typeof(Foo));
}
}
---------------------