<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface A {
    x: number;
}

var a: A;
var { x: x2 } = a;"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
    <span class="pl-c1">x</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">var</span> <span class="pl-s1">a</span>: <span class="pl-smi">A</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-s1">x2</span> <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-s1">a</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">This gives the type "any" when mousing over <code class="notranslate">x</code></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1096010/8070646/a8984194-0eb7-11e5-82c6-54bf3f66956c.png"><img src="https://cloud.githubusercontent.com/assets/1096010/8070646/a8984194-0eb7-11e5-82c6-54bf3f66956c.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">(Not sure what the corresponding services API is. <code class="notranslate">getTypeDefinitionAtPosition</code> ?)</p>
<p dir="auto">Mousing over <code class="notranslate">x2</code> is fine - it gives "number". It would be nice if mousing over <code class="notranslate">x</code> gave the same, since it helps with nested destructuring to see the intermediate steps.</p>
<p dir="auto">We unconditionally show <code class="notranslate">any</code>.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/972891/7057783/867b4c0c-de0e-11e4-8c39-3157a28a6c2b.png"><img src="https://cloud.githubusercontent.com/assets/972891/7057783/867b4c0c-de0e-11e4-8c39-3157a28a6c2b.png" alt="image" style="max-width: 100%;"></a></p>