title: Should creating a variable named _this conflict with this?
body: <p>This is a very contrived example, but let's suppose we create a variable <code>_this</code> somewhere in a class function.</p>
  
  <pre><code>class Person {
    constructor (public name : string) {}
    changeName(name) {
      var _this = {};
      (() =&gt; {
        this.name = name;
      })();
    }
  }
  </code></pre>
  
  <p>This will not work as expected when we call the <code>changeName</code> function because the relevant part of the compiled code looks like this:</p>
  
  <pre><code>var _this = this;
  var _this = {};
  (function () {
    _this.name = name;
  })();
  </code></pre>
  
  <p>This is bad Javascript: we have two <code>var</code> declarations overwriting each other. The <code>_this</code> created by the compiler is being overwritten by my <code>_this</code>.</p>
  
  <p>As far as I can see, this behavior isn't specified in the TypeScript spec.</p>
  
  <p>Why should they conflict? Can't the compiler detect if I have created a variable named <code>_this</code> and name the automatically generated one something else, like <code>_this2</code> to keep my variables and the compiler-generated ones from trampling on each other?</p>