Check node for errors before recursing.

This commit is contained in:
Cyrus Najmabadi 2014-11-20 13:48:23 -08:00
parent 2b189b035a
commit ed22f1ca3e
13 changed files with 96 additions and 84 deletions

View file

@ -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(<FunctionLikeDeclaration>node);
break;
case SyntaxKind.BreakStatement:
case SyntaxKind.ContinueStatement:
checkBreakOrContinueStatement(<BreakOrContinueStatement>node);
break;
return checkParsedSignature(<FunctionLikeDeclaration>node);
case SyntaxKind.BreakStatement:
case SyntaxKind.ContinueStatement:
return checkBreakOrContinueStatement(<BreakOrContinueStatement>node);
case SyntaxKind.LabeledStatement:
checkLabeledStatement(<LabeledStatement>node);
break;
case SyntaxKind.CallExpression:
return checkLabeledStatement(<LabeledStatement>node);
case SyntaxKind.CallExpression:
case SyntaxKind.NewExpression:
checkCallOrNewExpression(<NewExpression>node);
break;
case SyntaxKind.EnumDeclaration:
checkEnumInitializer(<EnumDeclaration>node);
break;
case SyntaxKind.Parameter:
checkParameter(<ParameterDeclaration>node);
break;
return checkCallOrNewExpression(<NewExpression>node);
case SyntaxKind.EnumDeclaration: return checkEnumInitializer(<EnumDeclaration>node);
case SyntaxKind.Parameter: return checkParameter(<ParameterDeclaration>node);
case SyntaxKind.BinaryExpression: return visitBinaryExpression(<BinaryExpression>node);
case SyntaxKind.CatchBlock: return visitCatchBlock(<CatchBlock>node);
case SyntaxKind.ClassDeclaration: return visitClassDeclaration(<ClassDeclaration>node);

View file

@ -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.

View file

@ -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.
}

View file

@ -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.
}
}

View file

@ -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<T>()' instead.
tests/cases/compiler/newOperator.ts(20,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/newOperator.ts(45,16): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' 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<T>()' instead.
}
}

View file

@ -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'.
~~~

View file

@ -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.
}

View file

@ -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.
}
}

View file

@ -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.
}
}

View file

@ -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.
}
}

View file

@ -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'.

View file

@ -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`);

View file

@ -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`);