microsoft / microsoft/TypeScript
Unexpected ASI after `declare` (regression since version 4.4)
Aperta
@rbuckton ci sta già lavorando.
Dal 12/6/2023.
Bug
Domain: Parser
Rescheduled
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Valutazione
Questa issue non è ancora stata valutata.