You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original issue was that we parse as if the let on the next line is an identifier
Why? let and interface were contextual keywords.
But it's not just those; there are TypeScript-specific contextual keywords.
What about binary operators?
We considered them expression starts for error recovery cases.
Kind of just a bug.
Idea is to say "this is an instantiation expression" if after the > something that looks like an expression start is preceded by a newline.
How does this impact JS + Types?
Technically doesn't. Instantiation expressions would need something like ::<type, args, here>.
Feeling okay about this, but we have to be careful with call expressions, new expressions, decorators(?), JSX expressions(?), and tagged template expressions that are split across lines.
What Ends an Instantiation Expression?
#49348
#49353
#49362
let
on the next line is an identifierlet
andinterface
were contextual keywords.>
something that looks like an expression start is preceded by a newline.::<type, args, here>
.new
expressions, decorators(?), JSX expressions(?), and tagged template expressions that are split across lines.Optional Chaining and Instantiation Expressions
#49293
<>
should just erase and not do anything.We could just stop parsing after the
<>
- say it totally bails out.We usually do still keep things in the AST for error recovery purposes.
TECHNICALLY there is a point to allowing this because
this
this
type.But this worked.
ExpressionWithTypesArguments
cannot beReferenced Import is Elided (and in JS too)
#48588
#22159
.d.ts
file that exports a value as just a type.importsNotUsedAsValues
?preserveValueImports
?preserveValueImports
.// @ts-ignore
that works in JS should continue to work when emitted.checkJs
, it is an error to import a thing without a value meaning.preserveValueImports
flag. Try being aggressive.The text was updated successfully, but these errors were encountered: