Incorrect ASI inside 'declare type' #54760
Labels
Fix Available
A PR has been opened for this issue
Needs Investigation
This issue needs a team member to investigate its status.
Milestone
Bug Report
If there is a newline between
declare type
andT = null;
, then as of v4.4.4 the parser behaves as if there was a semicolon betweentype
andT
(good) but also a semicolon betweendeclare
andtype
(bug).I think it's a bug that a semicolon was implicitly inserted between
declare
andtype
without any newline in the source code. ASI normally interjects only if a newline is present (or in other special cases which I don't think apply here).In version v4.3.5, the parser behaved as if there was only a semicolon between
type
andT
(where there's a newline).🔎 Search Terms
declare type asi
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
No diagnostic.
🙂 Expected behavior
Diagnostic: "';' expected." referring to after the
declare
token on line 3.The text was updated successfully, but these errors were encountered: