<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">1.7.5 / 1.8.0-beta / nightly (1.9.0-dev.20160217)</p>
<p dir="auto"><strong>Code</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// A self-contained demonstration of the problem follows...
"><pre class="notranslate"><span class="pl-c">// A self-contained demonstration of the problem follows...</span></pre></div>
<p dir="auto"><strong>Expected behavior:</strong></p>
<p dir="auto"><strong>Actual behavior:</strong></p>
<p dir="auto">I have a particular setup</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class Foo {
  get bar() {
    return 'foobar';
  }
}

class Bar {
  get foo() {
    return 'foobar';
  }
}

class Foobar {
  data: Foo | Bar;

  baz() {
    if (isFooInstance(this.data) {
      return this.data.bar;
    }
  }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">Foo</span> <span class="pl-kos">{</span>
  <span class="pl-k">get</span> <span class="pl-en">bar</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">return</span> <span class="pl-s">'foobar'</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-k">class</span> <span class="pl-v">Bar</span> <span class="pl-kos">{</span>
  <span class="pl-k">get</span> <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">return</span> <span class="pl-s">'foobar'</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-k">class</span> <span class="pl-v">Foobar</span> <span class="pl-kos">{</span>
  <span class="pl-c1">data</span>: <span class="pl-v">Foo</span> <span class="pl-c1">|</span> <span class="pl-c1">Bar</span><span class="pl-kos">;</span>

  <span class="pl-en">baz</span><span class="pl-kos">(</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-en">isFooInstance</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">data</span><span class="pl-kos">)</span><span class="pl-kos"></span> <span class="pl-kos">{</span>
      <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">data</span><span class="pl-kos">.</span><span class="pl-c1">bar</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">TypeScript throws an error in this situation saying <code class="notranslate">bar</code> does not exist on <code class="notranslate">Foo | Bar</code> - this is incorrect behavior IMO, especially if I have already screened out what type it is via other mechanisms.</p>