Beef icon indicating copy to clipboard operation
Beef copied to clipboard

[BUG] It is possible to create a class with the same name of a namespace

Open Igoorx opened this issue 5 years ago • 0 comments

This bug(?) makes possible unwanted implicitly access to the class with the same name of the namespace, for example, If this code is in a dependency of a project:

namespace TestN
{
	public class TestC
	{
		public struct ChildS
		{
			public const int i = 0x833F;
		}
	}
}

And if the code below is in the project, you will be able to access ChildS implicitly.

namespace TestN.TestC
{
	public class TestC
	{
		public void Test()
		{
			ChildS cs = ChildS(); // works
		}
	}
}

Igoorx avatar Jan 24 '21 16:01 Igoorx