<p dir="auto">Paste this snippet in the <a href="http://www.typescriptlang.org/Playground" rel="nofollow">playground</a>:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const result = [{ foo: 'hello' }]
    .map(({ foo }) =&gt; foo)
    .map(foo =&gt; foo);"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">{</span> <span class="pl-c1">foo</span>: <span class="pl-s">'hello'</span> <span class="pl-kos">}</span><span class="pl-kos">]</span>
    <span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">{</span> foo <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">foo</span><span class="pl-kos">)</span>
    <span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-s1">foo</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">foo</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">If you hover over <code class="notranslate">foo</code> in the first <code class="notranslate">map()</code> call, you'll notice that its type is <code class="notranslate">any</code> (should be <code class="notranslate">string</code>).</p>
<p dir="auto">The type of <code class="notranslate">result</code> is correctly inferred to be <code class="notranslate">string[]</code>, though. It just seems that there is no type information for destructured function parameters.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class GenericClass&lt;T&gt; {
  payload: T;
}

var genericObject = new GenericClass&lt;{greeting: string}&gt;();

function genericFunction&lt;T&gt;(object: GenericClass&lt;T&gt;, callback: (payload: T) =&gt; void) {
  callback(object.payload);
}

// Works
genericFunction(genericObject, (payload) =&gt; {
  // Here TS understands that payload have a property greeting
  // and that payload.greeting is a string.
});

// Fails to compile with &quot;Type 'T' has no property 'greeting' and no index signature.&quot;.
// Type of greeting is any
genericFunction(genericObject, ({greeting}) =&gt; {

});"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-smi">GenericClass</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-c1">payload</span>: <span class="pl-smi">T</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">var</span> <span class="pl-s1">genericObject</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">GenericClass</span><span class="pl-kos">&lt;</span><span class="pl-kos">{</span><span class="pl-c1">greeting</span>: <span class="pl-smi">string</span><span class="pl-kos">}</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">function</span> <span class="pl-en">genericFunction</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-s1">object</span>: <span class="pl-smi">GenericClass</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span><span class="pl-kos">,</span> <span class="pl-s1">callback</span>: <span class="pl-kos">(</span><span class="pl-s1">payload</span>: <span class="pl-smi">T</span><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-en">callback</span><span class="pl-kos">(</span><span class="pl-s1">object</span><span class="pl-kos">.</span><span class="pl-c1">payload</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-c">// Works</span>
<span class="pl-en">genericFunction</span><span class="pl-kos">(</span><span class="pl-s1">genericObject</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-s1">payload</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-c">// Here TS understands that payload have a property greeting</span>
  <span class="pl-c">// and that payload.greeting is a string.</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-c">// Fails to compile with "Type 'T' has no property 'greeting' and no index signature.".</span>
<span class="pl-c">// Type of greeting is any</span>
<span class="pl-en">genericFunction</span><span class="pl-kos">(</span><span class="pl-s1">genericObject</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">{</span>greeting<span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>

<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>