File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,12 @@ impl<'a> ParserImpl<'a> {
334334 self . asi ( ) ;
335335 None
336336 } ;
337+ self . verify_modifiers (
338+ modifiers,
339+ ModifierFlags :: DECLARE ,
340+ true ,
341+ diagnostics:: modifier_cannot_be_used_here,
342+ ) ;
337343 self . ast . alloc_ts_module_declaration (
338344 self . end_span ( span) ,
339345 id,
@@ -393,6 +399,13 @@ impl<'a> ParserImpl<'a> {
393399
394400 let body = self . parse_ts_module_block ( ) . unbox ( ) ;
395401
402+ self . verify_modifiers (
403+ modifiers,
404+ ModifierFlags :: DECLARE ,
405+ true ,
406+ diagnostics:: modifier_cannot_be_used_here,
407+ ) ;
408+
396409 self . ast . alloc_ts_global_declaration (
397410 self . end_span ( span) ,
398411 keyword_span,
Original file line number Diff line number Diff line change @@ -9683,6 +9683,15 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/Va
96839683 327 │ namespace m2 {
96849684 ╰────
96859685
9686+ × 'export' modifier cannot be used here.
9687+ ╭─[typescript/tests/cases/compiler/privacyImportParseErrors.ts:326:9]
9688+ 325 │
9689+ 326 │ declare export module "anotherParseError2" {
9690+ · ──────
9691+ 327 │ namespace m2 {
9692+ ╰────
9693+ help: Only 'declare' modifier is allowed here.
9694+
96869695 × Unexpected token
96879696 ╭─[typescript/tests/cases/compiler/privateNameJsx.tsx:4:22]
96889697 3 │ render() {
You can’t perform that action at this time.
0 commit comments