I have a situation in which one of my classes is called SpaceMine, and another class I have is called Ability and has a class nested within it called SpaceMine:
public class SpaceMine
{
}
public class Ability
{
public class SpaceMine : Ability
{
void Foo()
{
SpaceMine spaceMine;
}
}
}
Within Foo(), I'm trying to declare a variable of type SpaceMine (not Ability.SpaceMine), but it keeps saying that my variable is of type Ability.SpaceMine. Aside from changing the names, how can I ensure that the compiler knows which type I'm trying to declare?
Use explicit declaration