Why is a local function not always hidden in C#7?
问题 What I am showing below, is rather a theoretical question. But I am interested in how the new C#7 compiler works and resolves local functions. In C#7 I can use local functions. For example (you can try these examples in LinqPad beta): Example 1: Nested Main() void Main() { void Main() { Console.WriteLine("Hello!"); } Main(); } DotNetFiddle for Example 1 Rather than calling Main() in a recursive way, the local function Main() is being called once, so the output of this is: Hello! The compiler