TS 5.0 decorators don't follow the DecoratorCallExpression grammar #55336
Labels
Bug
A bug in TypeScript
Domain: Decorators
The issue relates to the decorator syntax
Fix Available
A PR has been opened for this issue
Rescheduled
This issue was previously scheduled to an earlier milestone
Milestone
🔎 Search Terms
DecoratorCallExpression
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play?target=99&ts=5.1.6#code/CYUwxgNghgTiAEEQBd4A8Bc8AUBKeAvAHzwDe8AnlnoSdpvFAHYUA0lWzF+xjL8AXwCwAKAACaPADoKeUZCgBnRfABmAe3VlhIoA
💻 Code
🙁 Actual behavior
TypeScript allows this invalid syntax without any errors.
🙂 Expected behavior
Here's the grammar (taken from the spec linked in the proposal):
My reading of this grammar is that TypeScript should only be allowing a single
Arguments
production at the end of the decorator. So I believe TypeScript should consider this example to be a syntax error. Here's what other decorator parsers do:Babel:
esbuild:
The text was updated successfully, but these errors were encountered: