Merge pull request #1025 from Microsoft/aliasObjectTypeLiterals

Allow type aliases for object type literals
This commit is contained in:
Anders Hejlsberg
2014-11-01 15:35:36 -07:00
14 changed files with 88 additions and 100 deletions

View File

@@ -120,9 +120,8 @@ 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." },
Invalid_template_literal_expected: { code: 1159, category: DiagnosticCategory.Error, key: "Invalid template literal; expected '}'" },
Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1160, category: DiagnosticCategory.Error, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." },
Invalid_template_literal_expected: { code: 1158, category: DiagnosticCategory.Error, key: "Invalid template literal; expected '}'" },
Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: DiagnosticCategory.Error, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." },
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." },

View File

@@ -471,17 +471,13 @@
"category": "Error",
"code": 1157
},
"Aliased type cannot be an object type literal. Use an interface declaration instead.": {
"Invalid template literal; expected '}'": {
"category": "Error",
"code": 1158
},
"Invalid template literal; expected '}'": {
"category": "Error",
"code": 1159
},
"Tagged templates are only available when targeting ECMAScript 6 and higher.": {
"category": "Error",
"code": 1160
"code": 1159
},
"Duplicate identifier '{0}'.": {

View File

@@ -3856,13 +3856,6 @@ module ts {
parseExpected(SyntaxKind.EqualsToken);
node.type = parseType();
parseSemicolon();
var n = node.type;
while (n.kind === SyntaxKind.ParenType) {
n = (<ParenTypeNode>n).type;
}
if (n.kind === SyntaxKind.TypeLiteral && (n.pos !== (<TypeLiteralNode>n).members.pos || n.end !== (<TypeLiteralNode>n).members.end)) {
grammarErrorOnNode(node.type, Diagnostics.Aliased_type_cannot_be_an_object_type_literal_Use_an_interface_declaration_instead);
}
return finishNode(node);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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