① In following C# code, CS1729 occurs but I understand that CS0122 would be more appropriate.
namespace A
{
class Program
{
static void Main()
{
Test test = new Test(1);
}
}
class Test
{
Test(int i) { }
}
}
CS1729: 'A.Test' does not contain a constructor that takes 1 arguments
CS0122: 'A.Test.Test(int) is inaccessible due to its protection level'
② In following C# code, CS0122 occurs but I understand that CS1729 would be more appropriate
namespace A
{
class Program
{
static void Main()
{
Test test = new Test();
}
}
class Test
{
Test(int i) { }
}
}
CS0122: 'A.Test.Test(int) is inaccessible due to its protection level'
CS1729: 'A.Test' does not contain a constructor that takes 0 arguments
Question: Is there any reason why CS0122 and CS1729 are swapped in ① and ② or is this C# compiler bug ?
P.S.: Errors in ① and ② can be reproduced with Microsoft Visual C# 2010 Compiler version 4.030319.1.