mirror of
https://github.com/danbulant/oxc
synced 2026-05-21 13:18:59 +00:00
fix(parser): change diagnostic to "modifier cannot be used here" (#3853)
This commit is contained in:
parent
97d59fc2f3
commit
13754cbd3d
7 changed files with 65 additions and 68 deletions
|
|
@ -410,9 +410,6 @@ pub fn jsx_element_no_match(span0: Span, span1: Span, name: &str) -> OxcDiagnost
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cold]
|
#[cold]
|
||||||
pub fn modifiers_cannot_appear(span: Span, name: &str) -> OxcDiagnostic {
|
pub fn modifier_cannot_be_used_here(span: Span, name: &str) -> OxcDiagnostic {
|
||||||
OxcDiagnostic::error(format!(
|
OxcDiagnostic::error(format!("'{name}' modifier cannot be used here.")).with_label(span)
|
||||||
"TS1044: '{name}' modifier cannot appear on a module or namespace element."
|
|
||||||
))
|
|
||||||
.with_label(span)
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ impl<'a> ParserImpl<'a> {
|
||||||
|
|
||||||
for modifier in modifiers.iter() {
|
for modifier in modifiers.iter() {
|
||||||
if !matches!(modifier.kind, ModifierKind::Declare | ModifierKind::Abstract) {
|
if !matches!(modifier.kind, ModifierKind::Declare | ModifierKind::Abstract) {
|
||||||
self.error(diagnostics::modifiers_cannot_appear(
|
self.error(diagnostics::modifier_cannot_be_used_here(
|
||||||
modifier.span,
|
modifier.span,
|
||||||
modifier.kind.as_str(),
|
modifier.kind.as_str(),
|
||||||
));
|
));
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ impl<'a> ParserImpl<'a> {
|
||||||
|
|
||||||
for modifier in modifiers.iter() {
|
for modifier in modifiers.iter() {
|
||||||
if modifier.kind != ModifierKind::Declare {
|
if modifier.kind != ModifierKind::Declare {
|
||||||
self.error(diagnostics::modifiers_cannot_appear(
|
self.error(diagnostics::modifier_cannot_be_used_here(
|
||||||
modifier.span,
|
modifier.span,
|
||||||
modifier.kind.as_str(),
|
modifier.kind.as_str(),
|
||||||
));
|
));
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ impl<'a> ParserImpl<'a> {
|
||||||
|
|
||||||
for modifier in modifiers.iter() {
|
for modifier in modifiers.iter() {
|
||||||
if !matches!(modifier.kind, ModifierKind::Declare | ModifierKind::Async) {
|
if !matches!(modifier.kind, ModifierKind::Declare | ModifierKind::Async) {
|
||||||
self.error(diagnostics::modifiers_cannot_appear(
|
self.error(diagnostics::modifier_cannot_be_used_here(
|
||||||
modifier.span,
|
modifier.span,
|
||||||
modifier.kind.as_str(),
|
modifier.kind.as_str(),
|
||||||
));
|
));
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ impl<'a> ParserImpl<'a> {
|
||||||
|
|
||||||
for modifier in modifiers.iter() {
|
for modifier in modifiers.iter() {
|
||||||
if !matches!(modifier.kind, ModifierKind::Declare | ModifierKind::Const) {
|
if !matches!(modifier.kind, ModifierKind::Declare | ModifierKind::Const) {
|
||||||
self.error(diagnostics::modifiers_cannot_appear(
|
self.error(diagnostics::modifier_cannot_be_used_here(
|
||||||
modifier.span,
|
modifier.span,
|
||||||
modifier.kind.as_str(),
|
modifier.kind.as_str(),
|
||||||
));
|
));
|
||||||
|
|
@ -119,7 +119,7 @@ impl<'a> ParserImpl<'a> {
|
||||||
|
|
||||||
for modifier in modifiers.iter() {
|
for modifier in modifiers.iter() {
|
||||||
if modifier.kind != ModifierKind::Declare {
|
if modifier.kind != ModifierKind::Declare {
|
||||||
self.error(diagnostics::modifiers_cannot_appear(
|
self.error(diagnostics::modifier_cannot_be_used_here(
|
||||||
modifier.span,
|
modifier.span,
|
||||||
modifier.kind.as_str(),
|
modifier.kind.as_str(),
|
||||||
));
|
));
|
||||||
|
|
@ -151,7 +151,7 @@ impl<'a> ParserImpl<'a> {
|
||||||
|
|
||||||
for modifier in modifiers.iter() {
|
for modifier in modifiers.iter() {
|
||||||
if modifier.kind != ModifierKind::Declare {
|
if modifier.kind != ModifierKind::Declare {
|
||||||
self.error(diagnostics::modifiers_cannot_appear(
|
self.error(diagnostics::modifier_cannot_be_used_here(
|
||||||
modifier.span,
|
modifier.span,
|
||||||
modifier.kind.as_str(),
|
modifier.kind.as_str(),
|
||||||
));
|
));
|
||||||
|
|
@ -293,7 +293,7 @@ impl<'a> ParserImpl<'a> {
|
||||||
|
|
||||||
for modifier in modifiers.iter() {
|
for modifier in modifiers.iter() {
|
||||||
if modifier.kind != ModifierKind::Declare {
|
if modifier.kind != ModifierKind::Declare {
|
||||||
self.error(diagnostics::modifiers_cannot_appear(
|
self.error(diagnostics::modifier_cannot_be_used_here(
|
||||||
modifier.span,
|
modifier.span,
|
||||||
modifier.kind.as_str(),
|
modifier.kind.as_str(),
|
||||||
));
|
));
|
||||||
|
|
|
||||||
|
|
@ -10137,7 +10137,7 @@ Expect to Parse: "typescript/types/const-type-parameters-babel-7/input.ts"
|
||||||
· ──
|
· ──
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'abstract' modifier cannot appear on a module or namespace element.
|
× 'abstract' modifier cannot be used here.
|
||||||
╭─[typescript/interface/abstract/input.ts:1:1]
|
╭─[typescript/interface/abstract/input.ts:1:1]
|
||||||
1 │ abstract interface Foo {
|
1 │ abstract interface Foo {
|
||||||
· ────────
|
· ────────
|
||||||
|
|
@ -10152,7 +10152,7 @@ Expect to Parse: "typescript/types/const-type-parameters-babel-7/input.ts"
|
||||||
╰────
|
╰────
|
||||||
help: Try insert a semicolon here
|
help: Try insert a semicolon here
|
||||||
|
|
||||||
× TS1044: 'abstract' modifier cannot appear on a module or namespace element.
|
× 'abstract' modifier cannot be used here.
|
||||||
╭─[typescript/interface/export-abstract-interface/input.ts:1:8]
|
╭─[typescript/interface/export-abstract-interface/input.ts:1:8]
|
||||||
1 │ export abstract interface I {
|
1 │ export abstract interface I {
|
||||||
· ────────
|
· ────────
|
||||||
|
|
|
||||||
|
|
@ -6414,7 +6414,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
· ╰── `from` expected
|
· ╰── `from` expected
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'export' modifier cannot appear on a module or namespace element.
|
× 'export' modifier cannot be used here.
|
||||||
╭─[compiler/exportAlreadySeen.ts:2:12]
|
╭─[compiler/exportAlreadySeen.ts:2:12]
|
||||||
1 │ module M {
|
1 │ module M {
|
||||||
2 │ export export var x = 1;
|
2 │ export export var x = 1;
|
||||||
|
|
@ -6422,7 +6422,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
3 │ export export function f() { }
|
3 │ export export function f() { }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'export' modifier cannot appear on a module or namespace element.
|
× 'export' modifier cannot be used here.
|
||||||
╭─[compiler/exportAlreadySeen.ts:3:12]
|
╭─[compiler/exportAlreadySeen.ts:3:12]
|
||||||
2 │ export export var x = 1;
|
2 │ export export var x = 1;
|
||||||
3 │ export export function f() { }
|
3 │ export export function f() { }
|
||||||
|
|
@ -6430,7 +6430,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
4 │
|
4 │
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'export' modifier cannot appear on a module or namespace element.
|
× 'export' modifier cannot be used here.
|
||||||
╭─[compiler/exportAlreadySeen.ts:6:16]
|
╭─[compiler/exportAlreadySeen.ts:6:16]
|
||||||
5 │ export export module N {
|
5 │ export export module N {
|
||||||
6 │ export export class C { }
|
6 │ export export class C { }
|
||||||
|
|
@ -6438,7 +6438,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
7 │ export export interface I { }
|
7 │ export export interface I { }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'export' modifier cannot appear on a module or namespace element.
|
× 'export' modifier cannot be used here.
|
||||||
╭─[compiler/exportAlreadySeen.ts:7:16]
|
╭─[compiler/exportAlreadySeen.ts:7:16]
|
||||||
6 │ export export class C { }
|
6 │ export export class C { }
|
||||||
7 │ export export interface I { }
|
7 │ export export interface I { }
|
||||||
|
|
@ -6446,7 +6446,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
8 │ }
|
8 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'export' modifier cannot appear on a module or namespace element.
|
× 'export' modifier cannot be used here.
|
||||||
╭─[compiler/exportAlreadySeen.ts:5:12]
|
╭─[compiler/exportAlreadySeen.ts:5:12]
|
||||||
4 │
|
4 │
|
||||||
5 │ export export module N {
|
5 │ export export module N {
|
||||||
|
|
@ -6454,7 +6454,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
6 │ export export class C { }
|
6 │ export export class C { }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'export' modifier cannot appear on a module or namespace element.
|
× 'export' modifier cannot be used here.
|
||||||
╭─[compiler/exportAlreadySeen.ts:12:12]
|
╭─[compiler/exportAlreadySeen.ts:12:12]
|
||||||
11 │ declare module A {
|
11 │ declare module A {
|
||||||
12 │ export export var x;
|
12 │ export export var x;
|
||||||
|
|
@ -6462,7 +6462,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
13 │ export export function f()
|
13 │ export export function f()
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'export' modifier cannot appear on a module or namespace element.
|
× 'export' modifier cannot be used here.
|
||||||
╭─[compiler/exportAlreadySeen.ts:13:12]
|
╭─[compiler/exportAlreadySeen.ts:13:12]
|
||||||
12 │ export export var x;
|
12 │ export export var x;
|
||||||
13 │ export export function f()
|
13 │ export export function f()
|
||||||
|
|
@ -6470,7 +6470,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
14 │
|
14 │
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'export' modifier cannot appear on a module or namespace element.
|
× 'export' modifier cannot be used here.
|
||||||
╭─[compiler/exportAlreadySeen.ts:16:16]
|
╭─[compiler/exportAlreadySeen.ts:16:16]
|
||||||
15 │ export export module N {
|
15 │ export export module N {
|
||||||
16 │ export export class C { }
|
16 │ export export class C { }
|
||||||
|
|
@ -6478,7 +6478,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
17 │ export export interface I { }
|
17 │ export export interface I { }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'export' modifier cannot appear on a module or namespace element.
|
× 'export' modifier cannot be used here.
|
||||||
╭─[compiler/exportAlreadySeen.ts:17:16]
|
╭─[compiler/exportAlreadySeen.ts:17:16]
|
||||||
16 │ export export class C { }
|
16 │ export export class C { }
|
||||||
17 │ export export interface I { }
|
17 │ export export interface I { }
|
||||||
|
|
@ -6486,7 +6486,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
18 │ }
|
18 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'export' modifier cannot appear on a module or namespace element.
|
× 'export' modifier cannot be used here.
|
||||||
╭─[compiler/exportAlreadySeen.ts:15:12]
|
╭─[compiler/exportAlreadySeen.ts:15:12]
|
||||||
14 │
|
14 │
|
||||||
15 │ export export module N {
|
15 │ export export module N {
|
||||||
|
|
@ -6743,7 +6743,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
154 │ }
|
154 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'export' modifier cannot appear on a module or namespace element.
|
× 'export' modifier cannot be used here.
|
||||||
╭─[compiler/functionsWithModifiersInBlocks1.ts:4:12]
|
╭─[compiler/functionsWithModifiersInBlocks1.ts:4:12]
|
||||||
3 │ export function f() { }
|
3 │ export function f() { }
|
||||||
4 │ declare export function f() { }
|
4 │ declare export function f() { }
|
||||||
|
|
@ -8697,7 +8697,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
1 │ if (true) {
|
1 │ if (true) {
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'export' modifier cannot appear on a module or namespace element.
|
× 'export' modifier cannot be used here.
|
||||||
╭─[compiler/privacyImportParseErrors.ts:326:9]
|
╭─[compiler/privacyImportParseErrors.ts:326:9]
|
||||||
325 │
|
325 │
|
||||||
326 │ declare export module "anotherParseError2" {
|
326 │ declare export module "anotherParseError2" {
|
||||||
|
|
@ -10668,7 +10668,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
2 │ }
|
2 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'async' modifier cannot appear on a module or namespace element.
|
× 'async' modifier cannot be used here.
|
||||||
╭─[conformance/async/es5/asyncClass_es5.ts:1:1]
|
╭─[conformance/async/es5/asyncClass_es5.ts:1:1]
|
||||||
1 │ async class C {
|
1 │ async class C {
|
||||||
· ─────
|
· ─────
|
||||||
|
|
@ -10683,7 +10683,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
3 │ }
|
3 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'async' modifier cannot appear on a module or namespace element.
|
× 'async' modifier cannot be used here.
|
||||||
╭─[conformance/async/es5/asyncEnum_es5.ts:1:1]
|
╭─[conformance/async/es5/asyncEnum_es5.ts:1:1]
|
||||||
1 │ async enum E {
|
1 │ async enum E {
|
||||||
· ─────
|
· ─────
|
||||||
|
|
@ -10699,14 +10699,14 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
3 │ }
|
3 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'async' modifier cannot appear on a module or namespace element.
|
× 'async' modifier cannot be used here.
|
||||||
╭─[conformance/async/es5/asyncInterface_es5.ts:1:1]
|
╭─[conformance/async/es5/asyncInterface_es5.ts:1:1]
|
||||||
1 │ async interface I {
|
1 │ async interface I {
|
||||||
· ─────
|
· ─────
|
||||||
2 │ }
|
2 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'async' modifier cannot appear on a module or namespace element.
|
× 'async' modifier cannot be used here.
|
||||||
╭─[conformance/async/es5/asyncModule_es5.ts:1:1]
|
╭─[conformance/async/es5/asyncModule_es5.ts:1:1]
|
||||||
1 │ async module M {
|
1 │ async module M {
|
||||||
· ─────
|
· ─────
|
||||||
|
|
@ -10803,7 +10803,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
2 │ }
|
2 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'async' modifier cannot appear on a module or namespace element.
|
× 'async' modifier cannot be used here.
|
||||||
╭─[conformance/async/es6/asyncClass_es6.ts:1:1]
|
╭─[conformance/async/es6/asyncClass_es6.ts:1:1]
|
||||||
1 │ async class C {
|
1 │ async class C {
|
||||||
· ─────
|
· ─────
|
||||||
|
|
@ -10818,7 +10818,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
3 │ }
|
3 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'async' modifier cannot appear on a module or namespace element.
|
× 'async' modifier cannot be used here.
|
||||||
╭─[conformance/async/es6/asyncEnum_es6.ts:1:1]
|
╭─[conformance/async/es6/asyncEnum_es6.ts:1:1]
|
||||||
1 │ async enum E {
|
1 │ async enum E {
|
||||||
· ─────
|
· ─────
|
||||||
|
|
@ -10834,14 +10834,14 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
3 │ }
|
3 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'async' modifier cannot appear on a module or namespace element.
|
× 'async' modifier cannot be used here.
|
||||||
╭─[conformance/async/es6/asyncInterface_es6.ts:1:1]
|
╭─[conformance/async/es6/asyncInterface_es6.ts:1:1]
|
||||||
1 │ async interface I {
|
1 │ async interface I {
|
||||||
· ─────
|
· ─────
|
||||||
2 │ }
|
2 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'async' modifier cannot appear on a module or namespace element.
|
× 'async' modifier cannot be used here.
|
||||||
╭─[conformance/async/es6/asyncModule_es6.ts:1:1]
|
╭─[conformance/async/es6/asyncModule_es6.ts:1:1]
|
||||||
1 │ async module M {
|
1 │ async module M {
|
||||||
· ─────
|
· ─────
|
||||||
|
|
@ -11005,7 +11005,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
17 │ }
|
17 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'abstract' modifier cannot appear on a module or namespace element.
|
× 'abstract' modifier cannot be used here.
|
||||||
╭─[conformance/classes/classDeclarations/classAbstractKeyword/classAbstractWithInterface.ts:1:1]
|
╭─[conformance/classes/classDeclarations/classAbstractKeyword/classAbstractWithInterface.ts:1:1]
|
||||||
1 │ abstract interface I {}
|
1 │ abstract interface I {}
|
||||||
· ────────
|
· ────────
|
||||||
|
|
@ -16205,7 +16205,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
3 │ let;
|
3 │ let;
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'public' modifier cannot appear on a module or namespace element.
|
× 'public' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:4:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:4:5]
|
||||||
3 │ module Y {
|
3 │ module Y {
|
||||||
4 │ public class A { s: string }
|
4 │ public class A { s: string }
|
||||||
|
|
@ -16213,7 +16213,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
5 │
|
5 │
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'public' modifier cannot appear on a module or namespace element.
|
× 'public' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:6:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:6:5]
|
||||||
5 │
|
5 │
|
||||||
6 │ public class BB<T> extends A {
|
6 │ public class BB<T> extends A {
|
||||||
|
|
@ -16221,7 +16221,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
7 │ id: number;
|
7 │ id: number;
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'public' modifier cannot appear on a module or namespace element.
|
× 'public' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:12:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:12:5]
|
||||||
11 │ module Y2 {
|
11 │ module Y2 {
|
||||||
12 │ public class AA<T> { s: T }
|
12 │ public class AA<T> { s: T }
|
||||||
|
|
@ -16229,7 +16229,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
13 │ public interface I { id: number }
|
13 │ public interface I { id: number }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'public' modifier cannot appear on a module or namespace element.
|
× 'public' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:13:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:13:5]
|
||||||
12 │ public class AA<T> { s: T }
|
12 │ public class AA<T> { s: T }
|
||||||
13 │ public interface I { id: number }
|
13 │ public interface I { id: number }
|
||||||
|
|
@ -16237,7 +16237,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
14 │
|
14 │
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'public' modifier cannot appear on a module or namespace element.
|
× 'public' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:15:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:15:5]
|
||||||
14 │
|
14 │
|
||||||
15 │ public class B extends AA<string> implements I { id: number }
|
15 │ public class B extends AA<string> implements I { id: number }
|
||||||
|
|
@ -16245,7 +16245,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
16 │ }
|
16 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'public' modifier cannot appear on a module or namespace element.
|
× 'public' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:19:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:19:5]
|
||||||
18 │ module Y3 {
|
18 │ module Y3 {
|
||||||
19 │ public module Module {
|
19 │ public module Module {
|
||||||
|
|
@ -16253,7 +16253,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
20 │ class A { s: string }
|
20 │ class A { s: string }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'public' modifier cannot appear on a module or namespace element.
|
× 'public' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:25:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:25:5]
|
||||||
24 │ module Y4 {
|
24 │ module Y4 {
|
||||||
25 │ public enum Color { Blue, Red }
|
25 │ public enum Color { Blue, Red }
|
||||||
|
|
@ -16261,7 +16261,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
26 │ }
|
26 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'private' modifier cannot appear on a module or namespace element.
|
× 'private' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:29:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:29:5]
|
||||||
28 │ module YY {
|
28 │ module YY {
|
||||||
29 │ private class A { s: string }
|
29 │ private class A { s: string }
|
||||||
|
|
@ -16269,7 +16269,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
30 │
|
30 │
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'private' modifier cannot appear on a module or namespace element.
|
× 'private' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:31:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:31:5]
|
||||||
30 │
|
30 │
|
||||||
31 │ private class BB<T> extends A {
|
31 │ private class BB<T> extends A {
|
||||||
|
|
@ -16277,7 +16277,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
32 │ id: number;
|
32 │ id: number;
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'private' modifier cannot appear on a module or namespace element.
|
× 'private' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:37:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:37:5]
|
||||||
36 │ module YY2 {
|
36 │ module YY2 {
|
||||||
37 │ private class AA<T> { s: T }
|
37 │ private class AA<T> { s: T }
|
||||||
|
|
@ -16285,7 +16285,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
38 │ private interface I { id: number }
|
38 │ private interface I { id: number }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'private' modifier cannot appear on a module or namespace element.
|
× 'private' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:38:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:38:5]
|
||||||
37 │ private class AA<T> { s: T }
|
37 │ private class AA<T> { s: T }
|
||||||
38 │ private interface I { id: number }
|
38 │ private interface I { id: number }
|
||||||
|
|
@ -16293,7 +16293,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
39 │
|
39 │
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'private' modifier cannot appear on a module or namespace element.
|
× 'private' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:40:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:40:5]
|
||||||
39 │
|
39 │
|
||||||
40 │ private class B extends AA<string> implements I { id: number }
|
40 │ private class B extends AA<string> implements I { id: number }
|
||||||
|
|
@ -16301,7 +16301,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
41 │ }
|
41 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'private' modifier cannot appear on a module or namespace element.
|
× 'private' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:44:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:44:5]
|
||||||
43 │ module YY3 {
|
43 │ module YY3 {
|
||||||
44 │ private module Module {
|
44 │ private module Module {
|
||||||
|
|
@ -16309,7 +16309,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
45 │ class A { s: string }
|
45 │ class A { s: string }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'private' modifier cannot appear on a module or namespace element.
|
× 'private' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:50:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:50:5]
|
||||||
49 │ module YY4 {
|
49 │ module YY4 {
|
||||||
50 │ private enum Color { Blue, Red }
|
50 │ private enum Color { Blue, Red }
|
||||||
|
|
@ -16317,7 +16317,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
51 │ }
|
51 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'static' modifier cannot appear on a module or namespace element.
|
× 'static' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:55:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:55:5]
|
||||||
54 │ module YYY {
|
54 │ module YYY {
|
||||||
55 │ static class A { s: string }
|
55 │ static class A { s: string }
|
||||||
|
|
@ -16325,7 +16325,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
56 │
|
56 │
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'static' modifier cannot appear on a module or namespace element.
|
× 'static' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:57:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:57:5]
|
||||||
56 │
|
56 │
|
||||||
57 │ static class BB<T> extends A {
|
57 │ static class BB<T> extends A {
|
||||||
|
|
@ -16333,7 +16333,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
58 │ id: number;
|
58 │ id: number;
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'static' modifier cannot appear on a module or namespace element.
|
× 'static' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:63:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:63:5]
|
||||||
62 │ module YYY2 {
|
62 │ module YYY2 {
|
||||||
63 │ static class AA<T> { s: T }
|
63 │ static class AA<T> { s: T }
|
||||||
|
|
@ -16341,7 +16341,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
64 │ static interface I { id: number }
|
64 │ static interface I { id: number }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'static' modifier cannot appear on a module or namespace element.
|
× 'static' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:64:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:64:5]
|
||||||
63 │ static class AA<T> { s: T }
|
63 │ static class AA<T> { s: T }
|
||||||
64 │ static interface I { id: number }
|
64 │ static interface I { id: number }
|
||||||
|
|
@ -16349,7 +16349,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
65 │
|
65 │
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'static' modifier cannot appear on a module or namespace element.
|
× 'static' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:66:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:66:5]
|
||||||
65 │
|
65 │
|
||||||
66 │ static class B extends AA<string> implements I { id: number }
|
66 │ static class B extends AA<string> implements I { id: number }
|
||||||
|
|
@ -16357,7 +16357,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
67 │ }
|
67 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'static' modifier cannot appear on a module or namespace element.
|
× 'static' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:70:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:70:5]
|
||||||
69 │ module YYY3 {
|
69 │ module YYY3 {
|
||||||
70 │ static module Module {
|
70 │ static module Module {
|
||||||
|
|
@ -16365,7 +16365,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
71 │ class A { s: string }
|
71 │ class A { s: string }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'static' modifier cannot appear on a module or namespace element.
|
× 'static' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:76:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts:76:5]
|
||||||
75 │ module YYY4 {
|
75 │ module YYY4 {
|
||||||
76 │ static enum Color { Blue, Red }
|
76 │ static enum Color { Blue, Red }
|
||||||
|
|
@ -16373,7 +16373,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
77 │ }
|
77 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'public' modifier cannot appear on a module or namespace element.
|
× 'public' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts:4:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts:4:5]
|
||||||
3 │ module Y {
|
3 │ module Y {
|
||||||
4 │ public var x: number = 0;
|
4 │ public var x: number = 0;
|
||||||
|
|
@ -16381,7 +16381,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
5 │ }
|
5 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'public' modifier cannot appear on a module or namespace element.
|
× 'public' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts:8:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts:8:5]
|
||||||
7 │ module Y2 {
|
7 │ module Y2 {
|
||||||
8 │ public function fn(x: string) { }
|
8 │ public function fn(x: string) { }
|
||||||
|
|
@ -16389,7 +16389,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
9 │ }
|
9 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'static' modifier cannot appear on a module or namespace element.
|
× 'static' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts:12:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts:12:5]
|
||||||
11 │ module Y4 {
|
11 │ module Y4 {
|
||||||
12 │ static var x: number = 0;
|
12 │ static var x: number = 0;
|
||||||
|
|
@ -16397,7 +16397,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
13 │ }
|
13 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'static' modifier cannot appear on a module or namespace element.
|
× 'static' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts:16:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts:16:5]
|
||||||
15 │ module YY {
|
15 │ module YY {
|
||||||
16 │ static function fn(x: string) { }
|
16 │ static function fn(x: string) { }
|
||||||
|
|
@ -16405,7 +16405,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
17 │ }
|
17 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'private' modifier cannot appear on a module or namespace element.
|
× 'private' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts:20:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts:20:5]
|
||||||
19 │ module YY2 {
|
19 │ module YY2 {
|
||||||
20 │ private var x: number = 0;
|
20 │ private var x: number = 0;
|
||||||
|
|
@ -16413,7 +16413,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
21 │ }
|
21 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'private' modifier cannot appear on a module or namespace element.
|
× 'private' modifier cannot be used here.
|
||||||
╭─[conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts:25:5]
|
╭─[conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts:25:5]
|
||||||
24 │ module YY3 {
|
24 │ module YY3 {
|
||||||
25 │ private function fn(x: string) { }
|
25 │ private function fn(x: string) { }
|
||||||
|
|
@ -17508,21 +17508,21 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
3 │ }
|
3 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'public' modifier cannot appear on a module or namespace element.
|
× 'public' modifier cannot be used here.
|
||||||
╭─[conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration3.ts:1:1]
|
╭─[conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration3.ts:1:1]
|
||||||
1 │ public interface I {
|
1 │ public interface I {
|
||||||
· ──────
|
· ──────
|
||||||
2 │ }
|
2 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'static' modifier cannot appear on a module or namespace element.
|
× 'static' modifier cannot be used here.
|
||||||
╭─[conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration4.ts:1:1]
|
╭─[conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration4.ts:1:1]
|
||||||
1 │ static interface I {
|
1 │ static interface I {
|
||||||
· ──────
|
· ──────
|
||||||
2 │ }
|
2 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'export' modifier cannot appear on a module or namespace element.
|
× 'export' modifier cannot be used here.
|
||||||
╭─[conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration6.ts:1:8]
|
╭─[conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration6.ts:1:8]
|
||||||
1 │ export export interface I {
|
1 │ export export interface I {
|
||||||
· ──────
|
· ──────
|
||||||
|
|
@ -17751,14 +17751,14 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
3 │ }
|
3 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'protected' modifier cannot appear on a module or namespace element.
|
× 'protected' modifier cannot be used here.
|
||||||
╭─[conformance/parser/ecmascript5/Protected/Protected1.ts:1:1]
|
╭─[conformance/parser/ecmascript5/Protected/Protected1.ts:1:1]
|
||||||
1 │ protected class C {
|
1 │ protected class C {
|
||||||
· ─────────
|
· ─────────
|
||||||
2 │ }
|
2 │ }
|
||||||
╰────
|
╰────
|
||||||
|
|
||||||
× TS1044: 'protected' modifier cannot appear on a module or namespace element.
|
× 'protected' modifier cannot be used here.
|
||||||
╭─[conformance/parser/ecmascript5/Protected/Protected2.ts:1:1]
|
╭─[conformance/parser/ecmascript5/Protected/Protected2.ts:1:1]
|
||||||
1 │ protected module M {
|
1 │ protected module M {
|
||||||
· ─────────
|
· ─────────
|
||||||
|
|
@ -17855,7 +17855,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
|
||||||
╰────
|
╰────
|
||||||
help: Try insert a semicolon here
|
help: Try insert a semicolon here
|
||||||
|
|
||||||
× TS1044: 'export' modifier cannot appear on a module or namespace element.
|
× 'export' modifier cannot be used here.
|
||||||
╭─[conformance/parser/ecmascript5/RegressionTests/parser618973.ts:1:8]
|
╭─[conformance/parser/ecmascript5/RegressionTests/parser618973.ts:1:8]
|
||||||
1 │ export export class Foo {
|
1 │ export export class Foo {
|
||||||
· ──────
|
· ──────
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue