Why does C# allow ambiguous function calls through optional arguments?
问题 I came across this today, and I am surprised that I haven't noticed it before. Given a simple C# program similar to the following: public class Program { public static void Main(string[] args) { Method(); // Called the method with no arguments. Method("a string"); // Called the method with a string. Console.ReadLine(); } public static void Method() { Console.WriteLine("Called the method with no arguments."); } public static void Method(string aString = "a string") { Console.WriteLine("Called