From 0a83d797ddb47253b5e6a5e597ff66499dd9b78a Mon Sep 17 00:00:00 2001 From: Jason Ramsay Date: Tue, 27 Sep 2016 13:22:48 -0700 Subject: [PATCH 1/3] Issue: Commit on enter isn't working correctly for JS completions in VS Fix: revert the change to always return true for isNewIdentifierLocation for JavaScript files. With recent Roslyn completion list changes and the new VS default statement completion settings to "Only use Tab or Enter to commit" this change is no longer required. There is no longer a completion on space issue for JavaScript in VS and the previous fix is stopping completion on enter from working correctly. --- src/services/completions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/completions.ts b/src/services/completions.ts index d6a4da89ed1..a43717921c4 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -56,7 +56,7 @@ namespace ts.Completions { addRange(entries, keywordCompletions); } - return { isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation || isSourceFileJavaScript(sourceFile), entries }; + return { isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries }; function getJavaScriptCompletionEntries(sourceFile: SourceFile, position: number, uniqueNames: Map): CompletionEntry[] { const entries: CompletionEntry[] = []; From 3bd2226e35a548d65f8aed282efefa2a4b89639d Mon Sep 17 00:00:00 2001 From: Lukas Elmer Date: Tue, 27 Sep 2016 12:32:48 +0200 Subject: [PATCH 2/3] Fix misleading error TS2410 from issue #10601 --- src/compiler/checker.ts | 8 ++++++- src/compiler/diagnosticMessages.json | 2 +- .../ambientWithStatements.errors.txt | 6 ++--- .../arrowFunctionContexts.errors.txt | 12 +++++----- ...nstDeclarations-invalidContexts.errors.txt | 6 ++--- .../constDeclarations-scopes.errors.txt | 6 ++--- ...constDeclarations-validContexts.errors.txt | 6 ++--- ...es5-asyncFunctionWithStatements.errors.txt | 24 +++++++++---------- .../functionExpressionInWithBlock.errors.txt | 6 ++--- ...letDeclarations-invalidContexts.errors.txt | 6 ++--- .../letDeclarations-scopes.errors.txt | 6 ++--- .../letDeclarations-validContexts.errors.txt | 6 ++--- .../reference/parserStrictMode14.errors.txt | 6 ++--- .../parserWithStatement1.d.errors.txt | 6 ++--- .../reference/parserWithStatement2.errors.txt | 6 ++--- .../sourceMapValidationStatements.errors.txt | 6 ++--- .../superCallsInConstructor.errors.txt | 6 ++--- .../reference/withStatement.errors.txt | 6 ++--- .../reference/withStatementErrors.errors.txt | 6 ++--- .../withStatementNestedScope.errors.txt | 6 ++--- .../reference/withStatements.errors.txt | 6 ++--- 21 files changed, 77 insertions(+), 71 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 61cf701eb95..5146ac17765 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16499,7 +16499,13 @@ namespace ts { } checkExpression(node.expression); - error(node.expression, Diagnostics.All_symbols_within_a_with_block_will_be_resolved_to_any); + + const sourceFile = getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + const start = getSpanOfTokenAtPosition(sourceFile, node.pos).start; + const end = node.statement.pos; + grammarErrorAtPos(sourceFile, start, end - start, Diagnostics.Unsupported_with_statement_all_symbols_within_a_with_block_will_be_resolved_to_any); + } } function checkSwitchStatement(node: SwitchStatement) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 11eb12bb2b4..a4a0d99f1d8 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1279,7 +1279,7 @@ "category": "Error", "code": 2409 }, - "All symbols within a 'with' block will be resolved to 'any'.": { + "Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'.": { "category": "Error", "code": 2410 }, diff --git a/tests/baselines/reference/ambientWithStatements.errors.txt b/tests/baselines/reference/ambientWithStatements.errors.txt index 023dd65f56d..53efe649d9c 100644 --- a/tests/baselines/reference/ambientWithStatements.errors.txt +++ b/tests/baselines/reference/ambientWithStatements.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/ambientWithStatements.ts(2,5): error TS1036: Statements are tests/cases/compiler/ambientWithStatements.ts(3,5): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. tests/cases/compiler/ambientWithStatements.ts(7,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. tests/cases/compiler/ambientWithStatements.ts(11,5): error TS1108: A 'return' statement can only be used within a function body. -tests/cases/compiler/ambientWithStatements.ts(25,11): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/ambientWithStatements.ts(25,5): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ==== tests/cases/compiler/ambientWithStatements.ts (5 errors) ==== @@ -39,7 +39,7 @@ tests/cases/compiler/ambientWithStatements.ts(25,11): error TS2410: All symbols finally { } with (x) { - ~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. } } \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionContexts.errors.txt b/tests/baselines/reference/arrowFunctionContexts.errors.txt index 5ffe9d1ec34..ed9eaf27343 100644 --- a/tests/baselines/reference/arrowFunctionContexts.errors.txt +++ b/tests/baselines/reference/arrowFunctionContexts.errors.txt @@ -1,10 +1,10 @@ +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(3,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(3,7): error TS2304: Cannot find name 'window'. -tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(3,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(19,1): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(31,9): error TS2322: Type '() => number' is not assignable to type 'E'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(32,16): error TS2332: 'this' cannot be referenced in current location. +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(44,5): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(44,11): error TS2304: Cannot find name 'window'. -tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(44,11): error TS2410: All symbols within a 'with' block will be resolved to 'any'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(60,5): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(72,13): error TS2322: Type '() => number' is not assignable to type 'E'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(73,20): error TS2332: 'this' cannot be referenced in current location. @@ -14,10 +14,10 @@ tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(73,20): e // Arrow function used in with statement with (window) { + ~~~~~~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ~~~~~~ !!! error TS2304: Cannot find name 'window'. - ~~~~~~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. var p = () => this; } @@ -65,10 +65,10 @@ tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(73,20): e module M2 { // Arrow function used in with statement with (window) { + ~~~~~~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ~~~~~~ !!! error TS2304: Cannot find name 'window'. - ~~~~~~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. var p = () => this; } diff --git a/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt b/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt index 20ec5b0c25b..0157265b56f 100644 --- a/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt +++ b/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/constDeclarations-invalidContexts.ts(4,5): error TS1156: 'c tests/cases/compiler/constDeclarations-invalidContexts.ts(6,5): error TS1156: 'const' declarations can only be declared inside a block. tests/cases/compiler/constDeclarations-invalidContexts.ts(9,5): error TS1156: 'const' declarations can only be declared inside a block. tests/cases/compiler/constDeclarations-invalidContexts.ts(12,5): error TS1156: 'const' declarations can only be declared inside a block. -tests/cases/compiler/constDeclarations-invalidContexts.ts(16,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/constDeclarations-invalidContexts.ts(16,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. tests/cases/compiler/constDeclarations-invalidContexts.ts(20,5): error TS1156: 'const' declarations can only be declared inside a block. tests/cases/compiler/constDeclarations-invalidContexts.ts(23,5): error TS1156: 'const' declarations can only be declared inside a block. tests/cases/compiler/constDeclarations-invalidContexts.ts(26,12): error TS1156: 'const' declarations can only be declared inside a block. @@ -34,8 +34,8 @@ tests/cases/compiler/constDeclarations-invalidContexts.ts(29,29): error TS1156: var obj; with (obj) - ~~~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. const c5 = 0; // No Error will be reported here since we turn off all type checking for (var i = 0; i < 10; i++) diff --git a/tests/baselines/reference/constDeclarations-scopes.errors.txt b/tests/baselines/reference/constDeclarations-scopes.errors.txt index 4c9f7ce5163..80c881035d5 100644 --- a/tests/baselines/reference/constDeclarations-scopes.errors.txt +++ b/tests/baselines/reference/constDeclarations-scopes.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/constDeclarations-scopes.ts(13,5): error TS7027: Unreachable code detected. tests/cases/compiler/constDeclarations-scopes.ts(22,1): error TS7027: Unreachable code detected. -tests/cases/compiler/constDeclarations-scopes.ts(28,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/constDeclarations-scopes.ts(28,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ==== tests/cases/compiler/constDeclarations-scopes.ts (3 errors) ==== @@ -36,8 +36,8 @@ tests/cases/compiler/constDeclarations-scopes.ts(28,7): error TS2410: All symbol var obj; with (obj) { - ~~~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. const c = 0; n = c; } diff --git a/tests/baselines/reference/constDeclarations-validContexts.errors.txt b/tests/baselines/reference/constDeclarations-validContexts.errors.txt index 7af16a53cbe..c91499ab4b1 100644 --- a/tests/baselines/reference/constDeclarations-validContexts.errors.txt +++ b/tests/baselines/reference/constDeclarations-validContexts.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/constDeclarations-validContexts.ts(20,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/constDeclarations-validContexts.ts(20,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ==== tests/cases/compiler/constDeclarations-validContexts.ts (1 errors) ==== @@ -22,8 +22,8 @@ tests/cases/compiler/constDeclarations-validContexts.ts(20,7): error TS2410: All var obj; with (obj) { - ~~~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. const c5 = 0; } diff --git a/tests/baselines/reference/es5-asyncFunctionWithStatements.errors.txt b/tests/baselines/reference/es5-asyncFunctionWithStatements.errors.txt index 560612bc81e..bf6d7fcc90c 100644 --- a/tests/baselines/reference/es5-asyncFunctionWithStatements.errors.txt +++ b/tests/baselines/reference/es5-asyncFunctionWithStatements.errors.txt @@ -1,11 +1,11 @@ tests/cases/compiler/es5-asyncFunctionWithStatements.ts(4,5): error TS1300: 'with' statements are not allowed in an async function block. -tests/cases/compiler/es5-asyncFunctionWithStatements.ts(4,11): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/es5-asyncFunctionWithStatements.ts(4,5): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. tests/cases/compiler/es5-asyncFunctionWithStatements.ts(10,5): error TS1300: 'with' statements are not allowed in an async function block. -tests/cases/compiler/es5-asyncFunctionWithStatements.ts(10,11): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/es5-asyncFunctionWithStatements.ts(10,5): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. tests/cases/compiler/es5-asyncFunctionWithStatements.ts(16,5): error TS1300: 'with' statements are not allowed in an async function block. -tests/cases/compiler/es5-asyncFunctionWithStatements.ts(16,11): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/es5-asyncFunctionWithStatements.ts(16,5): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. tests/cases/compiler/es5-asyncFunctionWithStatements.ts(24,5): error TS1300: 'with' statements are not allowed in an async function block. -tests/cases/compiler/es5-asyncFunctionWithStatements.ts(24,11): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/es5-asyncFunctionWithStatements.ts(24,5): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ==== tests/cases/compiler/es5-asyncFunctionWithStatements.ts (8 errors) ==== @@ -15,8 +15,8 @@ tests/cases/compiler/es5-asyncFunctionWithStatements.ts(24,11): error TS2410: Al with (x) { ~~~~ !!! error TS1300: 'with' statements are not allowed in an async function block. - ~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. y; } } @@ -25,8 +25,8 @@ tests/cases/compiler/es5-asyncFunctionWithStatements.ts(24,11): error TS2410: Al with (await x) { ~~~~ !!! error TS1300: 'with' statements are not allowed in an async function block. - ~~~~~~~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. y; } } @@ -35,8 +35,8 @@ tests/cases/compiler/es5-asyncFunctionWithStatements.ts(24,11): error TS2410: Al with (x) { ~~~~ !!! error TS1300: 'with' statements are not allowed in an async function block. - ~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. a; await y; b; @@ -47,8 +47,8 @@ tests/cases/compiler/es5-asyncFunctionWithStatements.ts(24,11): error TS2410: Al with (x) { ~~~~ !!! error TS1300: 'with' statements are not allowed in an async function block. - ~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. with (z) { a; await y; diff --git a/tests/baselines/reference/functionExpressionInWithBlock.errors.txt b/tests/baselines/reference/functionExpressionInWithBlock.errors.txt index eabb8af49f9..29599622368 100644 --- a/tests/baselines/reference/functionExpressionInWithBlock.errors.txt +++ b/tests/baselines/reference/functionExpressionInWithBlock.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/functionExpressionInWithBlock.ts(2,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/functionExpressionInWithBlock.ts(2,2): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ==== tests/cases/compiler/functionExpressionInWithBlock.ts (1 errors) ==== function x() { with({}) { - ~~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. function f() { () => this; } diff --git a/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt b/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt index e46554ec0e6..150ec9bb52c 100644 --- a/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt +++ b/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/letDeclarations-invalidContexts.ts(5,5): error TS1157: 'let tests/cases/compiler/letDeclarations-invalidContexts.ts(7,5): error TS1157: 'let' declarations can only be declared inside a block. tests/cases/compiler/letDeclarations-invalidContexts.ts(10,5): error TS1157: 'let' declarations can only be declared inside a block. tests/cases/compiler/letDeclarations-invalidContexts.ts(13,5): error TS1157: 'let' declarations can only be declared inside a block. -tests/cases/compiler/letDeclarations-invalidContexts.ts(17,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/letDeclarations-invalidContexts.ts(17,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. tests/cases/compiler/letDeclarations-invalidContexts.ts(21,5): error TS1157: 'let' declarations can only be declared inside a block. tests/cases/compiler/letDeclarations-invalidContexts.ts(24,5): error TS1157: 'let' declarations can only be declared inside a block. tests/cases/compiler/letDeclarations-invalidContexts.ts(27,12): error TS1157: 'let' declarations can only be declared inside a block. @@ -35,8 +35,8 @@ tests/cases/compiler/letDeclarations-invalidContexts.ts(30,29): error TS1157: 'l var obj; with (obj) - ~~~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. let l5 = 0; for (var i = 0; i < 10; i++) diff --git a/tests/baselines/reference/letDeclarations-scopes.errors.txt b/tests/baselines/reference/letDeclarations-scopes.errors.txt index 1b10903af7c..272f458b786 100644 --- a/tests/baselines/reference/letDeclarations-scopes.errors.txt +++ b/tests/baselines/reference/letDeclarations-scopes.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/letDeclarations-scopes.ts(29,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/letDeclarations-scopes.ts(29,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ==== tests/cases/compiler/letDeclarations-scopes.ts (1 errors) ==== @@ -31,8 +31,8 @@ tests/cases/compiler/letDeclarations-scopes.ts(29,7): error TS2410: All symbols var obj; with (obj) { - ~~~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. let l = 0; n = l; } diff --git a/tests/baselines/reference/letDeclarations-validContexts.errors.txt b/tests/baselines/reference/letDeclarations-validContexts.errors.txt index acec026daf0..1002a423444 100644 --- a/tests/baselines/reference/letDeclarations-validContexts.errors.txt +++ b/tests/baselines/reference/letDeclarations-validContexts.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/letDeclarations-validContexts.ts(21,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/letDeclarations-validContexts.ts(21,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ==== tests/cases/compiler/letDeclarations-validContexts.ts (1 errors) ==== @@ -23,8 +23,8 @@ tests/cases/compiler/letDeclarations-validContexts.ts(21,7): error TS2410: All s var obj; with (obj) { - ~~~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. let l5 = 0; } diff --git a/tests/baselines/reference/parserStrictMode14.errors.txt b/tests/baselines/reference/parserStrictMode14.errors.txt index fc9b66c5cdd..9b9d336faed 100644 --- a/tests/baselines/reference/parserStrictMode14.errors.txt +++ b/tests/baselines/reference/parserStrictMode14.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode14.ts(2,1): error TS1101: 'with' statements are not allowed in strict mode. +tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode14.ts(2,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode14.ts(2,7): error TS2304: Cannot find name 'a'. -tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode14.ts(2,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. ==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode14.ts (3 errors) ==== @@ -8,8 +8,8 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode14.ts(2,7) with (a) { ~~~~ !!! error TS1101: 'with' statements are not allowed in strict mode. + ~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ~ !!! error TS2304: Cannot find name 'a'. - ~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserWithStatement1.d.errors.txt b/tests/baselines/reference/parserWithStatement1.d.errors.txt index 21f0f8444e0..7290c1807f7 100644 --- a/tests/baselines/reference/parserWithStatement1.d.errors.txt +++ b/tests/baselines/reference/parserWithStatement1.d.errors.txt @@ -1,14 +1,14 @@ tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement1.d.ts(1,1): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement1.d.ts(1,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement1.d.ts(1,7): error TS2304: Cannot find name 'foo'. -tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement1.d.ts(1,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement1.d.ts (3 errors) ==== with (foo) { ~~~~ !!! error TS1036: Statements are not allowed in ambient contexts. + ~~~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ~~~ !!! error TS2304: Cannot find name 'foo'. - ~~~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserWithStatement2.errors.txt b/tests/baselines/reference/parserWithStatement2.errors.txt index bab548de06e..f93ad2f943e 100644 --- a/tests/baselines/reference/parserWithStatement2.errors.txt +++ b/tests/baselines/reference/parserWithStatement2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement2.ts(1,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement2.ts(1,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement2.ts (1 errors) ==== with (1) - ~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. return; \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationStatements.errors.txt b/tests/baselines/reference/sourceMapValidationStatements.errors.txt index ce795009909..70f53302381 100644 --- a/tests/baselines/reference/sourceMapValidationStatements.errors.txt +++ b/tests/baselines/reference/sourceMapValidationStatements.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/sourceMapValidationStatements.ts(43,11): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/sourceMapValidationStatements.ts(43,5): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ==== tests/cases/compiler/sourceMapValidationStatements.ts (1 errors) ==== @@ -45,8 +45,8 @@ tests/cases/compiler/sourceMapValidationStatements.ts(43,11): error TS2410: All y = 70; } with (obj) { - ~~~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. i = 2; z = 10; } diff --git a/tests/baselines/reference/superCallsInConstructor.errors.txt b/tests/baselines/reference/superCallsInConstructor.errors.txt index eee7c06b671..41af1b5f148 100644 --- a/tests/baselines/reference/superCallsInConstructor.errors.txt +++ b/tests/baselines/reference/superCallsInConstructor.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/superCallsInConstructor.ts(12,9): error TS1101: 'with' statements are not allowed in strict mode. -tests/cases/compiler/superCallsInConstructor.ts(12,14): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/superCallsInConstructor.ts(12,9): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ==== tests/cases/compiler/superCallsInConstructor.ts (2 errors) ==== @@ -17,8 +17,8 @@ tests/cases/compiler/superCallsInConstructor.ts(12,14): error TS2410: All symbol with(new C()) { ~~~~ !!! error TS1101: 'with' statements are not allowed in strict mode. - ~~~~~~~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. foo(); super(); bar(); diff --git a/tests/baselines/reference/withStatement.errors.txt b/tests/baselines/reference/withStatement.errors.txt index 8ae5f8b146e..f545e5c31db 100644 --- a/tests/baselines/reference/withStatement.errors.txt +++ b/tests/baselines/reference/withStatement.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/withStatement.ts(3,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/withStatement.ts(3,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ==== tests/cases/compiler/withStatement.ts (1 errors) ==== declare var ooo:any; with (ooo.eee.oo.ah_ah.ting.tang.walla.walla) { // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. bing = true; // no error bang = true; // no error diff --git a/tests/baselines/reference/withStatementErrors.errors.txt b/tests/baselines/reference/withStatementErrors.errors.txt index cbabba66cab..2eef07c218e 100644 --- a/tests/baselines/reference/withStatementErrors.errors.txt +++ b/tests/baselines/reference/withStatementErrors.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/withStatementErrors.ts(3,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/withStatementErrors.ts(3,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ==== tests/cases/compiler/withStatementErrors.ts (1 errors) ==== declare var ooo:any; with (ooo.eee.oo.ah_ah.ting.tang.walla.walla) { // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. bing = true; // no error bang = true; // no error diff --git a/tests/baselines/reference/withStatementNestedScope.errors.txt b/tests/baselines/reference/withStatementNestedScope.errors.txt index 143acd6dcda..cc48d389035 100644 --- a/tests/baselines/reference/withStatementNestedScope.errors.txt +++ b/tests/baselines/reference/withStatementNestedScope.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/withStatementNestedScope.ts(2,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/withStatementNestedScope.ts(2,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ==== tests/cases/compiler/withStatementNestedScope.ts (1 errors) ==== var x = 1; with (x) { - ~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. function f(a: number) { return 1; } diff --git a/tests/baselines/reference/withStatements.errors.txt b/tests/baselines/reference/withStatements.errors.txt index 467efbae2ed..e43c7197ff1 100644 --- a/tests/baselines/reference/withStatements.errors.txt +++ b/tests/baselines/reference/withStatements.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/statements/withStatements/withStatements.ts(2,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/conformance/statements/withStatements/withStatements.ts(2,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. ==== tests/cases/conformance/statements/withStatements/withStatements.ts (1 errors) ==== var x = 12; with (x) { - ~ -!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + ~~~~~~~~ +!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. name = 'twelve' id = 12 } \ No newline at end of file From 5c12fc556aaf2ff0a8f8dbbdb74b89917eec2d77 Mon Sep 17 00:00:00 2001 From: Lukas Elmer Date: Thu, 29 Sep 2016 19:06:32 +0200 Subject: [PATCH 3/3] Change the error message --- src/compiler/checker.ts | 2 +- src/compiler/diagnosticMessages.json | 2 +- .../reference/ambientWithStatements.errors.txt | 4 ++-- .../reference/arrowFunctionContexts.errors.txt | 8 ++++---- .../constDeclarations-invalidContexts.errors.txt | 4 ++-- .../constDeclarations-scopes.errors.txt | 4 ++-- .../constDeclarations-validContexts.errors.txt | 4 ++-- .../es5-asyncFunctionWithStatements.errors.txt | 16 ++++++++-------- .../functionExpressionInWithBlock.errors.txt | 4 ++-- .../letDeclarations-invalidContexts.errors.txt | 4 ++-- .../reference/letDeclarations-scopes.errors.txt | 4 ++-- .../letDeclarations-validContexts.errors.txt | 4 ++-- .../reference/parserStrictMode14.errors.txt | 4 ++-- .../reference/parserWithStatement1.d.errors.txt | 4 ++-- .../reference/parserWithStatement2.errors.txt | 4 ++-- .../sourceMapValidationStatements.errors.txt | 4 ++-- .../reference/superCallsInConstructor.errors.txt | 4 ++-- .../baselines/reference/withStatement.errors.txt | 4 ++-- .../reference/withStatementErrors.errors.txt | 4 ++-- .../withStatementNestedScope.errors.txt | 4 ++-- .../reference/withStatements.errors.txt | 4 ++-- 21 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5146ac17765..e9c49b72ef3 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16504,7 +16504,7 @@ namespace ts { if (!hasParseDiagnostics(sourceFile)) { const start = getSpanOfTokenAtPosition(sourceFile, node.pos).start; const end = node.statement.pos; - grammarErrorAtPos(sourceFile, start, end - start, Diagnostics.Unsupported_with_statement_all_symbols_within_a_with_block_will_be_resolved_to_any); + grammarErrorAtPos(sourceFile, start, end - start, Diagnostics.The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any); } } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index a4a0d99f1d8..f8cdb6d8882 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1279,7 +1279,7 @@ "category": "Error", "code": 2409 }, - "Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'.": { + "The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.": { "category": "Error", "code": 2410 }, diff --git a/tests/baselines/reference/ambientWithStatements.errors.txt b/tests/baselines/reference/ambientWithStatements.errors.txt index 53efe649d9c..6fb6aafd864 100644 --- a/tests/baselines/reference/ambientWithStatements.errors.txt +++ b/tests/baselines/reference/ambientWithStatements.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/ambientWithStatements.ts(2,5): error TS1036: Statements are tests/cases/compiler/ambientWithStatements.ts(3,5): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. tests/cases/compiler/ambientWithStatements.ts(7,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. tests/cases/compiler/ambientWithStatements.ts(11,5): error TS1108: A 'return' statement can only be used within a function body. -tests/cases/compiler/ambientWithStatements.ts(25,5): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/ambientWithStatements.ts(25,5): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ==== tests/cases/compiler/ambientWithStatements.ts (5 errors) ==== @@ -40,6 +40,6 @@ tests/cases/compiler/ambientWithStatements.ts(25,5): error TS2410: Unsupported ' } with (x) { ~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. } } \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionContexts.errors.txt b/tests/baselines/reference/arrowFunctionContexts.errors.txt index ed9eaf27343..461d84052d9 100644 --- a/tests/baselines/reference/arrowFunctionContexts.errors.txt +++ b/tests/baselines/reference/arrowFunctionContexts.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(3,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(3,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(3,7): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(19,1): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(31,9): error TS2322: Type '() => number' is not assignable to type 'E'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(32,16): error TS2332: 'this' cannot be referenced in current location. -tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(44,5): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(44,5): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(44,11): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(60,5): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(72,13): error TS2322: Type '() => number' is not assignable to type 'E'. @@ -15,7 +15,7 @@ tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(73,20): e // Arrow function used in with statement with (window) { ~~~~~~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ~~~~~~ !!! error TS2304: Cannot find name 'window'. var p = () => this; @@ -66,7 +66,7 @@ tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(73,20): e // Arrow function used in with statement with (window) { ~~~~~~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ~~~~~~ !!! error TS2304: Cannot find name 'window'. var p = () => this; diff --git a/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt b/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt index 0157265b56f..93a5644abb5 100644 --- a/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt +++ b/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/constDeclarations-invalidContexts.ts(4,5): error TS1156: 'c tests/cases/compiler/constDeclarations-invalidContexts.ts(6,5): error TS1156: 'const' declarations can only be declared inside a block. tests/cases/compiler/constDeclarations-invalidContexts.ts(9,5): error TS1156: 'const' declarations can only be declared inside a block. tests/cases/compiler/constDeclarations-invalidContexts.ts(12,5): error TS1156: 'const' declarations can only be declared inside a block. -tests/cases/compiler/constDeclarations-invalidContexts.ts(16,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/constDeclarations-invalidContexts.ts(16,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. tests/cases/compiler/constDeclarations-invalidContexts.ts(20,5): error TS1156: 'const' declarations can only be declared inside a block. tests/cases/compiler/constDeclarations-invalidContexts.ts(23,5): error TS1156: 'const' declarations can only be declared inside a block. tests/cases/compiler/constDeclarations-invalidContexts.ts(26,12): error TS1156: 'const' declarations can only be declared inside a block. @@ -35,7 +35,7 @@ tests/cases/compiler/constDeclarations-invalidContexts.ts(29,29): error TS1156: var obj; with (obj) ~~~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. const c5 = 0; // No Error will be reported here since we turn off all type checking for (var i = 0; i < 10; i++) diff --git a/tests/baselines/reference/constDeclarations-scopes.errors.txt b/tests/baselines/reference/constDeclarations-scopes.errors.txt index 80c881035d5..905988bf784 100644 --- a/tests/baselines/reference/constDeclarations-scopes.errors.txt +++ b/tests/baselines/reference/constDeclarations-scopes.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/constDeclarations-scopes.ts(13,5): error TS7027: Unreachable code detected. tests/cases/compiler/constDeclarations-scopes.ts(22,1): error TS7027: Unreachable code detected. -tests/cases/compiler/constDeclarations-scopes.ts(28,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/constDeclarations-scopes.ts(28,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ==== tests/cases/compiler/constDeclarations-scopes.ts (3 errors) ==== @@ -37,7 +37,7 @@ tests/cases/compiler/constDeclarations-scopes.ts(28,1): error TS2410: Unsupporte var obj; with (obj) { ~~~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. const c = 0; n = c; } diff --git a/tests/baselines/reference/constDeclarations-validContexts.errors.txt b/tests/baselines/reference/constDeclarations-validContexts.errors.txt index c91499ab4b1..65e80e7c6fd 100644 --- a/tests/baselines/reference/constDeclarations-validContexts.errors.txt +++ b/tests/baselines/reference/constDeclarations-validContexts.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/constDeclarations-validContexts.ts(20,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/constDeclarations-validContexts.ts(20,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ==== tests/cases/compiler/constDeclarations-validContexts.ts (1 errors) ==== @@ -23,7 +23,7 @@ tests/cases/compiler/constDeclarations-validContexts.ts(20,1): error TS2410: Uns var obj; with (obj) { ~~~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. const c5 = 0; } diff --git a/tests/baselines/reference/es5-asyncFunctionWithStatements.errors.txt b/tests/baselines/reference/es5-asyncFunctionWithStatements.errors.txt index bf6d7fcc90c..916a4acc676 100644 --- a/tests/baselines/reference/es5-asyncFunctionWithStatements.errors.txt +++ b/tests/baselines/reference/es5-asyncFunctionWithStatements.errors.txt @@ -1,11 +1,11 @@ tests/cases/compiler/es5-asyncFunctionWithStatements.ts(4,5): error TS1300: 'with' statements are not allowed in an async function block. -tests/cases/compiler/es5-asyncFunctionWithStatements.ts(4,5): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/es5-asyncFunctionWithStatements.ts(4,5): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. tests/cases/compiler/es5-asyncFunctionWithStatements.ts(10,5): error TS1300: 'with' statements are not allowed in an async function block. -tests/cases/compiler/es5-asyncFunctionWithStatements.ts(10,5): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/es5-asyncFunctionWithStatements.ts(10,5): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. tests/cases/compiler/es5-asyncFunctionWithStatements.ts(16,5): error TS1300: 'with' statements are not allowed in an async function block. -tests/cases/compiler/es5-asyncFunctionWithStatements.ts(16,5): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/es5-asyncFunctionWithStatements.ts(16,5): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. tests/cases/compiler/es5-asyncFunctionWithStatements.ts(24,5): error TS1300: 'with' statements are not allowed in an async function block. -tests/cases/compiler/es5-asyncFunctionWithStatements.ts(24,5): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/es5-asyncFunctionWithStatements.ts(24,5): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ==== tests/cases/compiler/es5-asyncFunctionWithStatements.ts (8 errors) ==== @@ -16,7 +16,7 @@ tests/cases/compiler/es5-asyncFunctionWithStatements.ts(24,5): error TS2410: Uns ~~~~ !!! error TS1300: 'with' statements are not allowed in an async function block. ~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. y; } } @@ -26,7 +26,7 @@ tests/cases/compiler/es5-asyncFunctionWithStatements.ts(24,5): error TS2410: Uns ~~~~ !!! error TS1300: 'with' statements are not allowed in an async function block. ~~~~~~~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. y; } } @@ -36,7 +36,7 @@ tests/cases/compiler/es5-asyncFunctionWithStatements.ts(24,5): error TS2410: Uns ~~~~ !!! error TS1300: 'with' statements are not allowed in an async function block. ~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. a; await y; b; @@ -48,7 +48,7 @@ tests/cases/compiler/es5-asyncFunctionWithStatements.ts(24,5): error TS2410: Uns ~~~~ !!! error TS1300: 'with' statements are not allowed in an async function block. ~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. with (z) { a; await y; diff --git a/tests/baselines/reference/functionExpressionInWithBlock.errors.txt b/tests/baselines/reference/functionExpressionInWithBlock.errors.txt index 29599622368..49d9f6cb790 100644 --- a/tests/baselines/reference/functionExpressionInWithBlock.errors.txt +++ b/tests/baselines/reference/functionExpressionInWithBlock.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/functionExpressionInWithBlock.ts(2,2): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/functionExpressionInWithBlock.ts(2,2): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ==== tests/cases/compiler/functionExpressionInWithBlock.ts (1 errors) ==== function x() { with({}) { ~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. function f() { () => this; } diff --git a/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt b/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt index 150ec9bb52c..d8230f29703 100644 --- a/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt +++ b/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/letDeclarations-invalidContexts.ts(5,5): error TS1157: 'let tests/cases/compiler/letDeclarations-invalidContexts.ts(7,5): error TS1157: 'let' declarations can only be declared inside a block. tests/cases/compiler/letDeclarations-invalidContexts.ts(10,5): error TS1157: 'let' declarations can only be declared inside a block. tests/cases/compiler/letDeclarations-invalidContexts.ts(13,5): error TS1157: 'let' declarations can only be declared inside a block. -tests/cases/compiler/letDeclarations-invalidContexts.ts(17,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/letDeclarations-invalidContexts.ts(17,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. tests/cases/compiler/letDeclarations-invalidContexts.ts(21,5): error TS1157: 'let' declarations can only be declared inside a block. tests/cases/compiler/letDeclarations-invalidContexts.ts(24,5): error TS1157: 'let' declarations can only be declared inside a block. tests/cases/compiler/letDeclarations-invalidContexts.ts(27,12): error TS1157: 'let' declarations can only be declared inside a block. @@ -36,7 +36,7 @@ tests/cases/compiler/letDeclarations-invalidContexts.ts(30,29): error TS1157: 'l var obj; with (obj) ~~~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. let l5 = 0; for (var i = 0; i < 10; i++) diff --git a/tests/baselines/reference/letDeclarations-scopes.errors.txt b/tests/baselines/reference/letDeclarations-scopes.errors.txt index 272f458b786..a44f6a90f7a 100644 --- a/tests/baselines/reference/letDeclarations-scopes.errors.txt +++ b/tests/baselines/reference/letDeclarations-scopes.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/letDeclarations-scopes.ts(29,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/letDeclarations-scopes.ts(29,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ==== tests/cases/compiler/letDeclarations-scopes.ts (1 errors) ==== @@ -32,7 +32,7 @@ tests/cases/compiler/letDeclarations-scopes.ts(29,1): error TS2410: Unsupported var obj; with (obj) { ~~~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. let l = 0; n = l; } diff --git a/tests/baselines/reference/letDeclarations-validContexts.errors.txt b/tests/baselines/reference/letDeclarations-validContexts.errors.txt index 1002a423444..dfd60c7ee53 100644 --- a/tests/baselines/reference/letDeclarations-validContexts.errors.txt +++ b/tests/baselines/reference/letDeclarations-validContexts.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/letDeclarations-validContexts.ts(21,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/letDeclarations-validContexts.ts(21,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ==== tests/cases/compiler/letDeclarations-validContexts.ts (1 errors) ==== @@ -24,7 +24,7 @@ tests/cases/compiler/letDeclarations-validContexts.ts(21,1): error TS2410: Unsup var obj; with (obj) { ~~~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. let l5 = 0; } diff --git a/tests/baselines/reference/parserStrictMode14.errors.txt b/tests/baselines/reference/parserStrictMode14.errors.txt index 9b9d336faed..ba694c1eb65 100644 --- a/tests/baselines/reference/parserStrictMode14.errors.txt +++ b/tests/baselines/reference/parserStrictMode14.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode14.ts(2,1): error TS1101: 'with' statements are not allowed in strict mode. -tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode14.ts(2,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode14.ts(2,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode14.ts(2,7): error TS2304: Cannot find name 'a'. @@ -9,7 +9,7 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode14.ts(2,7) ~~~~ !!! error TS1101: 'with' statements are not allowed in strict mode. ~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ~ !!! error TS2304: Cannot find name 'a'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserWithStatement1.d.errors.txt b/tests/baselines/reference/parserWithStatement1.d.errors.txt index 7290c1807f7..026bc8e3a6e 100644 --- a/tests/baselines/reference/parserWithStatement1.d.errors.txt +++ b/tests/baselines/reference/parserWithStatement1.d.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement1.d.ts(1,1): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement1.d.ts(1,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement1.d.ts(1,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement1.d.ts(1,7): error TS2304: Cannot find name 'foo'. @@ -8,7 +8,7 @@ tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement1.d.ts( ~~~~ !!! error TS1036: Statements are not allowed in ambient contexts. ~~~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ~~~ !!! error TS2304: Cannot find name 'foo'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserWithStatement2.errors.txt b/tests/baselines/reference/parserWithStatement2.errors.txt index f93ad2f943e..712ca12b4c0 100644 --- a/tests/baselines/reference/parserWithStatement2.errors.txt +++ b/tests/baselines/reference/parserWithStatement2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement2.ts(1,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement2.ts(1,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement2.ts (1 errors) ==== with (1) ~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. return; \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationStatements.errors.txt b/tests/baselines/reference/sourceMapValidationStatements.errors.txt index 70f53302381..3b4c2bd6a42 100644 --- a/tests/baselines/reference/sourceMapValidationStatements.errors.txt +++ b/tests/baselines/reference/sourceMapValidationStatements.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/sourceMapValidationStatements.ts(43,5): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/sourceMapValidationStatements.ts(43,5): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ==== tests/cases/compiler/sourceMapValidationStatements.ts (1 errors) ==== @@ -46,7 +46,7 @@ tests/cases/compiler/sourceMapValidationStatements.ts(43,5): error TS2410: Unsup } with (obj) { ~~~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. i = 2; z = 10; } diff --git a/tests/baselines/reference/superCallsInConstructor.errors.txt b/tests/baselines/reference/superCallsInConstructor.errors.txt index 41af1b5f148..36143b72c49 100644 --- a/tests/baselines/reference/superCallsInConstructor.errors.txt +++ b/tests/baselines/reference/superCallsInConstructor.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/superCallsInConstructor.ts(12,9): error TS1101: 'with' statements are not allowed in strict mode. -tests/cases/compiler/superCallsInConstructor.ts(12,9): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/superCallsInConstructor.ts(12,9): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ==== tests/cases/compiler/superCallsInConstructor.ts (2 errors) ==== @@ -18,7 +18,7 @@ tests/cases/compiler/superCallsInConstructor.ts(12,9): error TS2410: Unsupported ~~~~ !!! error TS1101: 'with' statements are not allowed in strict mode. ~~~~~~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. foo(); super(); bar(); diff --git a/tests/baselines/reference/withStatement.errors.txt b/tests/baselines/reference/withStatement.errors.txt index f545e5c31db..e6ad0ec3415 100644 --- a/tests/baselines/reference/withStatement.errors.txt +++ b/tests/baselines/reference/withStatement.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/withStatement.ts(3,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/withStatement.ts(3,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ==== tests/cases/compiler/withStatement.ts (1 errors) ==== @@ -6,7 +6,7 @@ tests/cases/compiler/withStatement.ts(3,1): error TS2410: Unsupported 'with' sta with (ooo.eee.oo.ah_ah.ting.tang.walla.walla) { // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. bing = true; // no error bang = true; // no error diff --git a/tests/baselines/reference/withStatementErrors.errors.txt b/tests/baselines/reference/withStatementErrors.errors.txt index 2eef07c218e..ebd7c557248 100644 --- a/tests/baselines/reference/withStatementErrors.errors.txt +++ b/tests/baselines/reference/withStatementErrors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/withStatementErrors.ts(3,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/withStatementErrors.ts(3,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ==== tests/cases/compiler/withStatementErrors.ts (1 errors) ==== @@ -6,7 +6,7 @@ tests/cases/compiler/withStatementErrors.ts(3,1): error TS2410: Unsupported 'wit with (ooo.eee.oo.ah_ah.ting.tang.walla.walla) { // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. bing = true; // no error bang = true; // no error diff --git a/tests/baselines/reference/withStatementNestedScope.errors.txt b/tests/baselines/reference/withStatementNestedScope.errors.txt index cc48d389035..41408b16aa0 100644 --- a/tests/baselines/reference/withStatementNestedScope.errors.txt +++ b/tests/baselines/reference/withStatementNestedScope.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/withStatementNestedScope.ts(2,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/withStatementNestedScope.ts(2,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ==== tests/cases/compiler/withStatementNestedScope.ts (1 errors) ==== var x = 1; with (x) { ~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. function f(a: number) { return 1; } diff --git a/tests/baselines/reference/withStatements.errors.txt b/tests/baselines/reference/withStatements.errors.txt index e43c7197ff1..1d56fb8a8c3 100644 --- a/tests/baselines/reference/withStatements.errors.txt +++ b/tests/baselines/reference/withStatements.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/statements/withStatements/withStatements.ts(2,1): error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +tests/cases/conformance/statements/withStatements/withStatements.ts(2,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. ==== tests/cases/conformance/statements/withStatements/withStatements.ts (1 errors) ==== var x = 12; with (x) { ~~~~~~~~ -!!! error TS2410: Unsupported 'with' statement, all symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. name = 'twelve' id = 12 } \ No newline at end of file