Skip to content

Instantly share code, notes, and snippets.

@wwahammy
Created August 20, 2013 17:41

Revisions

  1. @EricSchultz EricSchultz created this gist Aug 20, 2013.
    11 changes: 11 additions & 0 deletions My C# annoyance of the day
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    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