A C# Riddle, Try #2
The code below compiles (sorry about that again) and is actually the code problem I originally wanted to post. Now play the compiler - which is Bar's base class and why:
namespace NS
{
namespace NS
{
class Cls // Candidate #1
{
}
}
class Cls // Candidate #2
{
}
namespace Foo
{
class Bar : NS.Cls // Who am I?
{
}
}
}
For extra credit, how do I force the compiler to choose the other one?
[Update: Good going, everyone! Candidate #2 is indeed the one used. To use candidate #1, you must either apply the 'global::' prefix or explicitly use the class's full name.]