From ed22f1ca3eede649e0ec26c7ed79616a193d7b1a Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 20 Nov 2014 13:48:23 -0800 Subject: [PATCH] Check node for errors before recursing. --- src/compiler/parser.ts | 41 +++++++++---------- .../accessorsInAmbientContext.errors.txt | 24 +++++------ .../reference/ambientGetters.errors.txt | 6 +-- .../initializersInDeclarations.errors.txt | 6 +-- .../reference/newOperator.errors.txt | 6 +-- .../reference/objectLiteralErrors.errors.txt | 4 +- .../reference/parserAccessors5.errors.txt | 6 +-- .../privacyGloImportParseErrors.errors.txt | 12 +++--- .../privacyImportParseErrors.errors.txt | 24 +++++------ ...hStatementsWithMultipleDefaults.errors.txt | 23 +++++++++-- ...tringsWithIncompatibleTypedTags.errors.txt | 12 +++--- ...mplateStringsWithTagsTypedAsAny.errors.txt | 8 ++-- ...gedTemplateStringsWithTypedTags.errors.txt | 8 ++-- 13 files changed, 96 insertions(+), 84 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 477c414790..29214121c0 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3555,7 +3555,7 @@ module ts { inAmbientContext = true; } - checkNode(node); + checkNodeAndChildren(node); inAmbientContext = savedInAmbientContext; inFunctionBlock = savedInFunctionBlock; @@ -3564,7 +3564,7 @@ module ts { parent = savedParent; } - function checkNode(node: Node) { + function checkNodeAndChildren(node: Node) { var nodeKind = node.kind; // First, check if you have a statement in a place where it is not allowed. We want // to do this before recursing, because we'd prefer to report these errors at the top @@ -3573,41 +3573,38 @@ module ts { return; } - // Now recurse and perform all grammar checks on the children of this node. var diagnosticCount = grammarDiagnostics.length; - forEachChild(node, visitNode); + checkNode(node, nodeKind); // if we got any errors, just stop performing any more checks on this node or higher. if (diagnosticCount !== grammarDiagnostics.length) { return; } + // Otherwise, recurse and see if we have any errors below us. + forEachChild(node, visitNode); + } + + function checkNode(node: Node, nodeKind: SyntaxKind): any { // Now do node specific checks. switch (nodeKind) { - case SyntaxKind.ArrowFunction: + case SyntaxKind.ArrowFunction: case SyntaxKind.CallSignature: case SyntaxKind.ConstructorType: case SyntaxKind.ConstructSignature: case SyntaxKind.FunctionType: - checkParsedSignature(node); - break; - case SyntaxKind.BreakStatement: - case SyntaxKind.ContinueStatement: - checkBreakOrContinueStatement(node); - break; + return checkParsedSignature(node); + case SyntaxKind.BreakStatement: + case SyntaxKind.ContinueStatement: + return checkBreakOrContinueStatement(node); case SyntaxKind.LabeledStatement: - checkLabeledStatement(node); - break; - case SyntaxKind.CallExpression: + return checkLabeledStatement(node); + case SyntaxKind.CallExpression: case SyntaxKind.NewExpression: - checkCallOrNewExpression(node); - break; - case SyntaxKind.EnumDeclaration: - checkEnumInitializer(node); - break; - case SyntaxKind.Parameter: - checkParameter(node); - break; + return checkCallOrNewExpression(node); + + case SyntaxKind.EnumDeclaration: return checkEnumInitializer(node); + case SyntaxKind.Parameter: return checkParameter(node); case SyntaxKind.BinaryExpression: return visitBinaryExpression(node); case SyntaxKind.CatchBlock: return visitCatchBlock(node); case SyntaxKind.ClassDeclaration: return visitClassDeclaration(node); diff --git a/tests/baselines/reference/accessorsInAmbientContext.errors.txt b/tests/baselines/reference/accessorsInAmbientContext.errors.txt index 6028dc898f..ada59f21f6 100644 --- a/tests/baselines/reference/accessorsInAmbientContext.errors.txt +++ b/tests/baselines/reference/accessorsInAmbientContext.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/accessorsInAmbientContext.ts(4,19): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/accessorsInAmbientContext.ts(4,13): error TS1086: An accessor cannot be declared in an ambient context. tests/cases/compiler/accessorsInAmbientContext.ts(5,13): error TS1086: An accessor cannot be declared in an ambient context. -tests/cases/compiler/accessorsInAmbientContext.ts(7,26): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/accessorsInAmbientContext.ts(7,20): error TS1086: An accessor cannot be declared in an ambient context. tests/cases/compiler/accessorsInAmbientContext.ts(8,20): error TS1086: An accessor cannot be declared in an ambient context. -tests/cases/compiler/accessorsInAmbientContext.ts(13,15): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/accessorsInAmbientContext.ts(13,9): error TS1086: An accessor cannot be declared in an ambient context. tests/cases/compiler/accessorsInAmbientContext.ts(14,9): error TS1086: An accessor cannot be declared in an ambient context. -tests/cases/compiler/accessorsInAmbientContext.ts(16,22): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/accessorsInAmbientContext.ts(16,16): error TS1086: An accessor cannot be declared in an ambient context. tests/cases/compiler/accessorsInAmbientContext.ts(17,16): error TS1086: An accessor cannot be declared in an ambient context. @@ -13,15 +13,15 @@ tests/cases/compiler/accessorsInAmbientContext.ts(17,16): error TS1086: An acces declare module M { class C { get X() { return 1; } - ~~~~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. + ~ +!!! error TS1086: An accessor cannot be declared in an ambient context. set X(v) { } ~ !!! error TS1086: An accessor cannot be declared in an ambient context. static get Y() { return 1; } - ~~~~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. + ~ +!!! error TS1086: An accessor cannot be declared in an ambient context. static set Y(v) { } ~ !!! error TS1086: An accessor cannot be declared in an ambient context. @@ -30,15 +30,15 @@ tests/cases/compiler/accessorsInAmbientContext.ts(17,16): error TS1086: An acces declare class C { get X() { return 1; } - ~~~~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. + ~ +!!! error TS1086: An accessor cannot be declared in an ambient context. set X(v) { } ~ !!! error TS1086: An accessor cannot be declared in an ambient context. static get Y() { return 1; } - ~~~~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. + ~ +!!! error TS1086: An accessor cannot be declared in an ambient context. static set Y(v) { } ~ !!! error TS1086: An accessor cannot be declared in an ambient context. diff --git a/tests/baselines/reference/ambientGetters.errors.txt b/tests/baselines/reference/ambientGetters.errors.txt index 085b30b758..a56020c41f 100644 --- a/tests/baselines/reference/ambientGetters.errors.txt +++ b/tests/baselines/reference/ambientGetters.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/ambientGetters.ts(3,9): error TS1086: An accessor cannot be declared in an ambient context. -tests/cases/compiler/ambientGetters.ts(7,20): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/ambientGetters.ts(7,9): error TS1086: An accessor cannot be declared in an ambient context. ==== tests/cases/compiler/ambientGetters.ts (2 errors) ==== @@ -12,6 +12,6 @@ tests/cases/compiler/ambientGetters.ts(7,20): error TS1036: Statements are not a declare class B { get length() { return 0; } - ~~~~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. + ~~~~~~ +!!! error TS1086: An accessor cannot be declared in an ambient context. } \ No newline at end of file diff --git a/tests/baselines/reference/initializersInDeclarations.errors.txt b/tests/baselines/reference/initializersInDeclarations.errors.txt index 99798d749c..5ab9ae5d2b 100644 --- a/tests/baselines/reference/initializersInDeclarations.errors.txt +++ b/tests/baselines/reference/initializersInDeclarations.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/externalModules/initializersInDeclarations.ts(5,9): error TS1039: Initializers are not allowed in ambient contexts. tests/cases/conformance/externalModules/initializersInDeclarations.ts(6,16): error TS1039: Initializers are not allowed in ambient contexts. -tests/cases/conformance/externalModules/initializersInDeclarations.ts(8,3): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/conformance/externalModules/initializersInDeclarations.ts(7,16): error TS1037: A function implementation cannot be declared in an ambient context. tests/cases/conformance/externalModules/initializersInDeclarations.ts(12,15): error TS1039: Initializers are not allowed in ambient contexts. tests/cases/conformance/externalModules/initializersInDeclarations.ts(13,15): error TS1039: Initializers are not allowed in ambient contexts. tests/cases/conformance/externalModules/initializersInDeclarations.ts(16,2): error TS1036: Statements are not allowed in ambient contexts. @@ -19,9 +19,9 @@ tests/cases/conformance/externalModules/initializersInDeclarations.ts(18,16): er ~~ !!! error TS1039: Initializers are not allowed in ambient contexts. fn(): boolean { + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. return false; - ~~~~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. } } diff --git a/tests/baselines/reference/newOperator.errors.txt b/tests/baselines/reference/newOperator.errors.txt index 47f0a68b68..9232b86564 100644 --- a/tests/baselines/reference/newOperator.errors.txt +++ b/tests/baselines/reference/newOperator.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/newOperator.ts(18,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/compiler/newOperator.ts(20,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/newOperator.ts(45,16): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/newOperator.ts(44,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/newOperator.ts(3,13): error TS2304: Cannot find name 'ifc'. tests/cases/compiler/newOperator.ts(10,10): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/newOperator.ts(11,10): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -79,9 +79,9 @@ tests/cases/compiler/newOperator.ts(31,10): error TS2351: Cannot use 'new' with class S { public get xs(): M.T[] { + ~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return new M.T[]; - ~~~~~~~~~ -!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. } } \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralErrors.errors.txt b/tests/baselines/reference/objectLiteralErrors.errors.txt index d27823a30a..97cbdc3226 100644 --- a/tests/baselines/reference/objectLiteralErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralErrors.errors.txt @@ -13,7 +13,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,25) tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,23): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,23): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,27): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,26): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,46): error TS1119: An object literal cannot have property and accessor with the same name. @@ -293,7 +293,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,51) !!! error TS2300: Duplicate identifier '0x0'. var f14 = { 0: 0, get 000() { return 0; } }; ~~~ -!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. +!!! error TS1119: An object literal cannot have property and accessor with the same name. ~ !!! error TS2300: Duplicate identifier '0'. ~~~ diff --git a/tests/baselines/reference/parserAccessors5.errors.txt b/tests/baselines/reference/parserAccessors5.errors.txt index f2e3d8c8d3..b7dcd8ef92 100644 --- a/tests/baselines/reference/parserAccessors5.errors.txt +++ b/tests/baselines/reference/parserAccessors5.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors5.ts(2,15): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors5.ts(2,7): error TS1086: An accessor cannot be declared in an ambient context. ==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors5.ts (1 errors) ==== declare class C { get foo() { return 0; } - ~~~~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. + ~~~ +!!! error TS1086: An accessor cannot be declared in an ambient context. } \ No newline at end of file diff --git a/tests/baselines/reference/privacyGloImportParseErrors.errors.txt b/tests/baselines/reference/privacyGloImportParseErrors.errors.txt index a2f2843e4b..0e3ec1def2 100644 --- a/tests/baselines/reference/privacyGloImportParseErrors.errors.txt +++ b/tests/baselines/reference/privacyGloImportParseErrors.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(59,5): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyGloImportParseErrors.ts(125,13): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyGloImportParseErrors.ts(121,9): error TS1147: Import declarations in an internal module cannot reference an external module. tests/cases/compiler/privacyGloImportParseErrors.ts(133,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context. -tests/cases/compiler/privacyGloImportParseErrors.ts(149,9): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyGloImportParseErrors.ts(146,5): error TS1147: Import declarations in an internal module cannot reference an external module. tests/cases/compiler/privacyGloImportParseErrors.ts(22,27): error TS2435: Ambient external modules cannot be nested in other modules. tests/cases/compiler/privacyGloImportParseErrors.ts(30,20): error TS2435: Ambient external modules cannot be nested in other modules. tests/cases/compiler/privacyGloImportParseErrors.ts(59,37): error TS2307: Cannot find external module 'm1_M3_public'. @@ -143,12 +143,12 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambie module m2 { import errorImport = require("glo_M2_public"); + ~~~~~~ +!!! error TS1147: Import declarations in an internal module cannot reference an external module. import nonerrorImport = glo_M1_public; module m5 { import m5_errorImport = require("glo_M2_public"); - ~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. import m5_nonerrorImport = glo_M1_public; } } @@ -178,11 +178,11 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambie module m2 { import m3 = require("use_glo_M1_public"); + ~~~~~~ +!!! error TS1147: Import declarations in an internal module cannot reference an external module. module m4 { var a = 10; import m2 = require("use_glo_M1_public"); - ~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. } } \ No newline at end of file diff --git a/tests/baselines/reference/privacyImportParseErrors.errors.txt b/tests/baselines/reference/privacyImportParseErrors.errors.txt index 7ba28a2514..4f54c66097 100644 --- a/tests/baselines/reference/privacyImportParseErrors.errors.txt +++ b/tests/baselines/reference/privacyImportParseErrors.errors.txt @@ -1,11 +1,11 @@ tests/cases/compiler/privacyImportParseErrors.ts(59,5): error TS1147: Import declarations in an internal module cannot reference an external module. tests/cases/compiler/privacyImportParseErrors.ts(143,5): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(277,13): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(306,13): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyImportParseErrors.ts(273,9): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyImportParseErrors.ts(302,9): error TS1147: Import declarations in an internal module cannot reference an external module. tests/cases/compiler/privacyImportParseErrors.ts(314,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context. tests/cases/compiler/privacyImportParseErrors.ts(326,9): error TS1029: 'export' modifier must precede 'declare' modifier. -tests/cases/compiler/privacyImportParseErrors.ts(344,9): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(353,9): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyImportParseErrors.ts(341,5): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyImportParseErrors.ts(350,5): error TS1147: Import declarations in an internal module cannot reference an external module. tests/cases/compiler/privacyImportParseErrors.ts(22,27): error TS2435: Ambient external modules cannot be nested in other modules. tests/cases/compiler/privacyImportParseErrors.ts(30,20): error TS2435: Ambient external modules cannot be nested in other modules. tests/cases/compiler/privacyImportParseErrors.ts(59,37): error TS2307: Cannot find external module 'm1_M3_public'. @@ -352,12 +352,12 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient module m2 { import errorImport = require("glo_M2_public"); + ~~~~~~ +!!! error TS1147: Import declarations in an internal module cannot reference an external module. import nonerrorImport = glo_M1_public; module m5 { import m5_errorImport = require("glo_M2_public"); - ~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. import m5_nonerrorImport = glo_M1_public; } } @@ -391,12 +391,12 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient module m2 { import errorImport = require("glo_M4_private"); + ~~~~~~ +!!! error TS1147: Import declarations in an internal module cannot reference an external module. import nonerrorImport = glo_M3_private; module m5 { import m5_errorImport = require("glo_M4_private"); - ~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. import m5_nonerrorImport = glo_M3_private; } } @@ -452,22 +452,22 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient module m2 { import m3 = require("use_glo_M1_public"); + ~~~~~~ +!!! error TS1147: Import declarations in an internal module cannot reference an external module. module m4 { var a = 10; import m2 = require("use_glo_M1_public"); - ~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. } } export module m3 { import m3 = require("use_glo_M1_public"); + ~~~~~~ +!!! error TS1147: Import declarations in an internal module cannot reference an external module. module m4 { var a = 10; import m2 = require("use_glo_M1_public"); - ~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. } } \ No newline at end of file diff --git a/tests/baselines/reference/switchStatementsWithMultipleDefaults.errors.txt b/tests/baselines/reference/switchStatementsWithMultipleDefaults.errors.txt index 9c46389e90..084ed1f357 100644 --- a/tests/baselines/reference/switchStatementsWithMultipleDefaults.errors.txt +++ b/tests/baselines/reference/switchStatementsWithMultipleDefaults.errors.txt @@ -1,9 +1,14 @@ tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(9,5): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(10,5): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. -tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(28,22): error TS1108: A 'return' statement can only be used within a function body. +tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(21,13): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. +tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(25,13): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. +tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(26,13): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. +tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(28,13): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. +tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(29,13): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. +tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(29,22): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. -==== tests/cases/compiler/switchStatementsWithMultipleDefaults.ts (3 errors) ==== +==== tests/cases/compiler/switchStatementsWithMultipleDefaults.ts (8 errors) ==== var x = 10; @@ -29,15 +34,25 @@ tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(28,22): error TS110 switch (x * x) { default: // No issues. default: // Error; second 'default' clause. + ~~~~~~~~ +!!! error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. break; case 10000: x /= x; default: // Error, third 'default' clause + ~~~~~~~~ +!!! error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. def\u0061ult: // Error, fourth 'default' clause. + ~~~~~~~~~~~~~ +!!! error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. // Errors on fifth-seventh default: return; - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. + ~~~~~~~~ +!!! error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. default: default: + ~~~~~~~~ +!!! error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. + ~~~~~~~~ +!!! error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. } } \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt index 6676a6d8a8..910e1ce8c2 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt @@ -4,9 +4,9 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(18,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(20,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(22,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(28,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,19): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,40): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(28,50): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(14,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(18,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(22,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. @@ -58,19 +58,19 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. f `abc`[0].member `abc${1}def${2}ghi`; - ~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; - ~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; - ~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt index a50339adf1..4ea0304f42 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt @@ -6,8 +6,8 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(13,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(15,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(17,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(19,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(21,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(19,32): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(21,46): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts (10 errors) ==== @@ -46,11 +46,11 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; - ~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; - ~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f.thisIsNotATag(`abc`); diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.errors.txt index 02de690a22..173d3a6b74 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.errors.txt @@ -4,8 +4,8 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(16,3 tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(18,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(20,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(22,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(24,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(26,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(24,19): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(26,40): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts (8 errors) ==== @@ -45,11 +45,11 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(26,3 !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`[0].member `abc${1}def${2}ghi`; - ~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; - ~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f.thisIsNotATag(`abc`);