<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
I have an anonymous generic async arrow function which contain Prmose.all, it work fine when try to compile using tsc but fail using babel. Probably related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="384390609" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/9086" data-hovercard-type="issue" data-hovercard-url="/babel/babel/issues/9086/hovercard" href="https://github.com/babel/babel/issues/9086">#9086</a> . I try to create REPL bellow.</p>
<p dir="auto"><strong>Input Code</strong></p>
<ul dir="auto">
<li><a href="https://babeljs.io/repl#?babili=false&amp;browsers=&amp;build=&amp;builtIns=false&amp;spec=false&amp;loose=false&amp;code_lz=MYewdgzgLgBAhjAvPCBPMwYB4AqA-ACgBM4o4AuGHASkoAUAnEAWwEsIBTXPJHxl9hwB0DDhBAAbAG4dipONQBQoSLABGSFOkzc5ZSjgDaAXVox-bTrhM9EPAN6KYMFdBgAPTXADucVrAtBITgJCQInZxgSMiFmOAAHAk87cyZLYVFxaVl3amoAbgilZ1EoAFcGMA9FAF9FDnd4kAZYV1avNAxsfD0KKjNAq3xeVIFOETFJGV7qIA&amp;debug=false&amp;forceAllTransforms=false&amp;shippedProposals=false&amp;circleciRepo=&amp;evaluate=true&amp;fileSize=false&amp;timeTravel=false&amp;sourceType=module&amp;lineWrap=true&amp;presets=typescript&amp;prettier=false&amp;targets=&amp;version=7.3.4" rel="nofollow">REPL</a></li>
</ul>
<p dir="auto">It need plugin tranform typescript</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const a = async &lt;T&gt;(data: T): Promise&lt;T&gt; =&gt; Promise.resolve(data)
const b = async &lt;T&gt;(data: T[]): Promise&lt;T[]&gt; =&gt; {
  const x = await Promise.all(
    data.map(x =&gt; Promise.resolve(x));
  )
  return x
}
export const c = async &lt;T&gt;(data: T): Promise&lt;T&gt; =&gt; Promise.resolve(data)"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">async</span> <span class="pl-c1">&lt;</span><span class="pl-v">T</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-s1">data</span>: <span class="pl-v">T</span><span class="pl-kos">)</span>: <span class="pl-v">Promise</span><span class="pl-c1">&lt;</span><span class="pl-v">T</span><span class="pl-c1">&gt;</span> <span class="pl-c1">=&gt;</span> <span class="pl-v">Promise</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">data</span><span class="pl-kos">)</span>
<span class="pl-k">const</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-s1">async</span> <span class="pl-c1">&lt;</span><span class="pl-v">T</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-s1">data</span>: <span class="pl-v">T</span><span class="pl-kos">[</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-v">T</span><span class="pl-kos">[</span><span class="pl-s1"></span><span class="pl-kos">]</span><span class="pl-c1">&gt;</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  const <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-v">Promise</span><span class="pl-kos">.</span><span class="pl-en">all</span><span class="pl-kos">(</span>
    <span class="pl-s1">data</span><span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-s1">x</span> <span class="pl-c1">=&gt;</span> <span class="pl-v">Promise</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-kos">)</span>
  <span class="pl-s1">return</span> <span class="pl-s1">x</span>
<span class="pl-kos">}</span>
<span class="pl-s1">export</span> <span class="pl-k">const</span> <span class="pl-s1">c</span> <span class="pl-c1">=</span> <span class="pl-s1">async</span> <span class="pl-c1">&lt;</span><span class="pl-v">T</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-s1">data</span>: <span class="pl-v">T</span><span class="pl-kos">)</span>: <span class="pl-v">Promise</span><span class="pl-c1">&lt;</span><span class="pl-v">T</span><span class="pl-c1">&gt;</span> <span class="pl-c1">=&gt;</span> <span class="pl-v">Promise</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">data</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">it will compile if I comment c function</p>
<p dir="auto"><strong>Expected behavior/code</strong><br>
It works with tsc so it should work with babel too.</p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
 {
  &quot;presets&quot;: [
    [&quot;@babel/env&quot;, {
      &quot;targets&quot;: {
        &quot;node&quot;: true
      }
    }],
    &quot;@babel/typescript&quot;
  ],
  &quot;plugins&quot;: [
    [&quot;module-resolver&quot;, {
      &quot;root&quot;: [&quot;./src&quot;],
      &quot;alias&quot;: {
        &quot;@&quot;: &quot;./src&quot;
      },
      &quot;extensions&quot;: [&quot;.js&quot;, &quot;.ts&quot;, &quot;.tsx&quot;]
    }],
    &quot;@babel/proposal-class-properties&quot;,
    &quot;@babel/proposal-object-rest-spread&quot;
  ]
}
}"><pre class="notranslate"><span class="pl-kos">{</span>
 <span class="pl-kos">{</span>
  <span class="pl-s">"presets"</span>: <span class="pl-kos">[</span>
    <span class="pl-kos">[</span><span class="pl-s">"@babel/env"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
      <span class="pl-s">"targets"</span>: <span class="pl-kos">{</span>
        <span class="pl-s">"node"</span>: <span class="pl-c1">true</span>
      <span class="pl-kos">}</span>
    <span class="pl-kos">}</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/typescript"</span>
  <span class="pl-kos">]</span><span class="pl-kos">,</span>
  <span class="pl-s">"plugins"</span>: <span class="pl-kos">[</span>
    <span class="pl-kos">[</span><span class="pl-s">"module-resolver"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
      <span class="pl-s">"root"</span>: <span class="pl-kos">[</span><span class="pl-s">"./src"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
      <span class="pl-s">"alias"</span>: <span class="pl-kos">{</span>
        <span class="pl-s">"@"</span>: <span class="pl-s">"./src"</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-s">"extensions"</span>: <span class="pl-kos">[</span><span class="pl-s">".js"</span><span class="pl-kos">,</span> <span class="pl-s">".ts"</span><span class="pl-kos">,</span> <span class="pl-s">".tsx"</span><span class="pl-kos">]</span>
    <span class="pl-kos">}</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/proposal-class-properties"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/proposal-object-rest-spread"</span>
  <span class="pl-kos">]</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): v7.3.4</li>
<li>Node/npm version: node v10.15.1 / npm 6.4.1</li>
<li>OS: v10.15.1</li>
<li>Monorepo: yes</li>
<li>How you are using Babel: cli</li>
</ul>
<p dir="auto"><strong>Possible Solution</strong><br>
Probably related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="384390609" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/9086" data-hovercard-type="issue" data-hovercard-url="/babel/babel/issues/9086/hovercard" href="https://github.com/babel/babel/issues/9086">#9086</a></p>
<p dir="auto">this is my first issue report in my history, i'm sorry if i made any mistake.</p>
<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong></p>
<p dir="auto">In the current <code class="notranslate">@babel/parser</code> version 7.3.3, a class property that defines an async arrow function with generics breaks the parser.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    SyntaxError: boost/packages/core/src/Executor.ts: Unexpected token, expected &quot;;&quot; (85:52)

      83 |    * Execute a task with the provided value.
      84 |    */
    &gt; 85 |   executeTask = async &lt;T&gt;(task: Task&lt;Ctx&gt;, value?: T): Promise&lt;any&gt; =&gt; {
         |                                                      ^
      86 |     const { console: cli } = this.tool;
      87 |     let result = null;
      88 | 

      at Object.raise (node_modules/@babel/parser/lib/index.js:3831:17)"><pre class="notranslate"><code class="notranslate">    SyntaxError: boost/packages/core/src/Executor.ts: Unexpected token, expected ";" (85:52)

      83 |    * Execute a task with the provided value.
      84 |    */
    &gt; 85 |   executeTask = async &lt;T&gt;(task: Task&lt;Ctx&gt;, value?: T): Promise&lt;any&gt; =&gt; {
         |                                                      ^
      86 |     const { console: cli } = this.tool;
      87 |     let result = null;
      88 | 

      at Object.raise (node_modules/@babel/parser/lib/index.js:3831:17)
</code></pre></div>
<p dir="auto">If you remove the <code class="notranslate">&lt;T&gt;</code> generics or the <code class="notranslate">async/await</code>, the parser works.</p>
<p dir="auto"><strong>Input Code</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="  executeTask = async &lt;T&gt;(task: Task&lt;Ctx&gt;, value?: T): Promise&lt;any&gt; =&gt; {
    const { console: cli } = this.tool;
    let result = null;

    cli.emit('task', [task, value, this.parallel]);

    try {
      result = await task.run(this.context, value);

      if (task.isSkipped()) {
        cli.emit('task.skip', [task, value, this.parallel]);
      } else {
        cli.emit('task.pass', [task, result, this.parallel]);
      }
    } catch (error) {
      cli.emit('task.fail', [task, error, this.parallel]);

      throw error;
    }

    return result;
  };"><pre class="notranslate">  <span class="pl-en">executeTask</span> <span class="pl-c1">=</span> <span class="pl-k">async</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">task</span>: <span class="pl-smi">Task</span><span class="pl-kos">&lt;</span><span class="pl-smi">Ctx</span><span class="pl-kos">&gt;</span><span class="pl-kos">,</span> <span class="pl-s1">value</span>?: <span class="pl-smi">T</span><span class="pl-kos">)</span>: <span class="pl-smi">Promise</span><span class="pl-kos">&lt;</span><span class="pl-smi">any</span><span class="pl-kos">&gt;</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">const</span> <span class="pl-kos">{</span> <span class="pl-c1">console</span>: <span class="pl-s1">cli</span> <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">tool</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-c1">null</span><span class="pl-kos">;</span>

    <span class="pl-s1">cli</span><span class="pl-kos">.</span><span class="pl-en">emit</span><span class="pl-kos">(</span><span class="pl-s">'task'</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s1">task</span><span class="pl-kos">,</span> <span class="pl-s1">value</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">parallel</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-k">try</span> <span class="pl-kos">{</span>
      <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">task</span><span class="pl-kos">.</span><span class="pl-en">run</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">context</span><span class="pl-kos">,</span> <span class="pl-s1">value</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">task</span><span class="pl-kos">.</span><span class="pl-en">isSkipped</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-s1">cli</span><span class="pl-kos">.</span><span class="pl-en">emit</span><span class="pl-kos">(</span><span class="pl-s">'task.skip'</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s1">task</span><span class="pl-kos">,</span> <span class="pl-s1">value</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">parallel</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">else</span> <span class="pl-kos">{</span>
        <span class="pl-s1">cli</span><span class="pl-kos">.</span><span class="pl-en">emit</span><span class="pl-kos">(</span><span class="pl-s">'task.pass'</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s1">task</span><span class="pl-kos">,</span> <span class="pl-s1">result</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">parallel</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">catch</span> <span class="pl-kos">(</span><span class="pl-s1">error</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-s1">cli</span><span class="pl-kos">.</span><span class="pl-en">emit</span><span class="pl-kos">(</span><span class="pl-s">'task.fail'</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s1">task</span><span class="pl-kos">,</span> <span class="pl-s1">error</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">parallel</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

      <span class="pl-k">throw</span> <span class="pl-s1">error</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-k">return</span> <span class="pl-s1">result</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Expected behavior/code</strong></p>
<p dir="auto">It parses. This worked in the previous version.</p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="module.exports = {
  &quot;babelrc&quot;: false,
  &quot;comments&quot;: false,
  &quot;plugins&quot;: [
    &quot;@babel/plugin-proposal-class-properties&quot;,
    &quot;@babel/plugin-proposal-export-default-from&quot;,
    &quot;@babel/plugin-proposal-nullish-coalescing-operator&quot;,
    &quot;@babel/plugin-proposal-optional-catch-binding&quot;,
    &quot;@babel/plugin-proposal-optional-chaining&quot;,
    &quot;@babel/plugin-syntax-dynamic-import&quot;,
    [
      &quot;babel-plugin-transform-dev&quot;,
      {
        &quot;evaluate&quot;: false
      }
    ]
  ],
  &quot;presets&quot;: [
    [
      &quot;@babel/preset-env&quot;,
      {
        &quot;modules&quot;: &quot;commonjs&quot;,
        &quot;shippedProposals&quot;: true,
        &quot;targets&quot;: {
          &quot;node&quot;: &quot;10.9.0&quot;
        },
        &quot;useBuiltIns&quot;: false
      }
    ],
    &quot;@babel/preset-typescript&quot;
  ]
};"><pre class="notranslate"><span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
  <span class="pl-s">"babelrc"</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
  <span class="pl-s">"comments"</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
  <span class="pl-s">"plugins"</span>: <span class="pl-kos">[</span>
    <span class="pl-s">"@babel/plugin-proposal-class-properties"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/plugin-proposal-export-default-from"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/plugin-proposal-nullish-coalescing-operator"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/plugin-proposal-optional-catch-binding"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/plugin-proposal-optional-chaining"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/plugin-syntax-dynamic-import"</span><span class="pl-kos">,</span>
    <span class="pl-kos">[</span>
      <span class="pl-s">"babel-plugin-transform-dev"</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"evaluate"</span>: <span class="pl-c1">false</span>
      <span class="pl-kos">}</span>
    <span class="pl-kos">]</span>
  <span class="pl-kos">]</span><span class="pl-kos">,</span>
  <span class="pl-s">"presets"</span>: <span class="pl-kos">[</span>
    <span class="pl-kos">[</span>
      <span class="pl-s">"@babel/preset-env"</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"modules"</span>: <span class="pl-s">"commonjs"</span><span class="pl-kos">,</span>
        <span class="pl-s">"shippedProposals"</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
        <span class="pl-s">"targets"</span>: <span class="pl-kos">{</span>
          <span class="pl-s">"node"</span>: <span class="pl-s">"10.9.0"</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span>
        <span class="pl-s">"useBuiltIns"</span>: <span class="pl-c1">false</span>
      <span class="pl-kos">}</span>
    <span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/preset-typescript"</span>
  <span class="pl-kos">]</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): 7.3.3</li>
<li>Node/npm version: 10.14.1/6.5.0</li>
<li>OS: OSX 10.14.3</li>
<li>Monorepo: yes</li>
<li>How you are using Babel: cli</li>
</ul>