<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class X {
    foo = 1
    constructor( setup? : ( obj : this ) =&gt; void ) {
        if( setup ) setup( this )
    }
}

var x = new X( obj =&gt; {
    obj.foo = 2 // Ok, allowed
    // obj.bar = 3 // Ok, not allowed
} )"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-smi">X</span> <span class="pl-kos">{</span>
    <span class="pl-c1">foo</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span>
    <span class="pl-en">constructor</span><span class="pl-kos">(</span> <span class="pl-s1">setup</span>? : <span class="pl-kos">(</span> <span class="pl-s1">obj</span> : this <span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi"><span class="pl-k">void</span></span> <span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-k">if</span><span class="pl-kos">(</span> <span class="pl-s1">setup</span> <span class="pl-kos">)</span> <span class="pl-en">setup</span><span class="pl-kos">(</span> <span class="pl-smi">this</span> <span class="pl-kos">)</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-k">var</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">X</span><span class="pl-kos">(</span> <span class="pl-s1">obj</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-s1">obj</span><span class="pl-kos">.</span><span class="pl-c1">foo</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span> <span class="pl-c">// Ok, allowed</span>
    <span class="pl-c">// obj.bar = 3 // Ok, not allowed</span>
<span class="pl-kos">}</span> <span class="pl-kos">)</span></pre></div>
<blockquote>
<p dir="auto">A 'this' type is available only in a non-static member of a class or interface.</p>
</blockquote>
<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">1.8.9 / nightly<br>
<strong>Code</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="abstract class Abstract {
  protected name: string;

  constructor () {
    this.abstractMethod();
  }

  protected abstract abstractMethod (): void;
}

class Concrete extends Abstract {
  protected name: string = 'Concrete';

  protected abstractMethod () {
    console.log(this, this.name); // Concrete, undefined
  }
}

new Concrete();
"><pre class="notranslate"><span class="pl-k">abstract</span> <span class="pl-k">class</span> <span class="pl-smi">Abstract</span> <span class="pl-kos">{</span>
  <span class="pl-k">protected</span> <span class="pl-c1">name</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>

  <span class="pl-en">constructor</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">abstractMethod</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>

  <span class="pl-k">protected</span> <span class="pl-k">abstract</span> <span class="pl-c1">abstractMethod</span> <span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi"><span class="pl-k">void</span></span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">class</span> <span class="pl-smi">Concrete</span> <span class="pl-k">extends</span> <span class="pl-smi">Abstract</span> <span class="pl-kos">{</span>
  <span class="pl-k">protected</span> <span class="pl-c1">name</span>: <span class="pl-smi">string</span> <span class="pl-c1">=</span> <span class="pl-s">'Concrete'</span><span class="pl-kos">;</span>

  <span class="pl-k">protected</span> <span class="pl-en">abstractMethod</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">name</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Concrete, undefined</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-k">new</span> <span class="pl-smi">Concrete</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Playground: <a href="http://www.typescriptlang.org/play/index.html#src=abstract%20class%20Abstract%20%7B%0D%0A%09protected%20name%3A%20string%3B%0D%0A%09%0D%0A%09constructor%20%28%29%20%7B%0D%0A%09%09this.abstractMethod%28%29%3B%0D%0A%09%7D%0D%0A%09%0D%0A%09protected%20abstract%20abstractMethod%20%28%29%3A%20void%3B%0D%0A%7D%0D%0A%0D%0Aclass%20Concrete%20extends%20Abstract%20%7B%0D%0A%09protected%20name%3A%20string%20%3D%20'Concrete'%3B%0D%0A%09%0D%0A%09protected%20abstractMethod%20%28%29%20%7B%0D%0A%09%09console.log%28this%2C%20this.name%29%3B%0D%0A%09%7D%0D%0A%7D%0D%0A%0D%0Anew%20Concrete%28%29%3B" rel="nofollow">link</a></p>
<p dir="auto"><strong>Expected behavior:</strong><br>
this.name inside abstractMethod() realization must be pointed at <code class="notranslate">name</code> property of <code class="notranslate">Concrete</code> class.</p>
<p dir="auto"><strong>Actual behavior:</strong><br>
this.name inside abstractMethod() realization is pointed at <code class="notranslate">name</code> property of <code class="notranslate">Abstract</code> class.</p>