The C# compiler accepts the following program as syntactically valid: static void Main(string[] args) { Console.WriteLine("Hello " + (args: "World!")); }However, according to my understanding of the C# grammar, it is not a valid program.The C# compiler translates this into a CLR assembly which throws an InvalidProgramException at runtime (“Common Language Runtime detected an invalid program.”).(By the way, the use of the word “args” is irrelevant. The C# compiler accepts this program with any identifier before the colon.)
Visual Studio/Silverlight/Tooling version
What category (if any) best represents this feedback?
Steps to reproduce
Product Language
Operating System
Operating System Language
Actual results
Expected results