Merge pull request #1978 from Microsoft/esSymbols

Support ES6 built-in symbols
This commit is contained in:
Jason Freeman
2015-02-18 13:19:49 -08:00
487 changed files with 7458 additions and 1278 deletions
+7 -13
View File
@@ -51,17 +51,6 @@ module ts {
}
}
/**
* A declaration has a dynamic name if both of the following are true:
* 1. The declaration has a computed property name
* 2. The computed name is *not* expressed as Symbol.<name>, where name
* is a property of the Symbol constructor that denotes a built in
* Symbol.
*/
export function hasDynamicName(declaration: Declaration): boolean {
return declaration.name && declaration.name.kind === SyntaxKind.ComputedPropertyName;
}
export function bindSourceFile(file: SourceFile): void {
var start = new Date().getTime();
bindSourceFileWorker(file);
@@ -98,13 +87,18 @@ module ts {
if (symbolKind & SymbolFlags.Value && !symbol.valueDeclaration) symbol.valueDeclaration = node;
}
// Should not be called on a declaration with a computed property name.
// Should not be called on a declaration with a computed property name,
// unless it is a well known Symbol.
function getDeclarationName(node: Declaration): string {
if (node.name) {
if (node.kind === SyntaxKind.ModuleDeclaration && node.name.kind === SyntaxKind.StringLiteral) {
return '"' + (<LiteralExpression>node.name).text + '"';
}
Debug.assert(!hasDynamicName(node));
if (node.name.kind === SyntaxKind.ComputedPropertyName) {
var nameExpression = (<ComputedPropertyName>node.name).expression;
Debug.assert(isWellKnownSymbolSyntactically(nameExpression));
return getPropertyNameForKnownSymbolName((<PropertyAccessExpression>nameExpression).name.text);
}
return (<Identifier | LiteralExpression>node.name).text;
}
switch (node.kind) {
+244 -68
View File
@@ -67,6 +67,7 @@ module ts {
var stringType = createIntrinsicType(TypeFlags.String, "string");
var numberType = createIntrinsicType(TypeFlags.Number, "number");
var booleanType = createIntrinsicType(TypeFlags.Boolean, "boolean");
var esSymbolType = createIntrinsicType(TypeFlags.ESSymbol, "symbol");
var voidType = createIntrinsicType(TypeFlags.Void, "void");
var undefinedType = createIntrinsicType(TypeFlags.Undefined | TypeFlags.ContainsUndefinedOrNull, "undefined");
var nullType = createIntrinsicType(TypeFlags.Null | TypeFlags.ContainsUndefinedOrNull, "null");
@@ -84,6 +85,7 @@ module ts {
var globals: SymbolTable = {};
var globalArraySymbol: Symbol;
var globalESSymbolConstructorSymbol: Symbol;
var globalObjectType: ObjectType;
var globalFunctionType: ObjectType;
@@ -93,6 +95,7 @@ module ts {
var globalBooleanType: ObjectType;
var globalRegExpType: ObjectType;
var globalTemplateStringsArrayType: ObjectType;
var globalESSymbolType: ObjectType;
var anyArrayType: Type;
@@ -120,6 +123,10 @@ module ts {
"boolean": {
type: booleanType,
flags: TypeFlags.Boolean
},
"symbol": {
type: esSymbolType,
flags: TypeFlags.ESSymbol
}
};
@@ -706,9 +713,15 @@ module ts {
return type;
}
// A reserved member name starts with two underscores followed by a non-underscore
// A reserved member name starts with two underscores, but the third character cannot be an underscore
// or the @ symbol. A third underscore indicates an escaped form of an identifer that started
// with at least two underscores. The @ character indicates that the name is denoted by a well known ES
// Symbol instance.
function isReservedMemberName(name: string) {
return name.charCodeAt(0) === CharacterCodes._ && name.charCodeAt(1) === CharacterCodes._ && name.charCodeAt(2) !== CharacterCodes._;
return name.charCodeAt(0) === CharacterCodes._ &&
name.charCodeAt(1) === CharacterCodes._ &&
name.charCodeAt(2) !== CharacterCodes._ &&
name.charCodeAt(2) !== CharacterCodes.at;
}
function getNamedMembers(members: SymbolTable): Symbol[] {
@@ -2489,9 +2502,9 @@ module ts {
return getPropertiesOfObjectType(getApparentType(type));
}
// For a type parameter, return the base constraint of the type parameter. For the string, number, and
// boolean primitive types, return the corresponding object types.Otherwise return the type itself.
// Note that the apparent type of a union type is the union type itself.
// For a type parameter, return the base constraint of the type parameter. For the string, number,
// boolean, and symbol primitive types, return the corresponding object types. Otherwise return the
// type itself. Note that the apparent type of a union type is the union type itself.
function getApparentType(type: Type): Type {
if (type.flags & TypeFlags.TypeParameter) {
do {
@@ -2510,6 +2523,9 @@ module ts {
else if (type.flags & TypeFlags.Boolean) {
type = globalBooleanType;
}
else if (type.flags & TypeFlags.ESSymbol) {
type = globalESSymbolType;
}
return type;
}
@@ -2999,12 +3015,24 @@ module ts {
return <ObjectType>type;
}
function getGlobalSymbol(name: string): Symbol {
return resolveName(undefined, name, SymbolFlags.Type, Diagnostics.Cannot_find_global_type_0, name);
function getGlobalValueSymbol(name: string): Symbol {
return getGlobalSymbol(name, SymbolFlags.Value, Diagnostics.Cannot_find_global_value_0);
}
function getGlobalTypeSymbol(name: string): Symbol {
return getGlobalSymbol(name, SymbolFlags.Type, Diagnostics.Cannot_find_global_type_0);
}
function getGlobalSymbol(name: string, meaning: SymbolFlags, diagnostic: DiagnosticMessage): Symbol {
return resolveName(undefined, name, meaning, diagnostic, name);
}
function getGlobalType(name: string): ObjectType {
return getTypeOfGlobalSymbol(getGlobalSymbol(name), 0);
return getTypeOfGlobalSymbol(getGlobalTypeSymbol(name), 0);
}
function getGlobalESSymbolConstructorSymbol() {
return globalESSymbolConstructorSymbol || (globalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol"));
}
function createArrayType(elementType: Type): Type {
@@ -3174,6 +3202,8 @@ module ts {
return numberType;
case SyntaxKind.BooleanKeyword:
return booleanType;
case SyntaxKind.SymbolKeyword:
return esSymbolType;
case SyntaxKind.VoidKeyword:
return voidType;
case SyntaxKind.StringLiteral:
@@ -4740,7 +4770,7 @@ module ts {
if (assumeTrue) {
// Assumed result is true. If check was not for a primitive type, remove all primitive types
if (!typeInfo) {
return removeTypesFromUnionType(type, /*typeKind*/ TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.Boolean, /*isOfTypeKind*/ true);
return removeTypesFromUnionType(type, /*typeKind*/ TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.Boolean | TypeFlags.ESSymbol, /*isOfTypeKind*/ true);
}
// Check was for a primitive type, return that primitive type if it is a subtype
if (isTypeSubtypeOf(typeInfo.type, type)) {
@@ -5475,7 +5505,7 @@ module ts {
function isNumericComputedName(name: ComputedPropertyName): boolean {
// It seems odd to consider an expression of type Any to result in a numeric name,
// but this behavior is consistent with checkIndexedAccess
return isTypeOfKind(checkComputedPropertyName(name), TypeFlags.Any | TypeFlags.NumberLike);
return allConstituentTypesHaveKind(checkComputedPropertyName(name), TypeFlags.Any | TypeFlags.NumberLike);
}
function isNumericLiteralName(name: string) {
@@ -5508,10 +5538,13 @@ module ts {
if (!links.resolvedType) {
links.resolvedType = checkExpression(node.expression);
// This will allow types number, string, or any. It will also allow enums, the unknown
// This will allow types number, string, symbol or any. It will also allow enums, the unknown
// type, and any union of these types (like string | number).
if (!isTypeOfKind(links.resolvedType, TypeFlags.Any | TypeFlags.NumberLike | TypeFlags.StringLike)) {
error(node, Diagnostics.A_computed_property_name_must_be_of_type_string_number_or_any);
if (!allConstituentTypesHaveKind(links.resolvedType, TypeFlags.Any | TypeFlags.NumberLike | TypeFlags.StringLike | TypeFlags.ESSymbol)) {
error(node, Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any);
}
else {
checkThatExpressionIsProperSymbolReference(node.expression, links.resolvedType, /*reportError*/ true);
}
}
@@ -5760,8 +5793,8 @@ module ts {
// See if we can index as a property.
if (node.argumentExpression) {
if (node.argumentExpression.kind === SyntaxKind.StringLiteral || node.argumentExpression.kind === SyntaxKind.NumericLiteral) {
var name = (<LiteralExpression>node.argumentExpression).text;
var name = getPropertyNameForIndexedAccess(node.argumentExpression, indexType);
if (name !== undefined) {
var prop = getPropertyOfType(objectType, name);
if (prop) {
getNodeLinks(node).resolvedSymbol = prop;
@@ -5775,10 +5808,10 @@ module ts {
}
// Check for compatible indexer types.
if (isTypeOfKind(indexType, TypeFlags.Any | TypeFlags.StringLike | TypeFlags.NumberLike)) {
if (allConstituentTypesHaveKind(indexType, TypeFlags.Any | TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbol)) {
// Try to use a number indexer.
if (isTypeOfKind(indexType, TypeFlags.Any | TypeFlags.NumberLike)) {
if (allConstituentTypesHaveKind(indexType, TypeFlags.Any | TypeFlags.NumberLike)) {
var numberIndexType = getIndexTypeOfType(objectType, IndexKind.Number);
if (numberIndexType) {
return numberIndexType;
@@ -5800,11 +5833,78 @@ module ts {
}
// REVIEW: Users should know the type that was actually used.
error(node, Diagnostics.An_index_expression_argument_must_be_of_type_string_number_or_any);
error(node, Diagnostics.An_index_expression_argument_must_be_of_type_string_number_symbol_or_any);
return unknownType;
}
/**
* If indexArgumentExpression is a string literal or number literal, returns its text.
* If indexArgumentExpression is a well known symbol, returns the property name corresponding
* to this symbol, as long as it is a proper symbol reference.
* Otherwise, returns undefined.
*/
function getPropertyNameForIndexedAccess(indexArgumentExpression: Expression, indexArgumentType: Type): string {
if (indexArgumentExpression.kind === SyntaxKind.StringLiteral || indexArgumentExpression.kind === SyntaxKind.NumericLiteral) {
return (<LiteralExpression>indexArgumentExpression).text;
}
if (checkThatExpressionIsProperSymbolReference(indexArgumentExpression, indexArgumentType, /*reportError*/ false)) {
var rightHandSideName = (<Identifier>(<PropertyAccessExpression>indexArgumentExpression).name).text;
return getPropertyNameForKnownSymbolName(rightHandSideName);
}
return undefined;
}
/**
* A proper symbol reference requires the following:
* 1. The property access denotes a property that exists
* 2. The expression is of the form Symbol.<identifier>
* 3. The property access is of the primitive type symbol.
* 4. Symbol in this context resolves to the global Symbol object
*/
function checkThatExpressionIsProperSymbolReference(expression: Expression, expressionType: Type, reportError: boolean): boolean {
if (expressionType === unknownType) {
// There is already an error, so no need to report one.
return false;
}
if (!isWellKnownSymbolSyntactically(expression)) {
return false;
}
// Make sure the property type is the primitive symbol type
if ((expressionType.flags & TypeFlags.ESSymbol) === 0) {
if (reportError) {
error(expression, Diagnostics.A_computed_property_name_of_the_form_0_must_be_of_type_symbol, getTextOfNode(expression));
}
return false;
}
// The name is Symbol.<someName>, so make sure Symbol actually resolves to the
// global Symbol object
var leftHandSide = <Identifier>(<PropertyAccessExpression>expression).expression;
var leftHandSideSymbol = getResolvedSymbol(leftHandSide);
if (!leftHandSideSymbol) {
return false;
}
var globalESSymbol = getGlobalESSymbolConstructorSymbol();
if (!globalESSymbol) {
// Already errored when we tried to look up the symbol
return false;
}
if (leftHandSideSymbol !== globalESSymbol) {
if (reportError) {
error(leftHandSide, Diagnostics.Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object);
}
return false;
}
return true;
}
function resolveUntypedCall(node: CallLikeExpression): Signature {
if (node.kind === SyntaxKind.TaggedTemplateExpression) {
checkExpression((<TaggedTemplateExpression>node).template);
@@ -6719,7 +6819,7 @@ module ts {
}
function checkArithmeticOperandType(operand: Node, type: Type, diagnostic: DiagnosticMessage): boolean {
if (!isTypeOfKind(type, TypeFlags.Any | TypeFlags.NumberLike)) {
if (!allConstituentTypesHaveKind(type, TypeFlags.Any | TypeFlags.NumberLike)) {
error(operand, diagnostic);
return false;
}
@@ -6835,6 +6935,9 @@ module ts {
case SyntaxKind.PlusToken:
case SyntaxKind.MinusToken:
case SyntaxKind.TildeToken:
if (someConstituentTypeHasKind(operandType, TypeFlags.ESSymbol)) {
error(node.operand, Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, tokenToString(node.operator));
}
return numberType;
case SyntaxKind.ExclamationToken:
return booleanType;
@@ -6870,8 +6973,26 @@ module ts {
return numberType;
}
// Return true if type has the given flags, or is a union type composed of types that all have those flags
function isTypeOfKind(type: Type, kind: TypeFlags): boolean {
// Just like isTypeOfKind below, except that it returns true if *any* constituent
// has this kind.
function someConstituentTypeHasKind(type: Type, kind: TypeFlags): boolean {
if (type.flags & kind) {
return true;
}
if (type.flags & TypeFlags.Union) {
var types = (<UnionType>type).types;
for (var i = 0; i < types.length; i++) {
if (types[i].flags & kind) {
return true;
}
}
return false;
}
return false;
}
// Return true if type has the given flags, or is a union type composed of types that all have those flags.
function allConstituentTypesHaveKind(type: Type, kind: TypeFlags): boolean {
if (type.flags & kind) {
return true;
}
@@ -6901,7 +7022,7 @@ module ts {
// and the right operand to be of type Any or a subtype of the 'Function' interface type.
// The result is always of the Boolean primitive type.
// NOTE: do not raise error if leftType is unknown as related error was already reported
if (isTypeOfKind(leftType, TypeFlags.Primitive)) {
if (allConstituentTypesHaveKind(leftType, TypeFlags.Primitive)) {
error(node.left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter);
}
// NOTE: do not raise error if right is unknown as related error was already reported
@@ -6916,10 +7037,10 @@ module ts {
// The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type,
// and the right operand to be of type Any, an object type, or a type parameter type.
// The result is always of the Boolean primitive type.
if (!isTypeOfKind(leftType, TypeFlags.Any | TypeFlags.StringLike | TypeFlags.NumberLike)) {
error(node.left, Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number);
if (!allConstituentTypesHaveKind(leftType, TypeFlags.Any | TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbol)) {
error(node.left, Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol);
}
if (!isTypeOfKind(rightType, TypeFlags.Any | TypeFlags.ObjectType | TypeFlags.TypeParameter)) {
if (!allConstituentTypesHaveKind(rightType, TypeFlags.Any | TypeFlags.ObjectType | TypeFlags.TypeParameter)) {
error(node.right, Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter);
}
return booleanType;
@@ -7080,19 +7201,26 @@ module ts {
if (rightType.flags & (TypeFlags.Undefined | TypeFlags.Null)) rightType = leftType;
var resultType: Type;
if (isTypeOfKind(leftType, TypeFlags.NumberLike) && isTypeOfKind(rightType, TypeFlags.NumberLike)) {
if (allConstituentTypesHaveKind(leftType, TypeFlags.NumberLike) && allConstituentTypesHaveKind(rightType, TypeFlags.NumberLike)) {
// Operands of an enum type are treated as having the primitive type Number.
// If both operands are of the Number primitive type, the result is of the Number primitive type.
resultType = numberType;
}
else if (isTypeOfKind(leftType, TypeFlags.StringLike) || isTypeOfKind(rightType, TypeFlags.StringLike)) {
// If one or both operands are of the String primitive type, the result is of the String primitive type.
resultType = stringType;
}
else if (leftType.flags & TypeFlags.Any || rightType.flags & TypeFlags.Any) {
// Otherwise, the result is of type Any.
// NOTE: unknown type here denotes error type. Old compiler treated this case as any type so do we.
resultType = anyType;
else {
if (allConstituentTypesHaveKind(leftType, TypeFlags.StringLike) || allConstituentTypesHaveKind(rightType, TypeFlags.StringLike)) {
// If one or both operands are of the String primitive type, the result is of the String primitive type.
resultType = stringType;
}
else if (leftType.flags & TypeFlags.Any || rightType.flags & TypeFlags.Any) {
// Otherwise, the result is of type Any.
// NOTE: unknown type here denotes error type. Old compiler treated this case as any type so do we.
resultType = anyType;
}
// Symbols are not allowed at all in arithmetic expressions
if (resultType && !checkForDisallowedESSymbolOperand(operator)) {
return resultType;
}
}
if (!resultType) {
@@ -7104,14 +7232,18 @@ module ts {
checkAssignmentOperator(resultType);
}
return resultType;
case SyntaxKind.EqualsEqualsToken:
case SyntaxKind.ExclamationEqualsToken:
case SyntaxKind.EqualsEqualsEqualsToken:
case SyntaxKind.ExclamationEqualsEqualsToken:
case SyntaxKind.LessThanToken:
case SyntaxKind.GreaterThanToken:
case SyntaxKind.LessThanEqualsToken:
case SyntaxKind.GreaterThanEqualsToken:
if (!checkForDisallowedESSymbolOperand(operator)) {
return booleanType;
}
// Fall through
case SyntaxKind.EqualsEqualsToken:
case SyntaxKind.ExclamationEqualsToken:
case SyntaxKind.EqualsEqualsEqualsToken:
case SyntaxKind.ExclamationEqualsEqualsToken:
if (!isTypeAssignableTo(leftType, rightType) && !isTypeAssignableTo(rightType, leftType)) {
reportOperatorError();
}
@@ -7131,6 +7263,20 @@ module ts {
return rightType;
}
// Return type is true if there was no error, false if there was an error.
function checkForDisallowedESSymbolOperand(operator: SyntaxKind): boolean {
var offendingSymbolOperand =
someConstituentTypeHasKind(leftType, TypeFlags.ESSymbol) ? node.left :
someConstituentTypeHasKind(rightType, TypeFlags.ESSymbol) ? node.right :
undefined;
if (offendingSymbolOperand) {
error(offendingSymbolOperand, Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, tokenToString(operator));
return false;
}
return true;
}
function getSuggestedBooleanOperator(operator: SyntaxKind): SyntaxKind {
switch (operator) {
case SyntaxKind.BarToken:
@@ -7216,7 +7362,10 @@ module ts {
}
function checkPropertyAssignment(node: PropertyAssignment, contextualMapper?: TypeMapper): Type {
if (hasDynamicName(node)) {
// Do not use hasDynamicName here, because that returns false for well known symbols.
// We want to perform checkComputedPropertyName for all computed properties, including
// well known symbols.
if (node.name.kind === SyntaxKind.ComputedPropertyName) {
checkComputedPropertyName(<ComputedPropertyName>node.name);
}
@@ -7227,7 +7376,10 @@ module ts {
// Grammar checking
checkGrammarMethod(node);
if (hasDynamicName(node)) {
// Do not use hasDynamicName here, because that returns false for well known symbols.
// We want to perform checkComputedPropertyName for all computed properties, including
// well known symbols.
if (node.name.kind === SyntaxKind.ComputedPropertyName) {
checkComputedPropertyName(<ComputedPropertyName>node.name);
}
@@ -7490,7 +7642,7 @@ module ts {
function checkPropertyDeclaration(node: PropertyDeclaration) {
// Grammar checking
checkGrammarModifiers(node) || checkGrammarProperty(node);
checkGrammarModifiers(node) || checkGrammarProperty(node) || checkGrammarComputedPropertyName(node.name);
checkVariableLikeDeclaration(node);
}
@@ -8039,12 +8191,16 @@ module ts {
function checkFunctionLikeDeclaration(node: FunctionLikeDeclaration): void {
checkSignatureDeclaration(node);
if (hasDynamicName(node)) {
// Do not use hasDynamicName here, because that returns false for well known symbols.
// We want to perform checkComputedPropertyName for all computed properties, including
// well known symbols.
if (node.name.kind === SyntaxKind.ComputedPropertyName) {
// This check will account for methods in class/interface declarations,
// as well as accessors in classes/object literals
checkComputedPropertyName(<ComputedPropertyName>node.name);
}
else {
if (!hasDynamicName(node)) {
// first we want to check the local symbol that contain this declaration
// - if node.localSymbol !== undefined - this is current declaration is exported and localSymbol points to the local symbol
// - if node.localSymbol === undefined - this node is non-exported so we can just pick the result of getSymbolOfNode
@@ -8302,12 +8458,14 @@ module ts {
function checkVariableLikeDeclaration(node: VariableLikeDeclaration) {
checkSourceElement(node.type);
// For a computed property, just check the initializer and exit
if (hasDynamicName(node)) {
// Do not use hasDynamicName here, because that returns false for well known symbols.
// We want to perform checkComputedPropertyName for all computed properties, including
// well known symbols.
if (node.name.kind === SyntaxKind.ComputedPropertyName) {
checkComputedPropertyName(<ComputedPropertyName>node.name);
if (node.initializer) {
checkExpressionCached(node.initializer);
}
return;
}
// For a binding pattern, check contained binding elements
if (isBindingPattern(node.name)) {
@@ -8482,7 +8640,7 @@ module ts {
// and Expr must be an expression of type Any, an object type, or a type parameter type.
var varExpr = <Expression>node.initializer;
var exprType = checkExpression(varExpr);
if (exprType !== anyType && exprType !== stringType) {
if (!allConstituentTypesHaveKind(exprType, TypeFlags.Any | TypeFlags.StringLike)) {
error(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any);
}
else {
@@ -8494,7 +8652,7 @@ module ts {
var exprType = checkExpression(node.expression);
// unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved
// in this case error about missing name is already reported - do not report extra one
if (!isTypeOfKind(exprType, TypeFlags.Any | TypeFlags.ObjectType | TypeFlags.TypeParameter)) {
if (!allConstituentTypesHaveKind(exprType, TypeFlags.Any | TypeFlags.ObjectType | TypeFlags.TypeParameter)) {
error(node.expression, Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter);
}
@@ -8745,6 +8903,7 @@ module ts {
case "number":
case "boolean":
case "string":
case "symbol":
case "void":
error(name, message, (<Identifier>name).text);
}
@@ -8963,7 +9122,7 @@ module ts {
var typeName1 = typeToString(existing.containingType);
var typeName2 = typeToString(base);
var errorInfo = chainDiagnosticMessages(undefined, Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2);
var errorInfo = chainDiagnosticMessages(undefined, Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical, symbolToString(prop), typeName1, typeName2);
errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2);
diagnostics.add(createDiagnosticForNodeFromMessageChain(typeNode, errorInfo));
}
@@ -9755,6 +9914,7 @@ module ts {
case SyntaxKind.NumberKeyword:
case SyntaxKind.StringKeyword:
case SyntaxKind.BooleanKeyword:
case SyntaxKind.SymbolKeyword:
return true;
case SyntaxKind.VoidKeyword:
return node.parent.kind !== SyntaxKind.VoidExpression;
@@ -10279,7 +10439,7 @@ module ts {
getSymbolLinks(unknownSymbol).type = unknownType;
globals[undefinedSymbol.name] = undefinedSymbol;
// Initialize special types
globalArraySymbol = getGlobalSymbol("Array");
globalArraySymbol = getGlobalTypeSymbol("Array");
globalArrayType = getTypeOfGlobalSymbol(globalArraySymbol, 1);
globalObjectType = getGlobalType("Object");
globalFunctionType = getGlobalType("Function");
@@ -10287,11 +10447,24 @@ module ts {
globalNumberType = getGlobalType("Number");
globalBooleanType = getGlobalType("Boolean");
globalRegExpType = getGlobalType("RegExp");
// If we're in ES6 mode, load the TemplateStringsArray.
// Otherwise, default to 'unknown' for the purposes of type checking in LS scenarios.
globalTemplateStringsArrayType = languageVersion >= ScriptTarget.ES6
? getGlobalType("TemplateStringsArray")
: unknownType;
if (languageVersion >= ScriptTarget.ES6) {
globalTemplateStringsArrayType = getGlobalType("TemplateStringsArray");
globalESSymbolType = getGlobalType("Symbol");
globalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol");
}
else {
globalTemplateStringsArrayType = unknownType;
// Consider putting Symbol interface in lib.d.ts. On the plus side, putting it in lib.d.ts would make it
// extensible for Polyfilling Symbols. But putting it into lib.d.ts could also break users that have
// a global Symbol already, particularly if it is a class.
globalESSymbolType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
globalESSymbolConstructorSymbol = undefined;
}
anyArrayType = createArrayType(anyType);
}
@@ -10506,25 +10679,25 @@ module ts {
return grammarErrorOnNode(node, Diagnostics.An_index_signature_must_have_exactly_one_parameter);
}
}
else if (parameter.dotDotDotToken) {
if (parameter.dotDotDotToken) {
return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.An_index_signature_cannot_have_a_rest_parameter);
}
else if (parameter.flags & NodeFlags.Modifier) {
if (parameter.flags & NodeFlags.Modifier) {
return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier);
}
else if (parameter.questionToken) {
if (parameter.questionToken) {
return grammarErrorOnNode(parameter.questionToken, Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark);
}
else if (parameter.initializer) {
if (parameter.initializer) {
return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_initializer);
}
else if (!parameter.type) {
if (!parameter.type) {
return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_must_have_a_type_annotation);
}
else if (parameter.type.kind !== SyntaxKind.StringKeyword && parameter.type.kind !== SyntaxKind.NumberKeyword) {
if (parameter.type.kind !== SyntaxKind.StringKeyword && parameter.type.kind !== SyntaxKind.NumberKeyword) {
return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_must_be_string_or_number);
}
else if (!node.type) {
if (!node.type) {
return grammarErrorOnNode(node, Diagnostics.An_index_signature_must_have_a_type_annotation);
}
}
@@ -10797,8 +10970,8 @@ module ts {
}
}
function checkGrammarForDisallowedComputedProperty(node: DeclarationName, message: DiagnosticMessage) {
if (node.kind === SyntaxKind.ComputedPropertyName) {
function checkGrammarForNonSymbolComputedProperty(node: DeclarationName, message: DiagnosticMessage) {
if (node.kind === SyntaxKind.ComputedPropertyName && !isWellKnownSymbolSyntactically((<ComputedPropertyName>node).expression)) {
return grammarErrorOnNode(node, message);
}
}
@@ -10829,17 +11002,17 @@ module ts {
// and accessors are not allowed in ambient contexts in general,
// so this error only really matters for methods.
if (isInAmbientContext(node)) {
return checkGrammarForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_an_ambient_context);
return checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol);
}
else if (!node.body) {
return checkGrammarForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_method_overloads);
return checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol);
}
}
else if (node.parent.kind === SyntaxKind.InterfaceDeclaration) {
return checkGrammarForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_interfaces);
return checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol);
}
else if (node.parent.kind === SyntaxKind.TypeLiteral) {
return checkGrammarForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_type_literals);
return checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol);
}
}
@@ -11053,6 +11226,9 @@ module ts {
var inAmbientContext = isInAmbientContext(enumDecl);
for (var i = 0, n = enumDecl.members.length; i < n; i++) {
var node = enumDecl.members[i];
// Do not use hasDynamicName here, because that returns false for well known symbols.
// We want to perform checkComputedPropertyName for all computed properties, including
// well known symbols.
if (node.name.kind === SyntaxKind.ComputedPropertyName) {
hasError = grammarErrorOnNode(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums);
}
@@ -11133,17 +11309,17 @@ module ts {
function checkGrammarProperty(node: PropertyDeclaration) {
if (node.parent.kind === SyntaxKind.ClassDeclaration) {
if (checkGrammarForInvalidQuestionMark(node, node.questionToken, Diagnostics.A_class_member_cannot_be_declared_optional) ||
checkGrammarForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_class_property_declarations)) {
checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol)) {
return true;
}
}
else if (node.parent.kind === SyntaxKind.InterfaceDeclaration) {
if (checkGrammarForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_interfaces)) {
if (checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) {
return true;
}
}
else if (node.parent.kind === SyntaxKind.TypeLiteral) {
if (checkGrammarForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_type_literals)) {
if (checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) {
return true;
}
}
@@ -123,12 +123,12 @@ module ts {
An_object_member_cannot_be_declared_optional: { code: 1162, category: DiagnosticCategory.Error, key: "An object member cannot be declared optional." },
yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: DiagnosticCategory.Error, key: "'yield' expression must be contained_within a generator declaration." },
Computed_property_names_are_not_allowed_in_enums: { code: 1164, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in enums." },
Computed_property_names_are_not_allowed_in_an_ambient_context: { code: 1165, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in an ambient context." },
Computed_property_names_are_not_allowed_in_class_property_declarations: { code: 1166, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in class property declarations." },
A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { code: 1165, category: DiagnosticCategory.Error, key: "A computed property name in an ambient context must directly refer to a built-in symbol." },
A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { code: 1166, category: DiagnosticCategory.Error, key: "A computed property name in a class property declaration must directly refer to a built-in symbol." },
Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1167, category: DiagnosticCategory.Error, key: "Computed property names are only available when targeting ECMAScript 6 and higher." },
Computed_property_names_are_not_allowed_in_method_overloads: { code: 1168, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in method overloads." },
Computed_property_names_are_not_allowed_in_interfaces: { code: 1169, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in interfaces." },
Computed_property_names_are_not_allowed_in_type_literals: { code: 1170, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in type literals." },
A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { code: 1168, category: DiagnosticCategory.Error, key: "A computed property name in a method overload must directly refer to a built-in symbol." },
A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { code: 1169, category: DiagnosticCategory.Error, key: "A computed property name in an interface must directly refer to a built-in symbol." },
A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { code: 1170, category: DiagnosticCategory.Error, key: "A computed property name in a type literal must directly refer to a built-in symbol." },
A_comma_expression_is_not_allowed_in_a_computed_property_name: { code: 1171, category: DiagnosticCategory.Error, key: "A comma expression is not allowed in a computed property name." },
extends_clause_already_seen: { code: 1172, category: DiagnosticCategory.Error, key: "'extends' clause already seen." },
extends_clause_must_precede_implements_clause: { code: 1173, category: DiagnosticCategory.Error, key: "'extends' clause must precede 'implements' clause." },
@@ -166,7 +166,7 @@ module ts {
Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: DiagnosticCategory.Error, key: "Global type '{0}' must be a class or interface type." },
Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: DiagnosticCategory.Error, key: "Global type '{0}' must have {1} type parameter(s)." },
Cannot_find_global_type_0: { code: 2318, category: DiagnosticCategory.Error, key: "Cannot find global type '{0}'." },
Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: DiagnosticCategory.Error, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." },
Named_property_0_of_types_1_and_2_are_not_identical: { code: 2319, category: DiagnosticCategory.Error, key: "Named property '{0}' of types '{1}' and '{2}' are not identical." },
Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." },
Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: DiagnosticCategory.Error, key: "Excessive stack depth comparing types '{0}' and '{1}'." },
Type_0_is_not_assignable_to_type_1: { code: 2322, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." },
@@ -188,7 +188,7 @@ module ts {
Property_0_does_not_exist_on_type_1: { code: 2339, category: DiagnosticCategory.Error, key: "Property '{0}' does not exist on type '{1}'." },
Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: DiagnosticCategory.Error, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" },
Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: DiagnosticCategory.Error, key: "Property '{0}' is private and only accessible within class '{1}'." },
An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: DiagnosticCategory.Error, key: "An index expression argument must be of type 'string', 'number', or 'any'." },
An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: DiagnosticCategory.Error, key: "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'." },
Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}'." },
Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: DiagnosticCategory.Error, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." },
Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: DiagnosticCategory.Error, key: "Supplied parameters do not match any signature of call target." },
@@ -204,7 +204,7 @@ module ts {
The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: DiagnosticCategory.Error, key: "The operand of an increment or decrement operator must be a variable, property or indexer." },
The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: DiagnosticCategory.Error, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." },
The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: DiagnosticCategory.Error, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." },
The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2360, category: DiagnosticCategory.Error, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." },
The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: DiagnosticCategory.Error, key: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." },
The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: DiagnosticCategory.Error, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" },
The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: DiagnosticCategory.Error, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." },
The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: DiagnosticCategory.Error, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." },
@@ -299,20 +299,24 @@ module ts {
Type_0_is_not_an_array_type: { code: 2461, category: DiagnosticCategory.Error, key: "Type '{0}' is not an array type." },
A_rest_element_must_be_last_in_an_array_destructuring_pattern: { code: 2462, category: DiagnosticCategory.Error, key: "A rest element must be last in an array destructuring pattern" },
A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: DiagnosticCategory.Error, key: "A binding pattern parameter cannot be optional in an implementation signature." },
A_computed_property_name_must_be_of_type_string_number_or_any: { code: 2464, category: DiagnosticCategory.Error, key: "A computed property name must be of type 'string', 'number', or 'any'." },
A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: DiagnosticCategory.Error, key: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." },
this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in a computed property name." },
super_cannot_be_referenced_in_a_computed_property_name: { code: 2466, category: DiagnosticCategory.Error, key: "'super' cannot be referenced in a computed property name." },
A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { code: 2466, category: DiagnosticCategory.Error, key: "A computed property name cannot reference a type parameter from its containing type." },
Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher: { code: 2468, category: DiagnosticCategory.Error, key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher." },
Enum_declarations_must_all_be_const_or_non_const: { code: 2469, category: DiagnosticCategory.Error, key: "Enum declarations must all be const or non-const." },
In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 2470, category: DiagnosticCategory.Error, key: "In 'const' enum declarations member initializer must be constant expression." },
const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 2471, category: DiagnosticCategory.Error, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." },
A_const_enum_member_can_only_be_accessed_using_a_string_literal: { code: 2472, category: DiagnosticCategory.Error, key: "A const enum member can only be accessed using a string literal." },
const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 2473, category: DiagnosticCategory.Error, key: "'const' enum member initializer was evaluated to a non-finite value." },
const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 2474, category: DiagnosticCategory.Error, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." },
Property_0_does_not_exist_on_const_enum_1: { code: 2475, category: DiagnosticCategory.Error, key: "Property '{0}' does not exist on 'const' enum '{1}'." },
let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2476, category: DiagnosticCategory.Error, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." },
Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2477, category: DiagnosticCategory.Error, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." },
A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { code: 2467, category: DiagnosticCategory.Error, key: "A computed property name cannot reference a type parameter from its containing type." },
Cannot_find_global_value_0: { code: 2468, category: DiagnosticCategory.Error, key: "Cannot find global value '{0}'." },
The_0_operator_cannot_be_applied_to_type_symbol: { code: 2469, category: DiagnosticCategory.Error, key: "The '{0}' operator cannot be applied to type 'symbol'." },
Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: { code: 2470, category: DiagnosticCategory.Error, key: "'Symbol' reference does not refer to the global Symbol constructor object." },
A_computed_property_name_of_the_form_0_must_be_of_type_symbol: { code: 2471, category: DiagnosticCategory.Error, key: "A computed property name of the form '{0}' must be of type 'symbol'." },
Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher: { code: 2472, category: DiagnosticCategory.Error, key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher." },
Enum_declarations_must_all_be_const_or_non_const: { code: 2473, category: DiagnosticCategory.Error, key: "Enum declarations must all be const or non-const." },
In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 2474, category: DiagnosticCategory.Error, key: "In 'const' enum declarations member initializer must be constant expression." },
const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 2475, category: DiagnosticCategory.Error, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." },
A_const_enum_member_can_only_be_accessed_using_a_string_literal: { code: 2476, category: DiagnosticCategory.Error, key: "A const enum member can only be accessed using a string literal." },
const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 2477, category: DiagnosticCategory.Error, key: "'const' enum member initializer was evaluated to a non-finite value." },
const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 2478, category: DiagnosticCategory.Error, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." },
Property_0_does_not_exist_on_const_enum_1: { code: 2479, category: DiagnosticCategory.Error, key: "Property '{0}' does not exist on 'const' enum '{1}'." },
let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: DiagnosticCategory.Error, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." },
Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: DiagnosticCategory.Error, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." },
Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." },
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." },
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." },
+36 -20
View File
@@ -483,11 +483,11 @@
"category": "Error",
"code": 1164
},
"Computed property names are not allowed in an ambient context.": {
"A computed property name in an ambient context must directly refer to a built-in symbol.": {
"category": "Error",
"code": 1165
},
"Computed property names are not allowed in class property declarations.": {
"A computed property name in a class property declaration must directly refer to a built-in symbol.": {
"category": "Error",
"code": 1166
},
@@ -495,15 +495,15 @@
"category": "Error",
"code": 1167
},
"Computed property names are not allowed in method overloads.": {
"A computed property name in a method overload must directly refer to a built-in symbol.": {
"category": "Error",
"code": 1168
},
"Computed property names are not allowed in interfaces.": {
"A computed property name in an interface must directly refer to a built-in symbol.": {
"category": "Error",
"code": 1169
},
"Computed property names are not allowed in type literals.": {
"A computed property name in a type literal must directly refer to a built-in symbol.": {
"category": "Error",
"code": 1170
},
@@ -656,7 +656,7 @@
"category": "Error",
"code": 2318
},
"Named properties '{0}' of types '{1}' and '{2}' are not identical.": {
"Named property '{0}' of types '{1}' and '{2}' are not identical.": {
"category": "Error",
"code": 2319
},
@@ -744,7 +744,7 @@
"category": "Error",
"code": 2341
},
"An index expression argument must be of type 'string', 'number', or 'any'.": {
"An index expression argument must be of type 'string', 'number', 'symbol, or 'any'.": {
"category": "Error",
"code": 2342
},
@@ -808,7 +808,7 @@
"category": "Error",
"code": 2359
},
"The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.": {
"The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.": {
"category": "Error",
"code": 2360
},
@@ -1188,7 +1188,7 @@
"category": "Error",
"code": 2463
},
"A computed property name must be of type 'string', 'number', or 'any'.": {
"A computed property name must be of type 'string', 'number', 'symbol', or 'any'.": {
"category": "Error",
"code": 2464
},
@@ -1202,48 +1202,64 @@
},
"A computed property name cannot reference a type parameter from its containing type.": {
"category": "Error",
"code": 2466
"code": 2467
},
"Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher.": {
"Cannot find global value '{0}'.": {
"category": "Error",
"code": 2468
},
"Enum declarations must all be const or non-const.": {
"The '{0}' operator cannot be applied to type 'symbol'.": {
"category": "Error",
"code": 2469
},
"In 'const' enum declarations member initializer must be constant expression.": {
"'Symbol' reference does not refer to the global Symbol constructor object.": {
"category": "Error",
"code": 2470
},
"'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.": {
"A computed property name of the form '{0}' must be of type 'symbol'.": {
"category": "Error",
"code": 2471
},
"A const enum member can only be accessed using a string literal.": {
"Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher.": {
"category": "Error",
"code": 2472
},
"'const' enum member initializer was evaluated to a non-finite value.": {
"Enum declarations must all be const or non-const.": {
"category": "Error",
"code": 2473
},
"'const' enum member initializer was evaluated to disallowed value 'NaN'.": {
"In 'const' enum declarations member initializer must be constant expression.": {
"category": "Error",
"code": 2474
},
"Property '{0}' does not exist on 'const' enum '{1}'.": {
"'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.": {
"category": "Error",
"code": 2475
},
"'let' is not allowed to be used as a name in 'let' or 'const' declarations.": {
"A const enum member can only be accessed using a string literal.": {
"category": "Error",
"code": 2476
},
"Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'.": {
"'const' enum member initializer was evaluated to a non-finite value.": {
"category": "Error",
"code": 2477
},
"'const' enum member initializer was evaluated to disallowed value 'NaN'.": {
"category": "Error",
"code": 2478
},
"Property '{0}' does not exist on 'const' enum '{1}'.": {
"category": "Error",
"code": 2479
},
"'let' is not allowed to be used as a name in 'let' or 'const' declarations.": {
"category": "Error",
"code": 2480
},
"Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'.": {
"category": "Error",
"code": 2481
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",
+16 -12
View File
@@ -275,7 +275,7 @@ module ts {
var firstAccessor: AccessorDeclaration;
var getAccessor: AccessorDeclaration;
var setAccessor: AccessorDeclaration;
if (accessor.name.kind === SyntaxKind.ComputedPropertyName) {
if (hasDynamicName(accessor)) {
firstAccessor = accessor;
if (accessor.kind === SyntaxKind.GetAccessor) {
getAccessor = accessor;
@@ -289,19 +289,22 @@ module ts {
}
else {
forEach(node.members,(member: Declaration) => {
if ((member.kind === SyntaxKind.GetAccessor || member.kind === SyntaxKind.SetAccessor) &&
(<Identifier>member.name).text === (<Identifier>accessor.name).text &&
(member.flags & NodeFlags.Static) === (accessor.flags & NodeFlags.Static)) {
if (!firstAccessor) {
firstAccessor = <AccessorDeclaration>member;
}
if ((member.kind === SyntaxKind.GetAccessor || member.kind === SyntaxKind.SetAccessor)
&& (member.flags & NodeFlags.Static) === (accessor.flags & NodeFlags.Static)) {
var memberName = getPropertyNameForPropertyNameNode(member.name);
var accessorName = getPropertyNameForPropertyNameNode(accessor.name);
if (memberName === accessorName) {
if (!firstAccessor) {
firstAccessor = <AccessorDeclaration>member;
}
if (member.kind === SyntaxKind.GetAccessor && !getAccessor) {
getAccessor = <AccessorDeclaration>member;
}
if (member.kind === SyntaxKind.GetAccessor && !getAccessor) {
getAccessor = <AccessorDeclaration>member;
}
if (member.kind === SyntaxKind.SetAccessor && !setAccessor) {
setAccessor = <AccessorDeclaration>member;
if (member.kind === SyntaxKind.SetAccessor && !setAccessor) {
setAccessor = <AccessorDeclaration>member;
}
}
}
});
@@ -579,6 +582,7 @@ module ts {
case SyntaxKind.StringKeyword:
case SyntaxKind.NumberKeyword:
case SyntaxKind.BooleanKeyword:
case SyntaxKind.SymbolKeyword:
case SyntaxKind.VoidKeyword:
case SyntaxKind.StringLiteral:
return writeTextOfNode(currentSourceFile, type);
+2
View File
@@ -2593,6 +2593,7 @@ module ts {
case SyntaxKind.StringKeyword:
case SyntaxKind.NumberKeyword:
case SyntaxKind.BooleanKeyword:
case SyntaxKind.SymbolKeyword:
// If these are followed by a dot, then parse these out as a dotted type reference instead.
var node = tryParse(parseKeywordAndNoDot);
return node || parseTypeReference();
@@ -2617,6 +2618,7 @@ module ts {
case SyntaxKind.StringKeyword:
case SyntaxKind.NumberKeyword:
case SyntaxKind.BooleanKeyword:
case SyntaxKind.SymbolKeyword:
case SyntaxKind.VoidKeyword:
case SyntaxKind.TypeOfKeyword:
case SyntaxKind.OpenBraceToken:
+1
View File
@@ -82,6 +82,7 @@ module ts {
"string": SyntaxKind.StringKeyword,
"super": SyntaxKind.SuperKeyword,
"switch": SyntaxKind.SwitchKeyword,
"symbol": SyntaxKind.SymbolKeyword,
"this": SyntaxKind.ThisKeyword,
"throw": SyntaxKind.ThrowKeyword,
"true": SyntaxKind.TrueKeyword,
+4 -2
View File
@@ -140,6 +140,7 @@ module ts {
NumberKeyword,
SetKeyword,
StringKeyword,
SymbolKeyword,
TypeKeyword,
// Parse tree nodes
@@ -1298,9 +1299,10 @@ module ts {
ObjectLiteral = 0x00020000, // Originates in an object literal
ContainsUndefinedOrNull = 0x00040000, // Type is or contains Undefined or Null type
ContainsObjectLiteral = 0x00080000, // Type is or contains object literal type
ESSymbol = 0x00100000, // Type of symbol primitive introduced in ES6
Intrinsic = Any | String | Number | Boolean | Void | Undefined | Null,
Primitive = String | Number | Boolean | Void | Undefined | Null | StringLiteral | Enum,
Intrinsic = Any | String | Number | Boolean | ESSymbol | Void | Undefined | Null,
Primitive = String | Number | Boolean | ESSymbol | Void | Undefined | Null | StringLiteral | Enum,
StringLike = String | StringLiteral,
NumberLike = Number | Enum,
ObjectType = Class | Interface | Reference | Tuple | Anonymous,
+48
View File
@@ -835,6 +835,54 @@ module ts {
return SyntaxKind.FirstTriviaToken <= token && token <= SyntaxKind.LastTriviaToken;
}
/**
* A declaration has a dynamic name if both of the following are true:
* 1. The declaration has a computed property name
* 2. The computed name is *not* expressed as Symbol.<name>, where name
* is a property of the Symbol constructor that denotes a built in
* Symbol.
*/
export function hasDynamicName(declaration: Declaration): boolean {
return declaration.name &&
declaration.name.kind === SyntaxKind.ComputedPropertyName &&
!isWellKnownSymbolSyntactically((<ComputedPropertyName>declaration.name).expression);
}
/**
* Checks if the expression is of the form:
* Symbol.name
* where Symbol is literally the word "Symbol", and name is any identifierName
*/
export function isWellKnownSymbolSyntactically(node: Expression): boolean {
return node.kind === SyntaxKind.PropertyAccessExpression && isESSymbolIdentifier((<PropertyAccessExpression>node).expression);
}
export function getPropertyNameForPropertyNameNode(name: DeclarationName): string {
if (name.kind === SyntaxKind.Identifier || name.kind === SyntaxKind.StringLiteral || name.kind === SyntaxKind.NumericLiteral) {
return (<Identifier | LiteralExpression>name).text;
}
if (name.kind === SyntaxKind.ComputedPropertyName) {
var nameExpression = (<ComputedPropertyName>name).expression;
if (isWellKnownSymbolSyntactically(nameExpression)) {
var rightHandSideName = (<PropertyAccessExpression>nameExpression).name.text;
return getPropertyNameForKnownSymbolName(rightHandSideName);
}
}
return undefined;
}
export function getPropertyNameForKnownSymbolName(symbolName: string): string {
return "__@" + symbolName;
}
/**
* Includes the word "Symbol" with unicode escapes
*/
export function isESSymbolIdentifier(node: Node): boolean {
return node.kind === SyntaxKind.Identifier && (<Identifier>node).text === "Symbol";
}
export function isModifier(token: SyntaxKind): boolean {
switch (token) {
case SyntaxKind.PublicKeyword:
+39 -39
View File
@@ -1,4 +1,4 @@
declare type PropertyKey = string | number | Symbol;
declare type PropertyKey = string | number | symbol;
interface Symbol {
/** Returns a string representation of an object. */
@@ -7,7 +7,7 @@ interface Symbol {
/** Returns the primitive value of the specified object. */
valueOf(): Object;
// [Symbol.toStringTag]: string;
[Symbol.toStringTag]: string;
}
interface SymbolConstructor {
@@ -20,21 +20,21 @@ interface SymbolConstructor {
* Returns a new unique Symbol value.
* @param description Description of the new Symbol object.
*/
(description?: string|number): Symbol;
(description?: string|number): symbol;
/**
* Returns a Symbol object from the global symbol registry matching the given key if found.
* Otherwise, returns a new symbol with this key.
* @param key key to search for.
*/
for(key: string): Symbol;
for(key: string): symbol;
/**
* Returns a key from the global symbol registry matching the given Symbol if found.
* Otherwise, returns a undefined.
* @param sym Symbol to find the key for.
*/
keyFor(sym: Symbol): string;
keyFor(sym: symbol): string;
// Well-known Symbols
@@ -42,42 +42,42 @@ interface SymbolConstructor {
* A method that determines if a constructor object recognizes an object as one of the
* constructors instances. Called by the semantics of the instanceof operator.
*/
hasInstance: Symbol;
hasInstance: symbol;
/**
* A Boolean value that if true indicates that an object should flatten to its array elements
* by Array.prototype.concat.
*/
isConcatSpreadable: Symbol;
isConcatSpreadable: symbol;
/**
* A Boolean value that if true indicates that an object may be used as a regular expression.
*/
isRegExp: Symbol;
isRegExp: symbol;
/**
* A method that returns the default iterator for an object.Called by the semantics of the
* for-of statement.
*/
iterator: Symbol;
iterator: symbol;
/**
* A method that converts an object to a corresponding primitive value.Called by the ToPrimitive
* abstract operation.
*/
toPrimitive: Symbol;
toPrimitive: symbol;
/**
* A String value that is used in the creation of the default string description of an object.
* Called by the built- in method Object.prototype.toString.
*/
toStringTag: Symbol;
toStringTag: symbol;
/**
* An Object whose own property names are property names that are excluded from the with
* environment bindings of the associated objects.
*/
unscopables: Symbol;
unscopables: symbol;
}
declare var Symbol: SymbolConstructor;
@@ -108,7 +108,7 @@ interface ObjectConstructor {
* Returns an array of all symbol properties found directly on object o.
* @param o Object to retrieve the symbols from.
*/
getOwnPropertySymbols(o: any): Symbol[];
getOwnPropertySymbols(o: any): symbol[];
/**
* Returns true if the values are the same value, false otherwise.
@@ -230,7 +230,7 @@ interface ArrayLike<T> {
interface Array<T> {
/** Iterator */
// [Symbol.iterator] (): Iterator<T>;
[Symbol.iterator] (): Iterator<T>;
/**
* Returns an array of key, value pairs for every entry in the array
@@ -329,7 +329,7 @@ interface ArrayConstructor {
interface String {
/** Iterator */
// [Symbol.iterator] (): Iterator<string>;
[Symbol.iterator] (): Iterator<string>;
/**
* Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point
@@ -447,12 +447,12 @@ interface IteratorResult<T> {
}
interface Iterator<T> {
//[Symbol.iterator](): Iterator<T>;
[Symbol.iterator](): Iterator<T>;
next(): IteratorResult<T>;
}
interface Iterable<T> {
//[Symbol.iterator](): Iterator<T>;
[Symbol.iterator](): Iterator<T>;
}
interface GeneratorFunction extends Function {
@@ -474,7 +474,7 @@ interface Generator<T> extends Iterator<T> {
next(value?: any): IteratorResult<T>;
throw (exception: any): IteratorResult<T>;
return (value: T): IteratorResult<T>;
// [Symbol.toStringTag]: string;
[Symbol.toStringTag]: string;
}
interface Math {
@@ -588,11 +588,11 @@ interface Math {
*/
cbrt(x: number): number;
// [Symbol.toStringTag]: string;
[Symbol.toStringTag]: string;
}
interface RegExp {
// [Symbol.isRegExp]: boolean;
[Symbol.isRegExp]: boolean;
/**
* Matches a string with a regular expression, and returns an array containing the results of
@@ -649,8 +649,8 @@ interface Map<K, V> {
set(key: K, value?: V): Map<K, V>;
size: number;
values(): Iterator<V>;
// [Symbol.iterator]():Iterator<[K,V]>;
// [Symbol.toStringTag]: string;
[Symbol.iterator]():Iterator<[K,V]>;
[Symbol.toStringTag]: string;
}
interface MapConstructor {
@@ -666,7 +666,7 @@ interface WeakMap<K, V> {
get(key: K): V;
has(key: K): boolean;
set(key: K, value?: V): WeakMap<K, V>;
// [Symbol.toStringTag]: string;
[Symbol.toStringTag]: string;
}
interface WeakMapConstructor {
@@ -686,8 +686,8 @@ interface Set<T> {
keys(): Iterator<T>;
size: number;
values(): Iterator<T>;
// [Symbol.iterator]():Iterator<T>;
// [Symbol.toStringTag]: string;
[Symbol.iterator]():Iterator<T>;
[Symbol.toStringTag]: string;
}
interface SetConstructor {
@@ -702,7 +702,7 @@ interface WeakSet<T> {
clear(): void;
delete(value: T): boolean;
has(value: T): boolean;
// [Symbol.toStringTag]: string;
[Symbol.toStringTag]: string;
}
interface WeakSetConstructor {
@@ -713,7 +713,7 @@ interface WeakSetConstructor {
declare var WeakSet: WeakSetConstructor;
interface JSON {
// [Symbol.toStringTag]: string;
[Symbol.toStringTag]: string;
}
/**
@@ -733,7 +733,7 @@ interface ArrayBuffer {
*/
slice(begin: number, end?: number): ArrayBuffer;
// [Symbol.toStringTag]: string;
[Symbol.toStringTag]: string;
}
interface ArrayBufferConstructor {
@@ -870,7 +870,7 @@ interface DataView {
*/
setUint32(byteOffset: number, value: number, littleEndian: boolean): void;
// [Symbol.toStringTag]: string;
[Symbol.toStringTag]: string;
}
interface DataViewConstructor {
@@ -1137,7 +1137,7 @@ interface Int8Array {
values(): Iterator<number>;
[index: number]: number;
// [Symbol.iterator] (): Iterator<number>;
[Symbol.iterator] (): Iterator<number>;
}
interface Int8ArrayConstructor {
@@ -1427,7 +1427,7 @@ interface Uint8Array {
values(): Iterator<number>;
[index: number]: number;
// [Symbol.iterator] (): Iterator<number>;
[Symbol.iterator] (): Iterator<number>;
}
interface Uint8ArrayConstructor {
@@ -1717,7 +1717,7 @@ interface Uint8ClampedArray {
values(): Iterator<number>;
[index: number]: number;
// [Symbol.iterator] (): Iterator<number>;
[Symbol.iterator] (): Iterator<number>;
}
interface Uint8ClampedArrayConstructor {
@@ -2007,7 +2007,7 @@ interface Int16Array {
values(): Iterator<number>;
[index: number]: number;
// [Symbol.iterator] (): Iterator<number>;
[Symbol.iterator] (): Iterator<number>;
}
interface Int16ArrayConstructor {
@@ -2297,7 +2297,7 @@ interface Uint16Array {
values(): Iterator<number>;
[index: number]: number;
// [Symbol.iterator] (): Iterator<number>;
[Symbol.iterator] (): Iterator<number>;
}
interface Uint16ArrayConstructor {
@@ -2587,7 +2587,7 @@ interface Int32Array {
values(): Iterator<number>;
[index: number]: number;
// [Symbol.iterator] (): Iterator<number>;
[Symbol.iterator] (): Iterator<number>;
}
interface Int32ArrayConstructor {
@@ -2877,7 +2877,7 @@ interface Uint32Array {
values(): Iterator<number>;
[index: number]: number;
// [Symbol.iterator] (): Iterator<number>;
[Symbol.iterator] (): Iterator<number>;
}
interface Uint32ArrayConstructor {
@@ -3167,7 +3167,7 @@ interface Float32Array {
values(): Iterator<number>;
[index: number]: number;
// [Symbol.iterator] (): Iterator<number>;
[Symbol.iterator] (): Iterator<number>;
}
interface Float32ArrayConstructor {
@@ -3457,7 +3457,7 @@ interface Float64Array {
values(): Iterator<number>;
[index: number]: number;
// [Symbol.iterator] (): Iterator<number>;
[Symbol.iterator] (): Iterator<number>;
}
interface Float64ArrayConstructor {
@@ -3521,7 +3521,7 @@ declare var Reflect: {
getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
getPrototypeOf(target: any): any;
has(target: any, propertyKey: string): boolean;
has(target: any, propertyKey: Symbol): boolean;
has(target: any, propertyKey: symbol): boolean;
isExtensible(target: any): boolean;
ownKeys(target: any): Array<PropertyKey>;
preventExtensions(target: any): boolean;
+1 -1
View File
@@ -134,7 +134,7 @@ module ts.formatting {
static UnaryPredecrementExpressions = TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.OpenParenToken, SyntaxKind.ThisKeyword, SyntaxKind.NewKeyword]);
static UnaryPostdecrementExpressions = TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.CloseParenToken, SyntaxKind.CloseBracketToken, SyntaxKind.NewKeyword]);
static Comments = TokenRange.FromTokens([SyntaxKind.SingleLineCommentTrivia, SyntaxKind.MultiLineCommentTrivia]);
static TypeNames = TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.NumberKeyword, SyntaxKind.StringKeyword, SyntaxKind.BooleanKeyword, SyntaxKind.VoidKeyword, SyntaxKind.AnyKeyword]);
static TypeNames = TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.NumberKeyword, SyntaxKind.StringKeyword, SyntaxKind.BooleanKeyword, SyntaxKind.SymbolKeyword, SyntaxKind.VoidKeyword, SyntaxKind.AnyKeyword]);
}
}
}
+11 -5
View File
@@ -97,8 +97,7 @@ module ts.NavigationBar {
function sortNodes(nodes: Node[]): Node[] {
return nodes.slice(0).sort((n1: Declaration, n2: Declaration) => {
if (n1.name && n2.name) {
// TODO(jfreeman): How do we sort declarations with computed names?
return (<Identifier>n1.name).text.localeCompare((<Identifier>n2.name).text);
return getPropertyNameForPropertyNameNode(n1.name).localeCompare(getPropertyNameForPropertyNameNode(n2.name));
}
else if (n1.name) {
return 1;
@@ -426,7 +425,7 @@ module ts.NavigationBar {
// Add the constructor parameters in as children of the class (for property parameters).
// Note that *all* parameters will be added to the nodes array, but parameters that
// are not properties will be filtered out later by createChildItem.
var nodes: Node[] = removeComputedProperties(node);
var nodes: Node[] = removeDynamicallyNamedProperties(node);
if (constructor) {
nodes.push.apply(nodes, constructor.parameters);
}
@@ -455,7 +454,7 @@ module ts.NavigationBar {
}
function createIterfaceItem(node: InterfaceDeclaration): ts.NavigationBarItem {
var childItems = getItemsWorker(sortNodes(removeComputedProperties(node)), createChildItem);
var childItems = getItemsWorker(sortNodes(removeDynamicallyNamedProperties(node)), createChildItem);
return getNavigationBarItem(
node.name.text,
ts.ScriptElementKind.interfaceElement,
@@ -466,10 +465,17 @@ module ts.NavigationBar {
}
}
function removeComputedProperties(node: ClassDeclaration | InterfaceDeclaration | EnumDeclaration): Declaration[] {
function removeComputedProperties(node: EnumDeclaration): Declaration[] {
return filter<Declaration>(node.members, member => member.name === undefined || member.name.kind !== SyntaxKind.ComputedPropertyName);
}
/**
* Like removeComputedProperties, but retains the properties with well known symbol names
*/
function removeDynamicallyNamedProperties(node: ClassDeclaration | InterfaceDeclaration): Declaration[]{
return filter<Declaration>(node.members, member => !hasDynamicName(member));
}
function getInnermostModule(node: ModuleDeclaration): ModuleDeclaration {
while (node.body.kind === SyntaxKind.ModuleDeclaration) {
node = <ModuleDeclaration>node.body;
+2 -1
View File
@@ -5797,7 +5797,8 @@ module ts {
else if (token === SyntaxKind.AnyKeyword ||
token === SyntaxKind.StringKeyword ||
token === SyntaxKind.NumberKeyword ||
token === SyntaxKind.BooleanKeyword) {
token === SyntaxKind.BooleanKeyword ||
token === SyntaxKind.SymbolKeyword) {
if (angleBracketStack > 0 && !syntacticClassifierAbsent) {
// If it looks like we're could be in something generic, don't classify this
// as a keyword. We may just get overwritten by the syntactic classifier,
+99 -97
View File
@@ -179,110 +179,111 @@ declare module "typescript" {
NumberKeyword = 117,
SetKeyword = 118,
StringKeyword = 119,
TypeKeyword = 120,
QualifiedName = 121,
ComputedPropertyName = 122,
TypeParameter = 123,
Parameter = 124,
PropertySignature = 125,
PropertyDeclaration = 126,
MethodSignature = 127,
MethodDeclaration = 128,
Constructor = 129,
GetAccessor = 130,
SetAccessor = 131,
CallSignature = 132,
ConstructSignature = 133,
IndexSignature = 134,
TypeReference = 135,
FunctionType = 136,
ConstructorType = 137,
TypeQuery = 138,
TypeLiteral = 139,
ArrayType = 140,
TupleType = 141,
UnionType = 142,
ParenthesizedType = 143,
ObjectBindingPattern = 144,
ArrayBindingPattern = 145,
BindingElement = 146,
ArrayLiteralExpression = 147,
ObjectLiteralExpression = 148,
PropertyAccessExpression = 149,
ElementAccessExpression = 150,
CallExpression = 151,
NewExpression = 152,
TaggedTemplateExpression = 153,
TypeAssertionExpression = 154,
ParenthesizedExpression = 155,
FunctionExpression = 156,
ArrowFunction = 157,
DeleteExpression = 158,
TypeOfExpression = 159,
VoidExpression = 160,
PrefixUnaryExpression = 161,
PostfixUnaryExpression = 162,
BinaryExpression = 163,
ConditionalExpression = 164,
TemplateExpression = 165,
YieldExpression = 166,
SpreadElementExpression = 167,
OmittedExpression = 168,
TemplateSpan = 169,
Block = 170,
VariableStatement = 171,
EmptyStatement = 172,
ExpressionStatement = 173,
IfStatement = 174,
DoStatement = 175,
WhileStatement = 176,
ForStatement = 177,
ForInStatement = 178,
ContinueStatement = 179,
BreakStatement = 180,
ReturnStatement = 181,
WithStatement = 182,
SwitchStatement = 183,
LabeledStatement = 184,
ThrowStatement = 185,
TryStatement = 186,
DebuggerStatement = 187,
VariableDeclaration = 188,
VariableDeclarationList = 189,
FunctionDeclaration = 190,
ClassDeclaration = 191,
InterfaceDeclaration = 192,
TypeAliasDeclaration = 193,
EnumDeclaration = 194,
ModuleDeclaration = 195,
ModuleBlock = 196,
ImportDeclaration = 197,
ExportAssignment = 198,
ExternalModuleReference = 199,
CaseClause = 200,
DefaultClause = 201,
HeritageClause = 202,
CatchClause = 203,
PropertyAssignment = 204,
ShorthandPropertyAssignment = 205,
EnumMember = 206,
SourceFile = 207,
SyntaxList = 208,
Count = 209,
SymbolKeyword = 120,
TypeKeyword = 121,
QualifiedName = 122,
ComputedPropertyName = 123,
TypeParameter = 124,
Parameter = 125,
PropertySignature = 126,
PropertyDeclaration = 127,
MethodSignature = 128,
MethodDeclaration = 129,
Constructor = 130,
GetAccessor = 131,
SetAccessor = 132,
CallSignature = 133,
ConstructSignature = 134,
IndexSignature = 135,
TypeReference = 136,
FunctionType = 137,
ConstructorType = 138,
TypeQuery = 139,
TypeLiteral = 140,
ArrayType = 141,
TupleType = 142,
UnionType = 143,
ParenthesizedType = 144,
ObjectBindingPattern = 145,
ArrayBindingPattern = 146,
BindingElement = 147,
ArrayLiteralExpression = 148,
ObjectLiteralExpression = 149,
PropertyAccessExpression = 150,
ElementAccessExpression = 151,
CallExpression = 152,
NewExpression = 153,
TaggedTemplateExpression = 154,
TypeAssertionExpression = 155,
ParenthesizedExpression = 156,
FunctionExpression = 157,
ArrowFunction = 158,
DeleteExpression = 159,
TypeOfExpression = 160,
VoidExpression = 161,
PrefixUnaryExpression = 162,
PostfixUnaryExpression = 163,
BinaryExpression = 164,
ConditionalExpression = 165,
TemplateExpression = 166,
YieldExpression = 167,
SpreadElementExpression = 168,
OmittedExpression = 169,
TemplateSpan = 170,
Block = 171,
VariableStatement = 172,
EmptyStatement = 173,
ExpressionStatement = 174,
IfStatement = 175,
DoStatement = 176,
WhileStatement = 177,
ForStatement = 178,
ForInStatement = 179,
ContinueStatement = 180,
BreakStatement = 181,
ReturnStatement = 182,
WithStatement = 183,
SwitchStatement = 184,
LabeledStatement = 185,
ThrowStatement = 186,
TryStatement = 187,
DebuggerStatement = 188,
VariableDeclaration = 189,
VariableDeclarationList = 190,
FunctionDeclaration = 191,
ClassDeclaration = 192,
InterfaceDeclaration = 193,
TypeAliasDeclaration = 194,
EnumDeclaration = 195,
ModuleDeclaration = 196,
ModuleBlock = 197,
ImportDeclaration = 198,
ExportAssignment = 199,
ExternalModuleReference = 200,
CaseClause = 201,
DefaultClause = 202,
HeritageClause = 203,
CatchClause = 204,
PropertyAssignment = 205,
ShorthandPropertyAssignment = 206,
EnumMember = 207,
SourceFile = 208,
SyntaxList = 209,
Count = 210,
FirstAssignment = 52,
LastAssignment = 63,
FirstReservedWord = 65,
LastReservedWord = 100,
FirstKeyword = 65,
LastKeyword = 120,
LastKeyword = 121,
FirstFutureReservedWord = 101,
LastFutureReservedWord = 109,
FirstTypeNode = 135,
LastTypeNode = 143,
FirstTypeNode = 136,
LastTypeNode = 144,
FirstPunctuation = 14,
LastPunctuation = 63,
FirstToken = 0,
LastToken = 120,
LastToken = 121,
FirstTriviaToken = 2,
LastTriviaToken = 6,
FirstLiteralToken = 7,
@@ -291,7 +292,7 @@ declare module "typescript" {
LastTemplateToken = 13,
FirstBinaryOperator = 24,
LastBinaryOperator = 63,
FirstNode = 121,
FirstNode = 122,
}
const enum NodeFlags {
Export = 1,
@@ -1031,8 +1032,9 @@ declare module "typescript" {
ObjectLiteral = 131072,
ContainsUndefinedOrNull = 262144,
ContainsObjectLiteral = 524288,
Intrinsic = 127,
Primitive = 510,
ESSymbol = 1048576,
Intrinsic = 1048703,
Primitive = 1049086,
StringLike = 258,
NumberLike = 132,
ObjectType = 48128,
+103 -97
View File
@@ -553,274 +553,277 @@ declare module "typescript" {
StringKeyword = 119,
>StringKeyword : SyntaxKind
TypeKeyword = 120,
SymbolKeyword = 120,
>SymbolKeyword : SyntaxKind
TypeKeyword = 121,
>TypeKeyword : SyntaxKind
QualifiedName = 121,
QualifiedName = 122,
>QualifiedName : SyntaxKind
ComputedPropertyName = 122,
ComputedPropertyName = 123,
>ComputedPropertyName : SyntaxKind
TypeParameter = 123,
TypeParameter = 124,
>TypeParameter : SyntaxKind
Parameter = 124,
Parameter = 125,
>Parameter : SyntaxKind
PropertySignature = 125,
PropertySignature = 126,
>PropertySignature : SyntaxKind
PropertyDeclaration = 126,
PropertyDeclaration = 127,
>PropertyDeclaration : SyntaxKind
MethodSignature = 127,
MethodSignature = 128,
>MethodSignature : SyntaxKind
MethodDeclaration = 128,
MethodDeclaration = 129,
>MethodDeclaration : SyntaxKind
Constructor = 129,
Constructor = 130,
>Constructor : SyntaxKind
GetAccessor = 130,
GetAccessor = 131,
>GetAccessor : SyntaxKind
SetAccessor = 131,
SetAccessor = 132,
>SetAccessor : SyntaxKind
CallSignature = 132,
CallSignature = 133,
>CallSignature : SyntaxKind
ConstructSignature = 133,
ConstructSignature = 134,
>ConstructSignature : SyntaxKind
IndexSignature = 134,
IndexSignature = 135,
>IndexSignature : SyntaxKind
TypeReference = 135,
TypeReference = 136,
>TypeReference : SyntaxKind
FunctionType = 136,
FunctionType = 137,
>FunctionType : SyntaxKind
ConstructorType = 137,
ConstructorType = 138,
>ConstructorType : SyntaxKind
TypeQuery = 138,
TypeQuery = 139,
>TypeQuery : SyntaxKind
TypeLiteral = 139,
TypeLiteral = 140,
>TypeLiteral : SyntaxKind
ArrayType = 140,
ArrayType = 141,
>ArrayType : SyntaxKind
TupleType = 141,
TupleType = 142,
>TupleType : SyntaxKind
UnionType = 142,
UnionType = 143,
>UnionType : SyntaxKind
ParenthesizedType = 143,
ParenthesizedType = 144,
>ParenthesizedType : SyntaxKind
ObjectBindingPattern = 144,
ObjectBindingPattern = 145,
>ObjectBindingPattern : SyntaxKind
ArrayBindingPattern = 145,
ArrayBindingPattern = 146,
>ArrayBindingPattern : SyntaxKind
BindingElement = 146,
BindingElement = 147,
>BindingElement : SyntaxKind
ArrayLiteralExpression = 147,
ArrayLiteralExpression = 148,
>ArrayLiteralExpression : SyntaxKind
ObjectLiteralExpression = 148,
ObjectLiteralExpression = 149,
>ObjectLiteralExpression : SyntaxKind
PropertyAccessExpression = 149,
PropertyAccessExpression = 150,
>PropertyAccessExpression : SyntaxKind
ElementAccessExpression = 150,
ElementAccessExpression = 151,
>ElementAccessExpression : SyntaxKind
CallExpression = 151,
CallExpression = 152,
>CallExpression : SyntaxKind
NewExpression = 152,
NewExpression = 153,
>NewExpression : SyntaxKind
TaggedTemplateExpression = 153,
TaggedTemplateExpression = 154,
>TaggedTemplateExpression : SyntaxKind
TypeAssertionExpression = 154,
TypeAssertionExpression = 155,
>TypeAssertionExpression : SyntaxKind
ParenthesizedExpression = 155,
ParenthesizedExpression = 156,
>ParenthesizedExpression : SyntaxKind
FunctionExpression = 156,
FunctionExpression = 157,
>FunctionExpression : SyntaxKind
ArrowFunction = 157,
ArrowFunction = 158,
>ArrowFunction : SyntaxKind
DeleteExpression = 158,
DeleteExpression = 159,
>DeleteExpression : SyntaxKind
TypeOfExpression = 159,
TypeOfExpression = 160,
>TypeOfExpression : SyntaxKind
VoidExpression = 160,
VoidExpression = 161,
>VoidExpression : SyntaxKind
PrefixUnaryExpression = 161,
PrefixUnaryExpression = 162,
>PrefixUnaryExpression : SyntaxKind
PostfixUnaryExpression = 162,
PostfixUnaryExpression = 163,
>PostfixUnaryExpression : SyntaxKind
BinaryExpression = 163,
BinaryExpression = 164,
>BinaryExpression : SyntaxKind
ConditionalExpression = 164,
ConditionalExpression = 165,
>ConditionalExpression : SyntaxKind
TemplateExpression = 165,
TemplateExpression = 166,
>TemplateExpression : SyntaxKind
YieldExpression = 166,
YieldExpression = 167,
>YieldExpression : SyntaxKind
SpreadElementExpression = 167,
SpreadElementExpression = 168,
>SpreadElementExpression : SyntaxKind
OmittedExpression = 168,
OmittedExpression = 169,
>OmittedExpression : SyntaxKind
TemplateSpan = 169,
TemplateSpan = 170,
>TemplateSpan : SyntaxKind
Block = 170,
Block = 171,
>Block : SyntaxKind
VariableStatement = 171,
VariableStatement = 172,
>VariableStatement : SyntaxKind
EmptyStatement = 172,
EmptyStatement = 173,
>EmptyStatement : SyntaxKind
ExpressionStatement = 173,
ExpressionStatement = 174,
>ExpressionStatement : SyntaxKind
IfStatement = 174,
IfStatement = 175,
>IfStatement : SyntaxKind
DoStatement = 175,
DoStatement = 176,
>DoStatement : SyntaxKind
WhileStatement = 176,
WhileStatement = 177,
>WhileStatement : SyntaxKind
ForStatement = 177,
ForStatement = 178,
>ForStatement : SyntaxKind
ForInStatement = 178,
ForInStatement = 179,
>ForInStatement : SyntaxKind
ContinueStatement = 179,
ContinueStatement = 180,
>ContinueStatement : SyntaxKind
BreakStatement = 180,
BreakStatement = 181,
>BreakStatement : SyntaxKind
ReturnStatement = 181,
ReturnStatement = 182,
>ReturnStatement : SyntaxKind
WithStatement = 182,
WithStatement = 183,
>WithStatement : SyntaxKind
SwitchStatement = 183,
SwitchStatement = 184,
>SwitchStatement : SyntaxKind
LabeledStatement = 184,
LabeledStatement = 185,
>LabeledStatement : SyntaxKind
ThrowStatement = 185,
ThrowStatement = 186,
>ThrowStatement : SyntaxKind
TryStatement = 186,
TryStatement = 187,
>TryStatement : SyntaxKind
DebuggerStatement = 187,
DebuggerStatement = 188,
>DebuggerStatement : SyntaxKind
VariableDeclaration = 188,
VariableDeclaration = 189,
>VariableDeclaration : SyntaxKind
VariableDeclarationList = 189,
VariableDeclarationList = 190,
>VariableDeclarationList : SyntaxKind
FunctionDeclaration = 190,
FunctionDeclaration = 191,
>FunctionDeclaration : SyntaxKind
ClassDeclaration = 191,
ClassDeclaration = 192,
>ClassDeclaration : SyntaxKind
InterfaceDeclaration = 192,
InterfaceDeclaration = 193,
>InterfaceDeclaration : SyntaxKind
TypeAliasDeclaration = 193,
TypeAliasDeclaration = 194,
>TypeAliasDeclaration : SyntaxKind
EnumDeclaration = 194,
EnumDeclaration = 195,
>EnumDeclaration : SyntaxKind
ModuleDeclaration = 195,
ModuleDeclaration = 196,
>ModuleDeclaration : SyntaxKind
ModuleBlock = 196,
ModuleBlock = 197,
>ModuleBlock : SyntaxKind
ImportDeclaration = 197,
ImportDeclaration = 198,
>ImportDeclaration : SyntaxKind
ExportAssignment = 198,
ExportAssignment = 199,
>ExportAssignment : SyntaxKind
ExternalModuleReference = 199,
ExternalModuleReference = 200,
>ExternalModuleReference : SyntaxKind
CaseClause = 200,
CaseClause = 201,
>CaseClause : SyntaxKind
DefaultClause = 201,
DefaultClause = 202,
>DefaultClause : SyntaxKind
HeritageClause = 202,
HeritageClause = 203,
>HeritageClause : SyntaxKind
CatchClause = 203,
CatchClause = 204,
>CatchClause : SyntaxKind
PropertyAssignment = 204,
PropertyAssignment = 205,
>PropertyAssignment : SyntaxKind
ShorthandPropertyAssignment = 205,
ShorthandPropertyAssignment = 206,
>ShorthandPropertyAssignment : SyntaxKind
EnumMember = 206,
EnumMember = 207,
>EnumMember : SyntaxKind
SourceFile = 207,
SourceFile = 208,
>SourceFile : SyntaxKind
SyntaxList = 208,
SyntaxList = 209,
>SyntaxList : SyntaxKind
Count = 209,
Count = 210,
>Count : SyntaxKind
FirstAssignment = 52,
@@ -838,7 +841,7 @@ declare module "typescript" {
FirstKeyword = 65,
>FirstKeyword : SyntaxKind
LastKeyword = 120,
LastKeyword = 121,
>LastKeyword : SyntaxKind
FirstFutureReservedWord = 101,
@@ -847,10 +850,10 @@ declare module "typescript" {
LastFutureReservedWord = 109,
>LastFutureReservedWord : SyntaxKind
FirstTypeNode = 135,
FirstTypeNode = 136,
>FirstTypeNode : SyntaxKind
LastTypeNode = 143,
LastTypeNode = 144,
>LastTypeNode : SyntaxKind
FirstPunctuation = 14,
@@ -862,7 +865,7 @@ declare module "typescript" {
FirstToken = 0,
>FirstToken : SyntaxKind
LastToken = 120,
LastToken = 121,
>LastToken : SyntaxKind
FirstTriviaToken = 2,
@@ -889,7 +892,7 @@ declare module "typescript" {
LastBinaryOperator = 63,
>LastBinaryOperator : SyntaxKind
FirstNode = 121,
FirstNode = 122,
>FirstNode : SyntaxKind
}
const enum NodeFlags {
@@ -3318,10 +3321,13 @@ declare module "typescript" {
ContainsObjectLiteral = 524288,
>ContainsObjectLiteral : TypeFlags
Intrinsic = 127,
ESSymbol = 1048576,
>ESSymbol : TypeFlags
Intrinsic = 1048703,
>Intrinsic : TypeFlags
Primitive = 510,
Primitive = 1049086,
>Primitive : TypeFlags
StringLike = 258,
+108 -106
View File
@@ -210,110 +210,111 @@ declare module "typescript" {
NumberKeyword = 117,
SetKeyword = 118,
StringKeyword = 119,
TypeKeyword = 120,
QualifiedName = 121,
ComputedPropertyName = 122,
TypeParameter = 123,
Parameter = 124,
PropertySignature = 125,
PropertyDeclaration = 126,
MethodSignature = 127,
MethodDeclaration = 128,
Constructor = 129,
GetAccessor = 130,
SetAccessor = 131,
CallSignature = 132,
ConstructSignature = 133,
IndexSignature = 134,
TypeReference = 135,
FunctionType = 136,
ConstructorType = 137,
TypeQuery = 138,
TypeLiteral = 139,
ArrayType = 140,
TupleType = 141,
UnionType = 142,
ParenthesizedType = 143,
ObjectBindingPattern = 144,
ArrayBindingPattern = 145,
BindingElement = 146,
ArrayLiteralExpression = 147,
ObjectLiteralExpression = 148,
PropertyAccessExpression = 149,
ElementAccessExpression = 150,
CallExpression = 151,
NewExpression = 152,
TaggedTemplateExpression = 153,
TypeAssertionExpression = 154,
ParenthesizedExpression = 155,
FunctionExpression = 156,
ArrowFunction = 157,
DeleteExpression = 158,
TypeOfExpression = 159,
VoidExpression = 160,
PrefixUnaryExpression = 161,
PostfixUnaryExpression = 162,
BinaryExpression = 163,
ConditionalExpression = 164,
TemplateExpression = 165,
YieldExpression = 166,
SpreadElementExpression = 167,
OmittedExpression = 168,
TemplateSpan = 169,
Block = 170,
VariableStatement = 171,
EmptyStatement = 172,
ExpressionStatement = 173,
IfStatement = 174,
DoStatement = 175,
WhileStatement = 176,
ForStatement = 177,
ForInStatement = 178,
ContinueStatement = 179,
BreakStatement = 180,
ReturnStatement = 181,
WithStatement = 182,
SwitchStatement = 183,
LabeledStatement = 184,
ThrowStatement = 185,
TryStatement = 186,
DebuggerStatement = 187,
VariableDeclaration = 188,
VariableDeclarationList = 189,
FunctionDeclaration = 190,
ClassDeclaration = 191,
InterfaceDeclaration = 192,
TypeAliasDeclaration = 193,
EnumDeclaration = 194,
ModuleDeclaration = 195,
ModuleBlock = 196,
ImportDeclaration = 197,
ExportAssignment = 198,
ExternalModuleReference = 199,
CaseClause = 200,
DefaultClause = 201,
HeritageClause = 202,
CatchClause = 203,
PropertyAssignment = 204,
ShorthandPropertyAssignment = 205,
EnumMember = 206,
SourceFile = 207,
SyntaxList = 208,
Count = 209,
SymbolKeyword = 120,
TypeKeyword = 121,
QualifiedName = 122,
ComputedPropertyName = 123,
TypeParameter = 124,
Parameter = 125,
PropertySignature = 126,
PropertyDeclaration = 127,
MethodSignature = 128,
MethodDeclaration = 129,
Constructor = 130,
GetAccessor = 131,
SetAccessor = 132,
CallSignature = 133,
ConstructSignature = 134,
IndexSignature = 135,
TypeReference = 136,
FunctionType = 137,
ConstructorType = 138,
TypeQuery = 139,
TypeLiteral = 140,
ArrayType = 141,
TupleType = 142,
UnionType = 143,
ParenthesizedType = 144,
ObjectBindingPattern = 145,
ArrayBindingPattern = 146,
BindingElement = 147,
ArrayLiteralExpression = 148,
ObjectLiteralExpression = 149,
PropertyAccessExpression = 150,
ElementAccessExpression = 151,
CallExpression = 152,
NewExpression = 153,
TaggedTemplateExpression = 154,
TypeAssertionExpression = 155,
ParenthesizedExpression = 156,
FunctionExpression = 157,
ArrowFunction = 158,
DeleteExpression = 159,
TypeOfExpression = 160,
VoidExpression = 161,
PrefixUnaryExpression = 162,
PostfixUnaryExpression = 163,
BinaryExpression = 164,
ConditionalExpression = 165,
TemplateExpression = 166,
YieldExpression = 167,
SpreadElementExpression = 168,
OmittedExpression = 169,
TemplateSpan = 170,
Block = 171,
VariableStatement = 172,
EmptyStatement = 173,
ExpressionStatement = 174,
IfStatement = 175,
DoStatement = 176,
WhileStatement = 177,
ForStatement = 178,
ForInStatement = 179,
ContinueStatement = 180,
BreakStatement = 181,
ReturnStatement = 182,
WithStatement = 183,
SwitchStatement = 184,
LabeledStatement = 185,
ThrowStatement = 186,
TryStatement = 187,
DebuggerStatement = 188,
VariableDeclaration = 189,
VariableDeclarationList = 190,
FunctionDeclaration = 191,
ClassDeclaration = 192,
InterfaceDeclaration = 193,
TypeAliasDeclaration = 194,
EnumDeclaration = 195,
ModuleDeclaration = 196,
ModuleBlock = 197,
ImportDeclaration = 198,
ExportAssignment = 199,
ExternalModuleReference = 200,
CaseClause = 201,
DefaultClause = 202,
HeritageClause = 203,
CatchClause = 204,
PropertyAssignment = 205,
ShorthandPropertyAssignment = 206,
EnumMember = 207,
SourceFile = 208,
SyntaxList = 209,
Count = 210,
FirstAssignment = 52,
LastAssignment = 63,
FirstReservedWord = 65,
LastReservedWord = 100,
FirstKeyword = 65,
LastKeyword = 120,
LastKeyword = 121,
FirstFutureReservedWord = 101,
LastFutureReservedWord = 109,
FirstTypeNode = 135,
LastTypeNode = 143,
FirstTypeNode = 136,
LastTypeNode = 144,
FirstPunctuation = 14,
LastPunctuation = 63,
FirstToken = 0,
LastToken = 120,
LastToken = 121,
FirstTriviaToken = 2,
LastTriviaToken = 6,
FirstLiteralToken = 7,
@@ -322,7 +323,7 @@ declare module "typescript" {
LastTemplateToken = 13,
FirstBinaryOperator = 24,
LastBinaryOperator = 63,
FirstNode = 121,
FirstNode = 122,
}
const enum NodeFlags {
Export = 1,
@@ -1062,8 +1063,9 @@ declare module "typescript" {
ObjectLiteral = 131072,
ContainsUndefinedOrNull = 262144,
ContainsObjectLiteral = 524288,
Intrinsic = 127,
Primitive = 510,
ESSymbol = 1048576,
Intrinsic = 1048703,
Primitive = 1049086,
StringLike = 258,
NumberLike = 132,
ObjectType = 48128,
@@ -1976,24 +1978,24 @@ function delint(sourceFile) {
delintNode(sourceFile);
function delintNode(node) {
switch (node.kind) {
case 177 /* ForStatement */:
case 178 /* ForInStatement */:
case 176 /* WhileStatement */:
case 175 /* DoStatement */:
if (node.statement.kind !== 170 /* Block */) {
case 178 /* ForStatement */:
case 179 /* ForInStatement */:
case 177 /* WhileStatement */:
case 176 /* DoStatement */:
if (node.statement.kind !== 171 /* Block */) {
report(node, "A looping statement's contents should be wrapped in a block body.");
}
break;
case 174 /* IfStatement */:
case 175 /* IfStatement */:
var ifStatement = node;
if (ifStatement.thenStatement.kind !== 170 /* Block */) {
if (ifStatement.thenStatement.kind !== 171 /* Block */) {
report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body.");
}
if (ifStatement.elseStatement && ifStatement.elseStatement.kind !== 170 /* Block */ && ifStatement.elseStatement.kind !== 174 /* IfStatement */) {
if (ifStatement.elseStatement && ifStatement.elseStatement.kind !== 171 /* Block */ && ifStatement.elseStatement.kind !== 175 /* IfStatement */) {
report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body.");
}
break;
case 163 /* BinaryExpression */:
case 164 /* BinaryExpression */:
var op = node.operator;
if (op === 28 /* EqualsEqualsToken */ || op === 29 /* ExclamationEqualsToken */) {
report(node, "Use '===' and '!=='.");
+103 -97
View File
@@ -697,274 +697,277 @@ declare module "typescript" {
StringKeyword = 119,
>StringKeyword : SyntaxKind
TypeKeyword = 120,
SymbolKeyword = 120,
>SymbolKeyword : SyntaxKind
TypeKeyword = 121,
>TypeKeyword : SyntaxKind
QualifiedName = 121,
QualifiedName = 122,
>QualifiedName : SyntaxKind
ComputedPropertyName = 122,
ComputedPropertyName = 123,
>ComputedPropertyName : SyntaxKind
TypeParameter = 123,
TypeParameter = 124,
>TypeParameter : SyntaxKind
Parameter = 124,
Parameter = 125,
>Parameter : SyntaxKind
PropertySignature = 125,
PropertySignature = 126,
>PropertySignature : SyntaxKind
PropertyDeclaration = 126,
PropertyDeclaration = 127,
>PropertyDeclaration : SyntaxKind
MethodSignature = 127,
MethodSignature = 128,
>MethodSignature : SyntaxKind
MethodDeclaration = 128,
MethodDeclaration = 129,
>MethodDeclaration : SyntaxKind
Constructor = 129,
Constructor = 130,
>Constructor : SyntaxKind
GetAccessor = 130,
GetAccessor = 131,
>GetAccessor : SyntaxKind
SetAccessor = 131,
SetAccessor = 132,
>SetAccessor : SyntaxKind
CallSignature = 132,
CallSignature = 133,
>CallSignature : SyntaxKind
ConstructSignature = 133,
ConstructSignature = 134,
>ConstructSignature : SyntaxKind
IndexSignature = 134,
IndexSignature = 135,
>IndexSignature : SyntaxKind
TypeReference = 135,
TypeReference = 136,
>TypeReference : SyntaxKind
FunctionType = 136,
FunctionType = 137,
>FunctionType : SyntaxKind
ConstructorType = 137,
ConstructorType = 138,
>ConstructorType : SyntaxKind
TypeQuery = 138,
TypeQuery = 139,
>TypeQuery : SyntaxKind
TypeLiteral = 139,
TypeLiteral = 140,
>TypeLiteral : SyntaxKind
ArrayType = 140,
ArrayType = 141,
>ArrayType : SyntaxKind
TupleType = 141,
TupleType = 142,
>TupleType : SyntaxKind
UnionType = 142,
UnionType = 143,
>UnionType : SyntaxKind
ParenthesizedType = 143,
ParenthesizedType = 144,
>ParenthesizedType : SyntaxKind
ObjectBindingPattern = 144,
ObjectBindingPattern = 145,
>ObjectBindingPattern : SyntaxKind
ArrayBindingPattern = 145,
ArrayBindingPattern = 146,
>ArrayBindingPattern : SyntaxKind
BindingElement = 146,
BindingElement = 147,
>BindingElement : SyntaxKind
ArrayLiteralExpression = 147,
ArrayLiteralExpression = 148,
>ArrayLiteralExpression : SyntaxKind
ObjectLiteralExpression = 148,
ObjectLiteralExpression = 149,
>ObjectLiteralExpression : SyntaxKind
PropertyAccessExpression = 149,
PropertyAccessExpression = 150,
>PropertyAccessExpression : SyntaxKind
ElementAccessExpression = 150,
ElementAccessExpression = 151,
>ElementAccessExpression : SyntaxKind
CallExpression = 151,
CallExpression = 152,
>CallExpression : SyntaxKind
NewExpression = 152,
NewExpression = 153,
>NewExpression : SyntaxKind
TaggedTemplateExpression = 153,
TaggedTemplateExpression = 154,
>TaggedTemplateExpression : SyntaxKind
TypeAssertionExpression = 154,
TypeAssertionExpression = 155,
>TypeAssertionExpression : SyntaxKind
ParenthesizedExpression = 155,
ParenthesizedExpression = 156,
>ParenthesizedExpression : SyntaxKind
FunctionExpression = 156,
FunctionExpression = 157,
>FunctionExpression : SyntaxKind
ArrowFunction = 157,
ArrowFunction = 158,
>ArrowFunction : SyntaxKind
DeleteExpression = 158,
DeleteExpression = 159,
>DeleteExpression : SyntaxKind
TypeOfExpression = 159,
TypeOfExpression = 160,
>TypeOfExpression : SyntaxKind
VoidExpression = 160,
VoidExpression = 161,
>VoidExpression : SyntaxKind
PrefixUnaryExpression = 161,
PrefixUnaryExpression = 162,
>PrefixUnaryExpression : SyntaxKind
PostfixUnaryExpression = 162,
PostfixUnaryExpression = 163,
>PostfixUnaryExpression : SyntaxKind
BinaryExpression = 163,
BinaryExpression = 164,
>BinaryExpression : SyntaxKind
ConditionalExpression = 164,
ConditionalExpression = 165,
>ConditionalExpression : SyntaxKind
TemplateExpression = 165,
TemplateExpression = 166,
>TemplateExpression : SyntaxKind
YieldExpression = 166,
YieldExpression = 167,
>YieldExpression : SyntaxKind
SpreadElementExpression = 167,
SpreadElementExpression = 168,
>SpreadElementExpression : SyntaxKind
OmittedExpression = 168,
OmittedExpression = 169,
>OmittedExpression : SyntaxKind
TemplateSpan = 169,
TemplateSpan = 170,
>TemplateSpan : SyntaxKind
Block = 170,
Block = 171,
>Block : SyntaxKind
VariableStatement = 171,
VariableStatement = 172,
>VariableStatement : SyntaxKind
EmptyStatement = 172,
EmptyStatement = 173,
>EmptyStatement : SyntaxKind
ExpressionStatement = 173,
ExpressionStatement = 174,
>ExpressionStatement : SyntaxKind
IfStatement = 174,
IfStatement = 175,
>IfStatement : SyntaxKind
DoStatement = 175,
DoStatement = 176,
>DoStatement : SyntaxKind
WhileStatement = 176,
WhileStatement = 177,
>WhileStatement : SyntaxKind
ForStatement = 177,
ForStatement = 178,
>ForStatement : SyntaxKind
ForInStatement = 178,
ForInStatement = 179,
>ForInStatement : SyntaxKind
ContinueStatement = 179,
ContinueStatement = 180,
>ContinueStatement : SyntaxKind
BreakStatement = 180,
BreakStatement = 181,
>BreakStatement : SyntaxKind
ReturnStatement = 181,
ReturnStatement = 182,
>ReturnStatement : SyntaxKind
WithStatement = 182,
WithStatement = 183,
>WithStatement : SyntaxKind
SwitchStatement = 183,
SwitchStatement = 184,
>SwitchStatement : SyntaxKind
LabeledStatement = 184,
LabeledStatement = 185,
>LabeledStatement : SyntaxKind
ThrowStatement = 185,
ThrowStatement = 186,
>ThrowStatement : SyntaxKind
TryStatement = 186,
TryStatement = 187,
>TryStatement : SyntaxKind
DebuggerStatement = 187,
DebuggerStatement = 188,
>DebuggerStatement : SyntaxKind
VariableDeclaration = 188,
VariableDeclaration = 189,
>VariableDeclaration : SyntaxKind
VariableDeclarationList = 189,
VariableDeclarationList = 190,
>VariableDeclarationList : SyntaxKind
FunctionDeclaration = 190,
FunctionDeclaration = 191,
>FunctionDeclaration : SyntaxKind
ClassDeclaration = 191,
ClassDeclaration = 192,
>ClassDeclaration : SyntaxKind
InterfaceDeclaration = 192,
InterfaceDeclaration = 193,
>InterfaceDeclaration : SyntaxKind
TypeAliasDeclaration = 193,
TypeAliasDeclaration = 194,
>TypeAliasDeclaration : SyntaxKind
EnumDeclaration = 194,
EnumDeclaration = 195,
>EnumDeclaration : SyntaxKind
ModuleDeclaration = 195,
ModuleDeclaration = 196,
>ModuleDeclaration : SyntaxKind
ModuleBlock = 196,
ModuleBlock = 197,
>ModuleBlock : SyntaxKind
ImportDeclaration = 197,
ImportDeclaration = 198,
>ImportDeclaration : SyntaxKind
ExportAssignment = 198,
ExportAssignment = 199,
>ExportAssignment : SyntaxKind
ExternalModuleReference = 199,
ExternalModuleReference = 200,
>ExternalModuleReference : SyntaxKind
CaseClause = 200,
CaseClause = 201,
>CaseClause : SyntaxKind
DefaultClause = 201,
DefaultClause = 202,
>DefaultClause : SyntaxKind
HeritageClause = 202,
HeritageClause = 203,
>HeritageClause : SyntaxKind
CatchClause = 203,
CatchClause = 204,
>CatchClause : SyntaxKind
PropertyAssignment = 204,
PropertyAssignment = 205,
>PropertyAssignment : SyntaxKind
ShorthandPropertyAssignment = 205,
ShorthandPropertyAssignment = 206,
>ShorthandPropertyAssignment : SyntaxKind
EnumMember = 206,
EnumMember = 207,
>EnumMember : SyntaxKind
SourceFile = 207,
SourceFile = 208,
>SourceFile : SyntaxKind
SyntaxList = 208,
SyntaxList = 209,
>SyntaxList : SyntaxKind
Count = 209,
Count = 210,
>Count : SyntaxKind
FirstAssignment = 52,
@@ -982,7 +985,7 @@ declare module "typescript" {
FirstKeyword = 65,
>FirstKeyword : SyntaxKind
LastKeyword = 120,
LastKeyword = 121,
>LastKeyword : SyntaxKind
FirstFutureReservedWord = 101,
@@ -991,10 +994,10 @@ declare module "typescript" {
LastFutureReservedWord = 109,
>LastFutureReservedWord : SyntaxKind
FirstTypeNode = 135,
FirstTypeNode = 136,
>FirstTypeNode : SyntaxKind
LastTypeNode = 143,
LastTypeNode = 144,
>LastTypeNode : SyntaxKind
FirstPunctuation = 14,
@@ -1006,7 +1009,7 @@ declare module "typescript" {
FirstToken = 0,
>FirstToken : SyntaxKind
LastToken = 120,
LastToken = 121,
>LastToken : SyntaxKind
FirstTriviaToken = 2,
@@ -1033,7 +1036,7 @@ declare module "typescript" {
LastBinaryOperator = 63,
>LastBinaryOperator : SyntaxKind
FirstNode = 121,
FirstNode = 122,
>FirstNode : SyntaxKind
}
const enum NodeFlags {
@@ -3462,10 +3465,13 @@ declare module "typescript" {
ContainsObjectLiteral = 524288,
>ContainsObjectLiteral : TypeFlags
Intrinsic = 127,
ESSymbol = 1048576,
>ESSymbol : TypeFlags
Intrinsic = 1048703,
>Intrinsic : TypeFlags
Primitive = 510,
Primitive = 1049086,
>Primitive : TypeFlags
StringLike = 258,
@@ -211,110 +211,111 @@ declare module "typescript" {
NumberKeyword = 117,
SetKeyword = 118,
StringKeyword = 119,
TypeKeyword = 120,
QualifiedName = 121,
ComputedPropertyName = 122,
TypeParameter = 123,
Parameter = 124,
PropertySignature = 125,
PropertyDeclaration = 126,
MethodSignature = 127,
MethodDeclaration = 128,
Constructor = 129,
GetAccessor = 130,
SetAccessor = 131,
CallSignature = 132,
ConstructSignature = 133,
IndexSignature = 134,
TypeReference = 135,
FunctionType = 136,
ConstructorType = 137,
TypeQuery = 138,
TypeLiteral = 139,
ArrayType = 140,
TupleType = 141,
UnionType = 142,
ParenthesizedType = 143,
ObjectBindingPattern = 144,
ArrayBindingPattern = 145,
BindingElement = 146,
ArrayLiteralExpression = 147,
ObjectLiteralExpression = 148,
PropertyAccessExpression = 149,
ElementAccessExpression = 150,
CallExpression = 151,
NewExpression = 152,
TaggedTemplateExpression = 153,
TypeAssertionExpression = 154,
ParenthesizedExpression = 155,
FunctionExpression = 156,
ArrowFunction = 157,
DeleteExpression = 158,
TypeOfExpression = 159,
VoidExpression = 160,
PrefixUnaryExpression = 161,
PostfixUnaryExpression = 162,
BinaryExpression = 163,
ConditionalExpression = 164,
TemplateExpression = 165,
YieldExpression = 166,
SpreadElementExpression = 167,
OmittedExpression = 168,
TemplateSpan = 169,
Block = 170,
VariableStatement = 171,
EmptyStatement = 172,
ExpressionStatement = 173,
IfStatement = 174,
DoStatement = 175,
WhileStatement = 176,
ForStatement = 177,
ForInStatement = 178,
ContinueStatement = 179,
BreakStatement = 180,
ReturnStatement = 181,
WithStatement = 182,
SwitchStatement = 183,
LabeledStatement = 184,
ThrowStatement = 185,
TryStatement = 186,
DebuggerStatement = 187,
VariableDeclaration = 188,
VariableDeclarationList = 189,
FunctionDeclaration = 190,
ClassDeclaration = 191,
InterfaceDeclaration = 192,
TypeAliasDeclaration = 193,
EnumDeclaration = 194,
ModuleDeclaration = 195,
ModuleBlock = 196,
ImportDeclaration = 197,
ExportAssignment = 198,
ExternalModuleReference = 199,
CaseClause = 200,
DefaultClause = 201,
HeritageClause = 202,
CatchClause = 203,
PropertyAssignment = 204,
ShorthandPropertyAssignment = 205,
EnumMember = 206,
SourceFile = 207,
SyntaxList = 208,
Count = 209,
SymbolKeyword = 120,
TypeKeyword = 121,
QualifiedName = 122,
ComputedPropertyName = 123,
TypeParameter = 124,
Parameter = 125,
PropertySignature = 126,
PropertyDeclaration = 127,
MethodSignature = 128,
MethodDeclaration = 129,
Constructor = 130,
GetAccessor = 131,
SetAccessor = 132,
CallSignature = 133,
ConstructSignature = 134,
IndexSignature = 135,
TypeReference = 136,
FunctionType = 137,
ConstructorType = 138,
TypeQuery = 139,
TypeLiteral = 140,
ArrayType = 141,
TupleType = 142,
UnionType = 143,
ParenthesizedType = 144,
ObjectBindingPattern = 145,
ArrayBindingPattern = 146,
BindingElement = 147,
ArrayLiteralExpression = 148,
ObjectLiteralExpression = 149,
PropertyAccessExpression = 150,
ElementAccessExpression = 151,
CallExpression = 152,
NewExpression = 153,
TaggedTemplateExpression = 154,
TypeAssertionExpression = 155,
ParenthesizedExpression = 156,
FunctionExpression = 157,
ArrowFunction = 158,
DeleteExpression = 159,
TypeOfExpression = 160,
VoidExpression = 161,
PrefixUnaryExpression = 162,
PostfixUnaryExpression = 163,
BinaryExpression = 164,
ConditionalExpression = 165,
TemplateExpression = 166,
YieldExpression = 167,
SpreadElementExpression = 168,
OmittedExpression = 169,
TemplateSpan = 170,
Block = 171,
VariableStatement = 172,
EmptyStatement = 173,
ExpressionStatement = 174,
IfStatement = 175,
DoStatement = 176,
WhileStatement = 177,
ForStatement = 178,
ForInStatement = 179,
ContinueStatement = 180,
BreakStatement = 181,
ReturnStatement = 182,
WithStatement = 183,
SwitchStatement = 184,
LabeledStatement = 185,
ThrowStatement = 186,
TryStatement = 187,
DebuggerStatement = 188,
VariableDeclaration = 189,
VariableDeclarationList = 190,
FunctionDeclaration = 191,
ClassDeclaration = 192,
InterfaceDeclaration = 193,
TypeAliasDeclaration = 194,
EnumDeclaration = 195,
ModuleDeclaration = 196,
ModuleBlock = 197,
ImportDeclaration = 198,
ExportAssignment = 199,
ExternalModuleReference = 200,
CaseClause = 201,
DefaultClause = 202,
HeritageClause = 203,
CatchClause = 204,
PropertyAssignment = 205,
ShorthandPropertyAssignment = 206,
EnumMember = 207,
SourceFile = 208,
SyntaxList = 209,
Count = 210,
FirstAssignment = 52,
LastAssignment = 63,
FirstReservedWord = 65,
LastReservedWord = 100,
FirstKeyword = 65,
LastKeyword = 120,
LastKeyword = 121,
FirstFutureReservedWord = 101,
LastFutureReservedWord = 109,
FirstTypeNode = 135,
LastTypeNode = 143,
FirstTypeNode = 136,
LastTypeNode = 144,
FirstPunctuation = 14,
LastPunctuation = 63,
FirstToken = 0,
LastToken = 120,
LastToken = 121,
FirstTriviaToken = 2,
LastTriviaToken = 6,
FirstLiteralToken = 7,
@@ -323,7 +324,7 @@ declare module "typescript" {
LastTemplateToken = 13,
FirstBinaryOperator = 24,
LastBinaryOperator = 63,
FirstNode = 121,
FirstNode = 122,
}
const enum NodeFlags {
Export = 1,
@@ -1063,8 +1064,9 @@ declare module "typescript" {
ObjectLiteral = 131072,
ContainsUndefinedOrNull = 262144,
ContainsObjectLiteral = 524288,
Intrinsic = 127,
Primitive = 510,
ESSymbol = 1048576,
Intrinsic = 1048703,
Primitive = 1049086,
StringLike = 258,
NumberLike = 132,
ObjectType = 48128,
@@ -649,274 +649,277 @@ declare module "typescript" {
StringKeyword = 119,
>StringKeyword : SyntaxKind
TypeKeyword = 120,
SymbolKeyword = 120,
>SymbolKeyword : SyntaxKind
TypeKeyword = 121,
>TypeKeyword : SyntaxKind
QualifiedName = 121,
QualifiedName = 122,
>QualifiedName : SyntaxKind
ComputedPropertyName = 122,
ComputedPropertyName = 123,
>ComputedPropertyName : SyntaxKind
TypeParameter = 123,
TypeParameter = 124,
>TypeParameter : SyntaxKind
Parameter = 124,
Parameter = 125,
>Parameter : SyntaxKind
PropertySignature = 125,
PropertySignature = 126,
>PropertySignature : SyntaxKind
PropertyDeclaration = 126,
PropertyDeclaration = 127,
>PropertyDeclaration : SyntaxKind
MethodSignature = 127,
MethodSignature = 128,
>MethodSignature : SyntaxKind
MethodDeclaration = 128,
MethodDeclaration = 129,
>MethodDeclaration : SyntaxKind
Constructor = 129,
Constructor = 130,
>Constructor : SyntaxKind
GetAccessor = 130,
GetAccessor = 131,
>GetAccessor : SyntaxKind
SetAccessor = 131,
SetAccessor = 132,
>SetAccessor : SyntaxKind
CallSignature = 132,
CallSignature = 133,
>CallSignature : SyntaxKind
ConstructSignature = 133,
ConstructSignature = 134,
>ConstructSignature : SyntaxKind
IndexSignature = 134,
IndexSignature = 135,
>IndexSignature : SyntaxKind
TypeReference = 135,
TypeReference = 136,
>TypeReference : SyntaxKind
FunctionType = 136,
FunctionType = 137,
>FunctionType : SyntaxKind
ConstructorType = 137,
ConstructorType = 138,
>ConstructorType : SyntaxKind
TypeQuery = 138,
TypeQuery = 139,
>TypeQuery : SyntaxKind
TypeLiteral = 139,
TypeLiteral = 140,
>TypeLiteral : SyntaxKind
ArrayType = 140,
ArrayType = 141,
>ArrayType : SyntaxKind
TupleType = 141,
TupleType = 142,
>TupleType : SyntaxKind
UnionType = 142,
UnionType = 143,
>UnionType : SyntaxKind
ParenthesizedType = 143,
ParenthesizedType = 144,
>ParenthesizedType : SyntaxKind
ObjectBindingPattern = 144,
ObjectBindingPattern = 145,
>ObjectBindingPattern : SyntaxKind
ArrayBindingPattern = 145,
ArrayBindingPattern = 146,
>ArrayBindingPattern : SyntaxKind
BindingElement = 146,
BindingElement = 147,
>BindingElement : SyntaxKind
ArrayLiteralExpression = 147,
ArrayLiteralExpression = 148,
>ArrayLiteralExpression : SyntaxKind
ObjectLiteralExpression = 148,
ObjectLiteralExpression = 149,
>ObjectLiteralExpression : SyntaxKind
PropertyAccessExpression = 149,
PropertyAccessExpression = 150,
>PropertyAccessExpression : SyntaxKind
ElementAccessExpression = 150,
ElementAccessExpression = 151,
>ElementAccessExpression : SyntaxKind
CallExpression = 151,
CallExpression = 152,
>CallExpression : SyntaxKind
NewExpression = 152,
NewExpression = 153,
>NewExpression : SyntaxKind
TaggedTemplateExpression = 153,
TaggedTemplateExpression = 154,
>TaggedTemplateExpression : SyntaxKind
TypeAssertionExpression = 154,
TypeAssertionExpression = 155,
>TypeAssertionExpression : SyntaxKind
ParenthesizedExpression = 155,
ParenthesizedExpression = 156,
>ParenthesizedExpression : SyntaxKind
FunctionExpression = 156,
FunctionExpression = 157,
>FunctionExpression : SyntaxKind
ArrowFunction = 157,
ArrowFunction = 158,
>ArrowFunction : SyntaxKind
DeleteExpression = 158,
DeleteExpression = 159,
>DeleteExpression : SyntaxKind
TypeOfExpression = 159,
TypeOfExpression = 160,
>TypeOfExpression : SyntaxKind
VoidExpression = 160,
VoidExpression = 161,
>VoidExpression : SyntaxKind
PrefixUnaryExpression = 161,
PrefixUnaryExpression = 162,
>PrefixUnaryExpression : SyntaxKind
PostfixUnaryExpression = 162,
PostfixUnaryExpression = 163,
>PostfixUnaryExpression : SyntaxKind
BinaryExpression = 163,
BinaryExpression = 164,
>BinaryExpression : SyntaxKind
ConditionalExpression = 164,
ConditionalExpression = 165,
>ConditionalExpression : SyntaxKind
TemplateExpression = 165,
TemplateExpression = 166,
>TemplateExpression : SyntaxKind
YieldExpression = 166,
YieldExpression = 167,
>YieldExpression : SyntaxKind
SpreadElementExpression = 167,
SpreadElementExpression = 168,
>SpreadElementExpression : SyntaxKind
OmittedExpression = 168,
OmittedExpression = 169,
>OmittedExpression : SyntaxKind
TemplateSpan = 169,
TemplateSpan = 170,
>TemplateSpan : SyntaxKind
Block = 170,
Block = 171,
>Block : SyntaxKind
VariableStatement = 171,
VariableStatement = 172,
>VariableStatement : SyntaxKind
EmptyStatement = 172,
EmptyStatement = 173,
>EmptyStatement : SyntaxKind
ExpressionStatement = 173,
ExpressionStatement = 174,
>ExpressionStatement : SyntaxKind
IfStatement = 174,
IfStatement = 175,
>IfStatement : SyntaxKind
DoStatement = 175,
DoStatement = 176,
>DoStatement : SyntaxKind
WhileStatement = 176,
WhileStatement = 177,
>WhileStatement : SyntaxKind
ForStatement = 177,
ForStatement = 178,
>ForStatement : SyntaxKind
ForInStatement = 178,
ForInStatement = 179,
>ForInStatement : SyntaxKind
ContinueStatement = 179,
ContinueStatement = 180,
>ContinueStatement : SyntaxKind
BreakStatement = 180,
BreakStatement = 181,
>BreakStatement : SyntaxKind
ReturnStatement = 181,
ReturnStatement = 182,
>ReturnStatement : SyntaxKind
WithStatement = 182,
WithStatement = 183,
>WithStatement : SyntaxKind
SwitchStatement = 183,
SwitchStatement = 184,
>SwitchStatement : SyntaxKind
LabeledStatement = 184,
LabeledStatement = 185,
>LabeledStatement : SyntaxKind
ThrowStatement = 185,
ThrowStatement = 186,
>ThrowStatement : SyntaxKind
TryStatement = 186,
TryStatement = 187,
>TryStatement : SyntaxKind
DebuggerStatement = 187,
DebuggerStatement = 188,
>DebuggerStatement : SyntaxKind
VariableDeclaration = 188,
VariableDeclaration = 189,
>VariableDeclaration : SyntaxKind
VariableDeclarationList = 189,
VariableDeclarationList = 190,
>VariableDeclarationList : SyntaxKind
FunctionDeclaration = 190,
FunctionDeclaration = 191,
>FunctionDeclaration : SyntaxKind
ClassDeclaration = 191,
ClassDeclaration = 192,
>ClassDeclaration : SyntaxKind
InterfaceDeclaration = 192,
InterfaceDeclaration = 193,
>InterfaceDeclaration : SyntaxKind
TypeAliasDeclaration = 193,
TypeAliasDeclaration = 194,
>TypeAliasDeclaration : SyntaxKind
EnumDeclaration = 194,
EnumDeclaration = 195,
>EnumDeclaration : SyntaxKind
ModuleDeclaration = 195,
ModuleDeclaration = 196,
>ModuleDeclaration : SyntaxKind
ModuleBlock = 196,
ModuleBlock = 197,
>ModuleBlock : SyntaxKind
ImportDeclaration = 197,
ImportDeclaration = 198,
>ImportDeclaration : SyntaxKind
ExportAssignment = 198,
ExportAssignment = 199,
>ExportAssignment : SyntaxKind
ExternalModuleReference = 199,
ExternalModuleReference = 200,
>ExternalModuleReference : SyntaxKind
CaseClause = 200,
CaseClause = 201,
>CaseClause : SyntaxKind
DefaultClause = 201,
DefaultClause = 202,
>DefaultClause : SyntaxKind
HeritageClause = 202,
HeritageClause = 203,
>HeritageClause : SyntaxKind
CatchClause = 203,
CatchClause = 204,
>CatchClause : SyntaxKind
PropertyAssignment = 204,
PropertyAssignment = 205,
>PropertyAssignment : SyntaxKind
ShorthandPropertyAssignment = 205,
ShorthandPropertyAssignment = 206,
>ShorthandPropertyAssignment : SyntaxKind
EnumMember = 206,
EnumMember = 207,
>EnumMember : SyntaxKind
SourceFile = 207,
SourceFile = 208,
>SourceFile : SyntaxKind
SyntaxList = 208,
SyntaxList = 209,
>SyntaxList : SyntaxKind
Count = 209,
Count = 210,
>Count : SyntaxKind
FirstAssignment = 52,
@@ -934,7 +937,7 @@ declare module "typescript" {
FirstKeyword = 65,
>FirstKeyword : SyntaxKind
LastKeyword = 120,
LastKeyword = 121,
>LastKeyword : SyntaxKind
FirstFutureReservedWord = 101,
@@ -943,10 +946,10 @@ declare module "typescript" {
LastFutureReservedWord = 109,
>LastFutureReservedWord : SyntaxKind
FirstTypeNode = 135,
FirstTypeNode = 136,
>FirstTypeNode : SyntaxKind
LastTypeNode = 143,
LastTypeNode = 144,
>LastTypeNode : SyntaxKind
FirstPunctuation = 14,
@@ -958,7 +961,7 @@ declare module "typescript" {
FirstToken = 0,
>FirstToken : SyntaxKind
LastToken = 120,
LastToken = 121,
>LastToken : SyntaxKind
FirstTriviaToken = 2,
@@ -985,7 +988,7 @@ declare module "typescript" {
LastBinaryOperator = 63,
>LastBinaryOperator : SyntaxKind
FirstNode = 121,
FirstNode = 122,
>FirstNode : SyntaxKind
}
const enum NodeFlags {
@@ -3414,10 +3417,13 @@ declare module "typescript" {
ContainsObjectLiteral = 524288,
>ContainsObjectLiteral : TypeFlags
Intrinsic = 127,
ESSymbol = 1048576,
>ESSymbol : TypeFlags
Intrinsic = 1048703,
>Intrinsic : TypeFlags
Primitive = 510,
Primitive = 1049086,
>Primitive : TypeFlags
StringLike = 258,
+99 -97
View File
@@ -248,110 +248,111 @@ declare module "typescript" {
NumberKeyword = 117,
SetKeyword = 118,
StringKeyword = 119,
TypeKeyword = 120,
QualifiedName = 121,
ComputedPropertyName = 122,
TypeParameter = 123,
Parameter = 124,
PropertySignature = 125,
PropertyDeclaration = 126,
MethodSignature = 127,
MethodDeclaration = 128,
Constructor = 129,
GetAccessor = 130,
SetAccessor = 131,
CallSignature = 132,
ConstructSignature = 133,
IndexSignature = 134,
TypeReference = 135,
FunctionType = 136,
ConstructorType = 137,
TypeQuery = 138,
TypeLiteral = 139,
ArrayType = 140,
TupleType = 141,
UnionType = 142,
ParenthesizedType = 143,
ObjectBindingPattern = 144,
ArrayBindingPattern = 145,
BindingElement = 146,
ArrayLiteralExpression = 147,
ObjectLiteralExpression = 148,
PropertyAccessExpression = 149,
ElementAccessExpression = 150,
CallExpression = 151,
NewExpression = 152,
TaggedTemplateExpression = 153,
TypeAssertionExpression = 154,
ParenthesizedExpression = 155,
FunctionExpression = 156,
ArrowFunction = 157,
DeleteExpression = 158,
TypeOfExpression = 159,
VoidExpression = 160,
PrefixUnaryExpression = 161,
PostfixUnaryExpression = 162,
BinaryExpression = 163,
ConditionalExpression = 164,
TemplateExpression = 165,
YieldExpression = 166,
SpreadElementExpression = 167,
OmittedExpression = 168,
TemplateSpan = 169,
Block = 170,
VariableStatement = 171,
EmptyStatement = 172,
ExpressionStatement = 173,
IfStatement = 174,
DoStatement = 175,
WhileStatement = 176,
ForStatement = 177,
ForInStatement = 178,
ContinueStatement = 179,
BreakStatement = 180,
ReturnStatement = 181,
WithStatement = 182,
SwitchStatement = 183,
LabeledStatement = 184,
ThrowStatement = 185,
TryStatement = 186,
DebuggerStatement = 187,
VariableDeclaration = 188,
VariableDeclarationList = 189,
FunctionDeclaration = 190,
ClassDeclaration = 191,
InterfaceDeclaration = 192,
TypeAliasDeclaration = 193,
EnumDeclaration = 194,
ModuleDeclaration = 195,
ModuleBlock = 196,
ImportDeclaration = 197,
ExportAssignment = 198,
ExternalModuleReference = 199,
CaseClause = 200,
DefaultClause = 201,
HeritageClause = 202,
CatchClause = 203,
PropertyAssignment = 204,
ShorthandPropertyAssignment = 205,
EnumMember = 206,
SourceFile = 207,
SyntaxList = 208,
Count = 209,
SymbolKeyword = 120,
TypeKeyword = 121,
QualifiedName = 122,
ComputedPropertyName = 123,
TypeParameter = 124,
Parameter = 125,
PropertySignature = 126,
PropertyDeclaration = 127,
MethodSignature = 128,
MethodDeclaration = 129,
Constructor = 130,
GetAccessor = 131,
SetAccessor = 132,
CallSignature = 133,
ConstructSignature = 134,
IndexSignature = 135,
TypeReference = 136,
FunctionType = 137,
ConstructorType = 138,
TypeQuery = 139,
TypeLiteral = 140,
ArrayType = 141,
TupleType = 142,
UnionType = 143,
ParenthesizedType = 144,
ObjectBindingPattern = 145,
ArrayBindingPattern = 146,
BindingElement = 147,
ArrayLiteralExpression = 148,
ObjectLiteralExpression = 149,
PropertyAccessExpression = 150,
ElementAccessExpression = 151,
CallExpression = 152,
NewExpression = 153,
TaggedTemplateExpression = 154,
TypeAssertionExpression = 155,
ParenthesizedExpression = 156,
FunctionExpression = 157,
ArrowFunction = 158,
DeleteExpression = 159,
TypeOfExpression = 160,
VoidExpression = 161,
PrefixUnaryExpression = 162,
PostfixUnaryExpression = 163,
BinaryExpression = 164,
ConditionalExpression = 165,
TemplateExpression = 166,
YieldExpression = 167,
SpreadElementExpression = 168,
OmittedExpression = 169,
TemplateSpan = 170,
Block = 171,
VariableStatement = 172,
EmptyStatement = 173,
ExpressionStatement = 174,
IfStatement = 175,
DoStatement = 176,
WhileStatement = 177,
ForStatement = 178,
ForInStatement = 179,
ContinueStatement = 180,
BreakStatement = 181,
ReturnStatement = 182,
WithStatement = 183,
SwitchStatement = 184,
LabeledStatement = 185,
ThrowStatement = 186,
TryStatement = 187,
DebuggerStatement = 188,
VariableDeclaration = 189,
VariableDeclarationList = 190,
FunctionDeclaration = 191,
ClassDeclaration = 192,
InterfaceDeclaration = 193,
TypeAliasDeclaration = 194,
EnumDeclaration = 195,
ModuleDeclaration = 196,
ModuleBlock = 197,
ImportDeclaration = 198,
ExportAssignment = 199,
ExternalModuleReference = 200,
CaseClause = 201,
DefaultClause = 202,
HeritageClause = 203,
CatchClause = 204,
PropertyAssignment = 205,
ShorthandPropertyAssignment = 206,
EnumMember = 207,
SourceFile = 208,
SyntaxList = 209,
Count = 210,
FirstAssignment = 52,
LastAssignment = 63,
FirstReservedWord = 65,
LastReservedWord = 100,
FirstKeyword = 65,
LastKeyword = 120,
LastKeyword = 121,
FirstFutureReservedWord = 101,
LastFutureReservedWord = 109,
FirstTypeNode = 135,
LastTypeNode = 143,
FirstTypeNode = 136,
LastTypeNode = 144,
FirstPunctuation = 14,
LastPunctuation = 63,
FirstToken = 0,
LastToken = 120,
LastToken = 121,
FirstTriviaToken = 2,
LastTriviaToken = 6,
FirstLiteralToken = 7,
@@ -360,7 +361,7 @@ declare module "typescript" {
LastTemplateToken = 13,
FirstBinaryOperator = 24,
LastBinaryOperator = 63,
FirstNode = 121,
FirstNode = 122,
}
const enum NodeFlags {
Export = 1,
@@ -1100,8 +1101,9 @@ declare module "typescript" {
ObjectLiteral = 131072,
ContainsUndefinedOrNull = 262144,
ContainsObjectLiteral = 524288,
Intrinsic = 127,
Primitive = 510,
ESSymbol = 1048576,
Intrinsic = 1048703,
Primitive = 1049086,
StringLike = 258,
NumberLike = 132,
ObjectType = 48128,
+103 -97
View File
@@ -822,274 +822,277 @@ declare module "typescript" {
StringKeyword = 119,
>StringKeyword : SyntaxKind
TypeKeyword = 120,
SymbolKeyword = 120,
>SymbolKeyword : SyntaxKind
TypeKeyword = 121,
>TypeKeyword : SyntaxKind
QualifiedName = 121,
QualifiedName = 122,
>QualifiedName : SyntaxKind
ComputedPropertyName = 122,
ComputedPropertyName = 123,
>ComputedPropertyName : SyntaxKind
TypeParameter = 123,
TypeParameter = 124,
>TypeParameter : SyntaxKind
Parameter = 124,
Parameter = 125,
>Parameter : SyntaxKind
PropertySignature = 125,
PropertySignature = 126,
>PropertySignature : SyntaxKind
PropertyDeclaration = 126,
PropertyDeclaration = 127,
>PropertyDeclaration : SyntaxKind
MethodSignature = 127,
MethodSignature = 128,
>MethodSignature : SyntaxKind
MethodDeclaration = 128,
MethodDeclaration = 129,
>MethodDeclaration : SyntaxKind
Constructor = 129,
Constructor = 130,
>Constructor : SyntaxKind
GetAccessor = 130,
GetAccessor = 131,
>GetAccessor : SyntaxKind
SetAccessor = 131,
SetAccessor = 132,
>SetAccessor : SyntaxKind
CallSignature = 132,
CallSignature = 133,
>CallSignature : SyntaxKind
ConstructSignature = 133,
ConstructSignature = 134,
>ConstructSignature : SyntaxKind
IndexSignature = 134,
IndexSignature = 135,
>IndexSignature : SyntaxKind
TypeReference = 135,
TypeReference = 136,
>TypeReference : SyntaxKind
FunctionType = 136,
FunctionType = 137,
>FunctionType : SyntaxKind
ConstructorType = 137,
ConstructorType = 138,
>ConstructorType : SyntaxKind
TypeQuery = 138,
TypeQuery = 139,
>TypeQuery : SyntaxKind
TypeLiteral = 139,
TypeLiteral = 140,
>TypeLiteral : SyntaxKind
ArrayType = 140,
ArrayType = 141,
>ArrayType : SyntaxKind
TupleType = 141,
TupleType = 142,
>TupleType : SyntaxKind
UnionType = 142,
UnionType = 143,
>UnionType : SyntaxKind
ParenthesizedType = 143,
ParenthesizedType = 144,
>ParenthesizedType : SyntaxKind
ObjectBindingPattern = 144,
ObjectBindingPattern = 145,
>ObjectBindingPattern : SyntaxKind
ArrayBindingPattern = 145,
ArrayBindingPattern = 146,
>ArrayBindingPattern : SyntaxKind
BindingElement = 146,
BindingElement = 147,
>BindingElement : SyntaxKind
ArrayLiteralExpression = 147,
ArrayLiteralExpression = 148,
>ArrayLiteralExpression : SyntaxKind
ObjectLiteralExpression = 148,
ObjectLiteralExpression = 149,
>ObjectLiteralExpression : SyntaxKind
PropertyAccessExpression = 149,
PropertyAccessExpression = 150,
>PropertyAccessExpression : SyntaxKind
ElementAccessExpression = 150,
ElementAccessExpression = 151,
>ElementAccessExpression : SyntaxKind
CallExpression = 151,
CallExpression = 152,
>CallExpression : SyntaxKind
NewExpression = 152,
NewExpression = 153,
>NewExpression : SyntaxKind
TaggedTemplateExpression = 153,
TaggedTemplateExpression = 154,
>TaggedTemplateExpression : SyntaxKind
TypeAssertionExpression = 154,
TypeAssertionExpression = 155,
>TypeAssertionExpression : SyntaxKind
ParenthesizedExpression = 155,
ParenthesizedExpression = 156,
>ParenthesizedExpression : SyntaxKind
FunctionExpression = 156,
FunctionExpression = 157,
>FunctionExpression : SyntaxKind
ArrowFunction = 157,
ArrowFunction = 158,
>ArrowFunction : SyntaxKind
DeleteExpression = 158,
DeleteExpression = 159,
>DeleteExpression : SyntaxKind
TypeOfExpression = 159,
TypeOfExpression = 160,
>TypeOfExpression : SyntaxKind
VoidExpression = 160,
VoidExpression = 161,
>VoidExpression : SyntaxKind
PrefixUnaryExpression = 161,
PrefixUnaryExpression = 162,
>PrefixUnaryExpression : SyntaxKind
PostfixUnaryExpression = 162,
PostfixUnaryExpression = 163,
>PostfixUnaryExpression : SyntaxKind
BinaryExpression = 163,
BinaryExpression = 164,
>BinaryExpression : SyntaxKind
ConditionalExpression = 164,
ConditionalExpression = 165,
>ConditionalExpression : SyntaxKind
TemplateExpression = 165,
TemplateExpression = 166,
>TemplateExpression : SyntaxKind
YieldExpression = 166,
YieldExpression = 167,
>YieldExpression : SyntaxKind
SpreadElementExpression = 167,
SpreadElementExpression = 168,
>SpreadElementExpression : SyntaxKind
OmittedExpression = 168,
OmittedExpression = 169,
>OmittedExpression : SyntaxKind
TemplateSpan = 169,
TemplateSpan = 170,
>TemplateSpan : SyntaxKind
Block = 170,
Block = 171,
>Block : SyntaxKind
VariableStatement = 171,
VariableStatement = 172,
>VariableStatement : SyntaxKind
EmptyStatement = 172,
EmptyStatement = 173,
>EmptyStatement : SyntaxKind
ExpressionStatement = 173,
ExpressionStatement = 174,
>ExpressionStatement : SyntaxKind
IfStatement = 174,
IfStatement = 175,
>IfStatement : SyntaxKind
DoStatement = 175,
DoStatement = 176,
>DoStatement : SyntaxKind
WhileStatement = 176,
WhileStatement = 177,
>WhileStatement : SyntaxKind
ForStatement = 177,
ForStatement = 178,
>ForStatement : SyntaxKind
ForInStatement = 178,
ForInStatement = 179,
>ForInStatement : SyntaxKind
ContinueStatement = 179,
ContinueStatement = 180,
>ContinueStatement : SyntaxKind
BreakStatement = 180,
BreakStatement = 181,
>BreakStatement : SyntaxKind
ReturnStatement = 181,
ReturnStatement = 182,
>ReturnStatement : SyntaxKind
WithStatement = 182,
WithStatement = 183,
>WithStatement : SyntaxKind
SwitchStatement = 183,
SwitchStatement = 184,
>SwitchStatement : SyntaxKind
LabeledStatement = 184,
LabeledStatement = 185,
>LabeledStatement : SyntaxKind
ThrowStatement = 185,
ThrowStatement = 186,
>ThrowStatement : SyntaxKind
TryStatement = 186,
TryStatement = 187,
>TryStatement : SyntaxKind
DebuggerStatement = 187,
DebuggerStatement = 188,
>DebuggerStatement : SyntaxKind
VariableDeclaration = 188,
VariableDeclaration = 189,
>VariableDeclaration : SyntaxKind
VariableDeclarationList = 189,
VariableDeclarationList = 190,
>VariableDeclarationList : SyntaxKind
FunctionDeclaration = 190,
FunctionDeclaration = 191,
>FunctionDeclaration : SyntaxKind
ClassDeclaration = 191,
ClassDeclaration = 192,
>ClassDeclaration : SyntaxKind
InterfaceDeclaration = 192,
InterfaceDeclaration = 193,
>InterfaceDeclaration : SyntaxKind
TypeAliasDeclaration = 193,
TypeAliasDeclaration = 194,
>TypeAliasDeclaration : SyntaxKind
EnumDeclaration = 194,
EnumDeclaration = 195,
>EnumDeclaration : SyntaxKind
ModuleDeclaration = 195,
ModuleDeclaration = 196,
>ModuleDeclaration : SyntaxKind
ModuleBlock = 196,
ModuleBlock = 197,
>ModuleBlock : SyntaxKind
ImportDeclaration = 197,
ImportDeclaration = 198,
>ImportDeclaration : SyntaxKind
ExportAssignment = 198,
ExportAssignment = 199,
>ExportAssignment : SyntaxKind
ExternalModuleReference = 199,
ExternalModuleReference = 200,
>ExternalModuleReference : SyntaxKind
CaseClause = 200,
CaseClause = 201,
>CaseClause : SyntaxKind
DefaultClause = 201,
DefaultClause = 202,
>DefaultClause : SyntaxKind
HeritageClause = 202,
HeritageClause = 203,
>HeritageClause : SyntaxKind
CatchClause = 203,
CatchClause = 204,
>CatchClause : SyntaxKind
PropertyAssignment = 204,
PropertyAssignment = 205,
>PropertyAssignment : SyntaxKind
ShorthandPropertyAssignment = 205,
ShorthandPropertyAssignment = 206,
>ShorthandPropertyAssignment : SyntaxKind
EnumMember = 206,
EnumMember = 207,
>EnumMember : SyntaxKind
SourceFile = 207,
SourceFile = 208,
>SourceFile : SyntaxKind
SyntaxList = 208,
SyntaxList = 209,
>SyntaxList : SyntaxKind
Count = 209,
Count = 210,
>Count : SyntaxKind
FirstAssignment = 52,
@@ -1107,7 +1110,7 @@ declare module "typescript" {
FirstKeyword = 65,
>FirstKeyword : SyntaxKind
LastKeyword = 120,
LastKeyword = 121,
>LastKeyword : SyntaxKind
FirstFutureReservedWord = 101,
@@ -1116,10 +1119,10 @@ declare module "typescript" {
LastFutureReservedWord = 109,
>LastFutureReservedWord : SyntaxKind
FirstTypeNode = 135,
FirstTypeNode = 136,
>FirstTypeNode : SyntaxKind
LastTypeNode = 143,
LastTypeNode = 144,
>LastTypeNode : SyntaxKind
FirstPunctuation = 14,
@@ -1131,7 +1134,7 @@ declare module "typescript" {
FirstToken = 0,
>FirstToken : SyntaxKind
LastToken = 120,
LastToken = 121,
>LastToken : SyntaxKind
FirstTriviaToken = 2,
@@ -1158,7 +1161,7 @@ declare module "typescript" {
LastBinaryOperator = 63,
>LastBinaryOperator : SyntaxKind
FirstNode = 121,
FirstNode = 122,
>FirstNode : SyntaxKind
}
const enum NodeFlags {
@@ -3587,10 +3590,13 @@ declare module "typescript" {
ContainsObjectLiteral = 524288,
>ContainsObjectLiteral : TypeFlags
Intrinsic = 127,
ESSymbol = 1048576,
>ESSymbol : TypeFlags
Intrinsic = 1048703,
>Intrinsic : TypeFlags
Primitive = 510,
Primitive = 1049086,
>Primitive : TypeFlags
StringLike = 258,
@@ -0,0 +1,19 @@
tests/cases/conformance/Symbols/ES5SymbolProperty1.ts(7,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/Symbols/ES5SymbolProperty1.ts(7,6): error TS2471: A computed property name of the form 'Symbol.foo' must be of type 'symbol'.
==== tests/cases/conformance/Symbols/ES5SymbolProperty1.ts (2 errors) ====
interface SymbolConstructor {
foo: string;
}
var Symbol: SymbolConstructor;
var obj = {
[Symbol.foo]: 0
~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~
!!! error TS2471: A computed property name of the form 'Symbol.foo' must be of type 'symbol'.
}
obj[Symbol.foo];
@@ -0,0 +1,18 @@
//// [ES5SymbolProperty1.ts]
interface SymbolConstructor {
foo: string;
}
var Symbol: SymbolConstructor;
var obj = {
[Symbol.foo]: 0
}
obj[Symbol.foo];
//// [ES5SymbolProperty1.js]
var Symbol;
var obj = {
[Symbol.foo]: 0
};
obj[Symbol.foo];
@@ -0,0 +1,22 @@
tests/cases/conformance/Symbols/ES5SymbolProperty2.ts(5,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/Symbols/ES5SymbolProperty2.ts(5,10): error TS2471: A computed property name of the form 'Symbol.iterator' must be of type 'symbol'.
tests/cases/conformance/Symbols/ES5SymbolProperty2.ts(10,11): error TS2304: Cannot find name 'Symbol'.
==== tests/cases/conformance/Symbols/ES5SymbolProperty2.ts (3 errors) ====
module M {
var Symbol;
export class C {
[Symbol.iterator]() { }
~~~~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~~~~~
!!! error TS2471: A computed property name of the form 'Symbol.iterator' must be of type 'symbol'.
}
(new C)[Symbol.iterator];
}
(new M.C)[Symbol.iterator];
~~~~~~
!!! error TS2304: Cannot find name 'Symbol'.
@@ -0,0 +1,26 @@
//// [ES5SymbolProperty2.ts]
module M {
var Symbol;
export class C {
[Symbol.iterator]() { }
}
(new C)[Symbol.iterator];
}
(new M.C)[Symbol.iterator];
//// [ES5SymbolProperty2.js]
var M;
(function (M) {
var Symbol;
var C = (function () {
function C() {
}
C.prototype[Symbol.iterator] = function () { };
return C;
})();
M.C = C;
(new C)[Symbol.iterator];
})(M || (M = {}));
(new M.C)[Symbol.iterator];
@@ -0,0 +1,16 @@
tests/cases/conformance/Symbols/ES5SymbolProperty3.ts(4,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/Symbols/ES5SymbolProperty3.ts(4,6): error TS2471: A computed property name of the form 'Symbol.iterator' must be of type 'symbol'.
==== tests/cases/conformance/Symbols/ES5SymbolProperty3.ts (2 errors) ====
var Symbol;
class C {
[Symbol.iterator]() { }
~~~~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~~~~~
!!! error TS2471: A computed property name of the form 'Symbol.iterator' must be of type 'symbol'.
}
(new C)[Symbol.iterator]
@@ -0,0 +1,18 @@
//// [ES5SymbolProperty3.ts]
var Symbol;
class C {
[Symbol.iterator]() { }
}
(new C)[Symbol.iterator]
//// [ES5SymbolProperty3.js]
var Symbol;
var C = (function () {
function C() {
}
C.prototype[Symbol.iterator] = function () { };
return C;
})();
(new C)[Symbol.iterator];
@@ -0,0 +1,16 @@
tests/cases/conformance/Symbols/ES5SymbolProperty4.ts(4,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/Symbols/ES5SymbolProperty4.ts(4,6): error TS2471: A computed property name of the form 'Symbol.iterator' must be of type 'symbol'.
==== tests/cases/conformance/Symbols/ES5SymbolProperty4.ts (2 errors) ====
var Symbol: { iterator: string };
class C {
[Symbol.iterator]() { }
~~~~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~~~~~
!!! error TS2471: A computed property name of the form 'Symbol.iterator' must be of type 'symbol'.
}
(new C)[Symbol.iterator]
@@ -0,0 +1,18 @@
//// [ES5SymbolProperty4.ts]
var Symbol: { iterator: string };
class C {
[Symbol.iterator]() { }
}
(new C)[Symbol.iterator]
//// [ES5SymbolProperty4.js]
var Symbol;
var C = (function () {
function C() {
}
C.prototype[Symbol.iterator] = function () { };
return C;
})();
(new C)[Symbol.iterator];
@@ -0,0 +1,16 @@
tests/cases/conformance/Symbols/ES5SymbolProperty5.ts(4,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/Symbols/ES5SymbolProperty5.ts(7,1): error TS2346: Supplied parameters do not match any signature of call target.
==== tests/cases/conformance/Symbols/ES5SymbolProperty5.ts (2 errors) ====
var Symbol: { iterator: symbol };
class C {
[Symbol.iterator]() { }
~~~~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
(new C)[Symbol.iterator](0) // Should error
~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
@@ -0,0 +1,18 @@
//// [ES5SymbolProperty5.ts]
var Symbol: { iterator: symbol };
class C {
[Symbol.iterator]() { }
}
(new C)[Symbol.iterator](0) // Should error
//// [ES5SymbolProperty5.js]
var Symbol;
var C = (function () {
function C() {
}
C.prototype[Symbol.iterator] = function () { };
return C;
})();
(new C)[Symbol.iterator](0); // Should error
@@ -0,0 +1,17 @@
tests/cases/conformance/Symbols/ES5SymbolProperty6.ts(2,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/Symbols/ES5SymbolProperty6.ts(2,6): error TS2304: Cannot find name 'Symbol'.
tests/cases/conformance/Symbols/ES5SymbolProperty6.ts(5,9): error TS2304: Cannot find name 'Symbol'.
==== tests/cases/conformance/Symbols/ES5SymbolProperty6.ts (3 errors) ====
class C {
[Symbol.iterator]() { }
~~~~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~
!!! error TS2304: Cannot find name 'Symbol'.
}
(new C)[Symbol.iterator]
~~~~~~
!!! error TS2304: Cannot find name 'Symbol'.
@@ -0,0 +1,15 @@
//// [ES5SymbolProperty6.ts]
class C {
[Symbol.iterator]() { }
}
(new C)[Symbol.iterator]
//// [ES5SymbolProperty6.js]
var C = (function () {
function C() {
}
C.prototype[Symbol.iterator] = function () { };
return C;
})();
(new C)[Symbol.iterator];
@@ -0,0 +1,16 @@
tests/cases/conformance/Symbols/ES5SymbolProperty7.ts(4,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/Symbols/ES5SymbolProperty7.ts(4,6): error TS2471: A computed property name of the form 'Symbol.iterator' must be of type 'symbol'.
==== tests/cases/conformance/Symbols/ES5SymbolProperty7.ts (2 errors) ====
var Symbol: { iterator: any };
class C {
[Symbol.iterator]() { }
~~~~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~~~~~
!!! error TS2471: A computed property name of the form 'Symbol.iterator' must be of type 'symbol'.
}
(new C)[Symbol.iterator]
@@ -0,0 +1,18 @@
//// [ES5SymbolProperty7.ts]
var Symbol: { iterator: any };
class C {
[Symbol.iterator]() { }
}
(new C)[Symbol.iterator]
//// [ES5SymbolProperty7.js]
var Symbol;
var C = (function () {
function C() {
}
C.prototype[Symbol.iterator] = function () { };
return C;
})();
(new C)[Symbol.iterator];
@@ -0,0 +1,7 @@
//// [ES5SymbolType1.ts]
var s: symbol;
s.toString();
//// [ES5SymbolType1.js]
var s;
s.toString();
@@ -0,0 +1,10 @@
=== tests/cases/conformance/Symbols/ES5SymbolType1.ts ===
var s: symbol;
>s : symbol
s.toString();
>s.toString() : string
>s.toString : () => string
>s : symbol
>toString : () => string
@@ -1,5 +1,5 @@
tests/cases/compiler/baseTypePrivateMemberClash.ts(8,11): error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y'.
Named properties 'm' of types 'X' and 'Y' are not identical.
Named property 'm' of types 'X' and 'Y' are not identical.
==== tests/cases/compiler/baseTypePrivateMemberClash.ts (1 errors) ====
@@ -13,4 +13,4 @@ tests/cases/compiler/baseTypePrivateMemberClash.ts(8,11): error TS2320: Interfac
interface Z extends X, Y { }
~
!!! error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y'.
!!! error TS2320: Named properties 'm' of types 'X' and 'Y' are not identical.
!!! error TS2320: Named property 'm' of types 'X' and 'Y' are not identical.
@@ -1,5 +1,5 @@
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(8,11): error TS2320: Interface 'A' cannot simultaneously extend types 'I<number>' and 'I<string>'.
Named properties 'foo' of types 'I<number>' and 'I<string>' are not identical.
Named property 'foo' of types 'I<number>' and 'I<string>' are not identical.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(13,16): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
@@ -14,7 +14,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesTha
interface A extends I<number>, I<string> { }
~
!!! error TS2320: Interface 'A' cannot simultaneously extend types 'I<number>' and 'I<string>'.
!!! error TS2320: Named properties 'foo' of types 'I<number>' and 'I<string>' are not identical.
!!! error TS2320: Named property 'foo' of types 'I<number>' and 'I<string>' are not identical.
var x: A;
// BUG 822524
@@ -1,4 +1,4 @@
tests/cases/conformance/expressions/functionCalls/callWithSpread.ts(52,21): error TS2468: Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/expressions/functionCalls/callWithSpread.ts(52,21): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/expressions/functionCalls/callWithSpread.ts (1 errors) ====
@@ -55,5 +55,5 @@ tests/cases/conformance/expressions/functionCalls/callWithSpread.ts(52,21): erro
// Only supported in when target is ES6
var c = new C(1, 2, ...a);
~~~~
!!! error TS2468: Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher.
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher.
@@ -1,14 +1,14 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(5,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(6,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(7,12): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(8,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(9,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(10,12): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(11,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(12,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(13,12): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(14,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(15,12): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(5,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(6,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(7,12): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(8,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(9,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(10,12): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(11,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(12,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(13,12): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(14,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(15,12): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts (11 errors) ====
@@ -18,35 +18,35 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames12.ts(15,12)
class C {
[s]: number;
~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
[n] = n;
~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
static [s + s]: string;
~~~~~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
[s + n] = 2;
~~~~~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
[+s]: typeof s;
~~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
static [""]: number;
~~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
[0]: number;
~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
[a]: number;
~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
static [<any>true]: number;
~~~~~~~~~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
[`hello bye`] = 0;
~~~~~~~~~~~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
static [`hello ${a} bye`] = 0
~~~~~~~~~~~~~~~~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
}
@@ -1,9 +1,9 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames14.ts(3,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14.ts(4,12): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14.ts(5,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14.ts(6,12): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14.ts(7,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14.ts(8,12): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14.ts(3,5): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14.ts(4,12): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14.ts(5,5): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14.ts(6,12): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14.ts(7,5): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14.ts(8,12): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames14.ts (6 errors) ====
@@ -11,20 +11,20 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames14.ts(8,12):
class C {
[b]() {}
~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
static [true]() { }
~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
[[]]() { }
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
static [{}]() { }
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
[undefined]() { }
~~~~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
static [null]() { }
~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
}
@@ -1,5 +1,5 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames15.ts(6,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames15.ts(7,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames15.ts(6,5): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames15.ts(7,5): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames15.ts (2 errors) ====
@@ -10,8 +10,8 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames15.ts(7,5):
[p1]() { }
[p2]() { }
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
[p3]() { }
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
}
@@ -1,9 +1,9 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames17.ts(3,9): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17.ts(4,16): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17.ts(5,9): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17.ts(6,9): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17.ts(7,16): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17.ts(8,9): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17.ts(3,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17.ts(4,16): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17.ts(5,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17.ts(6,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17.ts(7,16): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17.ts(8,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames17.ts (6 errors) ====
@@ -11,20 +11,20 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames17.ts(8,9):
class C {
get [b]() { return 0;}
~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
static set [true](v) { }
~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
get [[]]() { return 0; }
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
set [{}](v) { }
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
static get [undefined]() { return 0; }
~~~~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
set [null](v) { }
~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
}
@@ -1,9 +1,9 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(4,12): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(4,12): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(5,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(5,9): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(6,9): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(5,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(6,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(7,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(7,16): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(7,16): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts (6 errors) ====
@@ -12,19 +12,19 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(7,16):
[0 + 1]() { }
static [() => { }]() { }
~~~~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
get [delete id]() { }
~~~~~~~~~~~
!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
~~~~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
set [[0, 1]](v) { }
~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
static get [<String>""]() { }
~~~~~~~~~~~~
!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
~~~~~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
static set [id.toString()](v) { }
}
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames32.ts(6,10): error TS2466: A computed property name cannot reference a type parameter from its containing type.
tests/cases/conformance/es6/computedProperties/computedPropertyNames32.ts(6,10): error TS2467: A computed property name cannot reference a type parameter from its containing type.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames32.ts (1 errors) ====
@@ -9,5 +9,5 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames32.ts(6,10):
}
[foo<T>()]() { }
~
!!! error TS2466: A computed property name cannot reference a type parameter from its containing type.
!!! error TS2467: A computed property name cannot reference a type parameter from its containing type.
}
@@ -1,5 +1,5 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames35.ts(4,5): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/conformance/es6/computedProperties/computedPropertyNames35.ts(4,10): error TS2466: A computed property name cannot reference a type parameter from its containing type.
tests/cases/conformance/es6/computedProperties/computedPropertyNames35.ts(4,5): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
tests/cases/conformance/es6/computedProperties/computedPropertyNames35.ts(4,10): error TS2467: A computed property name cannot reference a type parameter from its containing type.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames35.ts (2 errors) ====
@@ -8,7 +8,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames35.ts(4,10):
bar(): string;
[foo<T>()](): void;
~~~~~~~~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
!!! error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
~
!!! error TS2466: A computed property name cannot reference a type parameter from its containing type.
!!! error TS2467: A computed property name cannot reference a type parameter from its containing type.
}
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames42.ts(8,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/es6/computedProperties/computedPropertyNames42.ts(8,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/es6/computedProperties/computedPropertyNames42.ts(8,5): error TS2411: Property '[""]' of type 'Foo' is not assignable to string index type 'Foo2'.
@@ -12,7 +12,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames42.ts(8,5):
// Computed properties
[""]: Foo;
~~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
~~~~~~~~~~
!!! error TS2411: Property '[""]' of type 'Foo' is not assignable to string index type 'Foo2'.
}
@@ -1,9 +1,9 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames5.ts(3,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5.ts(4,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5.ts(5,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5.ts(6,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5.ts(7,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5.ts(8,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5.ts(3,5): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5.ts(4,5): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5.ts(5,5): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5.ts(6,5): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5.ts(7,5): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5.ts(8,5): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames5.ts (6 errors) ====
@@ -11,20 +11,20 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames5.ts(8,5): e
var v = {
[b]: 0,
~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
[true]: 1,
~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
[[]]: 0,
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
[{}]: 0,
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
[undefined]: undefined,
~~~~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
[null]: null
~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
}
@@ -1,5 +1,5 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames6.ts(6,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames6.ts(7,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames6.ts(6,5): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames6.ts(7,5): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames6.ts (2 errors) ====
@@ -10,8 +10,8 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames6.ts(7,5): e
[p1]: 0,
[p2]: 1,
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
[p3]: 2
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
}
@@ -1,5 +1,5 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames8.ts(5,9): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames8.ts(6,9): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames8.ts(5,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames8.ts(6,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames8.ts (2 errors) ====
@@ -9,9 +9,9 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames8.ts(6,9): e
var v = {
[t]: 0,
~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
[u]: 1
~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
};
}
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames9.ts(9,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames9.ts(9,5): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames9.ts (1 errors) ====
@@ -12,5 +12,5 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames9.ts(9,5): e
[f(0)]: 0,
[f(true)]: 0
~~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
}
@@ -1,9 +1,9 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit3.ts(2,5): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit3.ts(2,5): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit3.ts (1 errors) ====
interface I {
["" + ""](): void;
~~~~~~~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
!!! error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
}
@@ -1,9 +1,9 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit4.ts(2,5): error TS1170: Computed property names are not allowed in type literals.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit4.ts(2,5): error TS1170: A computed property name in a type literal must directly refer to a built-in symbol.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit4.ts (1 errors) ====
var v: {
["" + ""](): void;
~~~~~~~~~
!!! error TS1170: Computed property names are not allowed in type literals.
!!! error TS1170: A computed property name in a type literal must directly refer to a built-in symbol.
}
@@ -1,5 +1,5 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads.ts(4,5): error TS1168: Computed property names are not allowed in method overloads.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads.ts(5,5): error TS1168: Computed property names are not allowed in method overloads.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads.ts(4,5): error TS1168: A computed property name in a method overload must directly refer to a built-in symbol.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads.ts(5,5): error TS1168: A computed property name in a method overload must directly refer to a built-in symbol.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads.ts (2 errors) ====
@@ -8,9 +8,9 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads.
class C {
[methodName](v: string);
~~~~~~~~~~~~
!!! error TS1168: Computed property names are not allowed in method overloads.
!!! error TS1168: A computed property name in a method overload must directly refer to a built-in symbol.
[methodName]();
~~~~~~~~~~~~
!!! error TS1168: Computed property names are not allowed in method overloads.
!!! error TS1168: A computed property name in a method overload must directly refer to a built-in symbol.
[methodName](v?: string) { }
}
@@ -1,5 +1,5 @@
tests/cases/compiler/conflictingMemberTypesInBases.ts(12,11): error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D'.
Named properties 'm' of types 'B' and 'D' are not identical.
Named property 'm' of types 'B' and 'D' are not identical.
==== tests/cases/compiler/conflictingMemberTypesInBases.ts (1 errors) ====
@@ -17,6 +17,6 @@ tests/cases/compiler/conflictingMemberTypesInBases.ts(12,11): error TS2320: Inte
interface E extends B { } // Error here for extending B and D
~
!!! error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D'.
!!! error TS2320: Named properties 'm' of types 'B' and 'D' are not identical.
!!! error TS2320: Named property 'm' of types 'B' and 'D' are not identical.
interface E extends D { } // No duplicate error here
@@ -1,6 +1,6 @@
tests/cases/compiler/constDeclarationShadowedByVarDeclaration.ts(7,9): error TS2477: Cannot initialize outer scoped variable 'x' in the same scope as block scoped declaration 'x'.
tests/cases/compiler/constDeclarationShadowedByVarDeclaration.ts(15,13): error TS2477: Cannot initialize outer scoped variable 'y' in the same scope as block scoped declaration 'y'.
tests/cases/compiler/constDeclarationShadowedByVarDeclaration.ts(22,7): error TS2477: Cannot initialize outer scoped variable 'z' in the same scope as block scoped declaration 'z'.
tests/cases/compiler/constDeclarationShadowedByVarDeclaration.ts(7,9): error TS2481: Cannot initialize outer scoped variable 'x' in the same scope as block scoped declaration 'x'.
tests/cases/compiler/constDeclarationShadowedByVarDeclaration.ts(15,13): error TS2481: Cannot initialize outer scoped variable 'y' in the same scope as block scoped declaration 'y'.
tests/cases/compiler/constDeclarationShadowedByVarDeclaration.ts(22,7): error TS2481: Cannot initialize outer scoped variable 'z' in the same scope as block scoped declaration 'z'.
==== tests/cases/compiler/constDeclarationShadowedByVarDeclaration.ts (3 errors) ====
@@ -12,7 +12,7 @@ tests/cases/compiler/constDeclarationShadowedByVarDeclaration.ts(22,7): error TS
var x = 0;
~
!!! error TS2477: Cannot initialize outer scoped variable 'x' in the same scope as block scoped declaration 'x'.
!!! error TS2481: Cannot initialize outer scoped variable 'x' in the same scope as block scoped declaration 'x'.
}
@@ -22,7 +22,7 @@ tests/cases/compiler/constDeclarationShadowedByVarDeclaration.ts(22,7): error TS
{
var y = 0;
~
!!! error TS2477: Cannot initialize outer scoped variable 'y' in the same scope as block scoped declaration 'y'.
!!! error TS2481: Cannot initialize outer scoped variable 'y' in the same scope as block scoped declaration 'y'.
}
}
@@ -31,5 +31,5 @@ tests/cases/compiler/constDeclarationShadowedByVarDeclaration.ts(22,7): error TS
const z = 0;
var z = 0
~
!!! error TS2477: Cannot initialize outer scoped variable 'z' in the same scope as block scoped declaration 'z'.
!!! error TS2481: Cannot initialize outer scoped variable 'z' in the same scope as block scoped declaration 'z'.
}
@@ -1,8 +1,8 @@
tests/cases/compiler/constEnumBadPropertyNames.ts(2,11): error TS2475: Property 'B' does not exist on 'const' enum 'E'.
tests/cases/compiler/constEnumBadPropertyNames.ts(2,11): error TS2479: Property 'B' does not exist on 'const' enum 'E'.
==== tests/cases/compiler/constEnumBadPropertyNames.ts (1 errors) ====
const enum E { A }
var x = E["B"]
~~~
!!! error TS2475: Property 'B' does not exist on 'const' enum 'E'.
!!! error TS2479: Property 'B' does not exist on 'const' enum 'E'.
@@ -1,16 +1,16 @@
tests/cases/compiler/constEnumErrors.ts(1,12): error TS2300: Duplicate identifier 'E'.
tests/cases/compiler/constEnumErrors.ts(5,8): error TS2300: Duplicate identifier 'E'.
tests/cases/compiler/constEnumErrors.ts(12,9): error TS2470: In 'const' enum declarations member initializer must be constant expression.
tests/cases/compiler/constEnumErrors.ts(14,9): error TS2470: In 'const' enum declarations member initializer must be constant expression.
tests/cases/compiler/constEnumErrors.ts(15,10): error TS2470: In 'const' enum declarations member initializer must be constant expression.
tests/cases/compiler/constEnumErrors.ts(22,13): error TS2472: A const enum member can only be accessed using a string literal.
tests/cases/compiler/constEnumErrors.ts(24,13): error TS2472: A const enum member can only be accessed using a string literal.
tests/cases/compiler/constEnumErrors.ts(26,9): error TS2471: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.
tests/cases/compiler/constEnumErrors.ts(27,10): error TS2471: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.
tests/cases/compiler/constEnumErrors.ts(32,5): error TS2471: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.
tests/cases/compiler/constEnumErrors.ts(40,9): error TS2473: 'const' enum member initializer was evaluated to a non-finite value.
tests/cases/compiler/constEnumErrors.ts(41,9): error TS2473: 'const' enum member initializer was evaluated to a non-finite value.
tests/cases/compiler/constEnumErrors.ts(42,9): error TS2474: 'const' enum member initializer was evaluated to disallowed value 'NaN'.
tests/cases/compiler/constEnumErrors.ts(12,9): error TS2474: In 'const' enum declarations member initializer must be constant expression.
tests/cases/compiler/constEnumErrors.ts(14,9): error TS2474: In 'const' enum declarations member initializer must be constant expression.
tests/cases/compiler/constEnumErrors.ts(15,10): error TS2474: In 'const' enum declarations member initializer must be constant expression.
tests/cases/compiler/constEnumErrors.ts(22,13): error TS2476: A const enum member can only be accessed using a string literal.
tests/cases/compiler/constEnumErrors.ts(24,13): error TS2476: A const enum member can only be accessed using a string literal.
tests/cases/compiler/constEnumErrors.ts(26,9): error TS2475: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.
tests/cases/compiler/constEnumErrors.ts(27,10): error TS2475: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.
tests/cases/compiler/constEnumErrors.ts(32,5): error TS2475: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.
tests/cases/compiler/constEnumErrors.ts(40,9): error TS2477: 'const' enum member initializer was evaluated to a non-finite value.
tests/cases/compiler/constEnumErrors.ts(41,9): error TS2477: 'const' enum member initializer was evaluated to a non-finite value.
tests/cases/compiler/constEnumErrors.ts(42,9): error TS2478: 'const' enum member initializer was evaluated to disallowed value 'NaN'.
==== tests/cases/compiler/constEnumErrors.ts (13 errors) ====
@@ -31,14 +31,14 @@ tests/cases/compiler/constEnumErrors.ts(42,9): error TS2474: 'const' enum member
// forward reference to the element of the same enum
X = Y,
~
!!! error TS2470: In 'const' enum declarations member initializer must be constant expression.
!!! error TS2474: In 'const' enum declarations member initializer must be constant expression.
// forward reference to the element of the same enum
Y = E1.Z,
~~~~
!!! error TS2470: In 'const' enum declarations member initializer must be constant expression.
!!! error TS2474: In 'const' enum declarations member initializer must be constant expression.
Y1 = E1["Z"]
~~~~~~~
!!! error TS2470: In 'const' enum declarations member initializer must be constant expression.
!!! error TS2474: In 'const' enum declarations member initializer must be constant expression.
}
const enum E2 {
@@ -47,25 +47,25 @@ tests/cases/compiler/constEnumErrors.ts(42,9): error TS2474: 'const' enum member
var y0 = E2[1]
~
!!! error TS2472: A const enum member can only be accessed using a string literal.
!!! error TS2476: A const enum member can only be accessed using a string literal.
var name = "A";
var y1 = E2[name];
~~~~
!!! error TS2472: A const enum member can only be accessed using a string literal.
!!! error TS2476: A const enum member can only be accessed using a string literal.
var x = E2;
~~
!!! error TS2471: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.
!!! error TS2475: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.
var y = [E2];
~~
!!! error TS2471: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.
!!! error TS2475: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.
function foo(t: any): void {
}
foo(E2);
~~
!!! error TS2471: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.
!!! error TS2475: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.
const enum NaNOrInfinity {
A = 9007199254740992,
@@ -75,11 +75,11 @@ tests/cases/compiler/constEnumErrors.ts(42,9): error TS2474: 'const' enum member
E = D * D,
F = E * E, // overflow
~~~~~
!!! error TS2473: 'const' enum member initializer was evaluated to a non-finite value.
!!! error TS2477: 'const' enum member initializer was evaluated to a non-finite value.
G = 1 / 0, // overflow
~~~~~
!!! error TS2473: 'const' enum member initializer was evaluated to a non-finite value.
!!! error TS2477: 'const' enum member initializer was evaluated to a non-finite value.
H = 0 / 0 // NaN
~~~~~
!!! error TS2474: 'const' enum member initializer was evaluated to disallowed value 'NaN'.
!!! error TS2478: 'const' enum member initializer was evaluated to disallowed value 'NaN'.
}
@@ -1,5 +1,5 @@
tests/cases/compiler/genericAndNonGenericInheritedSignature1.ts(7,11): error TS2320: Interface 'Hello' cannot simultaneously extend types 'Foo' and 'Bar'.
Named properties 'f' of types 'Foo' and 'Bar' are not identical.
Named property 'f' of types 'Foo' and 'Bar' are not identical.
==== tests/cases/compiler/genericAndNonGenericInheritedSignature1.ts (1 errors) ====
@@ -12,6 +12,6 @@ tests/cases/compiler/genericAndNonGenericInheritedSignature1.ts(7,11): error TS2
interface Hello extends Foo, Bar {
~~~~~
!!! error TS2320: Interface 'Hello' cannot simultaneously extend types 'Foo' and 'Bar'.
!!! error TS2320: Named properties 'f' of types 'Foo' and 'Bar' are not identical.
!!! error TS2320: Named property 'f' of types 'Foo' and 'Bar' are not identical.
}
@@ -1,5 +1,5 @@
tests/cases/compiler/genericAndNonGenericInheritedSignature2.ts(7,11): error TS2320: Interface 'Hello' cannot simultaneously extend types 'Bar' and 'Foo'.
Named properties 'f' of types 'Bar' and 'Foo' are not identical.
Named property 'f' of types 'Bar' and 'Foo' are not identical.
==== tests/cases/compiler/genericAndNonGenericInheritedSignature2.ts (1 errors) ====
@@ -12,6 +12,6 @@ tests/cases/compiler/genericAndNonGenericInheritedSignature2.ts(7,11): error TS2
interface Hello extends Bar, Foo {
~~~~~
!!! error TS2320: Interface 'Hello' cannot simultaneously extend types 'Bar' and 'Foo'.
!!! error TS2320: Named properties 'f' of types 'Bar' and 'Foo' are not identical.
!!! error TS2320: Named property 'f' of types 'Bar' and 'Foo' are not identical.
}
+16 -16
View File
@@ -16,7 +16,7 @@ tests/cases/compiler/giant.ts(34,16): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(35,12): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(36,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(36,16): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(61,5): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/giant.ts(61,5): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
tests/cases/compiler/giant.ts(61,6): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(62,5): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(63,6): error TS1096: An index signature must have exactly one parameter.
@@ -39,7 +39,7 @@ tests/cases/compiler/giant.ts(98,20): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(99,16): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(100,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(100,20): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(125,9): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/giant.ts(125,9): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
tests/cases/compiler/giant.ts(125,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(126,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(127,10): error TS1096: An index signature must have exactly one parameter.
@@ -63,7 +63,7 @@ tests/cases/compiler/giant.ts(177,20): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(178,16): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(179,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(179,20): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(204,9): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/giant.ts(204,9): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
tests/cases/compiler/giant.ts(204,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(205,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(206,10): error TS1096: An index signature must have exactly one parameter.
@@ -119,7 +119,7 @@ tests/cases/compiler/giant.ts(292,16): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(293,12): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(294,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(294,16): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(319,5): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/giant.ts(319,5): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
tests/cases/compiler/giant.ts(319,6): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(320,5): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(321,6): error TS1096: An index signature must have exactly one parameter.
@@ -142,7 +142,7 @@ tests/cases/compiler/giant.ts(356,20): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(357,16): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(358,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(358,20): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(383,9): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/giant.ts(383,9): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
tests/cases/compiler/giant.ts(383,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(384,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(385,10): error TS1096: An index signature must have exactly one parameter.
@@ -166,7 +166,7 @@ tests/cases/compiler/giant.ts(435,20): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(436,16): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(437,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(437,20): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(462,9): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/giant.ts(462,9): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
tests/cases/compiler/giant.ts(462,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(463,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(464,10): error TS1096: An index signature must have exactly one parameter.
@@ -238,7 +238,7 @@ tests/cases/compiler/giant.ts(556,21): error TS1036: Statements are not allowed
tests/cases/compiler/giant.ts(558,24): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(561,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(563,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(587,9): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/giant.ts(587,9): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
tests/cases/compiler/giant.ts(587,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(588,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(589,10): error TS1096: An index signature must have exactly one parameter.
@@ -255,7 +255,7 @@ tests/cases/compiler/giant.ts(621,26): error TS1184: An implementation cannot be
tests/cases/compiler/giant.ts(623,24): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(626,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(628,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(653,9): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/giant.ts(653,9): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
tests/cases/compiler/giant.ts(653,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(654,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(655,10): error TS1096: An index signature must have exactly one parameter.
@@ -364,7 +364,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
//Index Signature
[p];
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
!!! error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'p'.
[p1: string];
@@ -474,7 +474,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
//Index Signature
[p];
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
!!! error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'p'.
[p1: string];
@@ -601,7 +601,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
//Index Signature
[p];
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
!!! error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'p'.
[p1: string];
@@ -828,7 +828,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
//Index Signature
[p];
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
!!! error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'p'.
[p1: string];
@@ -938,7 +938,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
//Index Signature
[p];
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
!!! error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'p'.
[p1: string];
@@ -1065,7 +1065,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
//Index Signature
[p];
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
!!! error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'p'.
[p1: string];
@@ -1334,7 +1334,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
//Index Signature
[p];
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
!!! error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'p'.
[p1: string];
@@ -1434,7 +1434,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
//Index Signature
[p];
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
!!! error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'p'.
[p1: string];
@@ -1,10 +1,10 @@
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(12,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(13,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(14,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(16,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(17,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(19,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(20,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(12,11): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(13,11): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(14,11): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(16,11): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(17,11): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(19,11): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(20,11): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(30,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(31,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(32,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
@@ -15,7 +15,7 @@ tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInv
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(37,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(38,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(39,17): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(43,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(43,11): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(43,17): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
@@ -33,27 +33,27 @@ tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInv
var ra1 = a1 in x;
~~
!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.
!!! error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
var ra2 = a2 in x;
~~
!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.
!!! error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
var ra3 = a3 in x;
~~
!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.
!!! error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
var ra4 = a4 in x;
var ra5 = null in x;
~~~~
!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.
!!! error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
var ra6 = undefined in x;
~~~~~~~~~
!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.
!!! error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
var ra7 = E.a in x;
var ra8 = false in x;
~~~~~
!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.
!!! error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
var ra9 = {} in x;
~~
!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.
!!! error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
// invalid right operands
// the right operand is required to be of type Any, an object type, or a type parameter type
@@ -98,6 +98,6 @@ tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInv
// both operands are invalid
var rc1 = {} in '';
~~
!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.
!!! error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
~~
!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
@@ -1,7 +1,7 @@
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(3,5): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(3,5): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(3,6): error TS2304: Cannot find name 'x'.
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(4,5): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(9,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(9,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(9,6): error TS2304: Cannot find name 'x'.
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(14,5): error TS1021: An index signature must have a type annotation.
@@ -11,7 +11,7 @@ tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(14,5): error TS1021
// Used to be indexer, now it is a computed property
[x]: string;
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
!!! error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'x'.
[x: string];
@@ -23,7 +23,7 @@ tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(14,5): error TS1021
// Used to be indexer, now it is a computed property
[x]: string
~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'x'.
@@ -1,6 +1,6 @@
tests/cases/compiler/indexSignatureWithInitializer.ts(3,5): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/indexSignatureWithInitializer.ts(3,5): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
tests/cases/compiler/indexSignatureWithInitializer.ts(3,6): error TS2304: Cannot find name 'x'.
tests/cases/compiler/indexSignatureWithInitializer.ts(7,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/compiler/indexSignatureWithInitializer.ts(7,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/compiler/indexSignatureWithInitializer.ts(7,6): error TS2304: Cannot find name 'x'.
@@ -9,7 +9,7 @@ tests/cases/compiler/indexSignatureWithInitializer.ts(7,6): error TS2304: Cannot
interface I {
[x = '']: string;
~~~~~~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
!!! error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'x'.
}
@@ -17,7 +17,7 @@ tests/cases/compiler/indexSignatureWithInitializer.ts(7,6): error TS2304: Cannot
class C {
[x = 0]: string
~~~~~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'x'.
}
@@ -5,7 +5,7 @@ tests/cases/compiler/indexTypeCheck.ts(22,2): error TS2413: Numeric index type '
tests/cases/compiler/indexTypeCheck.ts(27,2): error TS2413: Numeric index type 'number' is not assignable to string index type 'string'.
tests/cases/compiler/indexTypeCheck.ts(32,3): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/indexTypeCheck.ts(36,3): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/compiler/indexTypeCheck.ts(51,1): error TS2342: An index expression argument must be of type 'string', 'number', or 'any'.
tests/cases/compiler/indexTypeCheck.ts(51,1): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'.
==== tests/cases/compiler/indexTypeCheck.ts (8 errors) ====
@@ -75,7 +75,7 @@ tests/cases/compiler/indexTypeCheck.ts(51,1): error TS2342: An index expression
yellow[blue]; // error
~~~~~~~~~~~~
!!! error TS2342: An index expression argument must be of type 'string', 'number', or 'any'.
!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'.
var x:number[];
x[0];
@@ -1,4 +1,4 @@
tests/cases/compiler/indexWithoutParamType2.ts(3,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/compiler/indexWithoutParamType2.ts(3,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/compiler/indexWithoutParamType2.ts(3,6): error TS2304: Cannot find name 'x'.
@@ -7,7 +7,7 @@ tests/cases/compiler/indexWithoutParamType2.ts(3,6): error TS2304: Cannot find n
// Used to be indexer, now it is a computed property
[x]: string
~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'x'.
}
@@ -1,5 +1,5 @@
tests/cases/compiler/inheritSameNamePrivatePropertiesFromDifferentOrigins.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'.
Named properties 'x' of types 'C' and 'C2' are not identical.
Named property 'x' of types 'C' and 'C2' are not identical.
==== tests/cases/compiler/inheritSameNamePrivatePropertiesFromDifferentOrigins.ts (1 errors) ====
@@ -14,6 +14,6 @@ tests/cases/compiler/inheritSameNamePrivatePropertiesFromDifferentOrigins.ts(9,1
interface A extends C, C2 { // error
~
!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'.
!!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical.
!!! error TS2320: Named property 'x' of types 'C' and 'C2' are not identical.
y: string;
}
@@ -1,5 +1,5 @@
tests/cases/compiler/inheritSameNamePropertiesWithDifferentOptionality.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'.
Named properties 'x' of types 'C' and 'C2' are not identical.
Named property 'x' of types 'C' and 'C2' are not identical.
==== tests/cases/compiler/inheritSameNamePropertiesWithDifferentOptionality.ts (1 errors) ====
@@ -14,6 +14,6 @@ tests/cases/compiler/inheritSameNamePropertiesWithDifferentOptionality.ts(9,11):
interface A extends C, C2 { // error
~
!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'.
!!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical.
!!! error TS2320: Named property 'x' of types 'C' and 'C2' are not identical.
y: string;
}
@@ -1,5 +1,5 @@
tests/cases/compiler/inheritSameNamePropertiesWithDifferentVisibility.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'.
Named properties 'x' of types 'C' and 'C2' are not identical.
Named property 'x' of types 'C' and 'C2' are not identical.
==== tests/cases/compiler/inheritSameNamePropertiesWithDifferentVisibility.ts (1 errors) ====
@@ -14,6 +14,6 @@ tests/cases/compiler/inheritSameNamePropertiesWithDifferentVisibility.ts(9,11):
interface A extends C, C2 { // error
~
!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'.
!!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical.
!!! error TS2320: Named property 'x' of types 'C' and 'C2' are not identical.
y: string;
}
@@ -7,7 +7,7 @@ tests/cases/compiler/interfaceDeclaration1.ts(35,7): error TS2420: Class 'C1' in
Property 'prototype' is missing in type 'C1'.
tests/cases/compiler/interfaceDeclaration1.ts(41,11): error TS2310: Type 'i8' recursively references itself as a base type.
tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i12' cannot simultaneously extend types 'i10' and 'i11'.
Named properties 'foo' of types 'i10' and 'i11' are not identical.
Named property 'foo' of types 'i10' and 'i11' are not identical.
==== tests/cases/compiler/interfaceDeclaration1.ts (8 errors) ====
@@ -80,5 +80,5 @@ tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i
interface i12 extends i10, i11 { }
~~~
!!! error TS2320: Interface 'i12' cannot simultaneously extend types 'i10' and 'i11'.
!!! error TS2320: Named properties 'foo' of types 'i10' and 'i11' are not identical.
!!! error TS2320: Named property 'foo' of types 'i10' and 'i11' are not identical.
@@ -1,5 +1,5 @@
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'.
Named properties 'x' of types 'Foo' and 'Bar' are not identical.
Named property 'x' of types 'Foo' and 'Bar' are not identical.
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Bar'.
Property 'x' is private in type 'Bar' but not in type 'I4'.
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Foo'.
@@ -20,7 +20,7 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending
interface I3 extends Foo, Bar { // error
~~
!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'.
!!! error TS2320: Named properties 'x' of types 'Foo' and 'Bar' are not identical.
!!! error TS2320: Named property 'x' of types 'Foo' and 'Bar' are not identical.
}
interface I4 extends Foo, Bar { // error
@@ -1,5 +1,5 @@
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'.
Named properties 'x' of types 'Foo' and 'Bar' are not identical.
Named property 'x' of types 'Foo' and 'Bar' are not identical.
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Bar'.
Property 'x' is protected but type 'I4' is not a class derived from 'Bar'.
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Foo'.
@@ -20,7 +20,7 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending
interface I3 extends Foo, Bar { // error
~~
!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'.
!!! error TS2320: Named properties 'x' of types 'Foo' and 'Bar' are not identical.
!!! error TS2320: Named property 'x' of types 'Foo' and 'Bar' are not identical.
}
interface I4 extends Foo, Bar { // error
@@ -1,5 +1,5 @@
tests/cases/compiler/interfaceImplementation7.ts(4,11): error TS2320: Interface 'i3' cannot simultaneously extend types 'i1' and 'i2'.
Named properties 'name' of types 'i1' and 'i2' are not identical.
Named property 'name' of types 'i1' and 'i2' are not identical.
tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2420: Class 'C1' incorrectly implements interface 'i4'.
Types of property 'name' are incompatible.
Type '() => string' is not assignable to type '() => { s: string; n: number; }'.
@@ -14,7 +14,7 @@ tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2420: Class 'C1'
interface i3 extends i1, i2 { }
~~
!!! error TS2320: Interface 'i3' cannot simultaneously extend types 'i1' and 'i2'.
!!! error TS2320: Named properties 'name' of types 'i1' and 'i2' are not identical.
!!! error TS2320: Named property 'name' of types 'i1' and 'i2' are not identical.
interface i4 extends i1, i2 { name(): { s: string; n: number; }; }
class C1 implements i4 {
@@ -1,7 +1,7 @@
tests/cases/compiler/interfacePropertiesWithSameName2.ts(10,11): error TS2320: Interface 'MoverShaker' cannot simultaneously extend types 'Mover' and 'Shaker'.
Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical.
Named property 'getStatus' of types 'Mover' and 'Shaker' are not identical.
tests/cases/compiler/interfacePropertiesWithSameName2.ts(26,11): error TS2320: Interface 'MoverShaker2' cannot simultaneously extend types 'Mover' and 'Shaker'.
Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical.
Named property 'getStatus' of types 'Mover' and 'Shaker' are not identical.
==== tests/cases/compiler/interfacePropertiesWithSameName2.ts (2 errors) ====
@@ -17,7 +17,7 @@ tests/cases/compiler/interfacePropertiesWithSameName2.ts(26,11): error TS2320: I
interface MoverShaker extends Mover, Shaker {
~~~~~~~~~~~
!!! error TS2320: Interface 'MoverShaker' cannot simultaneously extend types 'Mover' and 'Shaker'.
!!! error TS2320: Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical.
!!! error TS2320: Named property 'getStatus' of types 'Mover' and 'Shaker' are not identical.
}
@@ -36,7 +36,7 @@ tests/cases/compiler/interfacePropertiesWithSameName2.ts(26,11): error TS2320: I
interface MoverShaker2 extends MoversAndShakers.Mover, MoversAndShakers.Shaker { } // error
~~~~~~~~~~~~
!!! error TS2320: Interface 'MoverShaker2' cannot simultaneously extend types 'Mover' and 'Shaker'.
!!! error TS2320: Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical.
!!! error TS2320: Named property 'getStatus' of types 'Mover' and 'Shaker' are not identical.
interface MoverShaker3 extends MoversAndShakers.Mover, MoversAndShakers.Shaker {
getStatus(): { speed: number; frequency: number; }; // ok because this getStatus overrides the conflicting ones above
@@ -1,7 +1,7 @@
tests/cases/compiler/interfacePropertiesWithSameName3.ts(3,11): error TS2320: Interface 'F' cannot simultaneously extend types 'E' and 'D'.
Named properties 'a' of types 'E' and 'D' are not identical.
Named property 'a' of types 'E' and 'D' are not identical.
tests/cases/compiler/interfacePropertiesWithSameName3.ts(7,11): error TS2320: Interface 'F2' cannot simultaneously extend types 'E2' and 'D2'.
Named properties 'a' of types 'E2' and 'D2' are not identical.
Named property 'a' of types 'E2' and 'D2' are not identical.
==== tests/cases/compiler/interfacePropertiesWithSameName3.ts (2 errors) ====
@@ -10,12 +10,12 @@ tests/cases/compiler/interfacePropertiesWithSameName3.ts(7,11): error TS2320: In
interface F extends E, D { } // error
~
!!! error TS2320: Interface 'F' cannot simultaneously extend types 'E' and 'D'.
!!! error TS2320: Named properties 'a' of types 'E' and 'D' are not identical.
!!! error TS2320: Named property 'a' of types 'E' and 'D' are not identical.
class D2 { a: number; }
class E2 { a: string; }
interface F2 extends E2, D2 { } // error
~~
!!! error TS2320: Interface 'F2' cannot simultaneously extend types 'E2' and 'D2'.
!!! error TS2320: Named properties 'a' of types 'E2' and 'D2' are not identical.
!!! error TS2320: Named property 'a' of types 'E2' and 'D2' are not identical.
@@ -4,7 +4,7 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBa
Types of property 'b' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(52,15): error TS2320: Interface 'Derived3<T>' cannot simultaneously extend types 'Base1<number>' and 'Base2<number>'.
Named properties 'x' of types 'Base1<number>' and 'Base2<number>' are not identical.
Named property 'x' of types 'Base1<number>' and 'Base2<number>' are not identical.
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(54,15): error TS2430: Interface 'Derived4<T>' incorrectly extends interface 'Base1<number>'.
Types of property 'x' are incompatible.
Type '{ a: T; b: T; }' is not assignable to type '{ a: number; }'.
@@ -86,7 +86,7 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBa
interface Derived3<T> extends Base1<number>, Base2<number> { } // error
~~~~~~~~
!!! error TS2320: Interface 'Derived3<T>' cannot simultaneously extend types 'Base1<number>' and 'Base2<number>'.
!!! error TS2320: Named properties 'x' of types 'Base1<number>' and 'Base2<number>' are not identical.
!!! error TS2320: Named property 'x' of types 'Base1<number>' and 'Base2<number>' are not identical.
interface Derived4<T> extends Base1<number>, Base2<number> { // error
~~~~~~~~
@@ -1,21 +1,21 @@
tests/cases/compiler/letInLetOrConstDeclarations.ts(2,9): error TS2476: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetOrConstDeclarations.ts(3,14): error TS2476: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetOrConstDeclarations.ts(6,11): error TS2476: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetOrConstDeclarations.ts(2,9): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetOrConstDeclarations.ts(3,14): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetOrConstDeclarations.ts(6,11): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
==== tests/cases/compiler/letInLetOrConstDeclarations.ts (3 errors) ====
{
let let = 1; // should error
~~~
!!! error TS2476: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
for (let let in []) { } // should error
~~~
!!! error TS2476: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
}
{
const let = 1; // should error
~~~
!!! error TS2476: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
}
{
function let() { // should be ok
@@ -1,7 +1,7 @@
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates3.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'.
Named properties 'x' of types 'C' and 'C2' are not identical.
Named property 'x' of types 'C' and 'C2' are not identical.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates3.ts(31,15): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'.
Named properties 'x' of types 'C' and 'C2' are not identical.
Named property 'x' of types 'C' and 'C2' are not identical.
==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates3.ts (2 errors) ====
@@ -16,7 +16,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri
interface A extends C { // error
~
!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'.
!!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical.
!!! error TS2320: Named property 'x' of types 'C' and 'C2' are not identical.
y: string;
}
@@ -41,7 +41,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri
interface A extends C { // error, privates conflict
~
!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'.
!!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical.
!!! error TS2320: Named property 'x' of types 'C' and 'C2' are not identical.
y: string;
}
@@ -1,5 +1,5 @@
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases4.ts(19,11): error TS2320: Interface 'A<T>' cannot simultaneously extend types 'C<string>' and 'C<number>'.
Named properties 'a' of types 'C<string>' and 'C<number>' are not identical.
Named property 'a' of types 'C<string>' and 'C<number>' are not identical.
==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases4.ts (1 errors) ====
@@ -24,7 +24,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultip
interface A<T> extends C<string>, C3<string> { // error
~
!!! error TS2320: Interface 'A<T>' cannot simultaneously extend types 'C<string>' and 'C<number>'.
!!! error TS2320: Named properties 'a' of types 'C<string>' and 'C<number>' are not identical.
!!! error TS2320: Named property 'a' of types 'C<string>' and 'C<number>' are not identical.
y: T;
}
@@ -1,5 +1,5 @@
tests/cases/compiler/multipleBaseInterfaesWithIncompatibleProperties.ts(6,11): error TS2320: Interface 'C' cannot simultaneously extend types 'A<string>' and 'A<number>'.
Named properties 'x' of types 'A<string>' and 'A<number>' are not identical.
Named property 'x' of types 'A<string>' and 'A<number>' are not identical.
==== tests/cases/compiler/multipleBaseInterfaesWithIncompatibleProperties.ts (1 errors) ====
@@ -11,5 +11,5 @@ tests/cases/compiler/multipleBaseInterfaesWithIncompatibleProperties.ts(6,11): e
interface C extends A<string>, A<number> { }
~
!!! error TS2320: Interface 'C' cannot simultaneously extend types 'A<string>' and 'A<number>'.
!!! error TS2320: Named properties 'x' of types 'A<string>' and 'A<number>' are not identical.
!!! error TS2320: Named property 'x' of types 'A<string>' and 'A<number>' are not identical.
@@ -1,6 +1,6 @@
tests/cases/compiler/objectCreationOfElementAccessExpression.ts(53,17): error TS2342: An index expression argument must be of type 'string', 'number', or 'any'.
tests/cases/compiler/objectCreationOfElementAccessExpression.ts(53,17): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'.
tests/cases/compiler/objectCreationOfElementAccessExpression.ts(53,63): error TS2348: Value of type 'typeof Cookie' is not callable. Did you mean to include 'new'?
tests/cases/compiler/objectCreationOfElementAccessExpression.ts(54,33): error TS2342: An index expression argument must be of type 'string', 'number', or 'any'.
tests/cases/compiler/objectCreationOfElementAccessExpression.ts(54,33): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'.
tests/cases/compiler/objectCreationOfElementAccessExpression.ts(54,79): error TS2348: Value of type 'typeof Cookie' is not callable. Did you mean to include 'new'?
@@ -59,12 +59,12 @@ tests/cases/compiler/objectCreationOfElementAccessExpression.ts(54,79): error TS
// ElementAccessExpressions can only contain one expression. There should be a parse error here.
var foods = new PetFood[new IceCream('Mint chocolate chip') , Cookie('Chocolate chip', false) , new Cookie('Peanut butter', true)];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2342: An index expression argument must be of type 'string', 'number', or 'any'.
!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2348: Value of type 'typeof Cookie' is not callable. Did you mean to include 'new'?
var foods2: MonsterFood[] = new PetFood[new IceCream('Mint chocolate chip') , Cookie('Chocolate chip', false) , new Cookie('Peanut butter', true)];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2342: An index expression argument must be of type 'string', 'number', or 'any'.
!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2348: Value of type 'typeof Cookie' is not callable. Did you mean to include 'new'?
@@ -1,4 +1,4 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName10.ts(2,4): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName10.ts(2,4): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName10.ts(2,5): error TS2304: Cannot find name 'e'.
@@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP
class C {
[e] = 1
~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'e'.
}
@@ -1,4 +1,4 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName11.ts(2,4): error TS1168: Computed property names are not allowed in method overloads.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName11.ts(2,4): error TS1168: A computed property name in a method overload must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName11.ts(2,5): error TS2304: Cannot find name 'e'.
@@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP
class C {
[e]();
~~~
!!! error TS1168: Computed property names are not allowed in method overloads.
!!! error TS1168: A computed property name in a method overload must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'e'.
}
@@ -1,10 +1,10 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName13.ts(1,10): error TS1170: Computed property names are not allowed in type literals.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName13.ts(1,10): error TS1170: A computed property name in a type literal must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName13.ts(1,11): error TS2304: Cannot find name 'e'.
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName13.ts (2 errors) ====
var v: { [e]: number };
~~~
!!! error TS1170: Computed property names are not allowed in type literals.
!!! error TS1170: A computed property name in a type literal must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'e'.
@@ -1,10 +1,10 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName14.ts(1,10): error TS1170: Computed property names are not allowed in type literals.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName14.ts(1,10): error TS1170: A computed property name in a type literal must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName14.ts(1,11): error TS2304: Cannot find name 'e'.
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName14.ts (2 errors) ====
var v: { [e](): number };
~~~
!!! error TS1170: Computed property names are not allowed in type literals.
!!! error TS1170: A computed property name in a type literal must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'e'.
@@ -1,10 +1,10 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName15.ts(1,31): error TS1170: Computed property names are not allowed in type literals.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName15.ts(1,31): error TS1170: A computed property name in a type literal must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName15.ts(1,32): error TS2304: Cannot find name 'e'.
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName15.ts (2 errors) ====
var v: { [e: number]: string; [e]: number };
~~~
!!! error TS1170: Computed property names are not allowed in type literals.
!!! error TS1170: A computed property name in a type literal must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'e'.
@@ -1,10 +1,10 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName18.ts(1,10): error TS1170: Computed property names are not allowed in type literals.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName18.ts(1,10): error TS1170: A computed property name in a type literal must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName18.ts(1,11): error TS2304: Cannot find name 'e'.
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName18.ts (2 errors) ====
var v: { [e]?(): number };
~~~
!!! error TS1170: Computed property names are not allowed in type literals.
!!! error TS1170: A computed property name in a type literal must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'e'.
@@ -1,10 +1,10 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName19.ts(1,10): error TS1170: Computed property names are not allowed in type literals.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName19.ts(1,10): error TS1170: A computed property name in a type literal must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName19.ts(1,11): error TS2304: Cannot find name 'e'.
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName19.ts (2 errors) ====
var v: { [e]? };
~~~
!!! error TS1170: Computed property names are not allowed in type literals.
!!! error TS1170: A computed property name in a type literal must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'e'.
@@ -1,4 +1,4 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName20.ts(2,5): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName20.ts(2,5): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName20.ts(2,6): error TS2304: Cannot find name 'e'.
@@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP
interface I {
[e](): number
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
!!! error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'e'.
}
@@ -1,4 +1,4 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName21.ts(2,5): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName21.ts(2,5): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName21.ts(2,6): error TS2304: Cannot find name 'e'.
@@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP
interface I {
[e]: number
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
!!! error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'e'.
}
@@ -1,4 +1,4 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName22.ts(2,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName22.ts(2,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName22.ts(2,6): error TS2304: Cannot find name 'e'.
@@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP
declare class C {
[e]: number
~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'e'.
}
@@ -1,4 +1,4 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName25.ts(3,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName25.ts(3,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName25.ts(3,6): error TS2304: Cannot find name 'e'.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName25.ts(4,6): error TS2304: Cannot find name 'e2'.
@@ -8,7 +8,7 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP
// No ASI
[e] = 0
~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'e'.
[e2] = 1
@@ -1,6 +1,6 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName28.ts(2,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName28.ts(2,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName28.ts(2,6): error TS2304: Cannot find name 'e'.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName28.ts(3,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName28.ts(3,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName28.ts(3,6): error TS2304: Cannot find name 'e2'.
@@ -8,12 +8,12 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP
class C {
[e]: number = 0;
~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'e'.
[e2]: number
~~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
~~
!!! error TS2304: Cannot find name 'e2'.
}
@@ -1,7 +1,7 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts(3,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts(3,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts(3,6): error TS2304: Cannot find name 'e'.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts(3,11): error TS2304: Cannot find name 'id'.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts(4,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts(4,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts(4,6): error TS2304: Cannot find name 'e2'.
@@ -10,14 +10,14 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP
// yes ASI
[e] = id++
~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'e'.
~~
!!! error TS2304: Cannot find name 'id'.
[e2]: number
~~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
~~
!!! error TS2304: Cannot find name 'e2'.
}
@@ -1,6 +1,6 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName31.ts(3,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName31.ts(3,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName31.ts(3,6): error TS2304: Cannot find name 'e'.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName31.ts(4,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName31.ts(4,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName31.ts(4,6): error TS2304: Cannot find name 'e2'.
@@ -9,12 +9,12 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP
// yes ASI
[e]: number
~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'e'.
[e2]: number
~~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
~~
!!! error TS2304: Cannot find name 'e2'.
}
@@ -1,4 +1,4 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName32.ts(2,5): error TS1165: Computed property names are not allowed in an ambient context.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName32.ts(2,5): error TS1165: A computed property name in an ambient context must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName32.ts(2,6): error TS2304: Cannot find name 'e'.
@@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP
declare class C {
[e](): number
~~~
!!! error TS1165: Computed property names are not allowed in an ambient context.
!!! error TS1165: A computed property name in an ambient context must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'e'.
}
@@ -1,4 +1,4 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts(2,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts(2,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts(2,6): error TS2304: Cannot find name 'public'.
@@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP
class C {
[public ]: string;
~~~~~~~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
~~~~~~
!!! error TS2304: Cannot find name 'public'.
}
@@ -1,9 +1,9 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName41.ts(2,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName41.ts(2,5): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName41.ts (1 errors) ====
var v = {
[0 in []]: true
~~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
}
@@ -1,4 +1,4 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName7.ts(2,4): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName7.ts(2,4): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName7.ts(2,5): error TS2304: Cannot find name 'e'.
@@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP
class C {
[e]
~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
~
!!! error TS2304: Cannot find name 'e'.
}

Some files were not shown because too many files have changed in this diff Show More