It is possible.
Imagine this shared library code:
namespace SharedLibrary
{
public class SharedLibraryClassOne
{
public static void PotentialCollisionMethod()
{
}
internal static void SharedLibraryMethodTwo()
{
}
}
public class SharedLibraryClassTwo
{
internal static void PotentialCollisionMethod()
{
}
public static void SharedLibraryMethodThree()
{
}
}
}
Here is a console app that links to the library:
using static SharedLibrary.SharedLibraryClassOne;
using static SharedLibrary.SharedLibraryClassTwo;
namespace StackOverflowChallenge20160121
{
class Program
{
static void Main(string[] args)
{
PotentialCollisionMethod(); // Invokes SharedLibraryClassOne.PotentialCollisionMethod
SharedLibraryMethodThree();
}
}
}
This all compiles. But, if I change SharedLibraryClassTwo.PotentialCollisionMethod
from internal to public, my dependent application no longer compiles.
Simply by making an internal method public, I get the following error in previously compiling code:
error CS0121: The call is ambiguous between the following methods or
properties: 'SharedLibraryClassOne.PotentialCollisionMethod()' and
'SharedLibraryClassTwo.PotentialCollisionMethod()'