<p dir="auto">This works fine:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="function test(): [number, string] {
    return [1, &quot;a&quot;];
}"><pre class="notranslate"><code class="notranslate">function test(): [number, string] {
    return [1, "a"];
}
</code></pre></div>
<p dir="auto">But this...</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="async function test(): Promise&lt;[number, string]&gt; {
    return [1, &quot;a&quot;];
}"><pre class="notranslate"><code class="notranslate">async function test(): Promise&lt;[number, string]&gt; {
    return [1, "a"];
}
</code></pre></div>
<p dir="auto">gives the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="main.ts(2,9): error TS2322: Type '(number | string)[]' is not assignable to type '[number, string]'.
  Property '0' is missing in type '(number | string)[]'."><pre class="notranslate"><code class="notranslate">main.ts(2,9): error TS2322: Type '(number | string)[]' is not assignable to type '[number, string]'.
  Property '0' is missing in type '(number | string)[]'.
</code></pre></div>
<p dir="auto">It appears that [1, "a"] has instead been inferred to be an array of number | string, which is not what I want.</p>
<p dir="auto">There appears to be a typing bug with the return values from async functions, perhaps limited to tuples. Examples:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Works!
function test(): [boolean, number] {
    return [true, 1];
}

// Works!
function test2(): Promise&lt;[boolean, number]&gt; {
    return Promise.resolve([true, 1]);
}

// Doesn't work
async function test3(): Promise&lt;[boolean, number]&gt; {
    return [true, 1]; // Error here!
}"><pre class="notranslate"><span class="pl-c">// Works!</span>
<span class="pl-k">function</span> <span class="pl-s1">test</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-kos">[</span><span class="pl-s1">boolean</span><span class="pl-kos">,</span> <span class="pl-s1">number</span><span class="pl-kos">]</span> <span class="pl-kos">{</span>
    <span class="pl-k">return</span> <span class="pl-kos">[</span><span class="pl-c1">true</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-c">// Works!</span>
<span class="pl-k">function</span> <span class="pl-s1">test2</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-v">Promise</span><span class="pl-c1">&lt;</span><span class="pl-kos">[</span><span class="pl-s1">boolean</span><span class="pl-kos">,</span> <span class="pl-s1">number</span><span class="pl-kos">]</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-s1">return</span> <span class="pl-v">Promise</span><span class="pl-kos">.</span><span class="pl-c1">resolve</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s1">true</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-kos">}</span>

<span class="pl-c">// Doesn't work</span>
async <span class="pl-k">function</span> <span class="pl-s1">test3</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-v">Promise</span><span class="pl-c1">&lt;</span><span class="pl-kos">[</span><span class="pl-s1">boolean</span><span class="pl-kos">,</span> <span class="pl-s1">number</span><span class="pl-kos">]</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span>
    return<span class="pl-kos"></span> <span class="pl-kos">[</span><span class="pl-c1">true</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-c">// Error here!</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">The error is:</p>
<blockquote>
<p dir="auto">Type '(boolean | number)[]' is not assignable to type '[boolean, number]'.</p>
</blockquote>