<p dir="auto">Attempting to <code class="notranslate">ts.transpile</code> this <a href="https://github.com/jhusain/asyncgenerator">async generator</a></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="async function*(f) { yield f; }"><pre class="notranslate"><span class="pl-k">async</span> <span class="pl-k">function</span><span class="pl-c1">*</span><span class="pl-kos">(</span><span class="pl-s1">f</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">yield</span> <span class="pl-s1">f</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div>
<p dir="auto">throws</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TypeError: Cannot read property 'members' of undefined
    at resolveDeclaredMembers (D:\repos\TypeScript\built\local\typescript.js:15456:65)
    at resolveTypeReferenceMembers (D:\repos\TypeScript\built\local\typescript.js:15486:26)
    at resolveStructuredTypeMembers (D:\repos\TypeScript\built\local\typescript.js:15705:21)
    at getPropertiesOfObjectType (D:\repos\TypeScript\built\local\typescript.js:15713:24)
    at propertiesRelatedTo (D:\repos\TypeScript\built\local\typescript.js:17272:34)
    at objectTypeRelatedTo (D:\repos\TypeScript\built\local\typescript.js:17238:30)
    at isRelatedTo (D:\repos\TypeScript\built\local\typescript.js:17062:34)
    at checkTypeRelatedTo (D:\repos\TypeScript\built\local\typescript.js:16929:26)
    at checkTypeAssignableTo (D:\repos\TypeScript\built\local\typescript.js:16902:20)
    at isTypeAssignableTo (D:\repos\TypeScript\built\local\typescript.js:16896:20)"><pre class="notranslate"><code class="notranslate">TypeError: Cannot read property 'members' of undefined
    at resolveDeclaredMembers (D:\repos\TypeScript\built\local\typescript.js:15456:65)
    at resolveTypeReferenceMembers (D:\repos\TypeScript\built\local\typescript.js:15486:26)
    at resolveStructuredTypeMembers (D:\repos\TypeScript\built\local\typescript.js:15705:21)
    at getPropertiesOfObjectType (D:\repos\TypeScript\built\local\typescript.js:15713:24)
    at propertiesRelatedTo (D:\repos\TypeScript\built\local\typescript.js:17272:34)
    at objectTypeRelatedTo (D:\repos\TypeScript\built\local\typescript.js:17238:30)
    at isRelatedTo (D:\repos\TypeScript\built\local\typescript.js:17062:34)
    at checkTypeRelatedTo (D:\repos\TypeScript\built\local\typescript.js:16929:26)
    at checkTypeAssignableTo (D:\repos\TypeScript\built\local\typescript.js:16902:20)
    at isTypeAssignableTo (D:\repos\TypeScript\built\local\typescript.js:16896:20)
</code></pre></div>
<p dir="auto">annotating the generator return value in any way causes the exception to not be thrown. This also only happens when the async generator is anonymous.</p>
<p dir="auto">I know that async generators aren't technically valid JS, but attempting to transpile one probably shouldn't throw.</p>
<p dir="auto">when compiling this code for ES5 (not ES6)</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="async function f() {
   return { };  
}"><pre class="notranslate"><span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">f</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-kos">{</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>  
<span class="pl-kos">}</span></pre></div>
<p dir="auto">instead of giving the "only available in ES6" warning, it throws this exception:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="               throw e;
                     ^
TypeError: Cannot read property 'members' of undefined
   at resolveDeclaredMembers (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:15429:65)
   at resolveTypeReferenceMembers (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:15459:26)
   at resolveStructuredTypeMembers (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:15665:21)
   at getPropertiesOfObjectType (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:15673:24)
   at propertiesRelatedTo (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:17141:34)
   at objectTypeRelatedTo (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:17107:30)
   at isRelatedTo (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:16935:34)
   at checkTypeRelatedTo (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:16824:26)
   at checkTypeAssignableTo (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:16797:20)
   at isTypeAssignableTo (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:16791:20)"><pre class="notranslate"><code class="notranslate">               throw e;
                     ^
TypeError: Cannot read property 'members' of undefined
   at resolveDeclaredMembers (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:15429:65)
   at resolveTypeReferenceMembers (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:15459:26)
   at resolveStructuredTypeMembers (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:15665:21)
   at getPropertiesOfObjectType (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:15673:24)
   at propertiesRelatedTo (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:17141:34)
   at objectTypeRelatedTo (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:17107:30)
   at isRelatedTo (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:16935:34)
   at checkTypeRelatedTo (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:16824:26)
   at checkTypeAssignableTo (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:16797:20)
   at isTypeAssignableTo (C:\Users\Nino\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:16791:20)
</code></pre></div>
<p dir="auto">using tsc <code class="notranslate">1.5.3</code></p>