Skip to content

Instantly share code, notes, and snippets.

@wwahammy
Created August 20, 2013 17:41
Show Gist options
  • Save wwahammy/6284692 to your computer and use it in GitHub Desktop.
Save wwahammy/6284692 to your computer and use it in GitHub Desktop.
My C# annoyance of the day
public void SomeMethod(){
if (SomeCondition())
{
string name = "something";
//use name here
}
string name = "something else" //COMPILER ERROR: name is already declared in this scope... BUT it's not!!!
}
//Yes I know why the compiler thinks it is and it's correct BUT it's still annoying
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment