From bd07cee9535a4ce39da23172c2d76184b41167ed Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 1 Nov 2014 07:38:46 -0700 Subject: [PATCH 1/2] Allow type aliases for object type literals --- src/compiler/diagnosticInformationMap.generated.ts | 1 - src/compiler/diagnosticMessages.json | 4 ---- src/compiler/parser.ts | 7 ------- 3 files changed, 12 deletions(-) diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 82567f70ca6..b9485de89fd 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -120,7 +120,6 @@ module ts { const_declarations_must_be_initialized: { code: 1155, category: DiagnosticCategory.Error, key: "'const' declarations must be initialized" }, const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: DiagnosticCategory.Error, key: "'const' declarations can only be declared inside a block." }, let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: DiagnosticCategory.Error, key: "'let' declarations can only be declared inside a block." }, - Aliased_type_cannot_be_an_object_type_literal_Use_an_interface_declaration_instead: { code: 1158, category: DiagnosticCategory.Error, key: "Aliased type cannot be an object type literal. Use an interface declaration instead." }, Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 72d7c79a024..d4be9b83313 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -471,10 +471,6 @@ "category": "Error", "code": 1157 }, - "Aliased type cannot be an object type literal. Use an interface declaration instead.": { - "category": "Error", - "code": 1158 - }, "Duplicate identifier '{0}'.": { "category": "Error", diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 6c2207a08d2..429c4b8a4ed 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3760,13 +3760,6 @@ module ts { parseExpected(SyntaxKind.EqualsToken); node.type = parseType(); parseSemicolon(); - var n = node.type; - while (n.kind === SyntaxKind.ParenType) { - n = (n).type; - } - if (n.kind === SyntaxKind.TypeLiteral && (n.pos !== (n).members.pos || n.end !== (n).members.end)) { - grammarErrorOnNode(node.type, Diagnostics.Aliased_type_cannot_be_an_object_type_literal_Use_an_interface_declaration_instead); - } return finishNode(node); } From 0c5057e913fa59be6feb866dc8ab8f87d980e8e3 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 1 Nov 2014 15:30:07 -0700 Subject: [PATCH 2/2] Accepting updated baselines --- ...tringsWithIncompatibleTypedTags.errors.txt | 40 ++++++++-------- ...ithManyCallAndMemberExpressions.errors.txt | 4 +- ...mplateStringsWithTagsTypedAsAny.errors.txt | 48 +++++++++---------- ...gedTemplateStringsWithTypedTags.errors.txt | 40 ++++++++-------- .../templateStringInModuleName.errors.txt | 8 ++-- .../templateStringInObjectLiteral.errors.txt | 4 +- .../templateStringInPropertyName1.errors.txt | 4 +- .../templateStringInPropertyName2.errors.txt | 4 +- .../templateStringInYieldKeyword.errors.txt | 4 +- ...eStringWithEmbeddedYieldKeyword.errors.txt | 8 ++-- ...ringWithEmbeddedYieldKeywordES6.errors.txt | 4 +- 11 files changed, 84 insertions(+), 84 deletions(-) diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt index a9f4be155d9..21600aa2f9b 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt @@ -1,13 +1,13 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(12,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(14,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(16,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(18,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(20,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(22,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(12,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(14,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(16,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(18,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(20,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(22,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts (10 errors) ==== @@ -24,39 +24,39 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped f `abc` ~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`; ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`.member ~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`.member; ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`["member"]; ~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`["member"]; ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`[0].member `abc${1}def${2}ghi`; ~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! 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 TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f.thisIsNotATag(`abc`); diff --git a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.errors.txt index 4813fe5a239..3ba890959eb 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts(13,21): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts(13,21): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts (1 errors) ==== @@ -16,6 +16,6 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMember var x = new new new f `abc${ 0 }def`.member("hello")(42) === true; ~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt index f813e13e8b9..a15e0cbb49b 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt @@ -1,15 +1,15 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(3,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(5,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(7,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(9,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(11,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(13,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(15,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(17,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(19,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(19,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(21,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(21,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(3,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(5,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(7,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(9,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(11,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(13,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(15,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(17,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(19,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(19,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(21,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(21,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts (12 errors) ==== @@ -17,47 +17,47 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts f `abc` ~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`; ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f.g.h `abc` ~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f.g.h `abc${1}def${2}ghi`; ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`.member ~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`.member; ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`["member"]; ~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`["member"]; ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; ~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! 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 TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! 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 6a38ddc278a..0e4f7a63223 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.errors.txt @@ -1,13 +1,13 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(12,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(14,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(16,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(18,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(20,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(22,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(24,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(24,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(26,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(26,1): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(12,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(14,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(16,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(18,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(20,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(22,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(24,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(24,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(26,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(26,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts (10 errors) ==== @@ -24,39 +24,39 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(26,1 f `abc` ~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`; ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`.member ~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`.member; ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`["member"]; ~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`["member"]; ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`[0].member `abc${1}def${2}ghi`; ~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! 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 TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f.thisIsNotATag(`abc`); diff --git a/tests/baselines/reference/templateStringInModuleName.errors.txt b/tests/baselines/reference/templateStringInModuleName.errors.txt index 8b5e4eb8e14..fb6188d9d9a 100644 --- a/tests/baselines/reference/templateStringInModuleName.errors.txt +++ b/tests/baselines/reference/templateStringInModuleName.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,9): error TS1005: ';' expected. -tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,9): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,21): error TS1005: ';' expected. tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,9): error TS1005: ';' expected. -tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,9): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,24): error TS1005: ';' expected. tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,1): error TS2304: Cannot find name 'declare'. tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,9): error TS2304: Cannot find name 'module'. @@ -15,7 +15,7 @@ tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,9): error ~~~~~~ !!! error TS1005: ';' expected. ~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS1005: ';' expected. ~~~~~~~ @@ -28,7 +28,7 @@ tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,9): error ~~~~~~ !!! error TS1005: ';' expected. ~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS1005: ';' expected. ~~~~~~~ diff --git a/tests/baselines/reference/templateStringInObjectLiteral.errors.txt b/tests/baselines/reference/templateStringInObjectLiteral.errors.txt index 8604338d678..e190ea3a815 100644 --- a/tests/baselines/reference/templateStringInObjectLiteral.errors.txt +++ b/tests/baselines/reference/templateStringInObjectLiteral.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(1,9): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(1,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(3,5): error TS1136: Property assignment expected. tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(3,8): error TS1005: ',' expected. tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(3,10): error TS1134: Variable declaration expected. @@ -12,7 +12,7 @@ tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(4,1): err ~~~~~~~~~~~~~~~~~~~~~~~~ `b`: 321 ~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~ !!! error TS1136: Property assignment expected. ~ diff --git a/tests/baselines/reference/templateStringInPropertyName1.errors.txt b/tests/baselines/reference/templateStringInPropertyName1.errors.txt index 0e7dc998046..95d509e9151 100644 --- a/tests/baselines/reference/templateStringInPropertyName1.errors.txt +++ b/tests/baselines/reference/templateStringInPropertyName1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(1,9): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(1,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(2,5): error TS1136: Property assignment expected. tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(2,8): error TS1005: ',' expected. tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(2,10): error TS1134: Variable declaration expected. @@ -10,7 +10,7 @@ tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(3,1): err ~ `a`: 321 ~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~ !!! error TS1136: Property assignment expected. ~ diff --git a/tests/baselines/reference/templateStringInPropertyName2.errors.txt b/tests/baselines/reference/templateStringInPropertyName2.errors.txt index a20d09f401f..eed5791ea8e 100644 --- a/tests/baselines/reference/templateStringInPropertyName2.errors.txt +++ b/tests/baselines/reference/templateStringInPropertyName2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(1,9): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(1,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(2,5): error TS1136: Property assignment expected. tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(2,32): error TS1005: ',' expected. tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(2,34): error TS1134: Variable declaration expected. @@ -10,7 +10,7 @@ tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(3,1): err ~ `abc${ 123 }def${ 456 }ghi`: 321 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~ !!! error TS1136: Property assignment expected. ~ diff --git a/tests/baselines/reference/templateStringInYieldKeyword.errors.txt b/tests/baselines/reference/templateStringInYieldKeyword.errors.txt index be6fccbe1bc..b70af797c5c 100644 --- a/tests/baselines/reference/templateStringInYieldKeyword.errors.txt +++ b/tests/baselines/reference/templateStringInYieldKeyword.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(1,9): error TS1003: Identifier expected. tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(1,15): error TS1005: ';' expected. -tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(3,13): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(3,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(1,11): error TS2304: Cannot find name 'gen'. tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(3,13): error TS2304: Cannot find name 'yield'. @@ -16,7 +16,7 @@ tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(3,13): err // Once this is supported, the inner expression does not need to be parenthesized. var x = yield `abc${ x }def`; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~ !!! error TS2304: Cannot find name 'yield'. } diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt b/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt index e5f159a0a13..b9e803a8a14 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,9): error TS1003: Identifier expected. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,15): error TS1005: ';' expected. -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,26): error TS1159: Invalid template literal; expected '}' -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,30): error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,26): error TS1158: Invalid template literal; expected '}' +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,30): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(5,1): error TS1126: Unexpected end of text. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,11): error TS2304: Cannot find name 'gen'. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,20): error TS2304: Cannot find name 'yield'. @@ -19,7 +19,7 @@ tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts( // Once this is supported, yield *must* be parenthesized. var x = `abc${ yield 10 }def`; ~~ -!!! error TS1159: Invalid template literal; expected '}' +!!! error TS1158: Invalid template literal; expected '}' ~~~~~ ~~~~~ !!! error TS2304: Cannot find name 'yield'. @@ -29,6 +29,6 @@ tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts( ~ -!!! error TS1160: Tagged templates are only available when targeting ECMAScript 6 and higher. +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. !!! error TS1126: Unexpected end of text. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt index 45142cd02d9..6cae5332517 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,9): error TS1003: Identifier expected. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,17): error TS1005: ';' expected. -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,26): error TS1159: Invalid template literal; expected '}' +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,26): error TS1158: Invalid template literal; expected '}' tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(5,1): error TS1126: Unexpected end of text. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,11): error TS2304: Cannot find name 'gen'. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,20): error TS2304: Cannot find name 'yield'. @@ -18,7 +18,7 @@ tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6. // Once this is supported, yield *must* be parenthesized. var x = `abc${ yield 10 }def`; ~~ -!!! error TS1159: Invalid template literal; expected '}' +!!! error TS1158: Invalid template literal; expected '}' ~~~~~ !!! error TS2304: Cannot find name 'yield'. ~~~