<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">nightly (1.9.0-dev.20160429)</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="class AAA {
    fieldA: string;
}

class BBB {
    fieldB: string;
}

class AA {
    data: AAA;
}

class BB {
    data: BBB;
}

class A {
    d: AA;
}

class B {
    d: BB;
}

function main(x: A | B) {
    for (let i of [1, 1]) {
        if (x instanceof A) {
            x.d.data.fieldA;
        } else if (x instanceof B) {
            x.d.data.fieldB; // Not compiles here. 
        }
    }
}
"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-smi">AAA</span> <span class="pl-kos">{</span>
    <span class="pl-c1">fieldA</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">class</span> <span class="pl-smi">BBB</span> <span class="pl-kos">{</span>
    <span class="pl-c1">fieldB</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">class</span> <span class="pl-smi">AA</span> <span class="pl-kos">{</span>
    <span class="pl-c1">data</span>: <span class="pl-smi">AAA</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">class</span> <span class="pl-smi">BB</span> <span class="pl-kos">{</span>
    <span class="pl-c1">data</span>: <span class="pl-smi">BBB</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">class</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
    <span class="pl-c1">d</span>: <span class="pl-smi">AA</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">class</span> <span class="pl-smi">B</span> <span class="pl-kos">{</span>
    <span class="pl-c1">d</span>: <span class="pl-smi">BB</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">function</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">A</span> <span class="pl-c1">|</span> <span class="pl-smi">B</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">let</span> <span class="pl-s1">i</span> <span class="pl-k">of</span> <span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">1</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-s1">x</span> <span class="pl-k">instanceof</span> <span class="pl-smi">A</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-s1">x</span><span class="pl-kos">.</span><span class="pl-c1">d</span><span class="pl-kos">.</span><span class="pl-c1">data</span><span class="pl-kos">.</span><span class="pl-c1">fieldA</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">x</span> <span class="pl-k">instanceof</span> <span class="pl-smi">B</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-s1">x</span><span class="pl-kos">.</span><span class="pl-c1">d</span><span class="pl-kos">.</span><span class="pl-c1">data</span><span class="pl-kos">.</span><span class="pl-c1">fieldB</span><span class="pl-kos">;</span> <span class="pl-c">// Not compiles here. </span>
        <span class="pl-kos">}</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Expected behavior:</strong></p>
<p dir="auto">To access to the <code class="notranslate">fieldB</code> field of <code class="notranslate">BBB</code> class inside of block <code class="notranslate">} else if (x instanceof B) {</code></p>
<p dir="auto"><strong>Actual behavior:</strong></p>
<p dir="auto">The compiler raises the follow error: <code class="notranslate">TS2339: Property 'fieldB' does not exist on type 'AAA'.</code>.<br>
The behavior in the version 1.8.10 is correct.</p>
<p dir="auto"><strong>TypeScript Version:</strong><br>
1.8.6</p>
<p dir="auto"><strong>Visual Studio Version:</strong><br>
2015 Enterprise Update 1</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="&quot;use strict&quot;;

function giveString(): Promise&lt;string&gt; {
    return new Promise((resolve, reject) =&gt; {
        resolve(&quot;Yay&quot;);
    });
}

async function main() {
    let awaited = await giveString();
    console.log(awaited);
}

main();"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>

<span class="pl-k">function</span> <span class="pl-en">giveString</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi">Promise</span><span class="pl-kos">&lt;</span><span class="pl-smi">string</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-smi">Promise</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">resolve</span><span class="pl-kos">,</span> <span class="pl-s1">reject</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
        <span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s">"Yay"</span><span class="pl-kos">)</span><span class="pl-kos">;</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">async</span> <span class="pl-k">function</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> <span class="pl-s1">awaited</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-en">giveString</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-s1">awaited</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Expected behavior:</strong><br>
No IntelliSense Errors, since I think this is valid for ECMAScript 6 (which is set as target version in the Project Properties), and when I choose start, it compiles and runs fine, too.</p>
<p dir="auto"><strong>Actual behavior:</strong><br>
Instead, I get multiple IntelliSense errors including</p>
<blockquote>
<p dir="auto">TS1311    Async functions are only available when targeting ECMAScript 6 and higher.</p>
<p dir="auto">TS2304 Cannot find name 'Promise'.</p>
</blockquote>