import<T>
is valid syntax in nightly
#48759
Labels
Bug
A bug in TypeScript
Fix Available
A PR has been opened for this issue
Help Wanted
You can do this
Milestone
Bug Report
Context: I'm trying to figure out how to update esbuild to handle the latest ASI-related behavior changes that just landed (#48755 and #48659). In the process, I discovered this weird TypeScript behavior that I believe was an oversight. I assume #47607 introduced the regression since it landed around the same time.
I tried to dig through code history to understand this better. It looks like
isStartOfLeftHandSideExpression
allows<
afterimport
due to #16544, although no tests were added forimport
followed by<
in that PR. So I'm assuming TypeScript only allows<
afterimport
for parser recovery, which I don't need to support in esbuild.🔎 Search Terms
regression import expression type parameters missing arguments
🕗 Version & Regression Information
4.7.0-dev.20220216
and4.7.0-dev.20220217
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
The nightly TypeScript compiler converts the above TypeScript code into the following JavaScript without any errors:
🙂 Expected behavior
I either expected the TypeScript compiler to consider this invalid syntax, or if it's valid syntax I expected it to give type errors for the missing type names.
The text was updated successfully, but these errors were encountered: