tc39 / proposal-type-annotations

ECMAScript proposal for type syntax that is erased - Stage 1
https://tc39.es/proposal-type-annotations/
4.13k stars 44 forks source link

[grammar] Async arrowhead might be missing type annotation #191

Open takikawa opened 9 months ago

takikawa commented 9 months ago

The draft grammar has the following productions:

CoverCallExpressionAndAsyncArrowHead :
   MemberExpression TypeParameters_opt Arguments TypeAnnotation_opt

AsyncArrowHead :
  async [no LineTerminator here] TypeParameters_opt ArrowFormalParameters

The second production might be missing a TypeAnnotation_opt at the end, since the return type might need to be specified for an async arrow. Also the first production is supposed to cover the second, but right now the type annotation doesn't seem to be covering anything in AsyncArrowHead.