C#'s compiler doesn't complain when you instantiate an enum using new:

enum Foo
{
    Bar
}

Foo x = new Foo();

x will then be a Foo with value Bar.

Does new Foo() have any use I'm not aware of? Or am I just boxing and immediately unboxing an enum value?

c#
Edit
Report