microsoft / microsoft/TypeScript
Unexpected ASI after `declare` (regression since version 4.4)
オープン
@rbuckton がすでに取り組んでいます。
2023年6月12日 から。
Bug
Domain: Parser
Rescheduled
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
Bug Report
🔎 Search Terms
declare asi semicolon
🕗 Version & Regression Information
- This changed between version 4.3.5 (where it doesn't happen) and version 4.4.4 (where it starts happening)
⏯ Playground Link
Playground link for version 4.3.5 (fine)
Playground link for version 4.4.4 (problematic)
💻 Code
Some random examples that TS 5.1 considers valid syntax (not exhaustive):
declare let declare: any, foo: any
declare foo
declare let declare: any, foo: any
declare foo()
declare let declare: any, foo: any
declare {foo}
🙁 Actual behavior
TypeScript silently does automatic semicolon insertion after declare in all of these cases without generating any syntax errors.
🙂 Expected behavior
I expected these to be syntax errors. I did not expect TypeScript to silently be doing automatic semicolon insertion after declare here as if this is valid syntax.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。