Skip to content

Commit be3857d

Browse files
committed
Reject surviving parameter decorators after transforms
Add a Program-owned validation pass that walks the final AST and reports TS1206 once per decorated parameter, using the full decorator-list span for the diagnostic range. Invoke that validation from compile after transforms have had their afterInitialize window, so transformers can still remove parameter decorators before any diagnostics are emitted. Add a dedicated compiler rejection fixture covering regular, rest, explicit-this, constructor-property, function-type, function-expression, and arrow-parameter cases.
1 parent f648e0f commit be3857d

4 files changed

Lines changed: 453 additions & 0 deletions

File tree

src/compiler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ export class Compiler extends DiagnosticEmitter {
536536

537537
// initialize lookup maps, built-ins, imports, exports, etc.
538538
this.program.initialize();
539+
this.program.validateParameterDecorators();
539540

540541

541542
// Binaryen treats all function references as being leaked to the outside world when

0 commit comments

Comments
 (0)