diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e9ed2d889a9..2653b822a5f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2497,7 +2497,7 @@ namespace ts { return (type).intrinsicName === "true" ? createTrue() : createFalse(); } if (type.flags & TypeFlags.UniqueESSymbol) { - return createESSymbolTypeNode(); + return createTypeOperatorNode(SyntaxKind.UniqueKeyword, createKeywordTypeNode(SyntaxKind.SymbolKeyword)); } if (type.flags & TypeFlags.Void) { return createKeywordTypeNode(SyntaxKind.VoidKeyword); @@ -3313,9 +3313,9 @@ namespace ts { writeAnonymousType(type, nextFlags); } else if (type.flags & TypeFlags.UniqueESSymbol) { + writeKeyword(writer, SyntaxKind.UniqueKeyword); + writeSpace(writer); writeKeyword(writer, SyntaxKind.SymbolKeyword); - writePunctuation(writer, SyntaxKind.OpenParenToken); - writePunctuation(writer, SyntaxKind.CloseParenToken); } else if (type.flags & TypeFlags.StringOrNumberLiteral) { writer.writeStringLiteral(literalTypeToString(type)); @@ -4533,7 +4533,7 @@ namespace ts { reportErrorsFromWidening(declaration, type); } - // always widen a unique 'symbol()' type if the type was created for a different declaration. + // always widen a 'unique symbol' type if the type was created for a different declaration. if (type.flags & TypeFlags.UniqueESSymbol && !declaration.type && type.symbol !== getSymbolOfNode(declaration)) { type = esSymbolType; } @@ -5949,7 +5949,9 @@ namespace ts { const modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T' const templateReadonly = !!type.declaration.readonlyToken; const templateOptional = !!type.declaration.questionToken; - if (type.declaration.typeParameter.constraint.kind === SyntaxKind.TypeOperator) { + const constraintDeclaration = type.declaration.typeParameter.constraint; + if (constraintDeclaration.kind === SyntaxKind.TypeOperator && + (constraintDeclaration).operator === SyntaxKind.KeyOfKeyword) { // We have a { [P in keyof T]: X } for (const propertySymbol of getPropertiesOfType(modifiersType)) { addMemberForKeyType(getLiteralTypeFromPropertyName(propertySymbol), propertySymbol); @@ -6024,7 +6026,8 @@ namespace ts { function getModifiersTypeFromMappedType(type: MappedType) { if (!type.modifiersType) { const constraintDeclaration = type.declaration.typeParameter.constraint; - if (constraintDeclaration.kind === SyntaxKind.TypeOperator) { + if (constraintDeclaration.kind === SyntaxKind.TypeOperator && + (constraintDeclaration).operator === SyntaxKind.KeyOfKeyword) { // If the constraint declaration is a 'keyof T' node, the modifiers type is T. We check // AST nodes here because, when T is a non-generic type, the logic below eagerly resolves // 'keyof T' to a literal union type and we can't recover T from that type. @@ -7822,7 +7825,21 @@ namespace ts { function getTypeFromTypeOperatorNode(node: TypeOperatorNode) { const links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); + switch (node.operator) { + case SyntaxKind.KeyOfKeyword: + links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); + break; + case SyntaxKind.UniqueKeyword: + if (node.type.kind === SyntaxKind.SymbolKeyword) { + const parent = skipParentheses(node).parent; + const symbol = getSymbolOfNode(parent); + links.resolvedType = symbol ? getUniqueESSymbolTypeForSymbol(symbol) : esSymbolType; + } + else { + links.resolvedType = unknownType; + } + break; + } } return links.resolvedType; } @@ -8226,21 +8243,6 @@ namespace ts { return esSymbolType; } - function getTypeFromESSymbolTypeNode(node: ESSymbolTypeNode): Type { - const links = getNodeLinks(node); - if (!links.resolvedType) { - const parent = skipParentheses(node).parent; - const symbol = getSymbolOfNode(parent); - if (symbol) { - links.resolvedType = getUniqueESSymbolTypeForSymbol(symbol); - } - else { - links.resolvedType = esSymbolType; - } - } - return links.resolvedType; - } - function getTypeFromJSDocVariadicType(node: JSDocVariadicType): Type { const links = getNodeLinks(node); if (!links.resolvedType) { @@ -8300,8 +8302,6 @@ namespace ts { return getTypeFromThisTypeNode(node as ThisExpression | ThisTypeNode); case SyntaxKind.LiteralType: return getTypeFromLiteralTypeNode(node); - case SyntaxKind.ESSymbolType: - return getTypeFromESSymbolTypeNode(node); case SyntaxKind.TypeReference: return getTypeFromTypeReference(node); case SyntaxKind.TypePredicate: @@ -17313,7 +17313,7 @@ namespace ts { type = checkAwaitedType(type, /*errorNode*/ func, Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } - // widen 'symbol()' types when we infer the return type. + // widen 'unique symbol' types when we infer the return type. type = getWidenedTypeOfUniqueESSymbolType(type); } else { @@ -17349,7 +17349,7 @@ namespace ts { // Return a union of the return expression types. type = getUnionType(types, /*subtypeReduction*/ true); - // widen 'symbol()' types when we infer the return type. + // widen 'unique symbol' types when we infer the return type. type = getWidenedTypeOfUniqueESSymbolType(type); if (functionFlags & FunctionFlags.Generator) { // AsyncGenerator function or Generator function @@ -19428,8 +19428,9 @@ namespace ts { checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint); } - function checkSymbolType(node: ESSymbolTypeNode) { - checkGrammarESSymbolTypeNode(node); + function checkTypeOperator(node: TypeOperatorNode) { + checkGrammarTypeOperatorNode(node); + checkSourceElement(node.type); } function isPrivateWithinAmbient(node: Node): boolean { @@ -23000,8 +23001,9 @@ namespace ts { case SyntaxKind.IntersectionType: return checkUnionOrIntersectionType(node); case SyntaxKind.ParenthesizedType: - case SyntaxKind.TypeOperator: return checkSourceElement((node).type); + case SyntaxKind.TypeOperator: + return checkTypeOperator(node); case SyntaxKind.JSDocAugmentsTag: return checkJSDocAugmentsTag(node as JSDocAugmentsTag); case SyntaxKind.JSDocTypedefTag: @@ -23026,8 +23028,6 @@ namespace ts { return checkIndexedAccessType(node); case SyntaxKind.MappedType: return checkMappedType(node); - case SyntaxKind.ESSymbolType: - return checkSymbolType(node); case SyntaxKind.FunctionDeclaration: return checkFunctionDeclaration(node); case SyntaxKind.Block: @@ -25341,54 +25341,60 @@ namespace ts { } } - function checkGrammarESSymbolTypeNode(node: ESSymbolTypeNode) { - let parent = node.parent; - while (parent.kind === SyntaxKind.ParenthesizedType) { - parent = parent.parent; - } + function checkGrammarTypeOperatorNode(node: TypeOperatorNode) { + if (node.operator === SyntaxKind.UniqueKeyword) { + if (node.type.kind !== SyntaxKind.SymbolKeyword) { + return grammarErrorOnNode(node.type, Diagnostics._0_expected, tokenToString(SyntaxKind.SymbolKeyword)); + } - switch (parent.kind) { - case SyntaxKind.VariableDeclaration: - const decl = parent as VariableDeclaration; - if (decl.name.kind !== SyntaxKind.Identifier) { - return grammarErrorOnNode(node, Diagnostics.Unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); - } - if (!isVariableDeclarationInVariableStatement(decl)) { - return grammarErrorOnNode(node, Diagnostics.Unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement); - } - if (!(decl.parent.flags & NodeFlags.Const)) { - return grammarErrorOnNode((parent).name, Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); - } - break; + let parent = node.parent; + while (parent.kind === SyntaxKind.ParenthesizedType) { + parent = parent.parent; + } - case SyntaxKind.PropertyDeclaration: - if (!hasModifier(parent, ModifierFlags.Static) || - !hasModifier(parent, ModifierFlags.Readonly)) { - return grammarErrorOnNode((parent).name, Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); - } - break; + switch (parent.kind) { + case SyntaxKind.VariableDeclaration: + const decl = parent as VariableDeclaration; + if (decl.name.kind !== SyntaxKind.Identifier) { + return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); + } + if (!isVariableDeclarationInVariableStatement(decl)) { + return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement); + } + if (!(decl.parent.flags & NodeFlags.Const)) { + return grammarErrorOnNode((parent).name, Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); + } + break; - case SyntaxKind.PropertySignature: - if (!hasModifier(parent, ModifierFlags.Readonly)) { - return grammarErrorOnNode((parent).name, Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); - } - break; + case SyntaxKind.PropertyDeclaration: + if (!hasModifier(parent, ModifierFlags.Static) || + !hasModifier(parent, ModifierFlags.Readonly)) { + return grammarErrorOnNode((parent).name, Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); + } + break; - // report specific errors for cases where a `symbol()` type is disallowed even when it is in a `const` or `readonly` declaration. - case SyntaxKind.UnionType: - return grammarErrorOnNode(node, Diagnostics.Unique_symbol_types_are_not_allowed_in_a_union_type); - case SyntaxKind.IntersectionType: - return grammarErrorOnNode(node, Diagnostics.Unique_symbol_types_are_not_allowed_in_an_intersection_type); - case SyntaxKind.ArrayType: - return grammarErrorOnNode(node, Diagnostics.Unique_symbol_types_are_not_allowed_in_an_array_type); - case SyntaxKind.TupleType: - return grammarErrorOnNode(node, Diagnostics.Unique_symbol_types_are_not_allowed_in_a_tuple_type); - case SyntaxKind.MappedType: - return grammarErrorOnNode(node, Diagnostics.Unique_symbol_types_are_not_allowed_in_a_mapped_type); + case SyntaxKind.PropertySignature: + if (!hasModifier(parent, ModifierFlags.Readonly)) { + return grammarErrorOnNode((parent).name, Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); + } + break; - // report a general error for any other invalid use site. - default: - return grammarErrorOnNode(node, Diagnostics.Unique_symbol_types_are_not_allowed_here); + // report specific errors for cases where a `unique symbol` type is disallowed even when it is in a `const` or `readonly` declaration. + case SyntaxKind.UnionType: + return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_not_allowed_in_a_union_type); + case SyntaxKind.IntersectionType: + return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_not_allowed_in_an_intersection_type); + case SyntaxKind.ArrayType: + return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_not_allowed_in_an_array_type); + case SyntaxKind.TupleType: + return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_not_allowed_in_a_tuple_type); + case SyntaxKind.MappedType: + return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_not_allowed_in_a_mapped_type); + + // report a general error for any other invalid use site. + default: + return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_not_allowed_here); + } } } diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 3fb1a5d976e..7928d7ad46a 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -425,8 +425,6 @@ namespace ts { case SyntaxKind.ThisType: case SyntaxKind.LiteralType: return writeTextOfNode(currentText, type); - case SyntaxKind.ESSymbolType: - return write("symbol()"); case SyntaxKind.ExpressionWithTypeArguments: return emitExpressionWithTypeArguments(type); case SyntaxKind.TypeReference: diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e8a37fcbdea..995424e5f99 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -491,23 +491,23 @@ "category": "Error", "code": 1164 }, - "A computed property name in an ambient context must refer to an expression whose type is a literal type or a unique 'symbol()' type.": { + "A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.": { "category": "Error", "code": 1165 }, - "A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type.": { + "A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.": { "category": "Error", "code": 1166 }, - "A computed property name in a method overload must refer to an expression whose type is a literal type or a unique 'symbol()' type.": { + "A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type.": { "category": "Error", "code": 1168 }, - "A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type.": { + "A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.": { "category": "Error", "code": 1169 }, - "A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type.": { + "A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.": { "category": "Error", "code": 1170 }, @@ -907,47 +907,47 @@ "category": "Error", "code": 1328 }, - "Unique 'symbol()' types are not allowed in a union type.": { + "'unique symbol' types are not allowed in a union type.": { "category": "Error", "code": 1329 }, - "Unique 'symbol()' types are not allowed in an intersection type.": { + "'unique symbol' types are not allowed in an intersection type.": { "category": "Error", "code": 1330 }, - "Unique 'symbol()' types are not allowed in an array type.": { + "'unique symbol' types are not allowed in an array type.": { "category": "Error", "code": 1331 }, - "Unique 'symbol()' types are not allowed in a tuple type.": { + "'unique symbol' types are not allowed in a tuple type.": { "category": "Error", "code": 1332 }, - "Unique 'symbol()' types are not allowed in a mapped type.": { + "'unique symbol' types are not allowed in a mapped type.": { "category": "Error", "code": 1333 }, - "A property of an interface or type literal whose type is a unique 'symbol()' type must be 'readonly'.": { + "A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'.": { "category": "Error", "code": 1334 }, - "A property of a class whose type is a unique 'symbol()' type must be both 'static' and 'readonly'.": { + "A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'.": { "category": "Error", "code": 1335 }, - "A variable whose type is a unique 'symbol()' type must be 'const'.": { + "A variable whose type is a 'unique symbol' type must be 'const'.": { "category": "Error", "code": 1336 }, - "Unique 'symbol()' types may not be used on a variable declaration with a binding name.": { + "'unique symbol' types may not be used on a variable declaration with a binding name.": { "category": "Error", "code": 1337 }, - "Unique 'symbol()' types are only allowed on variables in a variable statement.": { + "'unique symbol' types are only allowed on variables in a variable statement.": { "category": "Error", "code": 1338 }, - "Unique 'symbol()' types are not allowed here.": { + "'unique symbol' types are not allowed here.": { "category": "Error", "code": 1339 }, diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index ba39d99ca10..8083b3841c8 100755 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -574,8 +574,6 @@ namespace ts { return emitMappedType(node); case SyntaxKind.LiteralType: return emitLiteralType(node); - case SyntaxKind.ESSymbolType: - return write("symbol()"); // Binding patterns case SyntaxKind.ObjectBindingPattern: diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 926608146c0..7362d565749 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -730,15 +730,17 @@ namespace ts { return createSynthesizedNode(SyntaxKind.ThisType); } - export function createTypeOperatorNode(type: TypeNode) { + export function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; + export function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword, type: TypeNode): TypeOperatorNode; + export function createTypeOperatorNode(operatorOrType: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | TypeNode, type?: TypeNode) { const node = createSynthesizedNode(SyntaxKind.TypeOperator) as TypeOperatorNode; - node.operator = SyntaxKind.KeyOfKeyword; - node.type = parenthesizeElementTypeMember(type); + node.operator = typeof operatorOrType === "number" ? operatorOrType : SyntaxKind.KeyOfKeyword; + node.type = parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } export function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode) { - return node.type !== type ? updateNode(createTypeOperatorNode(type), node) : node; + return node.type !== type ? updateNode(createTypeOperatorNode(node.operator, type), node) : node; } export function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode) { @@ -785,10 +787,6 @@ namespace ts { : node; } - export function createESSymbolTypeNode() { - return createSynthesizedNode(SyntaxKind.ESSymbolType); - } - // Binding Patterns export function createObjectBindingPattern(elements: ReadonlyArray) { diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 5aabc4163e0..337dba57de8 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -2609,19 +2609,6 @@ namespace ts { return token() === SyntaxKind.DotToken ? undefined : node; } - function parseSymbolType(): TypeNode | undefined { - const fullStart = scanner.getStartPos(); - parseExpected(SyntaxKind.SymbolKeyword); - if (token() === SyntaxKind.DotToken) return undefined; - if (parseOptional(SyntaxKind.OpenParenToken)) { - parseExpected(SyntaxKind.CloseParenToken); - return finishNode(createNode(SyntaxKind.ESSymbolType, fullStart)); - } - else { - return finishNode(createNode(SyntaxKind.SymbolKeyword, fullStart)); - } - } - function parseLiteralTypeNode(negative?: boolean): LiteralTypeNode { const node = createNode(SyntaxKind.LiteralType) as LiteralTypeNode; let unaryMinusExpression: PrefixUnaryExpression; @@ -2655,10 +2642,9 @@ namespace ts { case SyntaxKind.UndefinedKeyword: case SyntaxKind.NeverKeyword: case SyntaxKind.ObjectKeyword: - // If these are followed by a dot, then parse these out as a dotted type reference instead. - return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case SyntaxKind.SymbolKeyword: - return tryParse(parseSymbolType) || parseTypeReference(); + // If these are followed by a dot, then parse these out as a dotted type reference instead. + return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case SyntaxKind.AsteriskToken: return parseJSDocAllType(); case SyntaxKind.QuestionToken: @@ -2709,6 +2695,7 @@ namespace ts { case SyntaxKind.NumberKeyword: case SyntaxKind.BooleanKeyword: case SyntaxKind.SymbolKeyword: + case SyntaxKind.UniqueKeyword: case SyntaxKind.VoidKeyword: case SyntaxKind.UndefinedKeyword: case SyntaxKind.NullKeyword: @@ -2794,7 +2781,7 @@ namespace ts { return finishNode(postfix); } - function parseTypeOperator(operator: SyntaxKind.KeyOfKeyword) { + function parseTypeOperator(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword) { const node = createNode(SyntaxKind.TypeOperator); parseExpected(operator); node.operator = operator; @@ -2803,9 +2790,11 @@ namespace ts { } function parseTypeOperatorOrHigher(): TypeNode { - switch (token()) { + const operator = token(); + switch (operator) { case SyntaxKind.KeyOfKeyword: - return parseTypeOperator(SyntaxKind.KeyOfKeyword); + case SyntaxKind.UniqueKeyword: + return parseTypeOperator(operator); } return parsePostfixTypeOrHigher(); } diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index b19a1466328..d7748721ede 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -122,6 +122,7 @@ namespace ts { "type": SyntaxKind.TypeKeyword, "typeof": SyntaxKind.TypeOfKeyword, "undefined": SyntaxKind.UndefinedKeyword, + "unique": SyntaxKind.UniqueKeyword, "var": SyntaxKind.VarKeyword, "void": SyntaxKind.VoidKeyword, "while": SyntaxKind.WhileKeyword, diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 6fa30f547a5..a8e8e79e493 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -199,6 +199,7 @@ namespace ts { SymbolKeyword, TypeKeyword, UndefinedKeyword, + UniqueKeyword, FromKeyword, GlobalKeyword, OfKeyword, // LastKeyword and LastToken @@ -240,7 +241,6 @@ namespace ts { IndexedAccessType, MappedType, LiteralType, - ESSymbolType, // Binding patterns ObjectBindingPattern, ArrayBindingPattern, @@ -399,7 +399,7 @@ namespace ts { FirstFutureReservedWord = ImplementsKeyword, LastFutureReservedWord = YieldKeyword, FirstTypeNode = TypePredicate, - LastTypeNode = ESSymbolType, + LastTypeNode = LiteralType, FirstPunctuation = OpenBraceToken, LastPunctuation = CaretEqualsToken, FirstToken = Unknown, @@ -1030,7 +1030,7 @@ namespace ts { export interface TypeOperatorNode extends TypeNode { kind: SyntaxKind.TypeOperator; - operator: SyntaxKind.KeyOfKeyword; + operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword; type: TypeNode; } @@ -1053,11 +1053,6 @@ namespace ts { literal: BooleanLiteral | LiteralExpression | PrefixUnaryExpression; } - // Represents a unique `symbol()` type - export interface ESSymbolTypeNode extends TypeNode { - kind: SyntaxKind.ESSymbolType; - } - export interface StringLiteral extends LiteralExpression { kind: SyntaxKind.StringLiteral; /* @internal */ textSourceNode?: Identifier | StringLiteral | NumericLiteral; // Allows a StringLiteral to get its text from another node (used by transforms). @@ -3209,7 +3204,7 @@ namespace ts { BooleanLiteral = 1 << 7, EnumLiteral = 1 << 8, // Always combined with StringLiteral, NumberLiteral, or Union ESSymbol = 1 << 9, // Type of symbol primitive introduced in ES6 - UniqueESSymbol = 1 << 10, // symbol() + UniqueESSymbol = 1 << 10, // unique symbol Void = 1 << 11, Undefined = 1 << 12, Null = 1 << 13, diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 78c06778739..63f60edb2dc 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -200,160 +200,161 @@ declare namespace ts { SymbolKeyword = 137, TypeKeyword = 138, UndefinedKeyword = 139, - FromKeyword = 140, - GlobalKeyword = 141, - OfKeyword = 142, - QualifiedName = 143, - ComputedPropertyName = 144, - TypeParameter = 145, - Parameter = 146, - Decorator = 147, - PropertySignature = 148, - PropertyDeclaration = 149, - MethodSignature = 150, - MethodDeclaration = 151, - Constructor = 152, - GetAccessor = 153, - SetAccessor = 154, - CallSignature = 155, - ConstructSignature = 156, - IndexSignature = 157, - TypePredicate = 158, - TypeReference = 159, - FunctionType = 160, - ConstructorType = 161, - TypeQuery = 162, - TypeLiteral = 163, - ArrayType = 164, - TupleType = 165, - UnionType = 166, - IntersectionType = 167, - ParenthesizedType = 168, - ThisType = 169, - TypeOperator = 170, - IndexedAccessType = 171, - MappedType = 172, - LiteralType = 173, - ESSymbolType = 174, - ObjectBindingPattern = 175, - ArrayBindingPattern = 176, - BindingElement = 177, - ArrayLiteralExpression = 178, - ObjectLiteralExpression = 179, - PropertyAccessExpression = 180, - ElementAccessExpression = 181, - CallExpression = 182, - NewExpression = 183, - TaggedTemplateExpression = 184, - TypeAssertionExpression = 185, - ParenthesizedExpression = 186, - FunctionExpression = 187, - ArrowFunction = 188, - DeleteExpression = 189, - TypeOfExpression = 190, - VoidExpression = 191, - AwaitExpression = 192, - PrefixUnaryExpression = 193, - PostfixUnaryExpression = 194, - BinaryExpression = 195, - ConditionalExpression = 196, - TemplateExpression = 197, - YieldExpression = 198, - SpreadElement = 199, - ClassExpression = 200, - OmittedExpression = 201, - ExpressionWithTypeArguments = 202, - AsExpression = 203, - NonNullExpression = 204, - MetaProperty = 205, - TemplateSpan = 206, - SemicolonClassElement = 207, - Block = 208, - VariableStatement = 209, - EmptyStatement = 210, - ExpressionStatement = 211, - IfStatement = 212, - DoStatement = 213, - WhileStatement = 214, - ForStatement = 215, - ForInStatement = 216, - ForOfStatement = 217, - ContinueStatement = 218, - BreakStatement = 219, - ReturnStatement = 220, - WithStatement = 221, - SwitchStatement = 222, - LabeledStatement = 223, - ThrowStatement = 224, - TryStatement = 225, - DebuggerStatement = 226, - VariableDeclaration = 227, - VariableDeclarationList = 228, - FunctionDeclaration = 229, - ClassDeclaration = 230, - InterfaceDeclaration = 231, - TypeAliasDeclaration = 232, - EnumDeclaration = 233, - ModuleDeclaration = 234, - ModuleBlock = 235, - CaseBlock = 236, - NamespaceExportDeclaration = 237, - ImportEqualsDeclaration = 238, - ImportDeclaration = 239, - ImportClause = 240, - NamespaceImport = 241, - NamedImports = 242, - ImportSpecifier = 243, - ExportAssignment = 244, - ExportDeclaration = 245, - NamedExports = 246, - ExportSpecifier = 247, - MissingDeclaration = 248, - ExternalModuleReference = 249, - JsxElement = 250, - JsxSelfClosingElement = 251, - JsxOpeningElement = 252, - JsxClosingElement = 253, - JsxAttribute = 254, - JsxAttributes = 255, - JsxSpreadAttribute = 256, - JsxExpression = 257, - CaseClause = 258, - DefaultClause = 259, - HeritageClause = 260, - CatchClause = 261, - PropertyAssignment = 262, - ShorthandPropertyAssignment = 263, - SpreadAssignment = 264, - EnumMember = 265, - SourceFile = 266, - Bundle = 267, - JSDocTypeExpression = 268, - JSDocAllType = 269, - JSDocUnknownType = 270, - JSDocNullableType = 271, - JSDocNonNullableType = 272, - JSDocOptionalType = 273, - JSDocFunctionType = 274, - JSDocVariadicType = 275, - JSDocComment = 276, - JSDocTag = 277, - JSDocAugmentsTag = 278, - JSDocClassTag = 279, - JSDocParameterTag = 280, - JSDocReturnTag = 281, - JSDocTypeTag = 282, - JSDocTemplateTag = 283, - JSDocTypedefTag = 284, - JSDocPropertyTag = 285, - JSDocTypeLiteral = 286, - SyntaxList = 287, - NotEmittedStatement = 288, - PartiallyEmittedExpression = 289, - CommaListExpression = 290, - MergeDeclarationMarker = 291, - EndOfDeclarationMarker = 292, - Count = 293, + UniqueKeyword = 140, + FromKeyword = 141, + GlobalKeyword = 142, + OfKeyword = 143, + QualifiedName = 144, + ComputedPropertyName = 145, + TypeParameter = 146, + Parameter = 147, + Decorator = 148, + PropertySignature = 149, + PropertyDeclaration = 150, + MethodSignature = 151, + MethodDeclaration = 152, + Constructor = 153, + GetAccessor = 154, + SetAccessor = 155, + CallSignature = 156, + ConstructSignature = 157, + IndexSignature = 158, + TypePredicate = 159, + TypeReference = 160, + FunctionType = 161, + ConstructorType = 162, + TypeQuery = 163, + TypeLiteral = 164, + ArrayType = 165, + TupleType = 166, + UnionType = 167, + IntersectionType = 168, + ParenthesizedType = 169, + ThisType = 170, + TypeOperator = 171, + IndexedAccessType = 172, + MappedType = 173, + LiteralType = 174, + UniqueESSymbolType = 175, + ObjectBindingPattern = 176, + ArrayBindingPattern = 177, + BindingElement = 178, + ArrayLiteralExpression = 179, + ObjectLiteralExpression = 180, + PropertyAccessExpression = 181, + ElementAccessExpression = 182, + CallExpression = 183, + NewExpression = 184, + TaggedTemplateExpression = 185, + TypeAssertionExpression = 186, + ParenthesizedExpression = 187, + FunctionExpression = 188, + ArrowFunction = 189, + DeleteExpression = 190, + TypeOfExpression = 191, + VoidExpression = 192, + AwaitExpression = 193, + PrefixUnaryExpression = 194, + PostfixUnaryExpression = 195, + BinaryExpression = 196, + ConditionalExpression = 197, + TemplateExpression = 198, + YieldExpression = 199, + SpreadElement = 200, + ClassExpression = 201, + OmittedExpression = 202, + ExpressionWithTypeArguments = 203, + AsExpression = 204, + NonNullExpression = 205, + MetaProperty = 206, + TemplateSpan = 207, + SemicolonClassElement = 208, + Block = 209, + VariableStatement = 210, + EmptyStatement = 211, + ExpressionStatement = 212, + IfStatement = 213, + DoStatement = 214, + WhileStatement = 215, + ForStatement = 216, + ForInStatement = 217, + ForOfStatement = 218, + ContinueStatement = 219, + BreakStatement = 220, + ReturnStatement = 221, + WithStatement = 222, + SwitchStatement = 223, + LabeledStatement = 224, + ThrowStatement = 225, + TryStatement = 226, + DebuggerStatement = 227, + VariableDeclaration = 228, + VariableDeclarationList = 229, + FunctionDeclaration = 230, + ClassDeclaration = 231, + InterfaceDeclaration = 232, + TypeAliasDeclaration = 233, + EnumDeclaration = 234, + ModuleDeclaration = 235, + ModuleBlock = 236, + CaseBlock = 237, + NamespaceExportDeclaration = 238, + ImportEqualsDeclaration = 239, + ImportDeclaration = 240, + ImportClause = 241, + NamespaceImport = 242, + NamedImports = 243, + ImportSpecifier = 244, + ExportAssignment = 245, + ExportDeclaration = 246, + NamedExports = 247, + ExportSpecifier = 248, + MissingDeclaration = 249, + ExternalModuleReference = 250, + JsxElement = 251, + JsxSelfClosingElement = 252, + JsxOpeningElement = 253, + JsxClosingElement = 254, + JsxAttribute = 255, + JsxAttributes = 256, + JsxSpreadAttribute = 257, + JsxExpression = 258, + CaseClause = 259, + DefaultClause = 260, + HeritageClause = 261, + CatchClause = 262, + PropertyAssignment = 263, + ShorthandPropertyAssignment = 264, + SpreadAssignment = 265, + EnumMember = 266, + SourceFile = 267, + Bundle = 268, + JSDocTypeExpression = 269, + JSDocAllType = 270, + JSDocUnknownType = 271, + JSDocNullableType = 272, + JSDocNonNullableType = 273, + JSDocOptionalType = 274, + JSDocFunctionType = 275, + JSDocVariadicType = 276, + JSDocComment = 277, + JSDocTag = 278, + JSDocAugmentsTag = 279, + JSDocClassTag = 280, + JSDocParameterTag = 281, + JSDocReturnTag = 282, + JSDocTypeTag = 283, + JSDocTemplateTag = 284, + JSDocTypedefTag = 285, + JSDocPropertyTag = 286, + JSDocTypeLiteral = 287, + SyntaxList = 288, + NotEmittedStatement = 289, + PartiallyEmittedExpression = 290, + CommaListExpression = 291, + MergeDeclarationMarker = 292, + EndOfDeclarationMarker = 293, + Count = 294, FirstAssignment = 58, LastAssignment = 70, FirstCompoundAssignment = 59, @@ -361,15 +362,15 @@ declare namespace ts { FirstReservedWord = 72, LastReservedWord = 107, FirstKeyword = 72, - LastKeyword = 142, + LastKeyword = 143, FirstFutureReservedWord = 108, LastFutureReservedWord = 116, - FirstTypeNode = 158, - LastTypeNode = 174, + FirstTypeNode = 159, + LastTypeNode = 175, FirstPunctuation = 17, LastPunctuation = 70, FirstToken = 0, - LastToken = 142, + LastToken = 143, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -378,11 +379,11 @@ declare namespace ts { LastTemplateToken = 16, FirstBinaryOperator = 27, LastBinaryOperator = 70, - FirstNode = 143, - FirstJSDocNode = 268, - LastJSDocNode = 286, - FirstJSDocTagNode = 277, - LastJSDocTagNode = 286, + FirstNode = 144, + FirstJSDocNode = 269, + LastJSDocNode = 287, + FirstJSDocTagNode = 278, + LastJSDocTagNode = 287, } enum NodeFlags { None = 0, @@ -756,8 +757,8 @@ declare namespace ts { kind: SyntaxKind.LiteralType; literal: BooleanLiteral | LiteralExpression | PrefixUnaryExpression; } - interface ESSymbolTypeNode extends TypeNode { - kind: SyntaxKind.ESSymbolType; + interface UniqueESSymbolTypeNode extends TypeNode { + kind: SyntaxKind.UniqueESSymbolType; } interface StringLiteral extends LiteralExpression { kind: SyntaxKind.StringLiteral; @@ -3336,7 +3337,7 @@ declare namespace ts { function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; function createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode; function updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralTypeNode["literal"]): LiteralTypeNode; - function createESSymbolTypeNode(): ESSymbolTypeNode; + function createUniqueESSymbolTypeNode(): UniqueESSymbolTypeNode; function createObjectBindingPattern(elements: ReadonlyArray): ObjectBindingPattern; function updateObjectBindingPattern(node: ObjectBindingPattern, elements: ReadonlyArray): ObjectBindingPattern; function createArrayBindingPattern(elements: ReadonlyArray): ArrayBindingPattern; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 2be759e509e..6f88bf241ee 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -200,160 +200,161 @@ declare namespace ts { SymbolKeyword = 137, TypeKeyword = 138, UndefinedKeyword = 139, - FromKeyword = 140, - GlobalKeyword = 141, - OfKeyword = 142, - QualifiedName = 143, - ComputedPropertyName = 144, - TypeParameter = 145, - Parameter = 146, - Decorator = 147, - PropertySignature = 148, - PropertyDeclaration = 149, - MethodSignature = 150, - MethodDeclaration = 151, - Constructor = 152, - GetAccessor = 153, - SetAccessor = 154, - CallSignature = 155, - ConstructSignature = 156, - IndexSignature = 157, - TypePredicate = 158, - TypeReference = 159, - FunctionType = 160, - ConstructorType = 161, - TypeQuery = 162, - TypeLiteral = 163, - ArrayType = 164, - TupleType = 165, - UnionType = 166, - IntersectionType = 167, - ParenthesizedType = 168, - ThisType = 169, - TypeOperator = 170, - IndexedAccessType = 171, - MappedType = 172, - LiteralType = 173, - ESSymbolType = 174, - ObjectBindingPattern = 175, - ArrayBindingPattern = 176, - BindingElement = 177, - ArrayLiteralExpression = 178, - ObjectLiteralExpression = 179, - PropertyAccessExpression = 180, - ElementAccessExpression = 181, - CallExpression = 182, - NewExpression = 183, - TaggedTemplateExpression = 184, - TypeAssertionExpression = 185, - ParenthesizedExpression = 186, - FunctionExpression = 187, - ArrowFunction = 188, - DeleteExpression = 189, - TypeOfExpression = 190, - VoidExpression = 191, - AwaitExpression = 192, - PrefixUnaryExpression = 193, - PostfixUnaryExpression = 194, - BinaryExpression = 195, - ConditionalExpression = 196, - TemplateExpression = 197, - YieldExpression = 198, - SpreadElement = 199, - ClassExpression = 200, - OmittedExpression = 201, - ExpressionWithTypeArguments = 202, - AsExpression = 203, - NonNullExpression = 204, - MetaProperty = 205, - TemplateSpan = 206, - SemicolonClassElement = 207, - Block = 208, - VariableStatement = 209, - EmptyStatement = 210, - ExpressionStatement = 211, - IfStatement = 212, - DoStatement = 213, - WhileStatement = 214, - ForStatement = 215, - ForInStatement = 216, - ForOfStatement = 217, - ContinueStatement = 218, - BreakStatement = 219, - ReturnStatement = 220, - WithStatement = 221, - SwitchStatement = 222, - LabeledStatement = 223, - ThrowStatement = 224, - TryStatement = 225, - DebuggerStatement = 226, - VariableDeclaration = 227, - VariableDeclarationList = 228, - FunctionDeclaration = 229, - ClassDeclaration = 230, - InterfaceDeclaration = 231, - TypeAliasDeclaration = 232, - EnumDeclaration = 233, - ModuleDeclaration = 234, - ModuleBlock = 235, - CaseBlock = 236, - NamespaceExportDeclaration = 237, - ImportEqualsDeclaration = 238, - ImportDeclaration = 239, - ImportClause = 240, - NamespaceImport = 241, - NamedImports = 242, - ImportSpecifier = 243, - ExportAssignment = 244, - ExportDeclaration = 245, - NamedExports = 246, - ExportSpecifier = 247, - MissingDeclaration = 248, - ExternalModuleReference = 249, - JsxElement = 250, - JsxSelfClosingElement = 251, - JsxOpeningElement = 252, - JsxClosingElement = 253, - JsxAttribute = 254, - JsxAttributes = 255, - JsxSpreadAttribute = 256, - JsxExpression = 257, - CaseClause = 258, - DefaultClause = 259, - HeritageClause = 260, - CatchClause = 261, - PropertyAssignment = 262, - ShorthandPropertyAssignment = 263, - SpreadAssignment = 264, - EnumMember = 265, - SourceFile = 266, - Bundle = 267, - JSDocTypeExpression = 268, - JSDocAllType = 269, - JSDocUnknownType = 270, - JSDocNullableType = 271, - JSDocNonNullableType = 272, - JSDocOptionalType = 273, - JSDocFunctionType = 274, - JSDocVariadicType = 275, - JSDocComment = 276, - JSDocTag = 277, - JSDocAugmentsTag = 278, - JSDocClassTag = 279, - JSDocParameterTag = 280, - JSDocReturnTag = 281, - JSDocTypeTag = 282, - JSDocTemplateTag = 283, - JSDocTypedefTag = 284, - JSDocPropertyTag = 285, - JSDocTypeLiteral = 286, - SyntaxList = 287, - NotEmittedStatement = 288, - PartiallyEmittedExpression = 289, - CommaListExpression = 290, - MergeDeclarationMarker = 291, - EndOfDeclarationMarker = 292, - Count = 293, + UniqueKeyword = 140, + FromKeyword = 141, + GlobalKeyword = 142, + OfKeyword = 143, + QualifiedName = 144, + ComputedPropertyName = 145, + TypeParameter = 146, + Parameter = 147, + Decorator = 148, + PropertySignature = 149, + PropertyDeclaration = 150, + MethodSignature = 151, + MethodDeclaration = 152, + Constructor = 153, + GetAccessor = 154, + SetAccessor = 155, + CallSignature = 156, + ConstructSignature = 157, + IndexSignature = 158, + TypePredicate = 159, + TypeReference = 160, + FunctionType = 161, + ConstructorType = 162, + TypeQuery = 163, + TypeLiteral = 164, + ArrayType = 165, + TupleType = 166, + UnionType = 167, + IntersectionType = 168, + ParenthesizedType = 169, + ThisType = 170, + TypeOperator = 171, + IndexedAccessType = 172, + MappedType = 173, + LiteralType = 174, + UniqueESSymbolType = 175, + ObjectBindingPattern = 176, + ArrayBindingPattern = 177, + BindingElement = 178, + ArrayLiteralExpression = 179, + ObjectLiteralExpression = 180, + PropertyAccessExpression = 181, + ElementAccessExpression = 182, + CallExpression = 183, + NewExpression = 184, + TaggedTemplateExpression = 185, + TypeAssertionExpression = 186, + ParenthesizedExpression = 187, + FunctionExpression = 188, + ArrowFunction = 189, + DeleteExpression = 190, + TypeOfExpression = 191, + VoidExpression = 192, + AwaitExpression = 193, + PrefixUnaryExpression = 194, + PostfixUnaryExpression = 195, + BinaryExpression = 196, + ConditionalExpression = 197, + TemplateExpression = 198, + YieldExpression = 199, + SpreadElement = 200, + ClassExpression = 201, + OmittedExpression = 202, + ExpressionWithTypeArguments = 203, + AsExpression = 204, + NonNullExpression = 205, + MetaProperty = 206, + TemplateSpan = 207, + SemicolonClassElement = 208, + Block = 209, + VariableStatement = 210, + EmptyStatement = 211, + ExpressionStatement = 212, + IfStatement = 213, + DoStatement = 214, + WhileStatement = 215, + ForStatement = 216, + ForInStatement = 217, + ForOfStatement = 218, + ContinueStatement = 219, + BreakStatement = 220, + ReturnStatement = 221, + WithStatement = 222, + SwitchStatement = 223, + LabeledStatement = 224, + ThrowStatement = 225, + TryStatement = 226, + DebuggerStatement = 227, + VariableDeclaration = 228, + VariableDeclarationList = 229, + FunctionDeclaration = 230, + ClassDeclaration = 231, + InterfaceDeclaration = 232, + TypeAliasDeclaration = 233, + EnumDeclaration = 234, + ModuleDeclaration = 235, + ModuleBlock = 236, + CaseBlock = 237, + NamespaceExportDeclaration = 238, + ImportEqualsDeclaration = 239, + ImportDeclaration = 240, + ImportClause = 241, + NamespaceImport = 242, + NamedImports = 243, + ImportSpecifier = 244, + ExportAssignment = 245, + ExportDeclaration = 246, + NamedExports = 247, + ExportSpecifier = 248, + MissingDeclaration = 249, + ExternalModuleReference = 250, + JsxElement = 251, + JsxSelfClosingElement = 252, + JsxOpeningElement = 253, + JsxClosingElement = 254, + JsxAttribute = 255, + JsxAttributes = 256, + JsxSpreadAttribute = 257, + JsxExpression = 258, + CaseClause = 259, + DefaultClause = 260, + HeritageClause = 261, + CatchClause = 262, + PropertyAssignment = 263, + ShorthandPropertyAssignment = 264, + SpreadAssignment = 265, + EnumMember = 266, + SourceFile = 267, + Bundle = 268, + JSDocTypeExpression = 269, + JSDocAllType = 270, + JSDocUnknownType = 271, + JSDocNullableType = 272, + JSDocNonNullableType = 273, + JSDocOptionalType = 274, + JSDocFunctionType = 275, + JSDocVariadicType = 276, + JSDocComment = 277, + JSDocTag = 278, + JSDocAugmentsTag = 279, + JSDocClassTag = 280, + JSDocParameterTag = 281, + JSDocReturnTag = 282, + JSDocTypeTag = 283, + JSDocTemplateTag = 284, + JSDocTypedefTag = 285, + JSDocPropertyTag = 286, + JSDocTypeLiteral = 287, + SyntaxList = 288, + NotEmittedStatement = 289, + PartiallyEmittedExpression = 290, + CommaListExpression = 291, + MergeDeclarationMarker = 292, + EndOfDeclarationMarker = 293, + Count = 294, FirstAssignment = 58, LastAssignment = 70, FirstCompoundAssignment = 59, @@ -361,15 +362,15 @@ declare namespace ts { FirstReservedWord = 72, LastReservedWord = 107, FirstKeyword = 72, - LastKeyword = 142, + LastKeyword = 143, FirstFutureReservedWord = 108, LastFutureReservedWord = 116, - FirstTypeNode = 158, - LastTypeNode = 174, + FirstTypeNode = 159, + LastTypeNode = 175, FirstPunctuation = 17, LastPunctuation = 70, FirstToken = 0, - LastToken = 142, + LastToken = 143, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -378,11 +379,11 @@ declare namespace ts { LastTemplateToken = 16, FirstBinaryOperator = 27, LastBinaryOperator = 70, - FirstNode = 143, - FirstJSDocNode = 268, - LastJSDocNode = 286, - FirstJSDocTagNode = 277, - LastJSDocTagNode = 286, + FirstNode = 144, + FirstJSDocNode = 269, + LastJSDocNode = 287, + FirstJSDocTagNode = 278, + LastJSDocTagNode = 287, } enum NodeFlags { None = 0, @@ -756,8 +757,8 @@ declare namespace ts { kind: SyntaxKind.LiteralType; literal: BooleanLiteral | LiteralExpression | PrefixUnaryExpression; } - interface ESSymbolTypeNode extends TypeNode { - kind: SyntaxKind.ESSymbolType; + interface UniqueESSymbolTypeNode extends TypeNode { + kind: SyntaxKind.UniqueESSymbolType; } interface StringLiteral extends LiteralExpression { kind: SyntaxKind.StringLiteral; @@ -3283,7 +3284,7 @@ declare namespace ts { function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; function createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode; function updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralTypeNode["literal"]): LiteralTypeNode; - function createESSymbolTypeNode(): ESSymbolTypeNode; + function createUniqueESSymbolTypeNode(): UniqueESSymbolTypeNode; function createObjectBindingPattern(elements: ReadonlyArray): ObjectBindingPattern; function updateObjectBindingPattern(node: ObjectBindingPattern, elements: ReadonlyArray): ObjectBindingPattern; function createArrayBindingPattern(elements: ReadonlyArray): ArrayBindingPattern; diff --git a/tests/baselines/reference/capturedParametersInInitializers2.errors.txt b/tests/baselines/reference/capturedParametersInInitializers2.errors.txt index 0cf6c7f07c1..70435b77cee 100644 --- a/tests/baselines/reference/capturedParametersInInitializers2.errors.txt +++ b/tests/baselines/reference/capturedParametersInInitializers2.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/capturedParametersInInitializers2.ts(1,36): error TS2373: Initializer of parameter 'y' cannot reference identifier 'x' declared after it. -tests/cases/compiler/capturedParametersInInitializers2.ts(4,26): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/compiler/capturedParametersInInitializers2.ts(4,26): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ==== tests/cases/compiler/capturedParametersInInitializers2.ts (2 errors) ==== @@ -10,5 +10,5 @@ tests/cases/compiler/capturedParametersInInitializers2.ts(4,26): error TS1166: A } function foo2(y = class {[x] = x}, x = 1) { ~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. } \ No newline at end of file diff --git a/tests/baselines/reference/complicatedPrivacy.errors.txt b/tests/baselines/reference/complicatedPrivacy.errors.txt index 2848a11b2a4..750beb1994d 100644 --- a/tests/baselines/reference/complicatedPrivacy.errors.txt +++ b/tests/baselines/reference/complicatedPrivacy.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/complicatedPrivacy.ts(11,24): error TS1054: A 'get' accessor cannot have parameters. -tests/cases/compiler/complicatedPrivacy.ts(35,5): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/compiler/complicatedPrivacy.ts(35,5): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/compiler/complicatedPrivacy.ts(35,6): error TS2693: 'number' only refers to a type, but is being used as a value here. tests/cases/compiler/complicatedPrivacy.ts(73,55): error TS2694: Namespace 'mglo5' has no exported member 'i6'. @@ -43,7 +43,7 @@ tests/cases/compiler/complicatedPrivacy.ts(73,55): error TS2694: Namespace 'mglo { [number]: C1; // Used to be indexer, now it is a computed property ~~~~~~~~ -!!! error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. ~~~~~~ !!! error TS2693: 'number' only refers to a type, but is being used as a value here. }) { diff --git a/tests/baselines/reference/computedPropertyNames12_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames12_ES5.errors.txt index bee9a01bcd4..309b734dfea 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames12_ES5.errors.txt @@ -1,12 +1,12 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(5,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(6,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(7,12): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(8,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(9,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(12,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(13,12): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(14,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(15,12): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(5,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(6,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(7,12): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(8,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(9,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(12,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(13,12): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(14,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(15,12): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts (9 errors) ==== @@ -16,31 +16,31 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(15 class C { [s]: number; ~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. [n] = n; ~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. static [s + s]: string; ~~~~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. [s + n] = 2; ~~~~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. [+s]: typeof s; ~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. static [""]: number; [0]: number; [a]: number; ~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. static [true]: number; ~~~~~~~~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. [`hello bye`] = 0; ~~~~~~~~~~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. static [`hello ${a} bye`] = 0 ~~~~~~~~~~~~~~~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames12_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames12_ES6.errors.txt index a81279994c2..13920995eaa 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames12_ES6.errors.txt @@ -1,12 +1,12 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(5,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(6,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(7,12): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(8,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(9,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(12,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(13,12): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(14,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(15,12): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(5,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(6,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(7,12): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(8,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(9,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(12,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(13,12): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(14,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(15,12): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts (9 errors) ==== @@ -16,31 +16,31 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(15 class C { [s]: number; ~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. [n] = n; ~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. static [s + s]: string; ~~~~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. [s + n] = 2; ~~~~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. [+s]: typeof s; ~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. static [""]: number; [0]: number; [a]: number; ~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. static [true]: number; ~~~~~~~~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. [`hello bye`] = 0; ~~~~~~~~~~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. static [`hello ${a} bye`] = 0 ~~~~~~~~~~~~~~~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames35_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames35_ES5.errors.txt index 730594d0df9..47ad09c51e3 100644 --- a/tests/baselines/reference/computedPropertyNames35_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames35_ES5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames35_ES5.ts(4,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames35_ES5.ts(4,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/conformance/es6/computedProperties/computedPropertyNames35_ES5.ts(4,10): error TS2467: A computed property name cannot reference a type parameter from its containing type. @@ -8,7 +8,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames35_ES5.ts(4, bar(): string; [foo()](): void; ~~~~~~~~~~ -!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2467: A computed property name cannot reference a type parameter from its containing type. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames35_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames35_ES6.errors.txt index 11e9b35eeb6..8a0be33325c 100644 --- a/tests/baselines/reference/computedPropertyNames35_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames35_ES6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames35_ES6.ts(4,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNames35_ES6.ts(4,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/conformance/es6/computedProperties/computedPropertyNames35_ES6.ts(4,10): error TS2467: A computed property name cannot reference a type parameter from its containing type. @@ -8,7 +8,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames35_ES6.ts(4, bar(): string; [foo()](): void; ~~~~~~~~~~ -!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2467: A computed property name cannot reference a type parameter from its containing type. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5.errors.txt b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5.errors.txt index 888f29c4dde..8ac89ebdb19 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit3_ES5.ts(2,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit3_ES5.ts(2,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit3_ES5.ts (1 errors) ==== interface I { ["" + ""](): void; ~~~~~~~~~ -!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES6.errors.txt b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES6.errors.txt index 70b2a3e2e16..79b0971d0b7 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES6.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit3_ES6.ts(2,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit3_ES6.ts(2,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit3_ES6.ts (1 errors) ==== interface I { ["" + ""](): void; ~~~~~~~~~ -!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5.errors.txt b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5.errors.txt index b9fad3157a9..be1543e81eb 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit4_ES5.ts(2,5): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit4_ES5.ts(2,5): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit4_ES5.ts (1 errors) ==== var v: { ["" + ""](): void; ~~~~~~~~~ -!!! error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES6.errors.txt b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES6.errors.txt index 94b904274ec..51daaef725f 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES6.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit4_ES6.ts(2,5): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit4_ES6.ts(2,5): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit4_ES6.ts (1 errors) ==== var v: { ["" + ""](): void; ~~~~~~~~~ -!!! error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.errors.txt b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.errors.txt index cf6c9801074..cdd5577f011 100644 --- a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_ES5.ts(4,5): error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_ES5.ts(5,5): error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_ES5.ts(4,5): error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_ES5.ts(5,5): error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_ES5.ts (2 errors) ==== @@ -8,9 +8,9 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_ class C { [methodName](v: string); ~~~~~~~~~~~~ -!!! error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type. [methodName](); ~~~~~~~~~~~~ -!!! error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type. [methodName](v?: string) { } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.errors.txt b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.errors.txt index 656a1d2b17e..3f31d408810 100644 --- a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_ES6.ts(4,5): error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_ES6.ts(5,5): error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_ES6.ts(4,5): error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_ES6.ts(5,5): error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_ES6.ts (2 errors) ==== @@ -8,9 +8,9 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_ class C { [methodName](v: string); ~~~~~~~~~~~~ -!!! error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type. [methodName](); ~~~~~~~~~~~~ -!!! error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type. [methodName](v?: string) { } } \ No newline at end of file diff --git a/tests/baselines/reference/dynamicNames.js b/tests/baselines/reference/dynamicNames.js index 979ed0c1beb..869f7282639 100644 --- a/tests/baselines/reference/dynamicNames.js +++ b/tests/baselines/reference/dynamicNames.js @@ -189,7 +189,7 @@ exports.o2 = exports.o1; //// [module.d.ts] export declare const c0 = "a"; export declare const c1 = 1; -export declare const s0: symbol(); +export declare const s0: unique symbol; export interface T0 { [c0]: number; [c1]: string; diff --git a/tests/baselines/reference/dynamicNames.types b/tests/baselines/reference/dynamicNames.types index 98d5617093f..07d46736978 100644 --- a/tests/baselines/reference/dynamicNames.types +++ b/tests/baselines/reference/dynamicNames.types @@ -8,8 +8,8 @@ export const c1 = 1; >1 : 1 export const s0 = Symbol(); ->s0 : symbol() ->Symbol() : symbol() +>s0 : unique symbol +>Symbol() : unique symbol >Symbol : SymbolConstructor export interface T0 { @@ -22,7 +22,7 @@ export interface T0 { >c1 : 1 [s0]: boolean; ->s0 : symbol() +>s0 : unique symbol } export declare class T1 implements T2 { >T1 : T1 @@ -35,7 +35,7 @@ export declare class T1 implements T2 { >c1 : 1 [s0]: boolean; ->s0 : symbol() +>s0 : unique symbol } export declare class T2 extends T1 { >T2 : T2 @@ -51,7 +51,7 @@ export declare type T3 = { >c1 : 1 [s0]: boolean; ->s0 : symbol() +>s0 : unique symbol }; @@ -59,7 +59,7 @@ export declare type T3 = { import { c0, c1, s0, T0, T1, T2, T3 } from "./module"; >c0 : "a" >c1 : 1 ->s0 : symbol() +>s0 : unique symbol >T0 : any >T1 : typeof T1 >T2 : typeof T2 @@ -80,9 +80,9 @@ namespace N { >1 : 1 export const s1: typeof s0 = s0; ->s1 : symbol() ->s0 : symbol() ->s0 : symbol() +>s1 : unique symbol +>s0 : unique symbol +>s0 : unique symbol export interface T4 { >T4 : T4 @@ -98,9 +98,9 @@ namespace N { >c3 : 1 [N.s1]: boolean; ->N.s1 : symbol() +>N.s1 : unique symbol >N : typeof N ->s1 : symbol() +>s1 : unique symbol } export declare class T5 implements T4 { >T5 : T5 @@ -117,9 +117,9 @@ namespace N { >c3 : 1 [N.s1]: boolean; ->N.s1 : symbol() +>N.s1 : unique symbol >N : typeof N ->s1 : symbol() +>s1 : unique symbol } export declare class T6 extends T5 { >T6 : T6 @@ -139,9 +139,9 @@ namespace N { >c3 : 1 [N.s1]: boolean; ->N.s1 : symbol() +>N.s1 : unique symbol >N : typeof N ->s1 : symbol() +>s1 : unique symbol }; } @@ -155,9 +155,9 @@ export const c5 = 1; >1 : 1 export const s2: typeof s0 = s0; ->s2 : symbol() ->s0 : symbol() ->s0 : symbol() +>s2 : unique symbol +>s0 : unique symbol +>s0 : unique symbol interface T8 { >T8 : T8 @@ -169,7 +169,7 @@ interface T8 { >c5 : 1 [s2]: boolean; ->s2 : symbol() +>s2 : unique symbol } declare class T9 implements T8 { >T9 : T9 @@ -182,7 +182,7 @@ declare class T9 implements T8 { >c5 : 1 [s2]: boolean; ->s2 : symbol() +>s2 : unique symbol } declare class T10 extends T9 { >T10 : T10 @@ -198,7 +198,7 @@ declare type T11 = { >c5 : 1 [s2]: boolean; ->s2 : symbol() +>s2 : unique symbol }; @@ -210,7 +210,7 @@ interface T12 { 1: string; [s2]: boolean; ->s2 : symbol() +>s2 : unique symbol } declare class T13 implements T2 { >T13 : T13 @@ -221,7 +221,7 @@ declare class T13 implements T2 { 1: string; [s2]: boolean; ->s2 : symbol() +>s2 : unique symbol } declare class T14 extends T13 { >T14 : T14 @@ -235,7 +235,7 @@ declare type T15 = { 1: string; [s2]: boolean; ->s2 : symbol() +>s2 : unique symbol }; @@ -473,7 +473,7 @@ export const o1 = { >"a" : "a" [s2]: true ->s2 : symbol() +>s2 : unique symbol >true : true }; @@ -495,7 +495,7 @@ export const o1_s2 = o1[s2]; >o1_s2 : boolean >o1[s2] : boolean >o1 : { [c4]: number; [c5]: string; [s2]: boolean; } ->s2 : symbol() +>s2 : unique symbol export const o2: T0 = o1; >o2 : T0 diff --git a/tests/baselines/reference/giant.errors.txt b/tests/baselines/reference/giant.errors.txt index d465bd8a958..eb899ff132e 100644 --- a/tests/baselines/reference/giant.errors.txt +++ b/tests/baselines/reference/giant.errors.txt @@ -16,7 +16,7 @@ tests/cases/compiler/giant.ts(33,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(34,12): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(35,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(35,16): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(60,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/compiler/giant.ts(60,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/compiler/giant.ts(60,6): error TS2304: Cannot find name 'p'. tests/cases/compiler/giant.ts(61,5): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(62,6): error TS1096: An index signature must have exactly one parameter. @@ -39,7 +39,7 @@ tests/cases/compiler/giant.ts(97,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(98,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(99,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(99,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(124,9): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/compiler/giant.ts(124,9): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/compiler/giant.ts(124,10): error TS2304: Cannot find name 'p'. tests/cases/compiler/giant.ts(125,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(126,10): error TS1096: An index signature must have exactly one parameter. @@ -63,7 +63,7 @@ tests/cases/compiler/giant.ts(176,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(177,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(178,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(178,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(203,9): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/compiler/giant.ts(203,9): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/compiler/giant.ts(203,10): error TS2304: Cannot find name 'p'. tests/cases/compiler/giant.ts(204,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(205,10): error TS1096: An index signature must have exactly one parameter. @@ -119,7 +119,7 @@ tests/cases/compiler/giant.ts(291,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(292,12): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(293,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(293,16): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(318,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/compiler/giant.ts(318,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/compiler/giant.ts(318,6): error TS2304: Cannot find name 'p'. tests/cases/compiler/giant.ts(319,5): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(320,6): error TS1096: An index signature must have exactly one parameter. @@ -142,7 +142,7 @@ tests/cases/compiler/giant.ts(355,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(356,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(357,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(357,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(382,9): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/compiler/giant.ts(382,9): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/compiler/giant.ts(382,10): error TS2304: Cannot find name 'p'. tests/cases/compiler/giant.ts(383,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(384,10): error TS1096: An index signature must have exactly one parameter. @@ -166,7 +166,7 @@ tests/cases/compiler/giant.ts(434,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(435,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(436,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(436,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(461,9): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/compiler/giant.ts(461,9): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/compiler/giant.ts(461,10): error TS2304: Cannot find name 'p'. tests/cases/compiler/giant.ts(462,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(463,10): error TS1096: An index signature must have exactly one parameter. @@ -238,7 +238,7 @@ tests/cases/compiler/giant.ts(555,21): error TS1036: Statements are not allowed tests/cases/compiler/giant.ts(557,24): error TS1183: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(560,21): error TS1183: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(562,21): error TS1183: An implementation cannot be declared in ambient contexts. -tests/cases/compiler/giant.ts(586,9): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/compiler/giant.ts(586,9): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/compiler/giant.ts(586,10): error TS2304: Cannot find name 'p'. tests/cases/compiler/giant.ts(587,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(588,10): error TS1096: An index signature must have exactly one parameter. @@ -255,7 +255,7 @@ tests/cases/compiler/giant.ts(620,26): error TS1183: An implementation cannot be tests/cases/compiler/giant.ts(622,24): error TS1183: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(625,21): error TS1183: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(627,21): error TS1183: An implementation cannot be declared in ambient contexts. -tests/cases/compiler/giant.ts(652,9): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/compiler/giant.ts(652,9): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/compiler/giant.ts(652,10): error TS2304: Cannot find name 'p'. tests/cases/compiler/giant.ts(653,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(654,10): error TS1096: An index signature must have exactly one parameter. @@ -363,7 +363,7 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be //Index Signature [p]; ~~~ -!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'p'. [p1: string]; @@ -473,7 +473,7 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be //Index Signature [p]; ~~~ -!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'p'. [p1: string]; @@ -600,7 +600,7 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be //Index Signature [p]; ~~~ -!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'p'. [p1: string]; @@ -827,7 +827,7 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be //Index Signature [p]; ~~~ -!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'p'. [p1: string]; @@ -937,7 +937,7 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be //Index Signature [p]; ~~~ -!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'p'. [p1: string]; @@ -1064,7 +1064,7 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be //Index Signature [p]; ~~~ -!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'p'. [p1: string]; @@ -1333,7 +1333,7 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be //Index Signature [p]; ~~~ -!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'p'. [p1: string]; @@ -1433,7 +1433,7 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be //Index Signature [p]; ~~~ -!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'p'. [p1: string]; diff --git a/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt b/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt index 7c5502967e1..bc18e0fb084 100644 --- a/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt +++ b/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(3,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(3,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(9,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! 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: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'x'. diff --git a/tests/baselines/reference/indexSignatureWithInitializer.errors.txt b/tests/baselines/reference/indexSignatureWithInitializer.errors.txt index e24d2163ad9..a2e78df0ed8 100644 --- a/tests/baselines/reference/indexSignatureWithInitializer.errors.txt +++ b/tests/baselines/reference/indexSignatureWithInitializer.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/indexSignatureWithInitializer.ts(3,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/compiler/indexSignatureWithInitializer.ts(3,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/compiler/indexSignatureWithInitializer.ts(3,6): error TS2304: Cannot find name 'x'. -tests/cases/compiler/indexSignatureWithInitializer.ts(7,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/compiler/indexSignatureWithInitializer.ts(7,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! 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: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'x'. } \ No newline at end of file diff --git a/tests/baselines/reference/indexWithoutParamType2.errors.txt b/tests/baselines/reference/indexWithoutParamType2.errors.txt index 64c4e43db84..5463980d66d 100644 --- a/tests/baselines/reference/indexWithoutParamType2.errors.txt +++ b/tests/baselines/reference/indexWithoutParamType2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/indexWithoutParamType2.ts(3,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/compiler/indexWithoutParamType2.ts(3,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'x'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName10.errors.txt b/tests/baselines/reference/parserComputedPropertyName10.errors.txt index 18c612291a4..c8ca89f4002 100644 --- a/tests/baselines/reference/parserComputedPropertyName10.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName10.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName10.ts(2,4): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName10.ts(2,4): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName11.errors.txt b/tests/baselines/reference/parserComputedPropertyName11.errors.txt index c9ff2faf43e..abbb667723b 100644 --- a/tests/baselines/reference/parserComputedPropertyName11.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName11.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName11.ts(2,4): error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName11.ts(2,4): error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a method overload must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName13.errors.txt b/tests/baselines/reference/parserComputedPropertyName13.errors.txt index ba15de5feaf..65fa109c348 100644 --- a/tests/baselines/reference/parserComputedPropertyName13.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName13.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName13.ts(1,10): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName13.ts(1,10): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName14.errors.txt b/tests/baselines/reference/parserComputedPropertyName14.errors.txt index 082f9f2dce4..668e1542c62 100644 --- a/tests/baselines/reference/parserComputedPropertyName14.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName14.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName14.ts(1,10): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName14.ts(1,10): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName15.errors.txt b/tests/baselines/reference/parserComputedPropertyName15.errors.txt index 7d9c7e8e5de..2311fcafc34 100644 --- a/tests/baselines/reference/parserComputedPropertyName15.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName15.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName15.ts(1,31): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName15.ts(1,31): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName18.errors.txt b/tests/baselines/reference/parserComputedPropertyName18.errors.txt index 715bb5dd437..8730dd60774 100644 --- a/tests/baselines/reference/parserComputedPropertyName18.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName18.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName18.ts(1,10): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName18.ts(1,10): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName19.errors.txt b/tests/baselines/reference/parserComputedPropertyName19.errors.txt index 626dbe78c5a..d7b2e25377d 100644 --- a/tests/baselines/reference/parserComputedPropertyName19.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName19.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName19.ts(1,10): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName19.ts(1,10): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName20.errors.txt b/tests/baselines/reference/parserComputedPropertyName20.errors.txt index 67bb57c519c..972457d8fbb 100644 --- a/tests/baselines/reference/parserComputedPropertyName20.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName20.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName20.ts(2,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName20.ts(2,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName21.errors.txt b/tests/baselines/reference/parserComputedPropertyName21.errors.txt index a67bf8e7799..52c26498999 100644 --- a/tests/baselines/reference/parserComputedPropertyName21.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName21.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName21.ts(2,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName21.ts(2,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName22.errors.txt b/tests/baselines/reference/parserComputedPropertyName22.errors.txt index 44add808580..866468aa53d 100644 --- a/tests/baselines/reference/parserComputedPropertyName22.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName22.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName22.ts(2,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName22.ts(2,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName25.errors.txt b/tests/baselines/reference/parserComputedPropertyName25.errors.txt index c88eb3aea11..d6bbb52ff7c 100644 --- a/tests/baselines/reference/parserComputedPropertyName25.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName25.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName25.ts(3,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName25.ts(3,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. [e2] = 1 diff --git a/tests/baselines/reference/parserComputedPropertyName28.errors.txt b/tests/baselines/reference/parserComputedPropertyName28.errors.txt index 3aa13e0dfdb..df9202df567 100644 --- a/tests/baselines/reference/parserComputedPropertyName28.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName28.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName28.ts(2,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName28.ts(2,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName28.ts(3,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. [e2]: number ~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~~ !!! error TS2304: Cannot find name 'e2'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName29.errors.txt b/tests/baselines/reference/parserComputedPropertyName29.errors.txt index bbb27f8f7bf..53800078b5e 100644 --- a/tests/baselines/reference/parserComputedPropertyName29.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName29.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts(3,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts(3,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts(4,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. ~~ !!! error TS2304: Cannot find name 'id'. [e2]: number ~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~~ !!! error TS2304: Cannot find name 'e2'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName31.errors.txt b/tests/baselines/reference/parserComputedPropertyName31.errors.txt index aaa88696965..57591fd4d94 100644 --- a/tests/baselines/reference/parserComputedPropertyName31.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName31.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName31.ts(3,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName31.ts(3,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName31.ts(4,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. [e2]: number ~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~~ !!! error TS2304: Cannot find name 'e2'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName32.errors.txt b/tests/baselines/reference/parserComputedPropertyName32.errors.txt index 3bc47afd90d..5d762d5ecc8 100644 --- a/tests/baselines/reference/parserComputedPropertyName32.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName32.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName32.ts(2,5): error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName32.ts(2,5): error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in an ambient context must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName36.errors.txt b/tests/baselines/reference/parserComputedPropertyName36.errors.txt index e746b5e4f54..9fbd7f565ad 100644 --- a/tests/baselines/reference/parserComputedPropertyName36.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName36.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts(2,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts(2,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts(2,6): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts(2,6): error TS2304: Cannot find name 'public'. @@ -7,7 +7,7 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP class C { [public ]: string; ~~~~~~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~~~~~~ !!! error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. ~~~~~~ diff --git a/tests/baselines/reference/parserComputedPropertyName7.errors.txt b/tests/baselines/reference/parserComputedPropertyName7.errors.txt index 2fc7fd03463..4fd7f320f26 100644 --- a/tests/baselines/reference/parserComputedPropertyName7.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName7.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName7.ts(2,4): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName7.ts(2,4): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. 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: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName8.errors.txt b/tests/baselines/reference/parserComputedPropertyName8.errors.txt index 0a57a6decbd..a846f858ea7 100644 --- a/tests/baselines/reference/parserComputedPropertyName8.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName8.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName8.ts(2,11): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName8.ts(2,11): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName8.ts(2,12): error TS2304: Cannot find name 'e'. @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP class C { public [e] ~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName9.errors.txt b/tests/baselines/reference/parserComputedPropertyName9.errors.txt index 8d283a5f1b8..8d0390053f1 100644 --- a/tests/baselines/reference/parserComputedPropertyName9.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName9.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName9.ts(2,4): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName9.ts(2,4): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName9.ts(2,5): error TS2304: Cannot find name 'e'. tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName9.ts(2,9): error TS2304: Cannot find name 'Type'. @@ -7,7 +7,7 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP class C { [e]: Type ~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. ~~~~ diff --git a/tests/baselines/reference/parserES5ComputedPropertyName1.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName1.errors.txt index 997587b0c79..7b1f9cb1832 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName1.errors.txt +++ b/tests/baselines/reference/parserES5ComputedPropertyName1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName1.ts(2,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName1.ts(2,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName1.ts(2,6): error TS2304: Cannot find name 'e'. @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5Comput declare class C { [e]: number ~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName10.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName10.errors.txt index 233e665d9bf..6fcb462d9e3 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName10.errors.txt +++ b/tests/baselines/reference/parserES5ComputedPropertyName10.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName10.ts(2,4): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName10.ts(2,4): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName10.ts(2,5): error TS2304: Cannot find name 'e'. @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5Comput class C { [e] = 1 ~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName11.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName11.errors.txt index a8ba9113ea6..2bd17b3f4ca 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName11.errors.txt +++ b/tests/baselines/reference/parserES5ComputedPropertyName11.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName11.ts(2,4): error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName11.ts(2,4): error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName11.ts(2,5): error TS2304: Cannot find name 'e'. @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5Comput class C { [e](); ~~~ -!!! error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1168: A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName5.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName5.errors.txt index c92babd424d..3c7cdfd38a3 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName5.errors.txt +++ b/tests/baselines/reference/parserES5ComputedPropertyName5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName5.ts(2,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName5.ts(2,5): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName5.ts(2,6): error TS2304: Cannot find name 'e'. @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5Comput interface I { [e]: number ~~~ -!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName7.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName7.errors.txt index d776c7921ea..487e84cccbf 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName7.errors.txt +++ b/tests/baselines/reference/parserES5ComputedPropertyName7.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName7.ts(2,4): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName7.ts(2,4): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName7.ts(2,5): error TS2304: Cannot find name 'e'. @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5Comput class C { [e] ~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName8.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName8.errors.txt index d8f152c6b5a..6057d4f7cd3 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName8.errors.txt +++ b/tests/baselines/reference/parserES5ComputedPropertyName8.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName8.ts(1,10): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName8.ts(1,10): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName8.ts(1,11): error TS2304: Cannot find name 'e'. ==== tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName8.ts (2 errors) ==== var v: { [e]: number }; ~~~ -!!! error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName9.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName9.errors.txt index f4a6da790c0..cb08a497e1c 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName9.errors.txt +++ b/tests/baselines/reference/parserES5ComputedPropertyName9.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName9.ts(2,4): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName9.ts(2,4): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName9.ts(2,5): error TS2304: Cannot find name 'e'. tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName9.ts(2,9): error TS2304: Cannot find name 'Type'. @@ -7,7 +7,7 @@ tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5Comput class C { [e]: Type ~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'e'. ~~~~ diff --git a/tests/baselines/reference/parserIndexSignature11.errors.txt b/tests/baselines/reference/parserIndexSignature11.errors.txt index 43f593c731a..1f525522357 100644 --- a/tests/baselines/reference/parserIndexSignature11.errors.txt +++ b/tests/baselines/reference/parserIndexSignature11.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature11.ts(2,9): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature11.ts(2,9): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature11.ts(2,10): error TS2304: Cannot find name 'p'. tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature11.ts(3,9): error TS1021: An index signature must have a type annotation. tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature11.ts(4,10): error TS1096: An index signature must have exactly one parameter. @@ -8,7 +8,7 @@ tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature1 interface I { [p]; // Used to be indexer, now it is a computed property ~~~ -!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'p'. [p1: string]; diff --git a/tests/baselines/reference/parserIndexSignature4.errors.txt b/tests/baselines/reference/parserIndexSignature4.errors.txt index 2a102bd4c6a..8bc0d9c40ea 100644 --- a/tests/baselines/reference/parserIndexSignature4.errors.txt +++ b/tests/baselines/reference/parserIndexSignature4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature4.ts(2,3): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature4.ts(2,3): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature4.ts(2,4): error TS2304: Cannot find name 'a'. @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature4 interface I { [a = 0] // Used to be indexer, now it is a computed property ~~~~~~~ -!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'a'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserIndexSignature5.errors.txt b/tests/baselines/reference/parserIndexSignature5.errors.txt index 2870258489c..c868ecc48e3 100644 --- a/tests/baselines/reference/parserIndexSignature5.errors.txt +++ b/tests/baselines/reference/parserIndexSignature5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature5.ts(2,3): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature5.ts(2,3): error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature5.ts(2,4): error TS2304: Cannot find name 'a'. @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature5 interface I { [a] // Used to be indexer, now it is a computed property ~~~ -!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type. ~ !!! error TS2304: Cannot find name 'a'. } \ No newline at end of file diff --git a/tests/baselines/reference/propertyAssignment.errors.txt b/tests/baselines/reference/propertyAssignment.errors.txt index 74a8c9d46ac..cb1b31ddb4d 100644 --- a/tests/baselines/reference/propertyAssignment.errors.txt +++ b/tests/baselines/reference/propertyAssignment.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/propertyAssignment.ts(4,13): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/compiler/propertyAssignment.ts(4,13): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. tests/cases/compiler/propertyAssignment.ts(4,14): error TS2304: Cannot find name 'index'. tests/cases/compiler/propertyAssignment.ts(12,1): error TS2322: Type '{ x: number; }' is not assignable to type 'new () => any'. Type '{ x: number; }' provides no match for the signature 'new (): any'. @@ -12,7 +12,7 @@ tests/cases/compiler/propertyAssignment.ts(14,1): error TS2322: Type '{ x: numbe var foo2: { [index]; } // should be an error, used to be indexer, now it is a computed property ~~~~~~~ -!!! error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. ~~~~~ !!! error TS2304: Cannot find name 'index'. var bar2: { x : number; } diff --git a/tests/baselines/reference/symbolProperty7.errors.txt b/tests/baselines/reference/symbolProperty7.errors.txt index b2a182aa3bb..bf6065a89d9 100644 --- a/tests/baselines/reference/symbolProperty7.errors.txt +++ b/tests/baselines/reference/symbolProperty7.errors.txt @@ -1,15 +1,15 @@ -tests/cases/conformance/es6/Symbols/symbolProperty7.ts(2,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. -tests/cases/conformance/es6/Symbols/symbolProperty7.ts(3,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +tests/cases/conformance/es6/Symbols/symbolProperty7.ts(2,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. +tests/cases/conformance/es6/Symbols/symbolProperty7.ts(3,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. ==== tests/cases/conformance/es6/Symbols/symbolProperty7.ts (2 errors) ==== class C { [Symbol()] = 0; ~~~~~~~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. [Symbol()]: number; ~~~~~~~~~~ -!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a unique 'symbol()' type. +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. [Symbol()]() { } get [Symbol()]() { return 0; diff --git a/tests/baselines/reference/uniqueSymbols.js b/tests/baselines/reference/uniqueSymbols.js index 88282afb60e..7da555e6b1f 100644 --- a/tests/baselines/reference/uniqueSymbols.js +++ b/tests/baselines/reference/uniqueSymbols.js @@ -5,10 +5,10 @@ let letCall = Symbol(); var varCall = Symbol(); // ambient declaration with type -declare const constType: symbol(); +declare const constType: unique symbol; // declaration with type and call initializer -const constTypeAndCall: symbol() = Symbol(); +const constTypeAndCall: unique symbol = Symbol(); // declaration from initializer const constInitToConstCall = constCall; @@ -57,8 +57,8 @@ async function* asyncGenFuncYieldVarCall() { yield varCall; } // classes class C { static readonly readonlyStaticCall = Symbol(); - static readonly readonlyStaticType: symbol(); - static readonly readonlyStaticTypeAndCall: symbol() = Symbol(); + static readonly readonlyStaticType: unique symbol; + static readonly readonlyStaticTypeAndCall: unique symbol = Symbol(); static readwriteStaticCall = Symbol(); readonly readonlyCall = Symbol(); @@ -85,7 +85,7 @@ const constInitToCReadwriteCallWithIndexedAccess: C["readwriteCall"] = c.readwri // interfaces interface I { - readonly readonlyType: symbol(); + readonly readonlyType: unique symbol; } declare const i: I; @@ -95,9 +95,9 @@ const constInitToIReadonlyTypeWithIndexedAccess: I["readonlyType"] = i.readonlyT // type literals type L = { - readonly readonlyType: symbol(); + readonly readonlyType: unique symbol; nested: { - readonly readonlyNestedType: symbol(); + readonly readonlyNestedType: unique symbol; } }; declare const l: L; @@ -195,11 +195,11 @@ const arrayOfConstCall = [constCall]; //// [uniqueSymbols.d.ts] -declare const constCall: symbol(); +declare const constCall: unique symbol; declare let letCall: symbol; declare var varCall: symbol; -declare const constType: symbol(); -declare const constTypeAndCall: symbol(); +declare const constType: unique symbol; +declare const constTypeAndCall: unique symbol; declare const constInitToConstCall: symbol; declare const constInitToLetCall: symbol; declare const constInitToVarCall: symbol; @@ -229,9 +229,9 @@ declare function asyncGenFuncYieldConstCall(): AsyncIterableIterator; declare function asyncGenFuncYieldLetCall(): AsyncIterableIterator; declare function asyncGenFuncYieldVarCall(): AsyncIterableIterator; declare class C { - static readonly readonlyStaticCall: symbol(); - static readonly readonlyStaticType: symbol(); - static readonly readonlyStaticTypeAndCall: symbol(); + static readonly readonlyStaticCall: unique symbol; + static readonly readonlyStaticType: unique symbol; + static readonly readonlyStaticTypeAndCall: unique symbol; static readwriteStaticCall: symbol; readonly readonlyCall: symbol; readwriteCall: symbol; @@ -252,16 +252,16 @@ declare const constInitToCReadwriteCallWithTypeQuery: typeof c.readwriteCall; declare const constInitToCReadonlyCallWithIndexedAccess: C["readonlyCall"]; declare const constInitToCReadwriteCallWithIndexedAccess: C["readwriteCall"]; interface I { - readonly readonlyType: symbol(); + readonly readonlyType: unique symbol; } declare const i: I; declare const constInitToIReadonlyType: symbol; declare const constInitToIReadonlyTypeWithTypeQuery: typeof i.readonlyType; declare const constInitToIReadonlyTypeWithIndexedAccess: I["readonlyType"]; declare type L = { - readonly readonlyType: symbol(); + readonly readonlyType: unique symbol; nested: { - readonly readonlyNestedType: symbol(); + readonly readonlyNestedType: unique symbol; }; }; declare const l: L; diff --git a/tests/baselines/reference/uniqueSymbols.symbols b/tests/baselines/reference/uniqueSymbols.symbols index 9831e201ece..970938094ca 100644 --- a/tests/baselines/reference/uniqueSymbols.symbols +++ b/tests/baselines/reference/uniqueSymbols.symbols @@ -13,11 +13,11 @@ var varCall = Symbol(); >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) // ambient declaration with type -declare const constType: symbol(); +declare const constType: unique symbol; >constType : Symbol(constType, Decl(uniqueSymbols.ts, 6, 13)) // declaration with type and call initializer -const constTypeAndCall: symbol() = Symbol(); +const constTypeAndCall: unique symbol = Symbol(); >constTypeAndCall : Symbol(constTypeAndCall, Decl(uniqueSymbols.ts, 9, 5)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) @@ -154,15 +154,15 @@ class C { >readonlyStaticCall : Symbol(C.readonlyStaticCall, Decl(uniqueSymbols.ts, 56, 9)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) - static readonly readonlyStaticType: symbol(); + static readonly readonlyStaticType: unique symbol; >readonlyStaticType : Symbol(C.readonlyStaticType, Decl(uniqueSymbols.ts, 57, 50)) - static readonly readonlyStaticTypeAndCall: symbol() = Symbol(); ->readonlyStaticTypeAndCall : Symbol(C.readonlyStaticTypeAndCall, Decl(uniqueSymbols.ts, 58, 49)) + static readonly readonlyStaticTypeAndCall: unique symbol = Symbol(); +>readonlyStaticTypeAndCall : Symbol(C.readonlyStaticTypeAndCall, Decl(uniqueSymbols.ts, 58, 54)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) static readwriteStaticCall = Symbol(); ->readwriteStaticCall : Symbol(C.readwriteStaticCall, Decl(uniqueSymbols.ts, 59, 67)) +>readwriteStaticCall : Symbol(C.readwriteStaticCall, Decl(uniqueSymbols.ts, 59, 72)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) readonly readonlyCall = Symbol(); @@ -191,15 +191,15 @@ const constInitToCReadonlyStaticType = C.readonlyStaticType; const constInitToCReadonlyStaticTypeAndCall = C.readonlyStaticTypeAndCall; >constInitToCReadonlyStaticTypeAndCall : Symbol(constInitToCReadonlyStaticTypeAndCall, Decl(uniqueSymbols.ts, 69, 5)) ->C.readonlyStaticTypeAndCall : Symbol(C.readonlyStaticTypeAndCall, Decl(uniqueSymbols.ts, 58, 49)) +>C.readonlyStaticTypeAndCall : Symbol(C.readonlyStaticTypeAndCall, Decl(uniqueSymbols.ts, 58, 54)) >C : Symbol(C, Decl(uniqueSymbols.ts, 53, 61)) ->readonlyStaticTypeAndCall : Symbol(C.readonlyStaticTypeAndCall, Decl(uniqueSymbols.ts, 58, 49)) +>readonlyStaticTypeAndCall : Symbol(C.readonlyStaticTypeAndCall, Decl(uniqueSymbols.ts, 58, 54)) const constInitToCReadwriteStaticCall = C.readwriteStaticCall; >constInitToCReadwriteStaticCall : Symbol(constInitToCReadwriteStaticCall, Decl(uniqueSymbols.ts, 70, 5)) ->C.readwriteStaticCall : Symbol(C.readwriteStaticCall, Decl(uniqueSymbols.ts, 59, 67)) +>C.readwriteStaticCall : Symbol(C.readwriteStaticCall, Decl(uniqueSymbols.ts, 59, 72)) >C : Symbol(C, Decl(uniqueSymbols.ts, 53, 61)) ->readwriteStaticCall : Symbol(C.readwriteStaticCall, Decl(uniqueSymbols.ts, 59, 67)) +>readwriteStaticCall : Symbol(C.readwriteStaticCall, Decl(uniqueSymbols.ts, 59, 72)) const constInitToCReadonlyStaticCallWithTypeQuery: typeof C.readonlyStaticCall = C.readonlyStaticCall; >constInitToCReadonlyStaticCallWithTypeQuery : Symbol(constInitToCReadonlyStaticCallWithTypeQuery, Decl(uniqueSymbols.ts, 72, 5)) @@ -221,21 +221,21 @@ const constInitToCReadonlyStaticTypeWithTypeQuery: typeof C.readonlyStaticType = const constInitToCReadonlyStaticTypeAndCallWithTypeQuery: typeof C.readonlyStaticTypeAndCall = C.readonlyStaticTypeAndCall; >constInitToCReadonlyStaticTypeAndCallWithTypeQuery : Symbol(constInitToCReadonlyStaticTypeAndCallWithTypeQuery, Decl(uniqueSymbols.ts, 74, 5)) ->C.readonlyStaticTypeAndCall : Symbol(C.readonlyStaticTypeAndCall, Decl(uniqueSymbols.ts, 58, 49)) +>C.readonlyStaticTypeAndCall : Symbol(C.readonlyStaticTypeAndCall, Decl(uniqueSymbols.ts, 58, 54)) >C : Symbol(C, Decl(uniqueSymbols.ts, 53, 61)) ->readonlyStaticTypeAndCall : Symbol(C.readonlyStaticTypeAndCall, Decl(uniqueSymbols.ts, 58, 49)) ->C.readonlyStaticTypeAndCall : Symbol(C.readonlyStaticTypeAndCall, Decl(uniqueSymbols.ts, 58, 49)) +>readonlyStaticTypeAndCall : Symbol(C.readonlyStaticTypeAndCall, Decl(uniqueSymbols.ts, 58, 54)) +>C.readonlyStaticTypeAndCall : Symbol(C.readonlyStaticTypeAndCall, Decl(uniqueSymbols.ts, 58, 54)) >C : Symbol(C, Decl(uniqueSymbols.ts, 53, 61)) ->readonlyStaticTypeAndCall : Symbol(C.readonlyStaticTypeAndCall, Decl(uniqueSymbols.ts, 58, 49)) +>readonlyStaticTypeAndCall : Symbol(C.readonlyStaticTypeAndCall, Decl(uniqueSymbols.ts, 58, 54)) const constInitToCReadwriteStaticCallWithTypeQuery: typeof C.readwriteStaticCall = C.readwriteStaticCall; >constInitToCReadwriteStaticCallWithTypeQuery : Symbol(constInitToCReadwriteStaticCallWithTypeQuery, Decl(uniqueSymbols.ts, 75, 5)) ->C.readwriteStaticCall : Symbol(C.readwriteStaticCall, Decl(uniqueSymbols.ts, 59, 67)) +>C.readwriteStaticCall : Symbol(C.readwriteStaticCall, Decl(uniqueSymbols.ts, 59, 72)) >C : Symbol(C, Decl(uniqueSymbols.ts, 53, 61)) ->readwriteStaticCall : Symbol(C.readwriteStaticCall, Decl(uniqueSymbols.ts, 59, 67)) ->C.readwriteStaticCall : Symbol(C.readwriteStaticCall, Decl(uniqueSymbols.ts, 59, 67)) +>readwriteStaticCall : Symbol(C.readwriteStaticCall, Decl(uniqueSymbols.ts, 59, 72)) +>C.readwriteStaticCall : Symbol(C.readwriteStaticCall, Decl(uniqueSymbols.ts, 59, 72)) >C : Symbol(C, Decl(uniqueSymbols.ts, 53, 61)) ->readwriteStaticCall : Symbol(C.readwriteStaticCall, Decl(uniqueSymbols.ts, 59, 67)) +>readwriteStaticCall : Symbol(C.readwriteStaticCall, Decl(uniqueSymbols.ts, 59, 72)) const constInitToCReadonlyCall = c.readonlyCall; >constInitToCReadonlyCall : Symbol(constInitToCReadonlyCall, Decl(uniqueSymbols.ts, 77, 5)) @@ -285,7 +285,7 @@ const constInitToCReadwriteCallWithIndexedAccess: C["readwriteCall"] = c.readwri interface I { >I : Symbol(I, Decl(uniqueSymbols.ts, 82, 87)) - readonly readonlyType: symbol(); + readonly readonlyType: unique symbol; >readonlyType : Symbol(I.readonlyType, Decl(uniqueSymbols.ts, 85, 13)) } declare const i: I; @@ -318,13 +318,13 @@ const constInitToIReadonlyTypeWithIndexedAccess: I["readonlyType"] = i.readonlyT type L = { >L : Symbol(L, Decl(uniqueSymbols.ts, 92, 84)) - readonly readonlyType: symbol(); + readonly readonlyType: unique symbol; >readonlyType : Symbol(readonlyType, Decl(uniqueSymbols.ts, 95, 10)) nested: { ->nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 36)) +>nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 41)) - readonly readonlyNestedType: symbol(); + readonly readonlyNestedType: unique symbol; >readonlyNestedType : Symbol(readonlyNestedType, Decl(uniqueSymbols.ts, 97, 13)) } }; @@ -341,9 +341,9 @@ const constInitToLReadonlyType = l.readonlyType; const constInitToLReadonlyNestedType = l.nested.readonlyNestedType; >constInitToLReadonlyNestedType : Symbol(constInitToLReadonlyNestedType, Decl(uniqueSymbols.ts, 104, 5)) >l.nested.readonlyNestedType : Symbol(readonlyNestedType, Decl(uniqueSymbols.ts, 97, 13)) ->l.nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 36)) +>l.nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 41)) >l : Symbol(l, Decl(uniqueSymbols.ts, 101, 13)) ->nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 36)) +>nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 41)) >readonlyNestedType : Symbol(readonlyNestedType, Decl(uniqueSymbols.ts, 97, 13)) const constInitToLReadonlyTypeWithTypeQuery: typeof l.readonlyType = l.readonlyType; @@ -358,14 +358,14 @@ const constInitToLReadonlyTypeWithTypeQuery: typeof l.readonlyType = l.readonlyT const constInitToLReadonlyNestedTypeWithTypeQuery: typeof l.nested.readonlyNestedType = l.nested.readonlyNestedType; >constInitToLReadonlyNestedTypeWithTypeQuery : Symbol(constInitToLReadonlyNestedTypeWithTypeQuery, Decl(uniqueSymbols.ts, 106, 5)) >l.nested.readonlyNestedType : Symbol(readonlyNestedType, Decl(uniqueSymbols.ts, 97, 13)) ->l.nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 36)) +>l.nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 41)) >l : Symbol(l, Decl(uniqueSymbols.ts, 101, 13)) ->nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 36)) +>nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 41)) >readonlyNestedType : Symbol(readonlyNestedType, Decl(uniqueSymbols.ts, 97, 13)) >l.nested.readonlyNestedType : Symbol(readonlyNestedType, Decl(uniqueSymbols.ts, 97, 13)) ->l.nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 36)) +>l.nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 41)) >l : Symbol(l, Decl(uniqueSymbols.ts, 101, 13)) ->nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 36)) +>nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 41)) >readonlyNestedType : Symbol(readonlyNestedType, Decl(uniqueSymbols.ts, 97, 13)) const constInitToLReadonlyTypeWithIndexedAccess: L["readonlyType"] = l.readonlyType; @@ -379,9 +379,9 @@ const constInitToLReadonlyNestedTypeWithIndexedAccess: L["nested"]["readonlyNest >constInitToLReadonlyNestedTypeWithIndexedAccess : Symbol(constInitToLReadonlyNestedTypeWithIndexedAccess, Decl(uniqueSymbols.ts, 108, 5)) >L : Symbol(L, Decl(uniqueSymbols.ts, 92, 84)) >l.nested.readonlyNestedType : Symbol(readonlyNestedType, Decl(uniqueSymbols.ts, 97, 13)) ->l.nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 36)) +>l.nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 41)) >l : Symbol(l, Decl(uniqueSymbols.ts, 101, 13)) ->nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 36)) +>nested : Symbol(nested, Decl(uniqueSymbols.ts, 96, 41)) >readonlyNestedType : Symbol(readonlyNestedType, Decl(uniqueSymbols.ts, 97, 13)) // type argument inference diff --git a/tests/baselines/reference/uniqueSymbols.types b/tests/baselines/reference/uniqueSymbols.types index c9ccf9baaac..495cf583294 100644 --- a/tests/baselines/reference/uniqueSymbols.types +++ b/tests/baselines/reference/uniqueSymbols.types @@ -1,8 +1,8 @@ === tests/cases/conformance/types/uniqueSymbol/uniqueSymbols.ts === // declarations with call initializer const constCall = Symbol(); ->constCall : symbol() ->Symbol() : symbol() +>constCall : unique symbol +>Symbol() : unique symbol >Symbol : SymbolConstructor let letCall = Symbol(); @@ -16,19 +16,19 @@ var varCall = Symbol(); >Symbol : SymbolConstructor // ambient declaration with type -declare const constType: symbol(); ->constType : symbol() +declare const constType: unique symbol; +>constType : unique symbol // declaration with type and call initializer -const constTypeAndCall: symbol() = Symbol(); ->constTypeAndCall : symbol() ->Symbol() : symbol() +const constTypeAndCall: unique symbol = Symbol(); +>constTypeAndCall : unique symbol +>Symbol() : unique symbol >Symbol : SymbolConstructor // declaration from initializer const constInitToConstCall = constCall; >constInitToConstCall : symbol ->constCall : symbol() +>constCall : unique symbol const constInitToLetCall = letCall; >constInitToLetCall : symbol @@ -40,11 +40,11 @@ const constInitToVarCall = varCall; const constInitToConstDeclAmbient = constType; >constInitToConstDeclAmbient : symbol ->constType : symbol() +>constType : unique symbol let letInitToConstCall = constCall; >letInitToConstCall : symbol ->constCall : symbol() +>constCall : unique symbol let letInitToLetCall = letCall; >letInitToLetCall : symbol @@ -56,11 +56,11 @@ let letInitToVarCall = varCall; let letInitToConstDeclAmbient = constType; >letInitToConstDeclAmbient : symbol ->constType : symbol() +>constType : unique symbol var varInitToConstCall = constCall; >varInitToConstCall : symbol ->constCall : symbol() +>constCall : unique symbol var varInitToLetCall = letCall; >varInitToLetCall : symbol @@ -72,23 +72,23 @@ var varInitToVarCall = varCall; var varInitToConstDeclAmbient = constType; >varInitToConstDeclAmbient : symbol ->constType : symbol() +>constType : unique symbol // declaration from initializer with type query const constInitToConstCallWithTypeQuery: typeof constCall = constCall; ->constInitToConstCallWithTypeQuery : symbol() ->constCall : symbol() ->constCall : symbol() +>constInitToConstCallWithTypeQuery : unique symbol +>constCall : unique symbol +>constCall : unique symbol const constInitToConstDeclAmbientWithTypeQuery: typeof constType = constType; ->constInitToConstDeclAmbientWithTypeQuery : symbol() ->constType : symbol() ->constType : symbol() +>constInitToConstDeclAmbientWithTypeQuery : unique symbol +>constType : unique symbol +>constType : unique symbol // function return inference function funcReturnConstCall() { return constCall; } >funcReturnConstCall : () => symbol ->constCall : symbol() +>constCall : unique symbol function funcReturnLetCall() { return letCall; } >funcReturnLetCall : () => symbol @@ -100,15 +100,15 @@ function funcReturnVarCall() { return varCall; } // function return value with type query function funcReturnConstCallWithTypeQuery(): typeof constCall { return constCall; } ->funcReturnConstCallWithTypeQuery : () => symbol() ->constCall : symbol() ->constCall : symbol() +>funcReturnConstCallWithTypeQuery : () => unique symbol +>constCall : unique symbol +>constCall : unique symbol // generator function yield inference function* genFuncYieldConstCall() { yield constCall; } >genFuncYieldConstCall : () => IterableIterator >yield constCall : any ->constCall : symbol() +>constCall : unique symbol function* genFuncYieldLetCall() { yield letCall; } >genFuncYieldLetCall : () => IterableIterator @@ -122,16 +122,16 @@ function* genFuncYieldVarCall() { yield varCall; } // generator function yield with return type query function* genFuncYieldConstCallWithTypeQuery(): IterableIterator { yield constCall; } ->genFuncYieldConstCallWithTypeQuery : () => IterableIterator +>genFuncYieldConstCallWithTypeQuery : () => IterableIterator >IterableIterator : IterableIterator ->constCall : symbol() +>constCall : unique symbol >yield constCall : any ->constCall : symbol() +>constCall : unique symbol // async function return inference async function asyncFuncReturnConstCall() { return constCall; } >asyncFuncReturnConstCall : () => Promise ->constCall : symbol() +>constCall : unique symbol async function asyncFuncReturnLetCall() { return letCall; } >asyncFuncReturnLetCall : () => Promise @@ -145,7 +145,7 @@ async function asyncFuncReturnVarCall() { return varCall; } async function* asyncGenFuncYieldConstCall() { yield constCall; } >asyncGenFuncYieldConstCall : () => AsyncIterableIterator >yield constCall : any ->constCall : symbol() +>constCall : unique symbol async function* asyncGenFuncYieldLetCall() { yield letCall; } >asyncGenFuncYieldLetCall : () => AsyncIterableIterator @@ -162,16 +162,16 @@ class C { >C : C static readonly readonlyStaticCall = Symbol(); ->readonlyStaticCall : symbol() ->Symbol() : symbol() +>readonlyStaticCall : unique symbol +>Symbol() : unique symbol >Symbol : SymbolConstructor - static readonly readonlyStaticType: symbol(); ->readonlyStaticType : symbol() + static readonly readonlyStaticType: unique symbol; +>readonlyStaticType : unique symbol - static readonly readonlyStaticTypeAndCall: symbol() = Symbol(); ->readonlyStaticTypeAndCall : symbol() ->Symbol() : symbol() + static readonly readonlyStaticTypeAndCall: unique symbol = Symbol(); +>readonlyStaticTypeAndCall : unique symbol +>Symbol() : unique symbol >Symbol : SymbolConstructor static readwriteStaticCall = Symbol(); @@ -195,21 +195,21 @@ declare const c: C; const constInitToCReadonlyStaticCall = C.readonlyStaticCall; >constInitToCReadonlyStaticCall : symbol ->C.readonlyStaticCall : symbol() +>C.readonlyStaticCall : unique symbol >C : typeof C ->readonlyStaticCall : symbol() +>readonlyStaticCall : unique symbol const constInitToCReadonlyStaticType = C.readonlyStaticType; >constInitToCReadonlyStaticType : symbol ->C.readonlyStaticType : symbol() +>C.readonlyStaticType : unique symbol >C : typeof C ->readonlyStaticType : symbol() +>readonlyStaticType : unique symbol const constInitToCReadonlyStaticTypeAndCall = C.readonlyStaticTypeAndCall; >constInitToCReadonlyStaticTypeAndCall : symbol ->C.readonlyStaticTypeAndCall : symbol() +>C.readonlyStaticTypeAndCall : unique symbol >C : typeof C ->readonlyStaticTypeAndCall : symbol() +>readonlyStaticTypeAndCall : unique symbol const constInitToCReadwriteStaticCall = C.readwriteStaticCall; >constInitToCReadwriteStaticCall : symbol @@ -218,31 +218,31 @@ const constInitToCReadwriteStaticCall = C.readwriteStaticCall; >readwriteStaticCall : symbol const constInitToCReadonlyStaticCallWithTypeQuery: typeof C.readonlyStaticCall = C.readonlyStaticCall; ->constInitToCReadonlyStaticCallWithTypeQuery : symbol() ->C.readonlyStaticCall : symbol() +>constInitToCReadonlyStaticCallWithTypeQuery : unique symbol +>C.readonlyStaticCall : unique symbol >C : typeof C ->readonlyStaticCall : symbol() ->C.readonlyStaticCall : symbol() +>readonlyStaticCall : unique symbol +>C.readonlyStaticCall : unique symbol >C : typeof C ->readonlyStaticCall : symbol() +>readonlyStaticCall : unique symbol const constInitToCReadonlyStaticTypeWithTypeQuery: typeof C.readonlyStaticType = C.readonlyStaticType; ->constInitToCReadonlyStaticTypeWithTypeQuery : symbol() ->C.readonlyStaticType : symbol() +>constInitToCReadonlyStaticTypeWithTypeQuery : unique symbol +>C.readonlyStaticType : unique symbol >C : typeof C ->readonlyStaticType : symbol() ->C.readonlyStaticType : symbol() +>readonlyStaticType : unique symbol +>C.readonlyStaticType : unique symbol >C : typeof C ->readonlyStaticType : symbol() +>readonlyStaticType : unique symbol const constInitToCReadonlyStaticTypeAndCallWithTypeQuery: typeof C.readonlyStaticTypeAndCall = C.readonlyStaticTypeAndCall; ->constInitToCReadonlyStaticTypeAndCallWithTypeQuery : symbol() ->C.readonlyStaticTypeAndCall : symbol() +>constInitToCReadonlyStaticTypeAndCallWithTypeQuery : unique symbol +>C.readonlyStaticTypeAndCall : unique symbol >C : typeof C ->readonlyStaticTypeAndCall : symbol() ->C.readonlyStaticTypeAndCall : symbol() +>readonlyStaticTypeAndCall : unique symbol +>C.readonlyStaticTypeAndCall : unique symbol >C : typeof C ->readonlyStaticTypeAndCall : symbol() +>readonlyStaticTypeAndCall : unique symbol const constInitToCReadwriteStaticCallWithTypeQuery: typeof C.readwriteStaticCall = C.readwriteStaticCall; >constInitToCReadwriteStaticCallWithTypeQuery : symbol @@ -301,8 +301,8 @@ const constInitToCReadwriteCallWithIndexedAccess: C["readwriteCall"] = c.readwri interface I { >I : I - readonly readonlyType: symbol(); ->readonlyType : symbol() + readonly readonlyType: unique symbol; +>readonlyType : unique symbol } declare const i: I; >i : I @@ -310,38 +310,38 @@ declare const i: I; const constInitToIReadonlyType = i.readonlyType; >constInitToIReadonlyType : symbol ->i.readonlyType : symbol() +>i.readonlyType : unique symbol >i : I ->readonlyType : symbol() +>readonlyType : unique symbol const constInitToIReadonlyTypeWithTypeQuery: typeof i.readonlyType = i.readonlyType; ->constInitToIReadonlyTypeWithTypeQuery : symbol() ->i.readonlyType : symbol() +>constInitToIReadonlyTypeWithTypeQuery : unique symbol +>i.readonlyType : unique symbol >i : I ->readonlyType : symbol() ->i.readonlyType : symbol() +>readonlyType : unique symbol +>i.readonlyType : unique symbol >i : I ->readonlyType : symbol() +>readonlyType : unique symbol const constInitToIReadonlyTypeWithIndexedAccess: I["readonlyType"] = i.readonlyType; ->constInitToIReadonlyTypeWithIndexedAccess : symbol() +>constInitToIReadonlyTypeWithIndexedAccess : unique symbol >I : I ->i.readonlyType : symbol() +>i.readonlyType : unique symbol >i : I ->readonlyType : symbol() +>readonlyType : unique symbol // type literals type L = { >L : L - readonly readonlyType: symbol(); ->readonlyType : symbol() + readonly readonlyType: unique symbol; +>readonlyType : unique symbol nested: { ->nested : { readonly readonlyNestedType: symbol(); } +>nested : { readonly readonlyNestedType: unique symbol; } - readonly readonlyNestedType: symbol(); ->readonlyNestedType : symbol() + readonly readonlyNestedType: unique symbol; +>readonlyNestedType : unique symbol } }; declare const l: L; @@ -350,55 +350,55 @@ declare const l: L; const constInitToLReadonlyType = l.readonlyType; >constInitToLReadonlyType : symbol ->l.readonlyType : symbol() +>l.readonlyType : unique symbol >l : L ->readonlyType : symbol() +>readonlyType : unique symbol const constInitToLReadonlyNestedType = l.nested.readonlyNestedType; >constInitToLReadonlyNestedType : symbol ->l.nested.readonlyNestedType : symbol() ->l.nested : { readonly readonlyNestedType: symbol(); } +>l.nested.readonlyNestedType : unique symbol +>l.nested : { readonly readonlyNestedType: unique symbol; } >l : L ->nested : { readonly readonlyNestedType: symbol(); } ->readonlyNestedType : symbol() +>nested : { readonly readonlyNestedType: unique symbol; } +>readonlyNestedType : unique symbol const constInitToLReadonlyTypeWithTypeQuery: typeof l.readonlyType = l.readonlyType; ->constInitToLReadonlyTypeWithTypeQuery : symbol() ->l.readonlyType : symbol() +>constInitToLReadonlyTypeWithTypeQuery : unique symbol +>l.readonlyType : unique symbol >l : L ->readonlyType : symbol() ->l.readonlyType : symbol() +>readonlyType : unique symbol +>l.readonlyType : unique symbol >l : L ->readonlyType : symbol() +>readonlyType : unique symbol const constInitToLReadonlyNestedTypeWithTypeQuery: typeof l.nested.readonlyNestedType = l.nested.readonlyNestedType; ->constInitToLReadonlyNestedTypeWithTypeQuery : symbol() ->l.nested.readonlyNestedType : symbol() ->l.nested : { readonly readonlyNestedType: symbol(); } +>constInitToLReadonlyNestedTypeWithTypeQuery : unique symbol +>l.nested.readonlyNestedType : unique symbol +>l.nested : { readonly readonlyNestedType: unique symbol; } >l : L ->nested : { readonly readonlyNestedType: symbol(); } ->readonlyNestedType : symbol() ->l.nested.readonlyNestedType : symbol() ->l.nested : { readonly readonlyNestedType: symbol(); } +>nested : { readonly readonlyNestedType: unique symbol; } +>readonlyNestedType : unique symbol +>l.nested.readonlyNestedType : unique symbol +>l.nested : { readonly readonlyNestedType: unique symbol; } >l : L ->nested : { readonly readonlyNestedType: symbol(); } ->readonlyNestedType : symbol() +>nested : { readonly readonlyNestedType: unique symbol; } +>readonlyNestedType : unique symbol const constInitToLReadonlyTypeWithIndexedAccess: L["readonlyType"] = l.readonlyType; ->constInitToLReadonlyTypeWithIndexedAccess : symbol() +>constInitToLReadonlyTypeWithIndexedAccess : unique symbol >L : L ->l.readonlyType : symbol() +>l.readonlyType : unique symbol >l : L ->readonlyType : symbol() +>readonlyType : unique symbol const constInitToLReadonlyNestedTypeWithIndexedAccess: L["nested"]["readonlyNestedType"] = l.nested.readonlyNestedType; ->constInitToLReadonlyNestedTypeWithIndexedAccess : symbol() +>constInitToLReadonlyNestedTypeWithIndexedAccess : unique symbol >L : L ->l.nested.readonlyNestedType : symbol() ->l.nested : { readonly readonlyNestedType: symbol(); } +>l.nested.readonlyNestedType : unique symbol +>l.nested : { readonly readonlyNestedType: unique symbol; } >l : L ->nested : { readonly readonlyNestedType: symbol(); } ->readonlyNestedType : symbol() +>nested : { readonly readonlyNestedType: unique symbol; } +>readonlyNestedType : unique symbol // type argument inference const promiseForConstCall = Promise.resolve(constCall); @@ -407,10 +407,10 @@ const promiseForConstCall = Promise.resolve(constCall); >Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor >resolve : { (value: T | PromiseLike): Promise; (): Promise; } ->constCall : symbol() +>constCall : unique symbol const arrayOfConstCall = [constCall]; >arrayOfConstCall : symbol[] >[constCall] : symbol[] ->constCall : symbol() +>constCall : unique symbol diff --git a/tests/baselines/reference/uniqueSymbolsErrors.errors.txt b/tests/baselines/reference/uniqueSymbolsErrors.errors.txt index 95c9132fb75..356617779aa 100644 --- a/tests/baselines/reference/uniqueSymbolsErrors.errors.txt +++ b/tests/baselines/reference/uniqueSymbolsErrors.errors.txt @@ -1,265 +1,265 @@ -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(2,19): error TS1337: Unique 'symbol()' types may not be used on a variable declaration with a binding name. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(3,13): error TS1336: A variable whose type is a unique 'symbol()' type must be 'const'. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(4,13): error TS1336: A variable whose type is a unique 'symbol()' type must be 'const'. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(7,38): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(8,45): error TS1331: Unique 'symbol()' types are not allowed in an array type. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(9,39): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(10,40): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(11,53): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(12,59): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(13,50): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(17,44): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(19,14): error TS1335: A property of a class whose type is a unique 'symbol()' type must be both 'static' and 'readonly'. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(20,5): error TS1335: A property of a class whose type is a unique 'symbol()' type must be both 'static' and 'readonly'. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(21,25): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(22,33): error TS1331: Unique 'symbol()' types are not allowed in an array type. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(23,26): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(24,27): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(25,40): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(26,46): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(27,37): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(28,26): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(29,28): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(31,12): error TS1335: A property of a class whose type is a unique 'symbol()' type must be both 'static' and 'readonly'. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(32,38): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(33,46): error TS1331: Unique 'symbol()' types are not allowed in an array type. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(34,39): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(35,40): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(36,53): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(37,59): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(38,50): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(39,39): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(40,41): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(45,5): error TS1334: A property of an interface or type literal whose type is a unique 'symbol()' type must be 'readonly'. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(46,25): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(47,33): error TS1331: Unique 'symbol()' types are not allowed in an array type. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(48,26): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(49,27): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(50,40): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(51,46): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(52,37): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(57,5): error TS1334: A property of an interface or type literal whose type is a unique 'symbol()' type must be 'readonly'. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(58,25): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(59,33): error TS1331: Unique 'symbol()' types are not allowed in an array type. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(60,26): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(61,27): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(62,40): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(63,46): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(64,37): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(68,21): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(69,52): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(70,49): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(73,44): error TS1339: Unique 'symbol()' types are not allowed here. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(74,33): error TS1331: Unique 'symbol()' types are not allowed in an array type. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(75,34): error TS1332: Unique 'symbol()' types are not allowed in a tuple type. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(78,51): error TS1333: Unique 'symbol()' types are not allowed in a mapped type. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(81,29): error TS1329: Unique 'symbol()' types are not allowed in a union type. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(81,40): error TS1329: Unique 'symbol()' types are not allowed in a union type. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(82,36): error TS1329: Unique 'symbol()' types are not allowed in a union type. -tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(82,47): error TS1329: Unique 'symbol()' types are not allowed in a union type. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(2,19): error TS1337: 'unique symbol' types may not be used on a variable declaration with a binding name. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(3,13): error TS1336: A variable whose type is a 'unique symbol' type must be 'const'. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(4,13): error TS1336: A variable whose type is a 'unique symbol' type must be 'const'. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(7,38): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(8,45): error TS1331: 'unique symbol' types are not allowed in an array type. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(9,39): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(10,40): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(11,53): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(12,59): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(13,50): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(17,44): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(19,14): error TS1335: A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(20,5): error TS1335: A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(21,25): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(22,33): error TS1331: 'unique symbol' types are not allowed in an array type. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(23,26): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(24,27): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(25,40): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(26,46): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(27,37): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(28,26): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(29,28): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(31,12): error TS1335: A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(32,38): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(33,46): error TS1331: 'unique symbol' types are not allowed in an array type. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(34,39): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(35,40): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(36,53): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(37,59): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(38,50): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(39,39): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(40,41): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(45,5): error TS1334: A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(46,25): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(47,33): error TS1331: 'unique symbol' types are not allowed in an array type. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(48,26): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(49,27): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(50,40): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(51,46): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(52,37): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(57,5): error TS1334: A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(58,25): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(59,33): error TS1331: 'unique symbol' types are not allowed in an array type. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(60,26): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(61,27): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(62,40): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(63,46): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(64,37): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(68,21): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(69,52): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(70,49): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(73,44): error TS1339: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(74,33): error TS1331: 'unique symbol' types are not allowed in an array type. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(75,34): error TS1332: 'unique symbol' types are not allowed in a tuple type. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(78,51): error TS1333: 'unique symbol' types are not allowed in a mapped type. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(81,29): error TS1329: 'unique symbol' types are not allowed in a union type. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(81,45): error TS1329: 'unique symbol' types are not allowed in a union type. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(82,36): error TS1329: 'unique symbol' types are not allowed in a union type. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(82,52): error TS1329: 'unique symbol' types are not allowed in a union type. ==== tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts (59 errors) ==== // declarations - declare const {}: symbol(); - ~~~~~~~~ -!!! error TS1337: Unique 'symbol()' types may not be used on a variable declaration with a binding name. - declare let invalidLetType: symbol(); + declare const {}: unique symbol; + ~~~~~~~~~~~~~ +!!! error TS1337: 'unique symbol' types may not be used on a variable declaration with a binding name. + declare let invalidLetType: unique symbol; ~~~~~~~~~~~~~~ -!!! error TS1336: A variable whose type is a unique 'symbol()' type must be 'const'. - declare var invalidVarType: symbol(); +!!! error TS1336: A variable whose type is a 'unique symbol' type must be 'const'. + declare var invalidVarType: unique symbol; ~~~~~~~~~~~~~~ -!!! error TS1336: A variable whose type is a unique 'symbol()' type must be 'const'. +!!! error TS1336: A variable whose type is a 'unique symbol' type must be 'const'. // function arguments and return types - declare function invalidArgType(arg: symbol()): void; - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - declare function invalidRestArgType(...arg: symbol()[]): void; - ~~~~~~~~ -!!! error TS1331: Unique 'symbol()' types are not allowed in an array type. - declare function invalidReturnType(): symbol(); - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - declare function invalidThisType(this: symbol()): void; - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - declare function invalidTypePredicate(n: any): n is symbol(); - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - declare function invalidTypeParameterConstraint(): void; - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - declare function invalidTypeParameterDefault(): void; - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. + declare function invalidArgType(arg: unique symbol): void; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + declare function invalidRestArgType(...arg: unique symbol[]): void; + ~~~~~~~~~~~~~ +!!! error TS1331: 'unique symbol' types are not allowed in an array type. + declare function invalidReturnType(): unique symbol; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + declare function invalidThisType(this: unique symbol): void; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + declare function invalidTypePredicate(n: any): n is unique symbol; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + declare function invalidTypeParameterConstraint(): void; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + declare function invalidTypeParameterDefault(): void; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. // classes class InvalidClass { - constructor(invalidConstructorArgType: symbol()) {} - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. + constructor(invalidConstructorArgType: unique symbol) {} + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. - readonly invalidReadonlyPropertyType: symbol(); + readonly invalidReadonlyPropertyType: unique symbol; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1335: A property of a class whose type is a unique 'symbol()' type must be both 'static' and 'readonly'. - invalidPropertyType: symbol(); +!!! error TS1335: A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'. + invalidPropertyType: unique symbol; ~~~~~~~~~~~~~~~~~~~ -!!! error TS1335: A property of a class whose type is a unique 'symbol()' type must be both 'static' and 'readonly'. - invalidArgType(arg: symbol()): void { return; } - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - invalidRestArgType(...args: symbol()[]): void { return; } - ~~~~~~~~ -!!! error TS1331: Unique 'symbol()' types are not allowed in an array type. - invalidReturnType(): symbol() { return; } - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - invalidThisType(this: symbol()): void { return; } - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - invalidTypePredicate(n: any): n is symbol() { return; } - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - invalidTypeParameterConstraint(): void { return; } - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - invalidTypeParameterDefault(): void { return; } - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - get invalidGetter(): symbol() { return; } - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - set invalidSetter(arg: symbol()) { return; } - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. +!!! error TS1335: A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'. + invalidArgType(arg: unique symbol): void { return; } + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + invalidRestArgType(...args: unique symbol[]): void { return; } + ~~~~~~~~~~~~~ +!!! error TS1331: 'unique symbol' types are not allowed in an array type. + invalidReturnType(): unique symbol { return; } + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + invalidThisType(this: unique symbol): void { return; } + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + invalidTypePredicate(n: any): n is unique symbol { return; } + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + invalidTypeParameterConstraint(): void { return; } + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + invalidTypeParameterDefault(): void { return; } + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + get invalidGetter(): unique symbol { return; } + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + set invalidSetter(arg: unique symbol) { return; } + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. - static invalidStaticPropertyType: symbol(); + static invalidStaticPropertyType: unique symbol; ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1335: A property of a class whose type is a unique 'symbol()' type must be both 'static' and 'readonly'. - static invalidStaticArgType(arg: symbol()): void { return; } - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - static invalidStaticRestArgType(...args: symbol()[]): void { return; } - ~~~~~~~~ -!!! error TS1331: Unique 'symbol()' types are not allowed in an array type. - static invalidStaticReturnType(): symbol() { return; } - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - static invalidStaticThisType(this: symbol()): void { return; } - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - static invalidStaticTypePredicate(n: any): n is symbol() { return; } - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - static invalidStaticTypeParameterConstraint(): void { return; } - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - static invalidStaticTypeParameterDefault(): void { return; } - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - static get invalidStaticGetter(): symbol() { return; } - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - static set invalidStaticSetter(arg: symbol()) { return; } - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. +!!! error TS1335: A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'. + static invalidStaticArgType(arg: unique symbol): void { return; } + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + static invalidStaticRestArgType(...args: unique symbol[]): void { return; } + ~~~~~~~~~~~~~ +!!! error TS1331: 'unique symbol' types are not allowed in an array type. + static invalidStaticReturnType(): unique symbol { return; } + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + static invalidStaticThisType(this: unique symbol): void { return; } + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + static invalidStaticTypePredicate(n: any): n is unique symbol { return; } + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + static invalidStaticTypeParameterConstraint(): void { return; } + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + static invalidStaticTypeParameterDefault(): void { return; } + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + static get invalidStaticGetter(): unique symbol { return; } + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + static set invalidStaticSetter(arg: unique symbol) { return; } + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. } // interfaces interface InvalidInterface { - invalidPropertyType: symbol(); + invalidPropertyType: unique symbol; ~~~~~~~~~~~~~~~~~~~ -!!! error TS1334: A property of an interface or type literal whose type is a unique 'symbol()' type must be 'readonly'. - invalidArgType(arg: symbol()): void; - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - invalidRestArgType(...args: symbol()[]): void; - ~~~~~~~~ -!!! error TS1331: Unique 'symbol()' types are not allowed in an array type. - invalidReturnType(): symbol(); - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - invalidThisType(this: symbol()); - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - invalidTypePredicate(n: any): n is symbol() - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - invalidTypeParameterConstraint(): void; - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - invalidTypeParameterDefault(): void; - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. +!!! error TS1334: A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'. + invalidArgType(arg: unique symbol): void; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + invalidRestArgType(...args: unique symbol[]): void; + ~~~~~~~~~~~~~ +!!! error TS1331: 'unique symbol' types are not allowed in an array type. + invalidReturnType(): unique symbol; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + invalidThisType(this: unique symbol); + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + invalidTypePredicate(n: any): n is unique symbol + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + invalidTypeParameterConstraint(): void; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + invalidTypeParameterDefault(): void; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. } // type literals type InvalidTypeLiteral = { - invalidPropertyType: symbol(); + invalidPropertyType: unique symbol; ~~~~~~~~~~~~~~~~~~~ -!!! error TS1334: A property of an interface or type literal whose type is a unique 'symbol()' type must be 'readonly'. - invalidArgType(arg: symbol()): void; - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - invalidRestArgType(...args: symbol()[]): void; - ~~~~~~~~ -!!! error TS1331: Unique 'symbol()' types are not allowed in an array type. - invalidReturnType(): symbol(); - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - invalidThisType(this: symbol()); - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - invalidTypePredicate(n: any): n is symbol() - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - invalidTypeParameterConstraint(): void; - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - invalidTypeParameterDefault(): void; - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. +!!! error TS1334: A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'. + invalidArgType(arg: unique symbol): void; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + invalidRestArgType(...args: unique symbol[]): void; + ~~~~~~~~~~~~~ +!!! error TS1331: 'unique symbol' types are not allowed in an array type. + invalidReturnType(): unique symbol; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + invalidThisType(this: unique symbol); + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + invalidTypePredicate(n: any): n is unique symbol + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + invalidTypeParameterConstraint(): void; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + invalidTypeParameterDefault(): void; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. }; // type alias - type InvalidAlias = symbol(); - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - type InvalidAliasTypeParameterConstraint = never; - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - type InvalidAliasTypeParameterDefault = never; - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. + type InvalidAlias = unique symbol; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + type InvalidAliasTypeParameterConstraint = never; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + type InvalidAliasTypeParameterDefault = never; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. // type references - declare const invalidTypeArgument: Promise; - ~~~~~~~~ -!!! error TS1339: Unique 'symbol()' types are not allowed here. - declare const invalidArrayType: symbol()[]; - ~~~~~~~~ -!!! error TS1331: Unique 'symbol()' types are not allowed in an array type. - declare const invalidTupleType: [symbol()]; - ~~~~~~~~ -!!! error TS1332: Unique 'symbol()' types are not allowed in a tuple type. + declare const invalidTypeArgument: Promise; + ~~~~~~~~~~~~~ +!!! error TS1339: 'unique symbol' types are not allowed here. + declare const invalidArrayType: unique symbol[]; + ~~~~~~~~~~~~~ +!!! error TS1331: 'unique symbol' types are not allowed in an array type. + declare const invalidTupleType: [unique symbol]; + ~~~~~~~~~~~~~ +!!! error TS1332: 'unique symbol' types are not allowed in a tuple type. // mapped types - declare const invalidMappedType: { [P in string]: symbol() }; - ~~~~~~~~ -!!! error TS1333: Unique 'symbol()' types are not allowed in a mapped type. + declare const invalidMappedType: { [P in string]: unique symbol }; + ~~~~~~~~~~~~~ +!!! error TS1333: 'unique symbol' types are not allowed in a mapped type. // unions/intersection - declare const invalidUnion: symbol() | symbol(); - ~~~~~~~~ -!!! error TS1329: Unique 'symbol()' types are not allowed in a union type. - ~~~~~~~~ -!!! error TS1329: Unique 'symbol()' types are not allowed in a union type. - declare const invalidIntersection: symbol() | symbol(); - ~~~~~~~~ -!!! error TS1329: Unique 'symbol()' types are not allowed in a union type. - ~~~~~~~~ -!!! error TS1329: Unique 'symbol()' types are not allowed in a union type. + declare const invalidUnion: unique symbol | unique symbol; + ~~~~~~~~~~~~~ +!!! error TS1329: 'unique symbol' types are not allowed in a union type. + ~~~~~~~~~~~~~ +!!! error TS1329: 'unique symbol' types are not allowed in a union type. + declare const invalidIntersection: unique symbol | unique symbol; + ~~~~~~~~~~~~~ +!!! error TS1329: 'unique symbol' types are not allowed in a union type. + ~~~~~~~~~~~~~ +!!! error TS1329: 'unique symbol' types are not allowed in a union type. \ No newline at end of file diff --git a/tests/baselines/reference/uniqueSymbolsErrors.js b/tests/baselines/reference/uniqueSymbolsErrors.js index 806e28a7178..0cb0427ea64 100644 --- a/tests/baselines/reference/uniqueSymbolsErrors.js +++ b/tests/baselines/reference/uniqueSymbolsErrors.js @@ -1,86 +1,86 @@ //// [uniqueSymbolsErrors.ts] // declarations -declare const {}: symbol(); -declare let invalidLetType: symbol(); -declare var invalidVarType: symbol(); +declare const {}: unique symbol; +declare let invalidLetType: unique symbol; +declare var invalidVarType: unique symbol; // function arguments and return types -declare function invalidArgType(arg: symbol()): void; -declare function invalidRestArgType(...arg: symbol()[]): void; -declare function invalidReturnType(): symbol(); -declare function invalidThisType(this: symbol()): void; -declare function invalidTypePredicate(n: any): n is symbol(); -declare function invalidTypeParameterConstraint(): void; -declare function invalidTypeParameterDefault(): void; +declare function invalidArgType(arg: unique symbol): void; +declare function invalidRestArgType(...arg: unique symbol[]): void; +declare function invalidReturnType(): unique symbol; +declare function invalidThisType(this: unique symbol): void; +declare function invalidTypePredicate(n: any): n is unique symbol; +declare function invalidTypeParameterConstraint(): void; +declare function invalidTypeParameterDefault(): void; // classes class InvalidClass { - constructor(invalidConstructorArgType: symbol()) {} + constructor(invalidConstructorArgType: unique symbol) {} - readonly invalidReadonlyPropertyType: symbol(); - invalidPropertyType: symbol(); - invalidArgType(arg: symbol()): void { return; } - invalidRestArgType(...args: symbol()[]): void { return; } - invalidReturnType(): symbol() { return; } - invalidThisType(this: symbol()): void { return; } - invalidTypePredicate(n: any): n is symbol() { return; } - invalidTypeParameterConstraint(): void { return; } - invalidTypeParameterDefault(): void { return; } - get invalidGetter(): symbol() { return; } - set invalidSetter(arg: symbol()) { return; } + readonly invalidReadonlyPropertyType: unique symbol; + invalidPropertyType: unique symbol; + invalidArgType(arg: unique symbol): void { return; } + invalidRestArgType(...args: unique symbol[]): void { return; } + invalidReturnType(): unique symbol { return; } + invalidThisType(this: unique symbol): void { return; } + invalidTypePredicate(n: any): n is unique symbol { return; } + invalidTypeParameterConstraint(): void { return; } + invalidTypeParameterDefault(): void { return; } + get invalidGetter(): unique symbol { return; } + set invalidSetter(arg: unique symbol) { return; } - static invalidStaticPropertyType: symbol(); - static invalidStaticArgType(arg: symbol()): void { return; } - static invalidStaticRestArgType(...args: symbol()[]): void { return; } - static invalidStaticReturnType(): symbol() { return; } - static invalidStaticThisType(this: symbol()): void { return; } - static invalidStaticTypePredicate(n: any): n is symbol() { return; } - static invalidStaticTypeParameterConstraint(): void { return; } - static invalidStaticTypeParameterDefault(): void { return; } - static get invalidStaticGetter(): symbol() { return; } - static set invalidStaticSetter(arg: symbol()) { return; } + static invalidStaticPropertyType: unique symbol; + static invalidStaticArgType(arg: unique symbol): void { return; } + static invalidStaticRestArgType(...args: unique symbol[]): void { return; } + static invalidStaticReturnType(): unique symbol { return; } + static invalidStaticThisType(this: unique symbol): void { return; } + static invalidStaticTypePredicate(n: any): n is unique symbol { return; } + static invalidStaticTypeParameterConstraint(): void { return; } + static invalidStaticTypeParameterDefault(): void { return; } + static get invalidStaticGetter(): unique symbol { return; } + static set invalidStaticSetter(arg: unique symbol) { return; } } // interfaces interface InvalidInterface { - invalidPropertyType: symbol(); - invalidArgType(arg: symbol()): void; - invalidRestArgType(...args: symbol()[]): void; - invalidReturnType(): symbol(); - invalidThisType(this: symbol()); - invalidTypePredicate(n: any): n is symbol() - invalidTypeParameterConstraint(): void; - invalidTypeParameterDefault(): void; + invalidPropertyType: unique symbol; + invalidArgType(arg: unique symbol): void; + invalidRestArgType(...args: unique symbol[]): void; + invalidReturnType(): unique symbol; + invalidThisType(this: unique symbol); + invalidTypePredicate(n: any): n is unique symbol + invalidTypeParameterConstraint(): void; + invalidTypeParameterDefault(): void; } // type literals type InvalidTypeLiteral = { - invalidPropertyType: symbol(); - invalidArgType(arg: symbol()): void; - invalidRestArgType(...args: symbol()[]): void; - invalidReturnType(): symbol(); - invalidThisType(this: symbol()); - invalidTypePredicate(n: any): n is symbol() - invalidTypeParameterConstraint(): void; - invalidTypeParameterDefault(): void; + invalidPropertyType: unique symbol; + invalidArgType(arg: unique symbol): void; + invalidRestArgType(...args: unique symbol[]): void; + invalidReturnType(): unique symbol; + invalidThisType(this: unique symbol); + invalidTypePredicate(n: any): n is unique symbol + invalidTypeParameterConstraint(): void; + invalidTypeParameterDefault(): void; }; // type alias -type InvalidAlias = symbol(); -type InvalidAliasTypeParameterConstraint = never; -type InvalidAliasTypeParameterDefault = never; +type InvalidAlias = unique symbol; +type InvalidAliasTypeParameterConstraint = never; +type InvalidAliasTypeParameterDefault = never; // type references -declare const invalidTypeArgument: Promise; -declare const invalidArrayType: symbol()[]; -declare const invalidTupleType: [symbol()]; +declare const invalidTypeArgument: Promise; +declare const invalidArrayType: unique symbol[]; +declare const invalidTupleType: [unique symbol]; // mapped types -declare const invalidMappedType: { [P in string]: symbol() }; +declare const invalidMappedType: { [P in string]: unique symbol }; // unions/intersection -declare const invalidUnion: symbol() | symbol(); -declare const invalidIntersection: symbol() | symbol(); +declare const invalidUnion: unique symbol | unique symbol; +declare const invalidIntersection: unique symbol | unique symbol; diff --git a/tests/baselines/reference/uniqueSymbolsErrors.symbols b/tests/baselines/reference/uniqueSymbolsErrors.symbols index 75c06e720d5..2177e2db8a3 100644 --- a/tests/baselines/reference/uniqueSymbolsErrors.symbols +++ b/tests/baselines/reference/uniqueSymbolsErrors.symbols @@ -1,125 +1,125 @@ === tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts === // declarations -declare const {}: symbol(); -declare let invalidLetType: symbol(); +declare const {}: unique symbol; +declare let invalidLetType: unique symbol; >invalidLetType : Symbol(invalidLetType, Decl(uniqueSymbolsErrors.ts, 2, 11)) -declare var invalidVarType: symbol(); +declare var invalidVarType: unique symbol; >invalidVarType : Symbol(invalidVarType, Decl(uniqueSymbolsErrors.ts, 3, 11)) // function arguments and return types -declare function invalidArgType(arg: symbol()): void; ->invalidArgType : Symbol(invalidArgType, Decl(uniqueSymbolsErrors.ts, 3, 37)) +declare function invalidArgType(arg: unique symbol): void; +>invalidArgType : Symbol(invalidArgType, Decl(uniqueSymbolsErrors.ts, 3, 42)) >arg : Symbol(arg, Decl(uniqueSymbolsErrors.ts, 6, 32)) -declare function invalidRestArgType(...arg: symbol()[]): void; ->invalidRestArgType : Symbol(invalidRestArgType, Decl(uniqueSymbolsErrors.ts, 6, 53)) +declare function invalidRestArgType(...arg: unique symbol[]): void; +>invalidRestArgType : Symbol(invalidRestArgType, Decl(uniqueSymbolsErrors.ts, 6, 58)) >arg : Symbol(arg, Decl(uniqueSymbolsErrors.ts, 7, 36)) -declare function invalidReturnType(): symbol(); ->invalidReturnType : Symbol(invalidReturnType, Decl(uniqueSymbolsErrors.ts, 7, 62)) +declare function invalidReturnType(): unique symbol; +>invalidReturnType : Symbol(invalidReturnType, Decl(uniqueSymbolsErrors.ts, 7, 67)) -declare function invalidThisType(this: symbol()): void; ->invalidThisType : Symbol(invalidThisType, Decl(uniqueSymbolsErrors.ts, 8, 47)) +declare function invalidThisType(this: unique symbol): void; +>invalidThisType : Symbol(invalidThisType, Decl(uniqueSymbolsErrors.ts, 8, 52)) >this : Symbol(this, Decl(uniqueSymbolsErrors.ts, 9, 33)) -declare function invalidTypePredicate(n: any): n is symbol(); ->invalidTypePredicate : Symbol(invalidTypePredicate, Decl(uniqueSymbolsErrors.ts, 9, 55)) +declare function invalidTypePredicate(n: any): n is unique symbol; +>invalidTypePredicate : Symbol(invalidTypePredicate, Decl(uniqueSymbolsErrors.ts, 9, 60)) >n : Symbol(n, Decl(uniqueSymbolsErrors.ts, 10, 38)) >n : Symbol(n, Decl(uniqueSymbolsErrors.ts, 10, 38)) -declare function invalidTypeParameterConstraint(): void; ->invalidTypeParameterConstraint : Symbol(invalidTypeParameterConstraint, Decl(uniqueSymbolsErrors.ts, 10, 61)) +declare function invalidTypeParameterConstraint(): void; +>invalidTypeParameterConstraint : Symbol(invalidTypeParameterConstraint, Decl(uniqueSymbolsErrors.ts, 10, 66)) >T : Symbol(T, Decl(uniqueSymbolsErrors.ts, 11, 48)) -declare function invalidTypeParameterDefault(): void; ->invalidTypeParameterDefault : Symbol(invalidTypeParameterDefault, Decl(uniqueSymbolsErrors.ts, 11, 76)) +declare function invalidTypeParameterDefault(): void; +>invalidTypeParameterDefault : Symbol(invalidTypeParameterDefault, Decl(uniqueSymbolsErrors.ts, 11, 81)) >T : Symbol(T, Decl(uniqueSymbolsErrors.ts, 12, 45)) // classes class InvalidClass { ->InvalidClass : Symbol(InvalidClass, Decl(uniqueSymbolsErrors.ts, 12, 67)) +>InvalidClass : Symbol(InvalidClass, Decl(uniqueSymbolsErrors.ts, 12, 72)) - constructor(invalidConstructorArgType: symbol()) {} + constructor(invalidConstructorArgType: unique symbol) {} >invalidConstructorArgType : Symbol(invalidConstructorArgType, Decl(uniqueSymbolsErrors.ts, 16, 16)) - readonly invalidReadonlyPropertyType: symbol(); ->invalidReadonlyPropertyType : Symbol(InvalidClass.invalidReadonlyPropertyType, Decl(uniqueSymbolsErrors.ts, 16, 55)) + readonly invalidReadonlyPropertyType: unique symbol; +>invalidReadonlyPropertyType : Symbol(InvalidClass.invalidReadonlyPropertyType, Decl(uniqueSymbolsErrors.ts, 16, 60)) - invalidPropertyType: symbol(); ->invalidPropertyType : Symbol(InvalidClass.invalidPropertyType, Decl(uniqueSymbolsErrors.ts, 18, 51)) + invalidPropertyType: unique symbol; +>invalidPropertyType : Symbol(InvalidClass.invalidPropertyType, Decl(uniqueSymbolsErrors.ts, 18, 56)) - invalidArgType(arg: symbol()): void { return; } ->invalidArgType : Symbol(InvalidClass.invalidArgType, Decl(uniqueSymbolsErrors.ts, 19, 34)) + invalidArgType(arg: unique symbol): void { return; } +>invalidArgType : Symbol(InvalidClass.invalidArgType, Decl(uniqueSymbolsErrors.ts, 19, 39)) >arg : Symbol(arg, Decl(uniqueSymbolsErrors.ts, 20, 19)) - invalidRestArgType(...args: symbol()[]): void { return; } ->invalidRestArgType : Symbol(InvalidClass.invalidRestArgType, Decl(uniqueSymbolsErrors.ts, 20, 51)) + invalidRestArgType(...args: unique symbol[]): void { return; } +>invalidRestArgType : Symbol(InvalidClass.invalidRestArgType, Decl(uniqueSymbolsErrors.ts, 20, 56)) >args : Symbol(args, Decl(uniqueSymbolsErrors.ts, 21, 23)) - invalidReturnType(): symbol() { return; } ->invalidReturnType : Symbol(InvalidClass.invalidReturnType, Decl(uniqueSymbolsErrors.ts, 21, 61)) + invalidReturnType(): unique symbol { return; } +>invalidReturnType : Symbol(InvalidClass.invalidReturnType, Decl(uniqueSymbolsErrors.ts, 21, 66)) - invalidThisType(this: symbol()): void { return; } ->invalidThisType : Symbol(InvalidClass.invalidThisType, Decl(uniqueSymbolsErrors.ts, 22, 45)) + invalidThisType(this: unique symbol): void { return; } +>invalidThisType : Symbol(InvalidClass.invalidThisType, Decl(uniqueSymbolsErrors.ts, 22, 50)) >this : Symbol(this, Decl(uniqueSymbolsErrors.ts, 23, 20)) - invalidTypePredicate(n: any): n is symbol() { return; } ->invalidTypePredicate : Symbol(InvalidClass.invalidTypePredicate, Decl(uniqueSymbolsErrors.ts, 23, 53)) + invalidTypePredicate(n: any): n is unique symbol { return; } +>invalidTypePredicate : Symbol(InvalidClass.invalidTypePredicate, Decl(uniqueSymbolsErrors.ts, 23, 58)) >n : Symbol(n, Decl(uniqueSymbolsErrors.ts, 24, 25)) >n : Symbol(n, Decl(uniqueSymbolsErrors.ts, 24, 25)) - invalidTypeParameterConstraint(): void { return; } ->invalidTypeParameterConstraint : Symbol(InvalidClass.invalidTypeParameterConstraint, Decl(uniqueSymbolsErrors.ts, 24, 59)) + invalidTypeParameterConstraint(): void { return; } +>invalidTypeParameterConstraint : Symbol(InvalidClass.invalidTypeParameterConstraint, Decl(uniqueSymbolsErrors.ts, 24, 64)) >T : Symbol(T, Decl(uniqueSymbolsErrors.ts, 25, 35)) - invalidTypeParameterDefault(): void { return; } ->invalidTypeParameterDefault : Symbol(InvalidClass.invalidTypeParameterDefault, Decl(uniqueSymbolsErrors.ts, 25, 74)) + invalidTypeParameterDefault(): void { return; } +>invalidTypeParameterDefault : Symbol(InvalidClass.invalidTypeParameterDefault, Decl(uniqueSymbolsErrors.ts, 25, 79)) >T : Symbol(T, Decl(uniqueSymbolsErrors.ts, 26, 32)) - get invalidGetter(): symbol() { return; } ->invalidGetter : Symbol(InvalidClass.invalidGetter, Decl(uniqueSymbolsErrors.ts, 26, 65)) + get invalidGetter(): unique symbol { return; } +>invalidGetter : Symbol(InvalidClass.invalidGetter, Decl(uniqueSymbolsErrors.ts, 26, 70)) - set invalidSetter(arg: symbol()) { return; } ->invalidSetter : Symbol(InvalidClass.invalidSetter, Decl(uniqueSymbolsErrors.ts, 27, 45)) + set invalidSetter(arg: unique symbol) { return; } +>invalidSetter : Symbol(InvalidClass.invalidSetter, Decl(uniqueSymbolsErrors.ts, 27, 50)) >arg : Symbol(arg, Decl(uniqueSymbolsErrors.ts, 28, 22)) - static invalidStaticPropertyType: symbol(); ->invalidStaticPropertyType : Symbol(InvalidClass.invalidStaticPropertyType, Decl(uniqueSymbolsErrors.ts, 28, 48)) + static invalidStaticPropertyType: unique symbol; +>invalidStaticPropertyType : Symbol(InvalidClass.invalidStaticPropertyType, Decl(uniqueSymbolsErrors.ts, 28, 53)) - static invalidStaticArgType(arg: symbol()): void { return; } ->invalidStaticArgType : Symbol(InvalidClass.invalidStaticArgType, Decl(uniqueSymbolsErrors.ts, 30, 47)) + static invalidStaticArgType(arg: unique symbol): void { return; } +>invalidStaticArgType : Symbol(InvalidClass.invalidStaticArgType, Decl(uniqueSymbolsErrors.ts, 30, 52)) >arg : Symbol(arg, Decl(uniqueSymbolsErrors.ts, 31, 32)) - static invalidStaticRestArgType(...args: symbol()[]): void { return; } ->invalidStaticRestArgType : Symbol(InvalidClass.invalidStaticRestArgType, Decl(uniqueSymbolsErrors.ts, 31, 64)) + static invalidStaticRestArgType(...args: unique symbol[]): void { return; } +>invalidStaticRestArgType : Symbol(InvalidClass.invalidStaticRestArgType, Decl(uniqueSymbolsErrors.ts, 31, 69)) >args : Symbol(args, Decl(uniqueSymbolsErrors.ts, 32, 36)) - static invalidStaticReturnType(): symbol() { return; } ->invalidStaticReturnType : Symbol(InvalidClass.invalidStaticReturnType, Decl(uniqueSymbolsErrors.ts, 32, 74)) + static invalidStaticReturnType(): unique symbol { return; } +>invalidStaticReturnType : Symbol(InvalidClass.invalidStaticReturnType, Decl(uniqueSymbolsErrors.ts, 32, 79)) - static invalidStaticThisType(this: symbol()): void { return; } ->invalidStaticThisType : Symbol(InvalidClass.invalidStaticThisType, Decl(uniqueSymbolsErrors.ts, 33, 58)) + static invalidStaticThisType(this: unique symbol): void { return; } +>invalidStaticThisType : Symbol(InvalidClass.invalidStaticThisType, Decl(uniqueSymbolsErrors.ts, 33, 63)) >this : Symbol(this, Decl(uniqueSymbolsErrors.ts, 34, 33)) - static invalidStaticTypePredicate(n: any): n is symbol() { return; } ->invalidStaticTypePredicate : Symbol(InvalidClass.invalidStaticTypePredicate, Decl(uniqueSymbolsErrors.ts, 34, 66)) + static invalidStaticTypePredicate(n: any): n is unique symbol { return; } +>invalidStaticTypePredicate : Symbol(InvalidClass.invalidStaticTypePredicate, Decl(uniqueSymbolsErrors.ts, 34, 71)) >n : Symbol(n, Decl(uniqueSymbolsErrors.ts, 35, 38)) >n : Symbol(n, Decl(uniqueSymbolsErrors.ts, 35, 38)) - static invalidStaticTypeParameterConstraint(): void { return; } ->invalidStaticTypeParameterConstraint : Symbol(InvalidClass.invalidStaticTypeParameterConstraint, Decl(uniqueSymbolsErrors.ts, 35, 72)) + static invalidStaticTypeParameterConstraint(): void { return; } +>invalidStaticTypeParameterConstraint : Symbol(InvalidClass.invalidStaticTypeParameterConstraint, Decl(uniqueSymbolsErrors.ts, 35, 77)) >T : Symbol(T, Decl(uniqueSymbolsErrors.ts, 36, 48)) - static invalidStaticTypeParameterDefault(): void { return; } ->invalidStaticTypeParameterDefault : Symbol(InvalidClass.invalidStaticTypeParameterDefault, Decl(uniqueSymbolsErrors.ts, 36, 87)) + static invalidStaticTypeParameterDefault(): void { return; } +>invalidStaticTypeParameterDefault : Symbol(InvalidClass.invalidStaticTypeParameterDefault, Decl(uniqueSymbolsErrors.ts, 36, 92)) >T : Symbol(T, Decl(uniqueSymbolsErrors.ts, 37, 45)) - static get invalidStaticGetter(): symbol() { return; } ->invalidStaticGetter : Symbol(InvalidClass.invalidStaticGetter, Decl(uniqueSymbolsErrors.ts, 37, 78)) + static get invalidStaticGetter(): unique symbol { return; } +>invalidStaticGetter : Symbol(InvalidClass.invalidStaticGetter, Decl(uniqueSymbolsErrors.ts, 37, 83)) - static set invalidStaticSetter(arg: symbol()) { return; } ->invalidStaticSetter : Symbol(InvalidClass.invalidStaticSetter, Decl(uniqueSymbolsErrors.ts, 38, 58)) + static set invalidStaticSetter(arg: unique symbol) { return; } +>invalidStaticSetter : Symbol(InvalidClass.invalidStaticSetter, Decl(uniqueSymbolsErrors.ts, 38, 63)) >arg : Symbol(arg, Decl(uniqueSymbolsErrors.ts, 39, 35)) } @@ -127,35 +127,35 @@ class InvalidClass { interface InvalidInterface { >InvalidInterface : Symbol(InvalidInterface, Decl(uniqueSymbolsErrors.ts, 40, 1)) - invalidPropertyType: symbol(); + invalidPropertyType: unique symbol; >invalidPropertyType : Symbol(InvalidInterface.invalidPropertyType, Decl(uniqueSymbolsErrors.ts, 43, 28)) - invalidArgType(arg: symbol()): void; ->invalidArgType : Symbol(InvalidInterface.invalidArgType, Decl(uniqueSymbolsErrors.ts, 44, 34)) + invalidArgType(arg: unique symbol): void; +>invalidArgType : Symbol(InvalidInterface.invalidArgType, Decl(uniqueSymbolsErrors.ts, 44, 39)) >arg : Symbol(arg, Decl(uniqueSymbolsErrors.ts, 45, 19)) - invalidRestArgType(...args: symbol()[]): void; ->invalidRestArgType : Symbol(InvalidInterface.invalidRestArgType, Decl(uniqueSymbolsErrors.ts, 45, 40)) + invalidRestArgType(...args: unique symbol[]): void; +>invalidRestArgType : Symbol(InvalidInterface.invalidRestArgType, Decl(uniqueSymbolsErrors.ts, 45, 45)) >args : Symbol(args, Decl(uniqueSymbolsErrors.ts, 46, 23)) - invalidReturnType(): symbol(); ->invalidReturnType : Symbol(InvalidInterface.invalidReturnType, Decl(uniqueSymbolsErrors.ts, 46, 50)) + invalidReturnType(): unique symbol; +>invalidReturnType : Symbol(InvalidInterface.invalidReturnType, Decl(uniqueSymbolsErrors.ts, 46, 55)) - invalidThisType(this: symbol()); ->invalidThisType : Symbol(InvalidInterface.invalidThisType, Decl(uniqueSymbolsErrors.ts, 47, 34)) + invalidThisType(this: unique symbol); +>invalidThisType : Symbol(InvalidInterface.invalidThisType, Decl(uniqueSymbolsErrors.ts, 47, 39)) >this : Symbol(this, Decl(uniqueSymbolsErrors.ts, 48, 20)) - invalidTypePredicate(n: any): n is symbol() ->invalidTypePredicate : Symbol(InvalidInterface.invalidTypePredicate, Decl(uniqueSymbolsErrors.ts, 48, 36)) + invalidTypePredicate(n: any): n is unique symbol +>invalidTypePredicate : Symbol(InvalidInterface.invalidTypePredicate, Decl(uniqueSymbolsErrors.ts, 48, 41)) >n : Symbol(n, Decl(uniqueSymbolsErrors.ts, 49, 25)) >n : Symbol(n, Decl(uniqueSymbolsErrors.ts, 49, 25)) - invalidTypeParameterConstraint(): void; ->invalidTypeParameterConstraint : Symbol(InvalidInterface.invalidTypeParameterConstraint, Decl(uniqueSymbolsErrors.ts, 49, 47)) + invalidTypeParameterConstraint(): void; +>invalidTypeParameterConstraint : Symbol(InvalidInterface.invalidTypeParameterConstraint, Decl(uniqueSymbolsErrors.ts, 49, 52)) >T : Symbol(T, Decl(uniqueSymbolsErrors.ts, 50, 35)) - invalidTypeParameterDefault(): void; ->invalidTypeParameterDefault : Symbol(InvalidInterface.invalidTypeParameterDefault, Decl(uniqueSymbolsErrors.ts, 50, 63)) + invalidTypeParameterDefault(): void; +>invalidTypeParameterDefault : Symbol(InvalidInterface.invalidTypeParameterDefault, Decl(uniqueSymbolsErrors.ts, 50, 68)) >T : Symbol(T, Decl(uniqueSymbolsErrors.ts, 51, 32)) } @@ -163,72 +163,72 @@ interface InvalidInterface { type InvalidTypeLiteral = { >InvalidTypeLiteral : Symbol(InvalidTypeLiteral, Decl(uniqueSymbolsErrors.ts, 52, 1)) - invalidPropertyType: symbol(); + invalidPropertyType: unique symbol; >invalidPropertyType : Symbol(invalidPropertyType, Decl(uniqueSymbolsErrors.ts, 55, 27)) - invalidArgType(arg: symbol()): void; ->invalidArgType : Symbol(invalidArgType, Decl(uniqueSymbolsErrors.ts, 56, 34)) + invalidArgType(arg: unique symbol): void; +>invalidArgType : Symbol(invalidArgType, Decl(uniqueSymbolsErrors.ts, 56, 39)) >arg : Symbol(arg, Decl(uniqueSymbolsErrors.ts, 57, 19)) - invalidRestArgType(...args: symbol()[]): void; ->invalidRestArgType : Symbol(invalidRestArgType, Decl(uniqueSymbolsErrors.ts, 57, 40)) + invalidRestArgType(...args: unique symbol[]): void; +>invalidRestArgType : Symbol(invalidRestArgType, Decl(uniqueSymbolsErrors.ts, 57, 45)) >args : Symbol(args, Decl(uniqueSymbolsErrors.ts, 58, 23)) - invalidReturnType(): symbol(); ->invalidReturnType : Symbol(invalidReturnType, Decl(uniqueSymbolsErrors.ts, 58, 50)) + invalidReturnType(): unique symbol; +>invalidReturnType : Symbol(invalidReturnType, Decl(uniqueSymbolsErrors.ts, 58, 55)) - invalidThisType(this: symbol()); ->invalidThisType : Symbol(invalidThisType, Decl(uniqueSymbolsErrors.ts, 59, 34)) + invalidThisType(this: unique symbol); +>invalidThisType : Symbol(invalidThisType, Decl(uniqueSymbolsErrors.ts, 59, 39)) >this : Symbol(this, Decl(uniqueSymbolsErrors.ts, 60, 20)) - invalidTypePredicate(n: any): n is symbol() ->invalidTypePredicate : Symbol(invalidTypePredicate, Decl(uniqueSymbolsErrors.ts, 60, 36)) + invalidTypePredicate(n: any): n is unique symbol +>invalidTypePredicate : Symbol(invalidTypePredicate, Decl(uniqueSymbolsErrors.ts, 60, 41)) >n : Symbol(n, Decl(uniqueSymbolsErrors.ts, 61, 25)) >n : Symbol(n, Decl(uniqueSymbolsErrors.ts, 61, 25)) - invalidTypeParameterConstraint(): void; ->invalidTypeParameterConstraint : Symbol(invalidTypeParameterConstraint, Decl(uniqueSymbolsErrors.ts, 61, 47)) + invalidTypeParameterConstraint(): void; +>invalidTypeParameterConstraint : Symbol(invalidTypeParameterConstraint, Decl(uniqueSymbolsErrors.ts, 61, 52)) >T : Symbol(T, Decl(uniqueSymbolsErrors.ts, 62, 35)) - invalidTypeParameterDefault(): void; ->invalidTypeParameterDefault : Symbol(invalidTypeParameterDefault, Decl(uniqueSymbolsErrors.ts, 62, 63)) + invalidTypeParameterDefault(): void; +>invalidTypeParameterDefault : Symbol(invalidTypeParameterDefault, Decl(uniqueSymbolsErrors.ts, 62, 68)) >T : Symbol(T, Decl(uniqueSymbolsErrors.ts, 63, 32)) }; // type alias -type InvalidAlias = symbol(); +type InvalidAlias = unique symbol; >InvalidAlias : Symbol(InvalidAlias, Decl(uniqueSymbolsErrors.ts, 64, 2)) -type InvalidAliasTypeParameterConstraint = never; ->InvalidAliasTypeParameterConstraint : Symbol(InvalidAliasTypeParameterConstraint, Decl(uniqueSymbolsErrors.ts, 67, 29)) +type InvalidAliasTypeParameterConstraint = never; +>InvalidAliasTypeParameterConstraint : Symbol(InvalidAliasTypeParameterConstraint, Decl(uniqueSymbolsErrors.ts, 67, 34)) >T : Symbol(T, Decl(uniqueSymbolsErrors.ts, 68, 41)) -type InvalidAliasTypeParameterDefault = never; ->InvalidAliasTypeParameterDefault : Symbol(InvalidAliasTypeParameterDefault, Decl(uniqueSymbolsErrors.ts, 68, 69)) +type InvalidAliasTypeParameterDefault = never; +>InvalidAliasTypeParameterDefault : Symbol(InvalidAliasTypeParameterDefault, Decl(uniqueSymbolsErrors.ts, 68, 74)) >T : Symbol(T, Decl(uniqueSymbolsErrors.ts, 69, 38)) // type references -declare const invalidTypeArgument: Promise; +declare const invalidTypeArgument: Promise; >invalidTypeArgument : Symbol(invalidTypeArgument, Decl(uniqueSymbolsErrors.ts, 72, 13)) >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) -declare const invalidArrayType: symbol()[]; +declare const invalidArrayType: unique symbol[]; >invalidArrayType : Symbol(invalidArrayType, Decl(uniqueSymbolsErrors.ts, 73, 13)) -declare const invalidTupleType: [symbol()]; +declare const invalidTupleType: [unique symbol]; >invalidTupleType : Symbol(invalidTupleType, Decl(uniqueSymbolsErrors.ts, 74, 13)) // mapped types -declare const invalidMappedType: { [P in string]: symbol() }; +declare const invalidMappedType: { [P in string]: unique symbol }; >invalidMappedType : Symbol(invalidMappedType, Decl(uniqueSymbolsErrors.ts, 77, 13)) >P : Symbol(P, Decl(uniqueSymbolsErrors.ts, 77, 36)) // unions/intersection -declare const invalidUnion: symbol() | symbol(); +declare const invalidUnion: unique symbol | unique symbol; >invalidUnion : Symbol(invalidUnion, Decl(uniqueSymbolsErrors.ts, 80, 13)) -declare const invalidIntersection: symbol() | symbol(); +declare const invalidIntersection: unique symbol | unique symbol; >invalidIntersection : Symbol(invalidIntersection, Decl(uniqueSymbolsErrors.ts, 81, 13)) diff --git a/tests/baselines/reference/uniqueSymbolsErrors.types b/tests/baselines/reference/uniqueSymbolsErrors.types index 455dd13c58d..d593b0c24ac 100644 --- a/tests/baselines/reference/uniqueSymbolsErrors.types +++ b/tests/baselines/reference/uniqueSymbolsErrors.types @@ -1,38 +1,38 @@ === tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts === // declarations -declare const {}: symbol(); -declare let invalidLetType: symbol(); +declare const {}: unique symbol; +declare let invalidLetType: unique symbol; >invalidLetType : symbol -declare var invalidVarType: symbol(); +declare var invalidVarType: unique symbol; >invalidVarType : symbol // function arguments and return types -declare function invalidArgType(arg: symbol()): void; +declare function invalidArgType(arg: unique symbol): void; >invalidArgType : (arg: symbol) => void >arg : symbol -declare function invalidRestArgType(...arg: symbol()[]): void; +declare function invalidRestArgType(...arg: unique symbol[]): void; >invalidRestArgType : (...arg: symbol[]) => void >arg : symbol[] -declare function invalidReturnType(): symbol(); +declare function invalidReturnType(): unique symbol; >invalidReturnType : () => symbol -declare function invalidThisType(this: symbol()): void; +declare function invalidThisType(this: unique symbol): void; >invalidThisType : (this: symbol) => void >this : symbol -declare function invalidTypePredicate(n: any): n is symbol(); +declare function invalidTypePredicate(n: any): n is unique symbol; >invalidTypePredicate : (n: any) => n is symbol >n : any >n : any -declare function invalidTypeParameterConstraint(): void; +declare function invalidTypeParameterConstraint(): void; >invalidTypeParameterConstraint : () => void >T : T -declare function invalidTypeParameterDefault(): void; +declare function invalidTypeParameterDefault(): void; >invalidTypeParameterDefault : () => void >T : T @@ -40,85 +40,85 @@ declare function invalidTypeParameterDefault(): void; class InvalidClass { >InvalidClass : InvalidClass - constructor(invalidConstructorArgType: symbol()) {} + constructor(invalidConstructorArgType: unique symbol) {} >invalidConstructorArgType : symbol - readonly invalidReadonlyPropertyType: symbol(); + readonly invalidReadonlyPropertyType: unique symbol; >invalidReadonlyPropertyType : symbol - invalidPropertyType: symbol(); + invalidPropertyType: unique symbol; >invalidPropertyType : symbol - invalidArgType(arg: symbol()): void { return; } + invalidArgType(arg: unique symbol): void { return; } >invalidArgType : (arg: symbol) => void >arg : symbol - invalidRestArgType(...args: symbol()[]): void { return; } + invalidRestArgType(...args: unique symbol[]): void { return; } >invalidRestArgType : (...args: symbol[]) => void >args : symbol[] - invalidReturnType(): symbol() { return; } + invalidReturnType(): unique symbol { return; } >invalidReturnType : () => symbol - invalidThisType(this: symbol()): void { return; } + invalidThisType(this: unique symbol): void { return; } >invalidThisType : (this: symbol) => void >this : symbol - invalidTypePredicate(n: any): n is symbol() { return; } + invalidTypePredicate(n: any): n is unique symbol { return; } >invalidTypePredicate : (n: any) => n is symbol >n : any >n : any - invalidTypeParameterConstraint(): void { return; } + invalidTypeParameterConstraint(): void { return; } >invalidTypeParameterConstraint : () => void >T : T - invalidTypeParameterDefault(): void { return; } + invalidTypeParameterDefault(): void { return; } >invalidTypeParameterDefault : () => void >T : T - get invalidGetter(): symbol() { return; } + get invalidGetter(): unique symbol { return; } >invalidGetter : symbol - set invalidSetter(arg: symbol()) { return; } + set invalidSetter(arg: unique symbol) { return; } >invalidSetter : symbol >arg : symbol - static invalidStaticPropertyType: symbol(); + static invalidStaticPropertyType: unique symbol; >invalidStaticPropertyType : symbol - static invalidStaticArgType(arg: symbol()): void { return; } + static invalidStaticArgType(arg: unique symbol): void { return; } >invalidStaticArgType : (arg: symbol) => void >arg : symbol - static invalidStaticRestArgType(...args: symbol()[]): void { return; } + static invalidStaticRestArgType(...args: unique symbol[]): void { return; } >invalidStaticRestArgType : (...args: symbol[]) => void >args : symbol[] - static invalidStaticReturnType(): symbol() { return; } + static invalidStaticReturnType(): unique symbol { return; } >invalidStaticReturnType : () => symbol - static invalidStaticThisType(this: symbol()): void { return; } + static invalidStaticThisType(this: unique symbol): void { return; } >invalidStaticThisType : (this: symbol) => void >this : symbol - static invalidStaticTypePredicate(n: any): n is symbol() { return; } + static invalidStaticTypePredicate(n: any): n is unique symbol { return; } >invalidStaticTypePredicate : (n: any) => n is symbol >n : any >n : any - static invalidStaticTypeParameterConstraint(): void { return; } + static invalidStaticTypeParameterConstraint(): void { return; } >invalidStaticTypeParameterConstraint : () => void >T : T - static invalidStaticTypeParameterDefault(): void { return; } + static invalidStaticTypeParameterDefault(): void { return; } >invalidStaticTypeParameterDefault : () => void >T : T - static get invalidStaticGetter(): symbol() { return; } + static get invalidStaticGetter(): unique symbol { return; } >invalidStaticGetter : symbol - static set invalidStaticSetter(arg: symbol()) { return; } + static set invalidStaticSetter(arg: unique symbol) { return; } >invalidStaticSetter : symbol >arg : symbol } @@ -127,34 +127,34 @@ class InvalidClass { interface InvalidInterface { >InvalidInterface : InvalidInterface - invalidPropertyType: symbol(); + invalidPropertyType: unique symbol; >invalidPropertyType : symbol - invalidArgType(arg: symbol()): void; + invalidArgType(arg: unique symbol): void; >invalidArgType : (arg: symbol) => void >arg : symbol - invalidRestArgType(...args: symbol()[]): void; + invalidRestArgType(...args: unique symbol[]): void; >invalidRestArgType : (...args: symbol[]) => void >args : symbol[] - invalidReturnType(): symbol(); + invalidReturnType(): unique symbol; >invalidReturnType : () => symbol - invalidThisType(this: symbol()); + invalidThisType(this: unique symbol); >invalidThisType : (this: symbol) => any >this : symbol - invalidTypePredicate(n: any): n is symbol() + invalidTypePredicate(n: any): n is unique symbol >invalidTypePredicate : (n: any) => n is symbol >n : any >n : any - invalidTypeParameterConstraint(): void; + invalidTypeParameterConstraint(): void; >invalidTypeParameterConstraint : () => void >T : T - invalidTypeParameterDefault(): void; + invalidTypeParameterDefault(): void; >invalidTypeParameterDefault : () => void >T : T } @@ -163,72 +163,72 @@ interface InvalidInterface { type InvalidTypeLiteral = { >InvalidTypeLiteral : InvalidTypeLiteral - invalidPropertyType: symbol(); + invalidPropertyType: unique symbol; >invalidPropertyType : symbol - invalidArgType(arg: symbol()): void; + invalidArgType(arg: unique symbol): void; >invalidArgType : (arg: symbol) => void >arg : symbol - invalidRestArgType(...args: symbol()[]): void; + invalidRestArgType(...args: unique symbol[]): void; >invalidRestArgType : (...args: symbol[]) => void >args : symbol[] - invalidReturnType(): symbol(); + invalidReturnType(): unique symbol; >invalidReturnType : () => symbol - invalidThisType(this: symbol()); + invalidThisType(this: unique symbol); >invalidThisType : (this: symbol) => any >this : symbol - invalidTypePredicate(n: any): n is symbol() + invalidTypePredicate(n: any): n is unique symbol >invalidTypePredicate : (n: any) => n is symbol >n : any >n : any - invalidTypeParameterConstraint(): void; + invalidTypeParameterConstraint(): void; >invalidTypeParameterConstraint : () => void >T : T - invalidTypeParameterDefault(): void; + invalidTypeParameterDefault(): void; >invalidTypeParameterDefault : () => void >T : T }; // type alias -type InvalidAlias = symbol(); +type InvalidAlias = unique symbol; >InvalidAlias : symbol -type InvalidAliasTypeParameterConstraint = never; +type InvalidAliasTypeParameterConstraint = never; >InvalidAliasTypeParameterConstraint : never >T : T -type InvalidAliasTypeParameterDefault = never; +type InvalidAliasTypeParameterDefault = never; >InvalidAliasTypeParameterDefault : never >T : T // type references -declare const invalidTypeArgument: Promise; +declare const invalidTypeArgument: Promise; >invalidTypeArgument : Promise >Promise : Promise -declare const invalidArrayType: symbol()[]; +declare const invalidArrayType: unique symbol[]; >invalidArrayType : symbol[] -declare const invalidTupleType: [symbol()]; +declare const invalidTupleType: [unique symbol]; >invalidTupleType : [symbol] // mapped types -declare const invalidMappedType: { [P in string]: symbol() }; +declare const invalidMappedType: { [P in string]: unique symbol }; >invalidMappedType : { [x: string]: symbol; } >P : P // unions/intersection -declare const invalidUnion: symbol() | symbol(); +declare const invalidUnion: unique symbol | unique symbol; >invalidUnion : symbol -declare const invalidIntersection: symbol() | symbol(); +declare const invalidIntersection: unique symbol | unique symbol; >invalidIntersection : symbol diff --git a/tests/cases/conformance/types/uniqueSymbol/uniqueSymbols.ts b/tests/cases/conformance/types/uniqueSymbol/uniqueSymbols.ts index e21e6eb195d..66b9a081691 100644 --- a/tests/cases/conformance/types/uniqueSymbol/uniqueSymbols.ts +++ b/tests/cases/conformance/types/uniqueSymbol/uniqueSymbols.ts @@ -8,10 +8,10 @@ let letCall = Symbol(); var varCall = Symbol(); // ambient declaration with type -declare const constType: symbol(); +declare const constType: unique symbol; // declaration with type and call initializer -const constTypeAndCall: symbol() = Symbol(); +const constTypeAndCall: unique symbol = Symbol(); // declaration from initializer const constInitToConstCall = constCall; @@ -60,8 +60,8 @@ async function* asyncGenFuncYieldVarCall() { yield varCall; } // classes class C { static readonly readonlyStaticCall = Symbol(); - static readonly readonlyStaticType: symbol(); - static readonly readonlyStaticTypeAndCall: symbol() = Symbol(); + static readonly readonlyStaticType: unique symbol; + static readonly readonlyStaticTypeAndCall: unique symbol = Symbol(); static readwriteStaticCall = Symbol(); readonly readonlyCall = Symbol(); @@ -88,7 +88,7 @@ const constInitToCReadwriteCallWithIndexedAccess: C["readwriteCall"] = c.readwri // interfaces interface I { - readonly readonlyType: symbol(); + readonly readonlyType: unique symbol; } declare const i: I; @@ -98,9 +98,9 @@ const constInitToIReadonlyTypeWithIndexedAccess: I["readonlyType"] = i.readonlyT // type literals type L = { - readonly readonlyType: symbol(); + readonly readonlyType: unique symbol; nested: { - readonly readonlyNestedType: symbol(); + readonly readonlyNestedType: unique symbol; } }; declare const l: L; diff --git a/tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts b/tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts index c077d5852ad..a1c01538767 100644 --- a/tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts +++ b/tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts @@ -1,86 +1,86 @@ // @target: esnext // declarations -declare const {}: symbol(); -declare let invalidLetType: symbol(); -declare var invalidVarType: symbol(); +declare const {}: unique symbol; +declare let invalidLetType: unique symbol; +declare var invalidVarType: unique symbol; // function arguments and return types -declare function invalidArgType(arg: symbol()): void; -declare function invalidRestArgType(...arg: symbol()[]): void; -declare function invalidReturnType(): symbol(); -declare function invalidThisType(this: symbol()): void; -declare function invalidTypePredicate(n: any): n is symbol(); -declare function invalidTypeParameterConstraint(): void; -declare function invalidTypeParameterDefault(): void; +declare function invalidArgType(arg: unique symbol): void; +declare function invalidRestArgType(...arg: unique symbol[]): void; +declare function invalidReturnType(): unique symbol; +declare function invalidThisType(this: unique symbol): void; +declare function invalidTypePredicate(n: any): n is unique symbol; +declare function invalidTypeParameterConstraint(): void; +declare function invalidTypeParameterDefault(): void; // classes class InvalidClass { - constructor(invalidConstructorArgType: symbol()) {} + constructor(invalidConstructorArgType: unique symbol) {} - readonly invalidReadonlyPropertyType: symbol(); - invalidPropertyType: symbol(); - invalidArgType(arg: symbol()): void { return; } - invalidRestArgType(...args: symbol()[]): void { return; } - invalidReturnType(): symbol() { return; } - invalidThisType(this: symbol()): void { return; } - invalidTypePredicate(n: any): n is symbol() { return; } - invalidTypeParameterConstraint(): void { return; } - invalidTypeParameterDefault(): void { return; } - get invalidGetter(): symbol() { return; } - set invalidSetter(arg: symbol()) { return; } + readonly invalidReadonlyPropertyType: unique symbol; + invalidPropertyType: unique symbol; + invalidArgType(arg: unique symbol): void { return; } + invalidRestArgType(...args: unique symbol[]): void { return; } + invalidReturnType(): unique symbol { return; } + invalidThisType(this: unique symbol): void { return; } + invalidTypePredicate(n: any): n is unique symbol { return; } + invalidTypeParameterConstraint(): void { return; } + invalidTypeParameterDefault(): void { return; } + get invalidGetter(): unique symbol { return; } + set invalidSetter(arg: unique symbol) { return; } - static invalidStaticPropertyType: symbol(); - static invalidStaticArgType(arg: symbol()): void { return; } - static invalidStaticRestArgType(...args: symbol()[]): void { return; } - static invalidStaticReturnType(): symbol() { return; } - static invalidStaticThisType(this: symbol()): void { return; } - static invalidStaticTypePredicate(n: any): n is symbol() { return; } - static invalidStaticTypeParameterConstraint(): void { return; } - static invalidStaticTypeParameterDefault(): void { return; } - static get invalidStaticGetter(): symbol() { return; } - static set invalidStaticSetter(arg: symbol()) { return; } + static invalidStaticPropertyType: unique symbol; + static invalidStaticArgType(arg: unique symbol): void { return; } + static invalidStaticRestArgType(...args: unique symbol[]): void { return; } + static invalidStaticReturnType(): unique symbol { return; } + static invalidStaticThisType(this: unique symbol): void { return; } + static invalidStaticTypePredicate(n: any): n is unique symbol { return; } + static invalidStaticTypeParameterConstraint(): void { return; } + static invalidStaticTypeParameterDefault(): void { return; } + static get invalidStaticGetter(): unique symbol { return; } + static set invalidStaticSetter(arg: unique symbol) { return; } } // interfaces interface InvalidInterface { - invalidPropertyType: symbol(); - invalidArgType(arg: symbol()): void; - invalidRestArgType(...args: symbol()[]): void; - invalidReturnType(): symbol(); - invalidThisType(this: symbol()); - invalidTypePredicate(n: any): n is symbol() - invalidTypeParameterConstraint(): void; - invalidTypeParameterDefault(): void; + invalidPropertyType: unique symbol; + invalidArgType(arg: unique symbol): void; + invalidRestArgType(...args: unique symbol[]): void; + invalidReturnType(): unique symbol; + invalidThisType(this: unique symbol); + invalidTypePredicate(n: any): n is unique symbol + invalidTypeParameterConstraint(): void; + invalidTypeParameterDefault(): void; } // type literals type InvalidTypeLiteral = { - invalidPropertyType: symbol(); - invalidArgType(arg: symbol()): void; - invalidRestArgType(...args: symbol()[]): void; - invalidReturnType(): symbol(); - invalidThisType(this: symbol()); - invalidTypePredicate(n: any): n is symbol() - invalidTypeParameterConstraint(): void; - invalidTypeParameterDefault(): void; + invalidPropertyType: unique symbol; + invalidArgType(arg: unique symbol): void; + invalidRestArgType(...args: unique symbol[]): void; + invalidReturnType(): unique symbol; + invalidThisType(this: unique symbol); + invalidTypePredicate(n: any): n is unique symbol + invalidTypeParameterConstraint(): void; + invalidTypeParameterDefault(): void; }; // type alias -type InvalidAlias = symbol(); -type InvalidAliasTypeParameterConstraint = never; -type InvalidAliasTypeParameterDefault = never; +type InvalidAlias = unique symbol; +type InvalidAliasTypeParameterConstraint = never; +type InvalidAliasTypeParameterDefault = never; // type references -declare const invalidTypeArgument: Promise; -declare const invalidArrayType: symbol()[]; -declare const invalidTupleType: [symbol()]; +declare const invalidTypeArgument: Promise; +declare const invalidArrayType: unique symbol[]; +declare const invalidTupleType: [unique symbol]; // mapped types -declare const invalidMappedType: { [P in string]: symbol() }; +declare const invalidMappedType: { [P in string]: unique symbol }; // unions/intersection -declare const invalidUnion: symbol() | symbol(); -declare const invalidIntersection: symbol() | symbol(); +declare const invalidUnion: unique symbol | unique symbol; +declare const invalidIntersection: unique symbol | unique symbol; diff --git a/tests/cases/fourslash/completionInJSDocFunctionNew.ts b/tests/cases/fourslash/completionInJSDocFunctionNew.ts index 0d3391cf774..6a06ec76fe5 100644 --- a/tests/cases/fourslash/completionInJSDocFunctionNew.ts +++ b/tests/cases/fourslash/completionInJSDocFunctionNew.ts @@ -6,5 +6,5 @@ ////var f = function () { return new/**/; } goTo.marker(); -verify.completionListCount(115); +verify.completionListCount(116); verify.completionListContains('new'); diff --git a/tests/cases/fourslash/completionInJSDocFunctionThis.ts b/tests/cases/fourslash/completionInJSDocFunctionThis.ts index c28eeeb397f..b161b4eff68 100644 --- a/tests/cases/fourslash/completionInJSDocFunctionThis.ts +++ b/tests/cases/fourslash/completionInJSDocFunctionThis.ts @@ -5,6 +5,6 @@ ////var f = function (s) { return this/**/; } goTo.marker(); -verify.completionListCount(116); +verify.completionListCount(117); verify.completionListContains('this');