Visual Studio 2010 marks, underlines the statement in green, the return in the else clause as unreachable which is logical.
public void UnreachableElse()
{
if (true) //If true will always evaluate to true.
return;
else //unreachable.
return;
}
However consider the following.
public void UnreachableElse()
{
if (true) //If true will always evaluate to true.
return;
else //unreachable.
throw new Exception();
}
Why isn't any of the throw statement marked, underlined, as unreachable?