diff --git a/crates/oxc_parser/src/diagnostics.rs b/crates/oxc_parser/src/diagnostics.rs index fb507095e0a1c..255618b048ad2 100644 --- a/crates/oxc_parser/src/diagnostics.rs +++ b/crates/oxc_parser/src/diagnostics.rs @@ -1137,7 +1137,7 @@ pub fn setter_with_rest_parameter(span: Span) -> OxcDiagnostic { } #[cold] pub fn setter_with_initializer(span: Span) -> OxcDiagnostic { - OxcDiagnostic::error("A 'set' accessor cannot have an initializer.").with_label(span) + ts_error("1052", "A 'set' accessor cannot have an initializer.").with_label(span) } #[cold] diff --git a/tasks/coverage/snapshots/parser_typescript.snap b/tasks/coverage/snapshots/parser_typescript.snap index 8e6e1ee2daabe..714154371a5ab 100644 --- a/tasks/coverage/snapshots/parser_typescript.snap +++ b/tasks/coverage/snapshots/parser_typescript.snap @@ -2478,7 +2478,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/Va ╰──── help: No modifiers are allowed here. - × A 'set' accessor cannot have an initializer. + × TS(1052): A 'set' accessor cannot have an initializer. ╭─[typescript/tests/cases/compiler/accessorWithInitializer.ts:2:10] 1 │ class C { 2 │ set X(v = 0) { } @@ -2486,7 +2486,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/Va 3 │ static set X(v2 = 0) { } ╰──── - × A 'set' accessor cannot have an initializer. + × TS(1052): A 'set' accessor cannot have an initializer. ╭─[typescript/tests/cases/compiler/accessorWithInitializer.ts:3:17] 2 │ set X(v = 0) { } 3 │ static set X(v2 = 0) { } @@ -22521,7 +22521,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/Va ╰──── help: No modifiers are allowed here. - × A 'set' accessor cannot have an initializer. + × TS(1052): A 'set' accessor cannot have an initializer. ╭─[typescript/tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration16.ts:2:11] 1 │ class C { 2 │ set Foo(a = 1) { }