diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2d9d0d189449d..0ee0b9cc37a48 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21614,7 +21614,7 @@ namespace ts { } if (!isRemovedPropertyFromObjectSpread(node.kind === SyntaxKind.Identifier ? node.parent : node)) { - error(node, Diagnostics._0_is_declared_but_its_value_is_never_read, name); + diagnostics.add(createDiagnosticForNodeSpan(getSourceFileOfNode(declaration), declaration, node, Diagnostics._0_is_declared_but_its_value_is_never_read, name)); } } @@ -21623,7 +21623,7 @@ namespace ts { } function isIdentifierThatStartsWithUnderScore(node: Node) { - return node.kind === SyntaxKind.Identifier && idText(node).charCodeAt(0) === CharacterCodes._; + return isIdentifier(node) && idText(node).charCodeAt(0) === CharacterCodes._; } function checkUnusedClassMembers(node: ClassDeclaration | ClassExpression): void { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index b6099c3959cb5..5552c6f988ad5 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -607,6 +607,11 @@ namespace ts { return createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3); } + export function createDiagnosticForNodeSpan(sourceFile: SourceFile, startNode: Node, endNode: Node, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): Diagnostic { + const start = skipTrivia(sourceFile.text, startNode.pos); + return createFileDiagnostic(sourceFile, start, endNode.end - start, message, arg0, arg1, arg2, arg3); + } + export function createDiagnosticForNodeFromMessageChain(node: Node, messageChain: DiagnosticMessageChain): Diagnostic { const sourceFile = getSourceFileOfNode(node); const span = getErrorSpanForNode(sourceFile, node); diff --git a/src/services/codefixes/fixUnusedIdentifier.ts b/src/services/codefixes/fixUnusedIdentifier.ts index de053c2fe8f3b..d074f2e0e5320 100644 --- a/src/services/codefixes/fixUnusedIdentifier.ts +++ b/src/services/codefixes/fixUnusedIdentifier.ts @@ -10,7 +10,7 @@ namespace ts.codefix { errorCodes, getCodeActions(context) { const { sourceFile } = context; - const token = getToken(sourceFile, context.span.start); + const token = getToken(sourceFile, textSpanEnd(context.span)); const result: CodeFixAction[] = []; const deletion = textChanges.ChangeTracker.with(context, t => tryDeleteDeclaration(t, sourceFile, token)); @@ -30,7 +30,7 @@ namespace ts.codefix { fixIds: [fixIdPrefix, fixIdDelete], getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => { const { sourceFile } = context; - const token = getToken(diag.file!, diag.start!); + const token = findPrecedingToken(textSpanEnd(diag), diag.file!); switch (context.fixId) { case fixIdPrefix: if (isIdentifier(token) && canPrefix(token)) { @@ -47,9 +47,9 @@ namespace ts.codefix { }); function getToken(sourceFile: SourceFile, pos: number): Node { - const token = getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + const token = findPrecedingToken(pos, sourceFile); // this handles var ["computed"] = 12; - return token.kind === SyntaxKind.OpenBracketToken ? getTokenAtPosition(sourceFile, pos + 1, /*includeJsDocComment*/ false) : token; + return token.kind === SyntaxKind.CloseBracketToken ? findPrecedingToken(pos - 1, sourceFile) : token; } function tryPrefixDeclaration(changes: textChanges.ChangeTracker, errorCode: number, sourceFile: SourceFile, token: Node): void { diff --git a/tests/baselines/reference/noUnusedLocals_selfReference.errors.txt b/tests/baselines/reference/noUnusedLocals_selfReference.errors.txt index a3aef6ced68e4..4202a580f8411 100644 --- a/tests/baselines/reference/noUnusedLocals_selfReference.errors.txt +++ b/tests/baselines/reference/noUnusedLocals_selfReference.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/noUnusedLocals_selfReference.ts(3,10): error TS6133: 'f' is declared but its value is never read. -tests/cases/compiler/noUnusedLocals_selfReference.ts(5,14): error TS6133: 'g' is declared but its value is never read. -tests/cases/compiler/noUnusedLocals_selfReference.ts(9,7): error TS6133: 'C' is declared but its value is never read. -tests/cases/compiler/noUnusedLocals_selfReference.ts(12,6): error TS6133: 'E' is declared but its value is never read. -tests/cases/compiler/noUnusedLocals_selfReference.ts(13,11): error TS6133: 'I' is declared but its value is never read. -tests/cases/compiler/noUnusedLocals_selfReference.ts(14,6): error TS6133: 'T' is declared but its value is never read. -tests/cases/compiler/noUnusedLocals_selfReference.ts(15,11): error TS6133: 'N' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_selfReference.ts(3,1): error TS6133: 'f' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_selfReference.ts(5,5): error TS6133: 'g' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_selfReference.ts(9,1): error TS6133: 'C' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_selfReference.ts(12,1): error TS6133: 'E' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_selfReference.ts(13,1): error TS6133: 'I' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_selfReference.ts(14,1): error TS6133: 'T' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_selfReference.ts(15,1): error TS6133: 'N' is declared but its value is never read. tests/cases/compiler/noUnusedLocals_selfReference.ts(22,19): error TS6133: 'm' is declared but its value is never read. @@ -12,31 +12,31 @@ tests/cases/compiler/noUnusedLocals_selfReference.ts(22,19): error TS6133: 'm' i export {}; // Make this a module scope, so these are local variables. function f() { - ~ + ~~~~~~~~~~ !!! error TS6133: 'f' is declared but its value is never read. f; function g() { - ~ + ~~~~~~~~~~ !!! error TS6133: 'g' is declared but its value is never read. g; } } class C { - ~ + ~~~~~~~ !!! error TS6133: 'C' is declared but its value is never read. m() { C; } } enum E { A = 0, B = E.A } - ~ + ~~~~~~ !!! error TS6133: 'E' is declared but its value is never read. interface I { x: I }; - ~ + ~~~~~~~~~~~ !!! error TS6133: 'I' is declared but its value is never read. type T = { x: T }; - ~ + ~~~~~~ !!! error TS6133: 'T' is declared but its value is never read. namespace N { N; } - ~ + ~~~~~~~~~~~ !!! error TS6133: 'N' is declared but its value is never read. // Avoid a false positive. diff --git a/tests/baselines/reference/noUnusedLocals_selfReference_skipsBlockLocations.errors.txt b/tests/baselines/reference/noUnusedLocals_selfReference_skipsBlockLocations.errors.txt index 9ea0147978ab5..f99b2522f1424 100644 --- a/tests/baselines/reference/noUnusedLocals_selfReference_skipsBlockLocations.errors.txt +++ b/tests/baselines/reference/noUnusedLocals_selfReference_skipsBlockLocations.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/noUnusedLocals_selfReference_skipsBlockLocations.ts(2,14): error TS6133: 'f' is declared but its value is never read. -tests/cases/compiler/noUnusedLocals_selfReference_skipsBlockLocations.ts(8,22): error TS6133: 'g' is declared but its value is never read. -tests/cases/compiler/noUnusedLocals_selfReference_skipsBlockLocations.ts(12,22): error TS6133: 'h' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_selfReference_skipsBlockLocations.ts(2,5): error TS6133: 'f' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_selfReference_skipsBlockLocations.ts(8,13): error TS6133: 'g' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_selfReference_skipsBlockLocations.ts(12,13): error TS6133: 'h' is declared but its value is never read. ==== tests/cases/compiler/noUnusedLocals_selfReference_skipsBlockLocations.ts (3 errors) ==== namespace n { function f() { - ~ + ~~~~~~~~~~ !!! error TS6133: 'f' is declared but its value is never read. f; } @@ -14,13 +14,13 @@ tests/cases/compiler/noUnusedLocals_selfReference_skipsBlockLocations.ts(12,22): switch (0) { case 0: function g() { - ~ + ~~~~~~~~~~ !!! error TS6133: 'g' is declared but its value is never read. g; } default: function h() { - ~ + ~~~~~~~~~~ !!! error TS6133: 'h' is declared but its value is never read. h; } diff --git a/tests/baselines/reference/unusedClassesinModule1.errors.txt b/tests/baselines/reference/unusedClassesinModule1.errors.txt index b7d0da8fc2d70..12b82ee97b6a5 100644 --- a/tests/baselines/reference/unusedClassesinModule1.errors.txt +++ b/tests/baselines/reference/unusedClassesinModule1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/unusedClassesinModule1.ts(2,11): error TS6133: 'Calculator' is declared but its value is never read. +tests/cases/compiler/unusedClassesinModule1.ts(2,5): error TS6133: 'Calculator' is declared but its value is never read. ==== tests/cases/compiler/unusedClassesinModule1.ts (1 errors) ==== module A { class Calculator { - ~~~~~~~~~~ + ~~~~~~~~~~~~~~~~ !!! error TS6133: 'Calculator' is declared but its value is never read. public handelChar() { } diff --git a/tests/baselines/reference/unusedClassesinNamespace1.errors.txt b/tests/baselines/reference/unusedClassesinNamespace1.errors.txt index 2df9f918e7dc8..4d4f26dde7b12 100644 --- a/tests/baselines/reference/unusedClassesinNamespace1.errors.txt +++ b/tests/baselines/reference/unusedClassesinNamespace1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/unusedClassesinNamespace1.ts(2,11): error TS6133: 'c1' is declared but its value is never read. +tests/cases/compiler/unusedClassesinNamespace1.ts(2,5): error TS6133: 'c1' is declared but its value is never read. ==== tests/cases/compiler/unusedClassesinNamespace1.ts (1 errors) ==== namespace Validation { class c1 { - ~~ + ~~~~~~~~ !!! error TS6133: 'c1' is declared but its value is never read. } diff --git a/tests/baselines/reference/unusedClassesinNamespace2.errors.txt b/tests/baselines/reference/unusedClassesinNamespace2.errors.txt index 2425ea02e5107..c98aeb283696b 100644 --- a/tests/baselines/reference/unusedClassesinNamespace2.errors.txt +++ b/tests/baselines/reference/unusedClassesinNamespace2.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/unusedClassesinNamespace2.ts(2,11): error TS6133: 'c1' is declared but its value is never read. +tests/cases/compiler/unusedClassesinNamespace2.ts(2,5): error TS6133: 'c1' is declared but its value is never read. ==== tests/cases/compiler/unusedClassesinNamespace2.ts (1 errors) ==== namespace Validation { class c1 { - ~~ + ~~~~~~~~ !!! error TS6133: 'c1' is declared but its value is never read. } diff --git a/tests/baselines/reference/unusedClassesinNamespace4.errors.txt b/tests/baselines/reference/unusedClassesinNamespace4.errors.txt index 719689fbca3ed..7545f0e2dde4e 100644 --- a/tests/baselines/reference/unusedClassesinNamespace4.errors.txt +++ b/tests/baselines/reference/unusedClassesinNamespace4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/unusedClassesinNamespace4.ts(10,11): error TS6133: 'c3' is declared but its value is never read. +tests/cases/compiler/unusedClassesinNamespace4.ts(10,5): error TS6133: 'c3' is declared but its value is never read. ==== tests/cases/compiler/unusedClassesinNamespace4.ts (1 errors) ==== @@ -12,7 +12,7 @@ tests/cases/compiler/unusedClassesinNamespace4.ts(10,11): error TS6133: 'c3' is } class c3 extends c1 { - ~~ + ~~~~~~~~ !!! error TS6133: 'c3' is declared but its value is never read. } diff --git a/tests/baselines/reference/unusedClassesinNamespace5.errors.txt b/tests/baselines/reference/unusedClassesinNamespace5.errors.txt index 7f7f5cf1b7a23..3512a1634c5ff 100644 --- a/tests/baselines/reference/unusedClassesinNamespace5.errors.txt +++ b/tests/baselines/reference/unusedClassesinNamespace5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/unusedClassesinNamespace5.ts(10,11): error TS6133: 'c3' is declared but its value is never read. +tests/cases/compiler/unusedClassesinNamespace5.ts(10,5): error TS6133: 'c3' is declared but its value is never read. ==== tests/cases/compiler/unusedClassesinNamespace5.ts (1 errors) ==== @@ -12,7 +12,7 @@ tests/cases/compiler/unusedClassesinNamespace5.ts(10,11): error TS6133: 'c3' is } class c3 { - ~~ + ~~~~~~~~ !!! error TS6133: 'c3' is declared but its value is never read. public x: c1; } diff --git a/tests/baselines/reference/unusedFunctionsinNamespaces1.errors.txt b/tests/baselines/reference/unusedFunctionsinNamespaces1.errors.txt index 202977c6fb776..7dee9ad072319 100644 --- a/tests/baselines/reference/unusedFunctionsinNamespaces1.errors.txt +++ b/tests/baselines/reference/unusedFunctionsinNamespaces1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/unusedFunctionsinNamespaces1.ts(2,14): error TS6133: 'function1' is declared but its value is never read. +tests/cases/compiler/unusedFunctionsinNamespaces1.ts(2,5): error TS6133: 'function1' is declared but its value is never read. ==== tests/cases/compiler/unusedFunctionsinNamespaces1.ts (1 errors) ==== namespace Validation { function function1() { - ~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~ !!! error TS6133: 'function1' is declared but its value is never read. } } \ No newline at end of file diff --git a/tests/baselines/reference/unusedFunctionsinNamespaces5.errors.txt b/tests/baselines/reference/unusedFunctionsinNamespaces5.errors.txt index 8f7f617e55925..07f22fa39dcc2 100644 --- a/tests/baselines/reference/unusedFunctionsinNamespaces5.errors.txt +++ b/tests/baselines/reference/unusedFunctionsinNamespaces5.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/unusedFunctionsinNamespaces5.ts(9,14): error TS6133: 'function3' is declared but its value is never read. -tests/cases/compiler/unusedFunctionsinNamespaces5.ts(13,14): error TS6133: 'function4' is declared but its value is never read. +tests/cases/compiler/unusedFunctionsinNamespaces5.ts(9,5): error TS6133: 'function3' is declared but its value is never read. +tests/cases/compiler/unusedFunctionsinNamespaces5.ts(13,5): error TS6133: 'function4' is declared but its value is never read. ==== tests/cases/compiler/unusedFunctionsinNamespaces5.ts (2 errors) ==== @@ -12,13 +12,13 @@ tests/cases/compiler/unusedFunctionsinNamespaces5.ts(13,14): error TS6133: 'func } function function3() { - ~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~ !!! error TS6133: 'function3' is declared but its value is never read. function1(); } function function4() { - ~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~ !!! error TS6133: 'function4' is declared but its value is never read. } diff --git a/tests/baselines/reference/unusedFunctionsinNamespaces6.errors.txt b/tests/baselines/reference/unusedFunctionsinNamespaces6.errors.txt index de5f7ae4d87fe..fe84d72524eae 100644 --- a/tests/baselines/reference/unusedFunctionsinNamespaces6.errors.txt +++ b/tests/baselines/reference/unusedFunctionsinNamespaces6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/unusedFunctionsinNamespaces6.ts(13,14): error TS6133: 'function4' is declared but its value is never read. +tests/cases/compiler/unusedFunctionsinNamespaces6.ts(13,5): error TS6133: 'function4' is declared but its value is never read. ==== tests/cases/compiler/unusedFunctionsinNamespaces6.ts (1 errors) ==== @@ -15,7 +15,7 @@ tests/cases/compiler/unusedFunctionsinNamespaces6.ts(13,14): error TS6133: 'func } function function4() { - ~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~ !!! error TS6133: 'function4' is declared but its value is never read. } diff --git a/tests/baselines/reference/unusedIdentifiersConsolidated1.errors.txt b/tests/baselines/reference/unusedIdentifiersConsolidated1.errors.txt index c327dc4b19b7f..7d3dcf34830d3 100644 --- a/tests/baselines/reference/unusedIdentifiersConsolidated1.errors.txt +++ b/tests/baselines/reference/unusedIdentifiersConsolidated1.errors.txt @@ -10,11 +10,11 @@ tests/cases/compiler/unusedIdentifiersConsolidated1.ts(17,13): error TS6133: 'un tests/cases/compiler/unusedIdentifiersConsolidated1.ts(24,13): error TS6133: 'unUsedPrivateFunction' is declared but its value is never read. tests/cases/compiler/unusedIdentifiersConsolidated1.ts(37,11): error TS6133: 'numberRegexp' is declared but its value is never read. tests/cases/compiler/unusedIdentifiersConsolidated1.ts(44,17): error TS6133: 'unUsedPrivateFunction' is declared but its value is never read. -tests/cases/compiler/unusedIdentifiersConsolidated1.ts(57,15): error TS6133: 'usedLocallyInterface2' is declared but its value is never read. -tests/cases/compiler/unusedIdentifiersConsolidated1.ts(64,11): error TS6133: 'dummy' is declared but its value is never read. -tests/cases/compiler/unusedIdentifiersConsolidated1.ts(67,15): error TS6133: 'unusedInterface' is declared but its value is never read. -tests/cases/compiler/unusedIdentifiersConsolidated1.ts(79,11): error TS6133: 'class3' is declared but its value is never read. -tests/cases/compiler/unusedIdentifiersConsolidated1.ts(99,15): error TS6133: 'interface5' is declared but its value is never read. +tests/cases/compiler/unusedIdentifiersConsolidated1.ts(57,5): error TS6133: 'usedLocallyInterface2' is declared but its value is never read. +tests/cases/compiler/unusedIdentifiersConsolidated1.ts(64,5): error TS6133: 'dummy' is declared but its value is never read. +tests/cases/compiler/unusedIdentifiersConsolidated1.ts(67,5): error TS6133: 'unusedInterface' is declared but its value is never read. +tests/cases/compiler/unusedIdentifiersConsolidated1.ts(79,5): error TS6133: 'class3' is declared but its value is never read. +tests/cases/compiler/unusedIdentifiersConsolidated1.ts(99,5): error TS6133: 'interface5' is declared but its value is never read. ==== tests/cases/compiler/unusedIdentifiersConsolidated1.ts (17 errors) ==== @@ -99,7 +99,7 @@ tests/cases/compiler/unusedIdentifiersConsolidated1.ts(99,15): error TS6133: 'in } interface usedLocallyInterface2 { - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS6133: 'usedLocallyInterface2' is declared but its value is never read. someFunction(s1: string): void; } @@ -108,12 +108,12 @@ tests/cases/compiler/unusedIdentifiersConsolidated1.ts(99,15): error TS6133: 'in } class dummy implements usedLocallyInterface { - ~~~~~ + ~~~~~~~~~~~ !!! error TS6133: 'dummy' is declared but its value is never read. } interface unusedInterface { - ~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS6133: 'unusedInterface' is declared but its value is never read. } } @@ -127,7 +127,7 @@ tests/cases/compiler/unusedIdentifiersConsolidated1.ts(99,15): error TS6133: 'in } class class3 { - ~~~~~~ + ~~~~~~~~~~~~ !!! error TS6133: 'class3' is declared but its value is never read. } @@ -149,7 +149,7 @@ tests/cases/compiler/unusedIdentifiersConsolidated1.ts(99,15): error TS6133: 'in export let a: interface3; interface interface5 { - ~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~ !!! error TS6133: 'interface5' is declared but its value is never read. } } \ No newline at end of file diff --git a/tests/baselines/reference/unusedImports10.errors.txt b/tests/baselines/reference/unusedImports10.errors.txt index b9688a0118557..e6c405d221cfb 100644 --- a/tests/baselines/reference/unusedImports10.errors.txt +++ b/tests/baselines/reference/unusedImports10.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/unusedImports10.ts(9,12): error TS6133: 'a' is declared but its value is never read. +tests/cases/compiler/unusedImports10.ts(9,5): error TS6133: 'a' is declared but its value is never read. ==== tests/cases/compiler/unusedImports10.ts (1 errors) ==== @@ -11,6 +11,6 @@ tests/cases/compiler/unusedImports10.ts(9,12): error TS6133: 'a' is declared but module B { import a = A; - ~ + ~~~~~~~~ !!! error TS6133: 'a' is declared but its value is never read. } \ No newline at end of file diff --git a/tests/baselines/reference/unusedImports12.errors.txt b/tests/baselines/reference/unusedImports12.errors.txt index 56df4edc5e3d7..84f1b91884dba 100644 --- a/tests/baselines/reference/unusedImports12.errors.txt +++ b/tests/baselines/reference/unusedImports12.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/a.ts(1,10): error TS6133: 'Member' is declared but its value is never read. tests/cases/compiler/a.ts(2,8): error TS6133: 'd' is declared but its value is never read. -tests/cases/compiler/a.ts(2,23): error TS6133: 'M' is declared but its value is never read. -tests/cases/compiler/a.ts(3,13): error TS6133: 'ns' is declared but its value is never read. -tests/cases/compiler/a.ts(4,8): error TS6133: 'r' is declared but its value is never read. +tests/cases/compiler/a.ts(2,13): error TS6133: 'M' is declared but its value is never read. +tests/cases/compiler/a.ts(3,8): error TS6133: 'ns' is declared but its value is never read. +tests/cases/compiler/a.ts(4,1): error TS6133: 'r' is declared but its value is never read. ==== tests/cases/compiler/a.ts (5 errors) ==== @@ -12,13 +12,13 @@ tests/cases/compiler/a.ts(4,8): error TS6133: 'r' is declared but its value is n import d, { Member as M } from './b'; ~ !!! error TS6133: 'd' is declared but its value is never read. - ~ + ~~~~~~~~~~~ !!! error TS6133: 'M' is declared but its value is never read. import * as ns from './b'; - ~~ + ~~~~~~~ !!! error TS6133: 'ns' is declared but its value is never read. import r = require("./b"); - ~ + ~~~~~~~~ !!! error TS6133: 'r' is declared but its value is never read. ==== tests/cases/compiler/b.ts (0 errors) ==== diff --git a/tests/baselines/reference/unusedImports7.errors.txt b/tests/baselines/reference/unusedImports7.errors.txt index 9482a2c6f479b..57338073efda2 100644 --- a/tests/baselines/reference/unusedImports7.errors.txt +++ b/tests/baselines/reference/unusedImports7.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/file2.ts(1,13): error TS6133: 'n' is declared but its value is never read. +tests/cases/compiler/file2.ts(1,8): error TS6133: 'n' is declared but its value is never read. ==== tests/cases/compiler/file1.ts (0 errors) ==== @@ -16,7 +16,7 @@ tests/cases/compiler/file2.ts(1,13): error TS6133: 'n' is declared but its value ==== tests/cases/compiler/file2.ts (1 errors) ==== import * as n from "./file1" - ~ + ~~~~~~ !!! error TS6133: 'n' is declared but its value is never read. \ No newline at end of file diff --git a/tests/baselines/reference/unusedImports8.errors.txt b/tests/baselines/reference/unusedImports8.errors.txt index a6cbaae8ff600..5cac8a8ee153b 100644 --- a/tests/baselines/reference/unusedImports8.errors.txt +++ b/tests/baselines/reference/unusedImports8.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/file2.ts(1,50): error TS6133: 't2' is declared but its value is never read. +tests/cases/compiler/file2.ts(1,41): error TS6133: 't2' is declared but its value is never read. ==== tests/cases/compiler/file1.ts (0 errors) ==== @@ -16,7 +16,7 @@ tests/cases/compiler/file2.ts(1,50): error TS6133: 't2' is declared but its valu ==== tests/cases/compiler/file2.ts (1 errors) ==== import {Calculator as calc, test as t1, test2 as t2} from "./file1" - ~~ + ~~~~~~~~~~~ !!! error TS6133: 't2' is declared but its value is never read. var x = new calc(); diff --git a/tests/baselines/reference/unusedImports9.errors.txt b/tests/baselines/reference/unusedImports9.errors.txt index 2452962b28990..02bee34686e10 100644 --- a/tests/baselines/reference/unusedImports9.errors.txt +++ b/tests/baselines/reference/unusedImports9.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/file2.ts(1,8): error TS6133: 'c' is declared but its value is never read. +tests/cases/compiler/file2.ts(1,1): error TS6133: 'c' is declared but its value is never read. ==== tests/cases/compiler/file2.ts (1 errors) ==== import c = require('./file1') - ~ + ~~~~~~~~ !!! error TS6133: 'c' is declared but its value is never read. ==== tests/cases/compiler/file1.ts (0 errors) ==== export class Calculator { diff --git a/tests/baselines/reference/unusedInterfaceinNamespace1.errors.txt b/tests/baselines/reference/unusedInterfaceinNamespace1.errors.txt index 613852735debd..e5e0149172753 100644 --- a/tests/baselines/reference/unusedInterfaceinNamespace1.errors.txt +++ b/tests/baselines/reference/unusedInterfaceinNamespace1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/unusedInterfaceinNamespace1.ts(2,15): error TS6133: 'i1' is declared but its value is never read. +tests/cases/compiler/unusedInterfaceinNamespace1.ts(2,5): error TS6133: 'i1' is declared but its value is never read. ==== tests/cases/compiler/unusedInterfaceinNamespace1.ts (1 errors) ==== namespace Validation { interface i1 { - ~~ + ~~~~~~~~~~~~ !!! error TS6133: 'i1' is declared but its value is never read. } diff --git a/tests/baselines/reference/unusedInterfaceinNamespace2.errors.txt b/tests/baselines/reference/unusedInterfaceinNamespace2.errors.txt index 9ce75e393fe83..3839b63f5075b 100644 --- a/tests/baselines/reference/unusedInterfaceinNamespace2.errors.txt +++ b/tests/baselines/reference/unusedInterfaceinNamespace2.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/unusedInterfaceinNamespace2.ts(2,15): error TS6133: 'i1' is declared but its value is never read. +tests/cases/compiler/unusedInterfaceinNamespace2.ts(2,5): error TS6133: 'i1' is declared but its value is never read. ==== tests/cases/compiler/unusedInterfaceinNamespace2.ts (1 errors) ==== namespace Validation { interface i1 { - ~~ + ~~~~~~~~~~~~ !!! error TS6133: 'i1' is declared but its value is never read. } diff --git a/tests/baselines/reference/unusedInterfaceinNamespace3.errors.txt b/tests/baselines/reference/unusedInterfaceinNamespace3.errors.txt index b1b1cbb9b8628..76d32cdf5830c 100644 --- a/tests/baselines/reference/unusedInterfaceinNamespace3.errors.txt +++ b/tests/baselines/reference/unusedInterfaceinNamespace3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/unusedInterfaceinNamespace3.ts(10,15): error TS6133: 'i3' is declared but its value is never read. +tests/cases/compiler/unusedInterfaceinNamespace3.ts(10,5): error TS6133: 'i3' is declared but its value is never read. ==== tests/cases/compiler/unusedInterfaceinNamespace3.ts (1 errors) ==== @@ -12,7 +12,7 @@ tests/cases/compiler/unusedInterfaceinNamespace3.ts(10,15): error TS6133: 'i3' i } interface i3 extends i1 { - ~~ + ~~~~~~~~~~~~ !!! error TS6133: 'i3' is declared but its value is never read. } diff --git a/tests/baselines/reference/unusedLocalsAndObjectSpread.errors.txt b/tests/baselines/reference/unusedLocalsAndObjectSpread.errors.txt index c3f89f32488f4..e590de2989c8f 100644 --- a/tests/baselines/reference/unusedLocalsAndObjectSpread.errors.txt +++ b/tests/baselines/reference/unusedLocalsAndObjectSpread.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/unusedLocalsAndObjectSpread.ts(20,18): error TS6133: 'bar' is declared but its value is never read. -tests/cases/compiler/unusedLocalsAndObjectSpread.ts(27,21): error TS6133: 'bar' is declared but its value is never read. +tests/cases/compiler/unusedLocalsAndObjectSpread.ts(20,15): error TS6133: 'bar' is declared but its value is never read. +tests/cases/compiler/unusedLocalsAndObjectSpread.ts(27,18): error TS6133: 'bar' is declared but its value is never read. ==== tests/cases/compiler/unusedLocalsAndObjectSpread.ts (2 errors) ==== @@ -23,7 +23,7 @@ tests/cases/compiler/unusedLocalsAndObjectSpread.ts(27,21): error TS6133: 'bar' const foo = { a: 1, b: 2 }; // 'a' is declared but never used const {a, ...bar} = foo; // bar should be unused - ~~~ + ~~~~~~ !!! error TS6133: 'bar' is declared but its value is never read. //console.log(bar); } @@ -32,7 +32,7 @@ tests/cases/compiler/unusedLocalsAndObjectSpread.ts(27,21): error TS6133: 'bar' const foo = { a: 1, b: 2 }; // '_' is declared but never used const {a: _, ...bar} = foo; // bar should be unused - ~~~ + ~~~~~~ !!! error TS6133: 'bar' is declared but its value is never read. //console.log(bar); } diff --git a/tests/baselines/reference/unusedLocalsAndObjectSpread2.errors.txt b/tests/baselines/reference/unusedLocalsAndObjectSpread2.errors.txt index 2e29bf04608a6..d4205782ef986 100644 --- a/tests/baselines/reference/unusedLocalsAndObjectSpread2.errors.txt +++ b/tests/baselines/reference/unusedLocalsAndObjectSpread2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/unusedLocalsAndObjectSpread2.ts(5,6): error TS6133: 'rest' is declared but its value is never read. -tests/cases/compiler/unusedLocalsAndObjectSpread2.ts(8,10): error TS6133: 'foo' is declared but its value is never read. -tests/cases/compiler/unusedLocalsAndObjectSpread2.ts(12,8): error TS6133: 'rest' is declared but its value is never read. +tests/cases/compiler/unusedLocalsAndObjectSpread2.ts(5,3): error TS6133: 'rest' is declared but its value is never read. +tests/cases/compiler/unusedLocalsAndObjectSpread2.ts(8,1): error TS6133: 'foo' is declared but its value is never read. +tests/cases/compiler/unusedLocalsAndObjectSpread2.ts(12,5): error TS6133: 'rest' is declared but its value is never read. ==== tests/cases/compiler/unusedLocalsAndObjectSpread2.ts (3 errors) ==== @@ -9,18 +9,18 @@ tests/cases/compiler/unusedLocalsAndObjectSpread2.ts(12,8): error TS6133: 'rest' children, // here! active: _a, // here! ...rest, - ~~~~ + ~~~~~~~ !!! error TS6133: 'rest' is declared but its value is never read. } = props; function foo() { - ~~~ + ~~~~~~~~~~~~ !!! error TS6133: 'foo' is declared but its value is never read. const { children, active: _a, ...rest, - ~~~~ + ~~~~~~~ !!! error TS6133: 'rest' is declared but its value is never read. } = props; } diff --git a/tests/baselines/reference/unusedLocalsAndParameters.errors.txt b/tests/baselines/reference/unusedLocalsAndParameters.errors.txt index 01fcdd4f225c6..7ee0e0b8cb93b 100644 --- a/tests/baselines/reference/unusedLocalsAndParameters.errors.txt +++ b/tests/baselines/reference/unusedLocalsAndParameters.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/unusedLocalsAndParameters.ts(4,12): error TS6133: 'a' is de tests/cases/compiler/unusedLocalsAndParameters.ts(9,22): error TS6133: 'a' is declared but its value is never read. tests/cases/compiler/unusedLocalsAndParameters.ts(15,5): error TS6133: 'farrow' is declared but its value is never read. tests/cases/compiler/unusedLocalsAndParameters.ts(15,15): error TS6133: 'a' is declared but its value is never read. -tests/cases/compiler/unusedLocalsAndParameters.ts(18,7): error TS6133: 'C' is declared but its value is never read. +tests/cases/compiler/unusedLocalsAndParameters.ts(18,1): error TS6133: 'C' is declared but its value is never read. tests/cases/compiler/unusedLocalsAndParameters.ts(20,12): error TS6133: 'a' is declared but its value is never read. tests/cases/compiler/unusedLocalsAndParameters.ts(23,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/unusedLocalsAndParameters.ts(23,11): error TS6133: 'v' is declared but its value is never read. @@ -20,7 +20,7 @@ tests/cases/compiler/unusedLocalsAndParameters.ts(63,11): error TS6133: 'c' is d tests/cases/compiler/unusedLocalsAndParameters.ts(68,11): error TS6133: 'a' is declared but its value is never read. tests/cases/compiler/unusedLocalsAndParameters.ts(71,11): error TS6133: 'c' is declared but its value is never read. tests/cases/compiler/unusedLocalsAndParameters.ts(74,11): error TS6133: 'c' is declared but its value is never read. -tests/cases/compiler/unusedLocalsAndParameters.ts(79,11): error TS6133: 'N' is declared but its value is never read. +tests/cases/compiler/unusedLocalsAndParameters.ts(79,1): error TS6133: 'N' is declared but its value is never read. tests/cases/compiler/unusedLocalsAndParameters.ts(80,9): error TS6133: 'x' is declared but its value is never read. @@ -51,7 +51,7 @@ tests/cases/compiler/unusedLocalsAndParameters.ts(80,9): error TS6133: 'x' is de }; class C { - ~ + ~~~~~~~ !!! error TS6133: 'C' is declared but its value is never read. // Method declaration paramter method(a) { @@ -148,7 +148,7 @@ tests/cases/compiler/unusedLocalsAndParameters.ts(80,9): error TS6133: 'x' is de // in a namespace namespace N { - ~ + ~~~~~~~~~~~ !!! error TS6133: 'N' is declared but its value is never read. var x; ~ diff --git a/tests/baselines/reference/unusedLocalsAndParametersTypeAliases2.errors.txt b/tests/baselines/reference/unusedLocalsAndParametersTypeAliases2.errors.txt index e30dc92d39456..31c825ce906f5 100644 --- a/tests/baselines/reference/unusedLocalsAndParametersTypeAliases2.errors.txt +++ b/tests/baselines/reference/unusedLocalsAndParametersTypeAliases2.errors.txt @@ -1,20 +1,20 @@ -tests/cases/compiler/unusedLocalsAndParametersTypeAliases2.ts(2,6): error TS6133: 'handler1' is declared but its value is never read. -tests/cases/compiler/unusedLocalsAndParametersTypeAliases2.ts(5,10): error TS6133: 'foo' is declared but its value is never read. -tests/cases/compiler/unusedLocalsAndParametersTypeAliases2.ts(6,10): error TS6133: 'handler2' is declared but its value is never read. +tests/cases/compiler/unusedLocalsAndParametersTypeAliases2.ts(2,1): error TS6133: 'handler1' is declared but its value is never read. +tests/cases/compiler/unusedLocalsAndParametersTypeAliases2.ts(5,1): error TS6133: 'foo' is declared but its value is never read. +tests/cases/compiler/unusedLocalsAndParametersTypeAliases2.ts(6,5): error TS6133: 'handler2' is declared but its value is never read. ==== tests/cases/compiler/unusedLocalsAndParametersTypeAliases2.ts (3 errors) ==== // unused type handler1 = () => void; - ~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS6133: 'handler1' is declared but its value is never read. function foo() { - ~~~ + ~~~~~~~~~~~~ !!! error TS6133: 'foo' is declared but its value is never read. type handler2 = () => void; - ~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS6133: 'handler2' is declared but its value is never read. foo(); } diff --git a/tests/baselines/reference/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration1.errors.txt b/tests/baselines/reference/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration1.errors.txt index da5bc7382e38e..ccfecf77634d0 100644 --- a/tests/baselines/reference/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration1.errors.txt +++ b/tests/baselines/reference/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration1.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration1.ts(1,18): error TS6133: 'person' is declared but its value is never read. tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration1.ts(1,34): error TS6133: 'person2' is declared but its value is never read. tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration1.ts(2,9): error TS6133: 'unused' is declared but its value is never read. -tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration1.ts(3,14): error TS6133: 'maker' is declared but its value is never read. +tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration1.ts(3,5): error TS6133: 'maker' is declared but its value is never read. tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration1.ts(3,20): error TS6133: 'child' is declared but its value is never read. tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration1.ts(4,13): error TS6133: 'unused2' is declared but its value is never read. @@ -16,7 +16,7 @@ tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration1 ~~~~~~ !!! error TS6133: 'unused' is declared but its value is never read. function maker(child: string): void { - ~~~~~ + ~~~~~~~~~~~~~~ !!! error TS6133: 'maker' is declared but its value is never read. ~~~~~ !!! error TS6133: 'child' is declared but its value is never read. diff --git a/tests/baselines/reference/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration2.errors.txt b/tests/baselines/reference/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration2.errors.txt index e5326d2c41fbe..dcd5b75ea8688 100644 --- a/tests/baselines/reference/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration2.errors.txt +++ b/tests/baselines/reference/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration2.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration2.ts(1,18): error TS6133: 'person' is declared but its value is never read. tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration2.ts(2,9): error TS6133: 'unused' is declared but its value is never read. -tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration2.ts(3,14): error TS6133: 'maker' is declared but its value is never read. +tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration2.ts(3,5): error TS6133: 'maker' is declared but its value is never read. tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration2.ts(3,20): error TS6133: 'child' is declared but its value is never read. tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration2.ts(4,13): error TS6133: 'unused2' is declared but its value is never read. tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration2.ts(6,21): error TS6133: 'child2' is declared but its value is never read. @@ -15,7 +15,7 @@ tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionDeclaration2 ~~~~~~ !!! error TS6133: 'unused' is declared but its value is never read. function maker(child: string): void { - ~~~~~ + ~~~~~~~~~~~~~~ !!! error TS6133: 'maker' is declared but its value is never read. ~~~~~ !!! error TS6133: 'child' is declared but its value is never read. diff --git a/tests/baselines/reference/unusedLocalsOnFunctionDeclarationWithinFunctionExpression1.errors.txt b/tests/baselines/reference/unusedLocalsOnFunctionDeclarationWithinFunctionExpression1.errors.txt index ac9b5c8632c7b..d8b92c7d71db3 100644 --- a/tests/baselines/reference/unusedLocalsOnFunctionDeclarationWithinFunctionExpression1.errors.txt +++ b/tests/baselines/reference/unusedLocalsOnFunctionDeclarationWithinFunctionExpression1.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionExpression1.ts(1,25): error TS6133: 'person' is declared but its value is never read. tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionExpression1.ts(1,41): error TS6133: 'person2' is declared but its value is never read. tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionExpression1.ts(2,9): error TS6133: 'unused' is declared but its value is never read. -tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionExpression1.ts(3,14): error TS6133: 'maker' is declared but its value is never read. +tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionExpression1.ts(3,5): error TS6133: 'maker' is declared but its value is never read. tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionExpression1.ts(3,20): error TS6133: 'child' is declared but its value is never read. tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionExpression1.ts(4,13): error TS6133: 'unused2' is declared but its value is never read. @@ -16,7 +16,7 @@ tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionExpression1. ~~~~~~ !!! error TS6133: 'unused' is declared but its value is never read. function maker(child: string): void { - ~~~~~ + ~~~~~~~~~~~~~~ !!! error TS6133: 'maker' is declared but its value is never read. ~~~~~ !!! error TS6133: 'child' is declared but its value is never read. diff --git a/tests/baselines/reference/unusedLocalsOnFunctionDeclarationWithinFunctionExpression2.errors.txt b/tests/baselines/reference/unusedLocalsOnFunctionDeclarationWithinFunctionExpression2.errors.txt index c709d189d1717..4b5da962c002b 100644 --- a/tests/baselines/reference/unusedLocalsOnFunctionDeclarationWithinFunctionExpression2.errors.txt +++ b/tests/baselines/reference/unusedLocalsOnFunctionDeclarationWithinFunctionExpression2.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionExpression2.ts(1,25): error TS6133: 'person' is declared but its value is never read. tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionExpression2.ts(2,9): error TS6133: 'unused' is declared but its value is never read. -tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionExpression2.ts(3,14): error TS6133: 'maker' is declared but its value is never read. +tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionExpression2.ts(3,5): error TS6133: 'maker' is declared but its value is never read. tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionExpression2.ts(3,20): error TS6133: 'child' is declared but its value is never read. tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionExpression2.ts(4,13): error TS6133: 'unused2' is declared but its value is never read. tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionExpression2.ts(6,21): error TS6133: 'child2' is declared but its value is never read. @@ -15,7 +15,7 @@ tests/cases/compiler/unusedLocalsOnFunctionDeclarationWithinFunctionExpression2. ~~~~~~ !!! error TS6133: 'unused' is declared but its value is never read. function maker(child: string): void { - ~~~~~ + ~~~~~~~~~~~~~~ !!! error TS6133: 'maker' is declared but its value is never read. ~~~~~ !!! error TS6133: 'child' is declared but its value is never read. diff --git a/tests/baselines/reference/unusedModuleInModule.errors.txt b/tests/baselines/reference/unusedModuleInModule.errors.txt index bd8040ce5903c..eb3aa9447977b 100644 --- a/tests/baselines/reference/unusedModuleInModule.errors.txt +++ b/tests/baselines/reference/unusedModuleInModule.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/unusedModuleInModule.ts(2,12): error TS6133: 'B' is declared but its value is never read. +tests/cases/compiler/unusedModuleInModule.ts(2,5): error TS6133: 'B' is declared but its value is never read. ==== tests/cases/compiler/unusedModuleInModule.ts (1 errors) ==== module A { module B {} - ~ + ~~~~~~~~ !!! error TS6133: 'B' is declared but its value is never read. } \ No newline at end of file diff --git a/tests/baselines/reference/unusedNamespaceInModule.errors.txt b/tests/baselines/reference/unusedNamespaceInModule.errors.txt index afc118b094a41..9cce14e295a4e 100644 --- a/tests/baselines/reference/unusedNamespaceInModule.errors.txt +++ b/tests/baselines/reference/unusedNamespaceInModule.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/unusedNamespaceInModule.ts(2,15): error TS6133: 'B' is declared but its value is never read. +tests/cases/compiler/unusedNamespaceInModule.ts(2,5): error TS6133: 'B' is declared but its value is never read. ==== tests/cases/compiler/unusedNamespaceInModule.ts (1 errors) ==== module A { namespace B { } - ~ + ~~~~~~~~~~~ !!! error TS6133: 'B' is declared but its value is never read. export namespace C {} } \ No newline at end of file diff --git a/tests/baselines/reference/unusedNamespaceInNamespace.errors.txt b/tests/baselines/reference/unusedNamespaceInNamespace.errors.txt index ff031f5af41d0..0988b749fd487 100644 --- a/tests/baselines/reference/unusedNamespaceInNamespace.errors.txt +++ b/tests/baselines/reference/unusedNamespaceInNamespace.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/unusedNamespaceInNamespace.ts(2,15): error TS6133: 'B' is declared but its value is never read. +tests/cases/compiler/unusedNamespaceInNamespace.ts(2,5): error TS6133: 'B' is declared but its value is never read. ==== tests/cases/compiler/unusedNamespaceInNamespace.ts (1 errors) ==== namespace A { namespace B { } - ~ + ~~~~~~~~~~~ !!! error TS6133: 'B' is declared but its value is never read. export namespace C {} } \ No newline at end of file