diff --git a/Jakefile b/Jakefile index 0425b0a0bf9..09b7e1efba4 100644 --- a/Jakefile +++ b/Jakefile @@ -95,6 +95,13 @@ var definitionsRoots = [ "services/services.d.ts", ]; +var internalDefinitionsRoots = [ + "compiler/core.d.ts", + "compiler/sys.d.ts", + "compiler/utilities.d.ts", + "services/utilities.d.ts", +]; + var harnessSources = [ "harness.ts", "sourceMapRecorder.ts", @@ -315,6 +322,8 @@ compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].conca var nodeDefinitionsFile = path.join(builtLocalDirectory, "typescript.d.ts"); var standaloneDefinitionsFile = path.join(builtLocalDirectory, "typescriptServices.d.ts"); +var internalNodeDefinitionsFile = path.join(builtLocalDirectory, "typescript_internal.d.ts"); +var internalStandaloneDefinitionsFile = path.join(builtLocalDirectory, "typescriptServices_internal.d.ts"); var tempDirPath = path.join(builtLocalDirectory, "temptempdir"); compileFile(nodeDefinitionsFile, servicesSources,[builtLocalDirectory, copyright].concat(servicesSources), /*prefixes*/ undefined, @@ -325,16 +334,25 @@ compileFile(nodeDefinitionsFile, servicesSources,[builtLocalDirectory, copyright /*keepComments*/ true, /*noResolve*/ true, /*callback*/ function () { - concatenateFiles(standaloneDefinitionsFile, definitionsRoots.map(function (f) { - return path.join(tempDirPath, f); - })); - prependFile(copyright, standaloneDefinitionsFile); + function makeDefinitionFiles(definitionsRoots, standaloneDefinitionsFile, nodeDefinitionsFile) { + // Create the standalone definition file + concatenateFiles(standaloneDefinitionsFile, definitionsRoots.map(function (f) { + return path.join(tempDirPath, f); + })); + prependFile(copyright, standaloneDefinitionsFile); - // Create the node definition file by replacing 'ts' module with '"typescript"' as a module. - jake.cpR(standaloneDefinitionsFile, nodeDefinitionsFile, {silent: true}); - var definitionFileContents = fs.readFileSync(nodeDefinitionsFile).toString(); - definitionFileContents = definitionFileContents.replace(/declare module ts/g, 'declare module "typescript"'); - fs.writeFileSync(nodeDefinitionsFile, definitionFileContents); + // Create the node definition file by replacing 'ts' module with '"typescript"' as a module. + jake.cpR(standaloneDefinitionsFile, nodeDefinitionsFile, {silent: true}); + var definitionFileContents = fs.readFileSync(nodeDefinitionsFile).toString(); + definitionFileContents = definitionFileContents.replace(/declare module ts/g, 'declare module "typescript"'); + fs.writeFileSync(nodeDefinitionsFile, definitionFileContents); + } + + // Create the public definition files + makeDefinitionFiles(definitionsRoots, standaloneDefinitionsFile, nodeDefinitionsFile); + + // Create the internal definition files + makeDefinitionFiles(internalDefinitionsRoots, internalStandaloneDefinitionsFile, internalNodeDefinitionsFile); // Delete the temp dir jake.rmRf(tempDirPath, {silent: true}); @@ -393,7 +411,7 @@ task("generate-spec", [specMd]) // Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory desc("Makes a new LKG out of the built js files"); task("LKG", ["clean", "release", "local"].concat(libraryTargets), function() { - var expectedFiles = [tscFile, servicesFile, nodeDefinitionsFile, standaloneDefinitionsFile].concat(libraryTargets); + var expectedFiles = [tscFile, servicesFile, nodeDefinitionsFile, standaloneDefinitionsFile, internalNodeDefinitionsFile, internalStandaloneDefinitionsFile].concat(libraryTargets); var missingFiles = expectedFiles.filter(function (f) { return !fs.existsSync(f); }); @@ -447,14 +465,10 @@ function exec(cmd, completeHandler) { complete(); }); ex.addListener("error", function(e, status) { - console.error("Process exited with code " + status); - complete(); + fail("Process exited with code " + status); }) - try{ - ex.run(); - } catch(e) { - console.log('Exception: ' + e) - } + + ex.run(); } function cleanTestDirs() { diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 9c710d1b1af..c641ae11a4e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -422,6 +422,13 @@ module ts { if (!links.target) { links.target = resolvingSymbol; var node = getDeclarationOfKind(symbol, SyntaxKind.ImportDeclaration); + // Grammar checking + if (node.moduleReference.kind === SyntaxKind.ExternalModuleReference) { + if ((node.moduleReference).expression.kind !== SyntaxKind.StringLiteral) { + grammarErrorOnNode((node.moduleReference).expression, Diagnostics.String_literal_expected); + } + } + var target = node.moduleReference.kind === SyntaxKind.ExternalModuleReference ? resolveExternalModuleName(node, getExternalModuleImportDeclarationExpression(node)) : getSymbolOfPartOfRightHandSideOfImport(node.moduleReference, node); @@ -5338,10 +5345,14 @@ module ts { } function checkObjectLiteral(node: ObjectLiteralExpression, contextualMapper?: TypeMapper): Type { + // Grammar checking + checkGrammarObjectLiteralExpression(node); + var members = node.symbol.members; var properties: SymbolTable = {}; var contextualType = getContextualType(node); var typeFlags: TypeFlags; + for (var id in members) { if (hasProperty(members, id)) { var member = members[id]; @@ -5390,6 +5401,7 @@ module ts { properties[member.name] = member; } } + var stringIndexType = getIndexType(IndexKind.String); var numberIndexType = getIndexType(IndexKind.Number); var result = createAnonymousType(node.symbol, properties, emptyArray, emptyArray, stringIndexType, numberIndexType); @@ -5531,6 +5543,21 @@ module ts { } function checkIndexedAccess(node: ElementAccessExpression): Type { + // Grammar checking + if (!node.argumentExpression) { + var sourceFile = getSourceFile(node); + if (node.parent.kind === SyntaxKind.NewExpression && (node.parent).expression === node) { + var start = skipTrivia(sourceFile.text, node.expression.end); + var end = node.end; + grammarErrorAtPos(sourceFile, start, end - start, Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + } + else { + var start = node.end - "]".length; + var end = node.end; + grammarErrorAtPos(sourceFile, start, end - start, Diagnostics.Expression_expected); + } + } + // Obtain base constraint such that we can bail out if the constraint is an unknown type var objectType = getApparentType(checkExpression(node.expression)); var indexType = node.argumentExpression ? checkExpression(node.argumentExpression) : unknownType; @@ -6233,6 +6260,9 @@ module ts { } function checkCallExpression(node: CallExpression): Type { + // Grammar checking; stop grammar-checking if checkGrammarTypeArguments return true + checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); + var signature = getResolvedSignature(node); if (node.expression.kind === SyntaxKind.SuperKeyword) { return voidType; @@ -6255,6 +6285,11 @@ module ts { } function checkTaggedTemplateExpression(node: TaggedTemplateExpression): Type { + // Grammar checking + if (compilerOptions.target < ScriptTarget.ES6) { + grammarErrorOnFirstToken(node.template, Diagnostics.Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + return getReturnTypeOfSignature(getResolvedSignature(node)); } @@ -6382,6 +6417,12 @@ module ts { function checkFunctionExpressionOrObjectLiteralMethod(node: FunctionExpression | MethodDeclaration, contextualMapper?: TypeMapper): Type { Debug.assert(node.kind !== SyntaxKind.MethodDeclaration || isObjectLiteralMethod(node)); + // Grammar checking + var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); + if (!hasGrammarError && node.kind === SyntaxKind.FunctionExpression) { + checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); + } + // The identityMapper object is used to indicate that function expressions are wildcards if (contextualMapper === identityMapper) { return anyFunctionType; @@ -6523,6 +6564,13 @@ module ts { } function checkDeleteExpression(node: DeleteExpression): Type { + // Grammar checking + if (node.parserContextFlags & ParserContextFlags.StrictMode && node.expression.kind === SyntaxKind.Identifier) { + // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its + // UnaryExpression is a direct reference to a variable, function argument, or function name + grammarErrorOnNode(node.expression, Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); + } + var operandType = checkExpression(node.expression); return booleanType; } @@ -6538,6 +6586,14 @@ module ts { } function checkPrefixUnaryExpression(node: PrefixUnaryExpression): Type { + // Grammar checking + // The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression + // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator + if ((node.operator === SyntaxKind.PlusPlusToken || node.operator === SyntaxKind.MinusMinusToken)) { + checkGrammarEvalOrArgumentsInStrictMode(node, node.operand); + } + var operandType = checkExpression(node.operand); switch (node.operator) { case SyntaxKind.PlusToken: @@ -6561,6 +6617,12 @@ module ts { } function checkPostfixUnaryExpression(node: PostfixUnaryExpression): Type { + // Grammar checking + // The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression + // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator. + checkGrammarEvalOrArgumentsInStrictMode(node, node.operand); + var operandType = checkExpression(node.operand); var ok = checkArithmeticOperandType(node.operand, operandType, Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { @@ -6687,6 +6749,13 @@ module ts { } function checkBinaryExpression(node: BinaryExpression, contextualMapper?: TypeMapper) { + // Grammar checking + if (isLeftHandSideExpression(node.left) && isAssignmentOperator(node.operator)) { + // ECMA 262 (Annex C) The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) + checkGrammarEvalOrArgumentsInStrictMode(node, node.left); + } + var operator = node.operator; if (operator === SyntaxKind.EqualsToken && (node.left.kind === SyntaxKind.ObjectLiteralExpression || node.left.kind === SyntaxKind.ArrayLiteralExpression)) { return checkDestructuringAssignment(node.left, checkExpression(node.right, contextualMapper), contextualMapper); @@ -6841,6 +6910,16 @@ module ts { } } + function checkYieldExpression(node: YieldExpression): void { + // Grammar checking + if (!(node.parserContextFlags & ParserContextFlags.Yield)) { + grammarErrorOnFirstToken(node, Diagnostics.yield_expression_must_be_contained_within_a_generator_declaration); + } + else { + grammarErrorOnFirstToken(node, Diagnostics.yield_expressions_are_not_currently_supported); + } + } + function checkConditionalExpression(node: ConditionalExpression, contextualMapper?: TypeMapper): Type { checkExpression(node.condition); var type1 = checkExpression(node.whenTrue, contextualMapper); @@ -6878,6 +6957,9 @@ module ts { } function checkObjectLiteralMethod(node: MethodDeclaration, contextualMapper?: TypeMapper): Type { + // Grammar checking + checkGrammarMethod(node); + var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); } @@ -6937,6 +7019,12 @@ module ts { return type; } + function checkNumericLiteral(node: LiteralExpression): Type { + // Grammar checking + checkGrammarNumbericLiteral(node); + return numberType; + } + function checkExpressionWorker(node: Expression, contextualMapper: TypeMapper): Type { switch (node.kind) { case SyntaxKind.Identifier: @@ -6951,7 +7039,7 @@ module ts { case SyntaxKind.FalseKeyword: return booleanType; case SyntaxKind.NumericLiteral: - return numberType; + return checkNumericLiteral(node); case SyntaxKind.TemplateExpression: return checkTemplateExpression(node); case SyntaxKind.StringLiteral: @@ -6995,6 +7083,9 @@ module ts { return checkConditionalExpression(node, contextualMapper); case SyntaxKind.OmittedExpression: return undefinedType; + case SyntaxKind.YieldExpression: + checkYieldExpression(node); + return unknownType; } return unknownType; } @@ -7002,6 +7093,11 @@ module ts { // DECLARATION AND STATEMENT TYPE CHECKING function checkTypeParameter(node: TypeParameterDeclaration) { + // Grammar Checking + if (node.expression) { + grammarErrorOnFirstToken(node.expression, Diagnostics.Type_expected); + } + checkSourceElement(node.constraint); if (fullTypeCheck) { checkTypeParameterHasIllegalReferencesInConstraint(node); @@ -7011,6 +7107,16 @@ module ts { } function checkParameter(node: ParameterDeclaration) { + // Grammar checking + // It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs as the + // Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code + // or if its FunctionBody is strict code(11.1.5). + // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a + // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) + + // Grammar checking + checkGrammarModifiers(node) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); + checkVariableLikeDeclaration(node); var func = getContainingFunction(node); if (node.flags & (NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected)) { @@ -7027,6 +7133,17 @@ module ts { } function checkSignatureDeclaration(node: SignatureDeclaration) { + // Grammar checking + if (node.kind === SyntaxKind.IndexSignature) { + checkGrammarIndexSignature(node); + } + // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled + else if (node.kind === SyntaxKind.FunctionType || node.kind === SyntaxKind.FunctionDeclaration || node.kind === SyntaxKind.ConstructorType || + node.kind === SyntaxKind.CallSignature || node.kind === SyntaxKind.Constructor || + node.kind === SyntaxKind.ConstructSignature){ + checkGrammarFunctionLikeDeclaration(node); + } + checkTypeParameters(node.typeParameters); forEach(node.parameters, checkParameter); if (node.type) { @@ -7093,15 +7210,26 @@ module ts { } function checkPropertyDeclaration(node: PropertyDeclaration) { + // Grammar checking + checkGrammarModifiers(node) || checkGrammarProperty(node); + checkVariableLikeDeclaration(node); } function checkMethodDeclaration(node: MethodDeclaration) { + // Grammar checking + checkGrammarMethod(node) || checkGrammarComputedPropertyName(node.name); + + // Grammar checking for modifiers is done inside the function checkGrammarFunctionLikeDeclaration checkFunctionLikeDeclaration(node); } function checkConstructorDeclaration(node: ConstructorDeclaration) { + // Grammar check on signature of constructor and modifier of the constructor is done in checkSignatureDeclaration function. checkSignatureDeclaration(node); + // Grammar check for checking only related to constructoDeclaration + checkGrammarConstructorTypeParameters(node) || checkGrammarConstructorTypeAnnotation(node); + checkSourceElement(node.body); var symbol = getSymbolOfNode(node); @@ -7184,6 +7312,9 @@ module ts { } function checkAccessorDeclaration(node: AccessorDeclaration) { + // Grammar checking accessors + checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); + if (fullTypeCheck) { if (node.kind === SyntaxKind.GetAccessor) { if (!isInAmbientContext(node) && nodeIsPresent(node.body) && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { @@ -7220,6 +7351,9 @@ module ts { } function checkTypeReference(node: TypeReferenceNode) { + // Grammar checking + checkGrammarTypeArguments(node, node.typeArguments); + var type = getTypeFromTypeReferenceNode(node); if (type !== unknownType && node.typeArguments) { // Do type argument local checks only if referenced type is successfully resolved @@ -7253,6 +7387,12 @@ module ts { } function checkTupleType(node: TupleTypeNode) { + // Grammar checking + var hasErrorFromDisallowedTrailingComma = checkGrammarForDisallowedTrailingComma(node.elementTypes); + if (!hasErrorFromDisallowedTrailingComma && node.elementTypes.length === 0) { + grammarErrorOnNode(node, Diagnostics.A_tuple_type_element_list_cannot_be_empty); + } + forEach(node.elementTypes, checkSourceElement); } @@ -7605,7 +7745,12 @@ module ts { } function checkFunctionDeclaration(node: FunctionDeclaration): void { + // Grammar Checking, check signature of function declaration as checkFunctionLikeDeclaration call checkGarmmarFunctionLikeDeclaration checkFunctionLikeDeclaration(node); + + //Grammar check other component of the functionDeclaration + checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); + if (fullTypeCheck) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); @@ -7651,6 +7796,11 @@ module ts { } function checkBlock(node: Block) { + // Grammar checking for SyntaxKind.Block + if (node.kind === SyntaxKind.Block) { + checkGrammarForStatementInAmbientContext(node); + } + forEach(node.statements, checkSourceElement); if (isFunctionBlock(node) || node.kind === SyntaxKind.ModuleBlock) { checkFunctionExpressionBodies(node); @@ -7842,6 +7992,15 @@ module ts { // Check variable, parameter, or property declaration function checkVariableLikeDeclaration(node: VariableLikeDeclaration) { + // Grammar checking + // TODO (yuisu) : Revisit this check once move all grammar checking + if (node.kind === SyntaxKind.BindingElement) { + checkGrammarEvalOrArgumentsInStrictMode(node, node.name); + } + else if (node.kind === SyntaxKind.VariableDeclaration) { + checkGrammarVariableDeclaration(node); + } + checkSourceElement(node.type); // For a computed property, just check the initializer and exit if (hasComputedNameButNotSymbol(node)) { @@ -7898,30 +8057,70 @@ module ts { } function checkVariableStatement(node: VariableStatement) { + // Grammar checking + checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarModifiers(node) || checkGrammarVariableDeclarationList(node.declarationList) || checkGrammarForDisallowedLetOrConstStatement(node); + forEach(node.declarationList.declarations, checkSourceElement); } + function checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node: Node) { + if (node.modifiers) { + if (inBlockOrObjectLiteralExpression(node)) { + return grammarErrorOnFirstToken(node, Diagnostics.Modifiers_cannot_appear_here); + } + } + } + + function inBlockOrObjectLiteralExpression(node: Node) { + while (node) { + if (node.kind === SyntaxKind.Block || node.kind === SyntaxKind.ObjectLiteralExpression) { + return true; + } + + node = node.parent; + } + } + function checkExpressionStatement(node: ExpressionStatement) { + // Grammar checking + checkGrammarForStatementInAmbientContext(node) + checkExpression(node.expression); } function checkIfStatement(node: IfStatement) { + // Grammar checking + checkGrammarForStatementInAmbientContext(node); + checkExpression(node.expression); checkSourceElement(node.thenStatement); checkSourceElement(node.elseStatement); } function checkDoStatement(node: DoStatement) { + // Grammar checking + checkGrammarForStatementInAmbientContext(node); + checkSourceElement(node.statement); checkExpression(node.expression); } function checkWhileStatement(node: WhileStatement) { + // Grammar checking + checkGrammarForStatementInAmbientContext(node); + checkExpression(node.expression); checkSourceElement(node.statement); } function checkForStatement(node: ForStatement) { + // Grammar checking + if (!checkGrammarForStatementInAmbientContext(node)) { + if (node.initializer && node.initializer.kind == SyntaxKind.VariableDeclarationList) { + checkGrammarVariableDeclarationList(node.initializer); + } + } + if (node.initializer) { if (node.initializer.kind === SyntaxKind.VariableDeclarationList) { forEach((node.initializer).declarations, checkVariableDeclaration) @@ -7937,6 +8136,17 @@ module ts { } function checkForInStatement(node: ForInStatement) { + // Grammar checking + if (!checkGrammarForStatementInAmbientContext(node)) { + if (node.initializer.kind === SyntaxKind.VariableDeclarationList) { + var variableList = node.initializer; + if (!checkGrammarVariableDeclarationList(variableList)) { + if (variableList.declarations.length > 1) { + grammarErrorOnFirstToken(variableList.declarations[1], Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); + } + } + } + } // TypeScript 1.0 spec (April 2014): 5.4 // In a 'for-in' statement of the form @@ -7980,6 +8190,9 @@ module ts { } function checkBreakOrContinueStatement(node: BreakOrContinueStatement) { + // Grammar checking + checkGrammarForStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); + // TODO: Check that target label is valid } @@ -7988,6 +8201,14 @@ module ts { } function checkReturnStatement(node: ReturnStatement) { + // Grammar checking + if (!checkGrammarForStatementInAmbientContext(node)) { + var functionBlock = getContainingFunction(node); + if (!functionBlock) { + grammarErrorOnFirstToken(node, Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + } + } + if (node.expression) { var func = getContainingFunction(node); if (func) { @@ -8011,13 +8232,40 @@ module ts { } function checkWithStatement(node: WithStatement) { + // Grammar checking for withStatement + if (!checkGrammarForStatementInAmbientContext(node)) { + if (node.parserContextFlags & ParserContextFlags.StrictMode) { + grammarErrorOnFirstToken(node, Diagnostics.with_statements_are_not_allowed_in_strict_mode); + } + } + checkExpression(node.expression); error(node.expression, Diagnostics.All_symbols_within_a_with_block_will_be_resolved_to_any); } function checkSwitchStatement(node: SwitchStatement) { + // Grammar checking + checkGrammarForStatementInAmbientContext(node); + + var firstDefaultClause: CaseOrDefaultClause; + var hasDuplicateDefaultClause = false; + var expressionType = checkExpression(node.expression); forEach(node.clauses, clause => { + // Grammar check for duplicate default clauses, skip if we already report duplicate default clause + if (clause.kind === SyntaxKind.DefaultClause && !hasDuplicateDefaultClause) { + if (firstDefaultClause === undefined) { + firstDefaultClause = clause; + } + else { + var sourceFile = getSourceFileOfNode(node); + var start = skipTrivia(sourceFile.text, clause.pos); + var end = clause.statements.length > 0 ? clause.statements[0].pos : clause.end; + grammarErrorAtPos(sourceFile, start, end - start, Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); + hasDuplicateDefaultClause = true; + } + } + if (fullTypeCheck && clause.kind === SyntaxKind.CaseClause) { var caseClause = clause; // TypeScript 1.0 spec (April 2014):5.9 @@ -8033,18 +8281,58 @@ module ts { } function checkLabeledStatement(node: LabeledStatement) { + // Grammar checking + if (!checkGrammarForStatementInAmbientContext(node)) { + var current = node.parent; + while (current) { + if (isAnyFunction(current)) { + break; + } + if (current.kind === SyntaxKind.LabeledStatement && (current).label.text === node.label.text) { + var sourceFile = getSourceFileOfNode(node); + grammarErrorOnNode(node.label, Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceFile.text, node.label)); + break; + } + current = current.parent; + } + } + + // ensure that label is unique checkSourceElement(node.statement); } function checkThrowStatement(node: ThrowStatement) { + // Grammar checking + if (!checkGrammarForStatementInAmbientContext(node)) { + if (node.expression === undefined) { + grammarErrorAfterFirstToken(node, Diagnostics.Line_break_not_permitted_here); + } + } + if (node.expression) { checkExpression(node.expression); } } function checkTryStatement(node: TryStatement) { + // Grammar checking + checkGrammarForStatementInAmbientContext(node); + checkBlock(node.tryBlock); - if (node.catchClause) checkBlock(node.catchClause.block); + var catchClause = node.catchClause; + if (catchClause) { + // Grammar checking + if (catchClause.type) { + var sourceFile = getSourceFileOfNode(node); + var colonStart = skipTrivia(sourceFile.text, catchClause.name.end); + grammarErrorAtPos(sourceFile, colonStart, ":".length, Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); + } + // It is a SyntaxError if a TryStatement with a Catch occurs within strict code and the Identifier of the + // Catch production is eval or arguments + checkGrammarEvalOrArgumentsInStrictMode(node, catchClause.name); + + checkBlock(catchClause.block); + } if (node.finallyBlock) checkBlock(node.finallyBlock); } @@ -8150,6 +8438,9 @@ module ts { } function checkClassDeclaration(node: ClassDeclaration) { + // Grammar checking + checkGrammarClassDeclarationHeritageClauses(node); + checkTypeNameIsReserved(node.name, Diagnostics.Class_name_cannot_be_0); checkTypeParameters(node.typeParameters); checkCollisionWithCapturedThisVariable(node, node.name); @@ -8353,6 +8644,9 @@ module ts { } function checkInterfaceDeclaration(node: InterfaceDeclaration) { + // Grammar checking + checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); + checkTypeParameters(node.typeParameters); if (fullTypeCheck) { checkTypeNameIsReserved(node.name, Diagnostics.Interface_name_cannot_be_0); @@ -8387,6 +8681,9 @@ module ts { } function checkTypeAliasDeclaration(node: TypeAliasDeclaration) { + // Grammar checking + checkGrammarModifiers(node); + checkTypeNameIsReserved(node.name, Diagnostics.Type_alias_name_cannot_be_0); checkSourceElement(node.type); } @@ -8550,6 +8847,9 @@ module ts { } function checkEnumDeclaration(node: EnumDeclaration) { + // Grammar checking + checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node); + if (!fullTypeCheck) { return; } @@ -8617,6 +8917,27 @@ module ts { } function checkModuleDeclaration(node: ModuleDeclaration) { + // Grammar checking + if (!checkGrammarModifiers(node)) { + if (!isInAmbientContext(node) && node.name.kind === SyntaxKind.StringLiteral) { + grammarErrorOnNode(node.name, Diagnostics.Only_ambient_modules_can_use_quoted_names); + } + else if (node.name.kind === SyntaxKind.Identifier && node.body.kind === SyntaxKind.ModuleBlock) { + var statements = (node.body).statements; + for (var i = 0, n = statements.length; i < n; i++) { + var statement = statements[i]; + + if (statement.kind === SyntaxKind.ExportAssignment) { + // Export assignments are not allowed in an internal module + grammarErrorOnNode(statement, Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); + } + else if (isExternalModuleImportDeclaration(statement)) { + grammarErrorOnNode(getExternalModuleImportDeclarationExpression(statement), Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + } + } + } + } + if (fullTypeCheck) { checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -8653,6 +8974,9 @@ module ts { } function checkImportDeclaration(node: ImportDeclaration) { + // Grammar checking + checkGrammarModifiers(node); + checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); var symbol = getSymbolOfNode(node); @@ -8718,6 +9042,11 @@ module ts { } function checkExportAssignment(node: ExportAssignment) { + // Grammar checking + if (!checkGrammarModifiers(node) && (node.flags & NodeFlags.Modifier)) { + grammarErrorOnFirstToken(node, Diagnostics.An_export_assignment_cannot_have_modifiers); + } + var container = node.parent; if (container.kind !== SyntaxKind.SourceFile) { // In a module, the immediate parent will be a block, so climb up one more parent @@ -8740,6 +9069,7 @@ module ts { case SyntaxKind.ConstructorType: case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: + return checkSignatureDeclaration(node); case SyntaxKind.IndexSignature: return checkSignatureDeclaration(node); case SyntaxKind.MethodDeclaration: @@ -8815,6 +9145,12 @@ module ts { return checkImportDeclaration(node); case SyntaxKind.ExportAssignment: return checkExportAssignment(node); + case SyntaxKind.EmptyStatement: + checkGrammarForStatementInAmbientContext(node); + return; + case SyntaxKind.DebuggerStatement: + checkGrammarForStatementInAmbientContext(node); + return; } } @@ -8907,6 +9243,9 @@ module ts { function checkSourceFile(node: SourceFile) { var links = getNodeLinks(node); if (!(links.flags & NodeCheckFlags.TypeChecked)) { + // Grammar checking + checkGrammarSourceFile(node); + emitExtends = false; potentialThisCollisions.length = 0; @@ -9472,7 +9811,7 @@ module ts { return program.getDiagnostics(sourceFile).length !== 0 || hasEarlyErrors(sourceFile) || (compilerOptions.noEmitOnError && getDiagnostics(sourceFile).length !== 0); - } + } function hasEarlyErrors(sourceFile?: SourceFile): boolean { return forEach(getDiagnostics(sourceFile), d => d.isEarly); @@ -9625,6 +9964,918 @@ module ts { anyArrayType = createArrayType(anyType); } + + // GRAMMAR CHECKING + function checkGrammarModifiers(node: Node): boolean { + switch (node.kind) { + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.Constructor: + case SyntaxKind.PropertyDeclaration: + case SyntaxKind.PropertySignature: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.MethodSignature: + case SyntaxKind.IndexSignature: + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.ModuleDeclaration: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.ExportAssignment: + case SyntaxKind.VariableStatement: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.TypeAliasDeclaration: + case SyntaxKind.ImportDeclaration: + case SyntaxKind.Parameter: + break; + default: + return false; + } + + if (!node.modifiers) { + return; + } + + var lastStatic: Node, lastPrivate: Node, lastProtected: Node, lastDeclare: Node; + var flags = 0; + for (var i = 0, n = node.modifiers.length; i < n; i++) { + var modifier = node.modifiers[i]; + + switch (modifier.kind) { + case SyntaxKind.PublicKeyword: + case SyntaxKind.ProtectedKeyword: + case SyntaxKind.PrivateKeyword: + var text: string; + if (modifier.kind === SyntaxKind.PublicKeyword) { + text = "public"; + } + else if (modifier.kind === SyntaxKind.ProtectedKeyword) { + text = "protected"; + lastProtected = modifier; + } + else { + text = "private"; + lastPrivate = modifier; + } + + if (flags & NodeFlags.AccessibilityModifier) { + return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen); + } + else if (flags & NodeFlags.Static) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); + } + else if (node.parent.kind === SyntaxKind.ModuleBlock || node.parent.kind === SyntaxKind.SourceFile) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); + } + flags |= modifierToFlag(modifier.kind); + break; + + case SyntaxKind.StaticKeyword: + if (flags & NodeFlags.Static) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static"); + } + else if (node.parent.kind === SyntaxKind.ModuleBlock || node.parent.kind === SyntaxKind.SourceFile) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); + } + else if (node.kind === SyntaxKind.Parameter) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); + } + flags |= NodeFlags.Static; + lastStatic = modifier; + break; + + case SyntaxKind.ExportKeyword: + if (flags & NodeFlags.Export) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export"); + } + else if (flags & NodeFlags.Ambient) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); + } + else if (node.parent.kind === SyntaxKind.ClassDeclaration) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); + } + else if (node.kind === SyntaxKind.Parameter) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); + } + flags |= NodeFlags.Export; + break; + + case SyntaxKind.DeclareKeyword: + if (flags & NodeFlags.Ambient) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare"); + } + else if (node.parent.kind === SyntaxKind.ClassDeclaration) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); + } + else if (node.kind === SyntaxKind.Parameter) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); + } + else if (isInAmbientContext(node.parent) && node.parent.kind === SyntaxKind.ModuleBlock) { + return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); + } + flags |= NodeFlags.Ambient; + lastDeclare = modifier + break; + } + } + + if (node.kind === SyntaxKind.Constructor) { + if (flags & NodeFlags.Static) { + return grammarErrorOnNode(lastStatic, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); + } + else if (flags & NodeFlags.Protected) { + return grammarErrorOnNode(lastProtected, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); + } + else if (flags & NodeFlags.Private) { + return grammarErrorOnNode(lastPrivate, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); + } + } + else if (node.kind === SyntaxKind.ImportDeclaration && flags & NodeFlags.Ambient) { + return grammarErrorOnNode(lastDeclare, Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); + } + else if (node.kind === SyntaxKind.InterfaceDeclaration && flags & NodeFlags.Ambient) { + return grammarErrorOnNode(lastDeclare, Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); + } + } + + function checkGrammarForDisallowedTrailingComma(list: NodeArray): boolean { + if (list && list.hasTrailingComma) { + var start = list.end - ",".length; + var end = list.end; + var sourceFile = getSourceFileOfNode(list[0]); + return grammarErrorAtPos(sourceFile, start, end - start, Diagnostics.Trailing_comma_not_allowed); + } + } + + function checkGrammarTypeParameterList(node: FunctionLikeDeclaration, typeParameters: NodeArray): boolean { + if (checkGrammarForDisallowedTrailingComma(typeParameters)) { + return true; + } + + if (typeParameters && typeParameters.length === 0) { + var start = typeParameters.pos - "<".length; + var sourceFile = getSourceFileOfNode(node); + var end = skipTrivia(sourceFile.text, typeParameters.end) + ">".length; + return grammarErrorAtPos(sourceFile, start, end - start, Diagnostics.Type_parameter_list_cannot_be_empty); + } + } + + function checkGrammarParameterList(parameters: NodeArray) { + if (checkGrammarForDisallowedTrailingComma(parameters)) { + return true; + } + + var seenOptionalParameter = false; + var parameterCount = parameters.length; + + for (var i = 0; i < parameterCount; i++) { + var parameter = parameters[i]; + if (parameter.dotDotDotToken) { + if (i !== (parameterCount - 1)) { + return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + } + + if (parameter.questionToken) { + return grammarErrorOnNode(parameter.questionToken, Diagnostics.A_rest_parameter_cannot_be_optional); + } + + if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_cannot_have_an_initializer); + } + } + else if (parameter.questionToken || parameter.initializer) { + seenOptionalParameter = true; + + if (parameter.questionToken && parameter.initializer) { + return grammarErrorOnNode(parameter.name, Diagnostics.Parameter_cannot_have_question_mark_and_initializer); + } + } + else { + if (seenOptionalParameter) { + return grammarErrorOnNode(parameter.name, Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); + } + } + } + } + + function checkGrammarFunctionLikeDeclaration(node: FunctionLikeDeclaration): boolean { + // Prevent cascading error by short-circuit + return checkGrammarModifiers(node) || checkGrammarTypeParameterList(node, node.typeParameters) || checkGrammarParameterList(node.parameters); + } + + function checkGrammarIndexSignatureParameters(node: SignatureDeclaration): boolean { + var parameter = node.parameters[0]; + if (node.parameters.length !== 1) { + if (parameter) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } + else { + return grammarErrorOnNode(node, Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } + } + else if (parameter.dotDotDotToken) { + return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.An_index_signature_cannot_have_a_rest_parameter); + } + else if (parameter.flags & NodeFlags.Modifier) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); + } + else if (parameter.questionToken) { + return grammarErrorOnNode(parameter.questionToken, Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); + } + else if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); + } + else if (!parameter.type) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); + } + else if (parameter.type.kind !== SyntaxKind.StringKeyword && parameter.type.kind !== SyntaxKind.NumberKeyword) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); + } + else if (!node.type) { + return grammarErrorOnNode(node, Diagnostics.An_index_signature_must_have_a_type_annotation); + } + } + + function checkGrammarForIndexSignatureModifier(node: SignatureDeclaration): void { + if (node.flags & NodeFlags.Modifier) { + grammarErrorOnFirstToken(node, Diagnostics.Modifiers_not_permitted_on_index_signature_members); + } + } + + function checkGrammarIndexSignature(node: SignatureDeclaration) { + // Prevent cascading error by short-circuit + checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node) || checkGrammarForIndexSignatureModifier(node); + } + + function checkGrammarForAtLeastOneTypeArgument(node: Node, typeArguments: NodeArray): boolean { + if (typeArguments && typeArguments.length === 0) { + var sourceFile = getSourceFileOfNode(node); + var start = typeArguments.pos - "<".length; + var end = skipTrivia(sourceFile.text, typeArguments.end) + ">".length; + return grammarErrorAtPos(sourceFile, start, end - start, Diagnostics.Type_argument_list_cannot_be_empty); + } + } + + function checkGrammarTypeArguments(node: Node, typeArguments: NodeArray): boolean { + return checkGrammarForDisallowedTrailingComma(typeArguments) || + checkGrammarForAtLeastOneTypeArgument(node, typeArguments); + } + + function checkGrammarForOmittedArgument(node: CallExpression, arguments: NodeArray): boolean { + if (arguments) { + var sourceFile = getSourceFileOfNode(node); + for (var i = 0, n = arguments.length; i < n; i++) { + var arg = arguments[i]; + if (arg.kind === SyntaxKind.OmittedExpression) { + return grammarErrorAtPos(sourceFile, arg.pos, 0, Diagnostics.Argument_expression_expected); + } + } + } + } + + function checkGrammarArguments(node: CallExpression, arguments: NodeArray): boolean { + return checkGrammarForDisallowedTrailingComma(arguments) || + checkGrammarForOmittedArgument(node, arguments); + } + + function checkGrammarHeritageClause(node: HeritageClause): boolean { + var types = node.types; + if (checkGrammarForDisallowedTrailingComma(types)) { + return true; + } + if (types && types.length === 0) { + var listType = tokenToString(node.token); + var sourceFile = getSourceFileOfNode(node); + return grammarErrorAtPos(sourceFile, types.pos, 0, Diagnostics._0_list_cannot_be_empty, listType) + } + } + + function checkGrammarClassDeclarationHeritageClauses(node: ClassDeclaration) { + var seenExtendsClause = false; + var seenImplementsClause = false; + + if (!checkGrammarModifiers(node) && node.heritageClauses) { + for (var i = 0, n = node.heritageClauses.length; i < n; i++) { + Debug.assert(i <= 2); + var heritageClause = node.heritageClauses[i]; + + if (heritageClause.token === SyntaxKind.ExtendsKeyword) { + if (seenExtendsClause) { + return grammarErrorOnFirstToken(heritageClause, Diagnostics.extends_clause_already_seen) + } + + if (seenImplementsClause) { + return grammarErrorOnFirstToken(heritageClause, Diagnostics.extends_clause_must_precede_implements_clause); + } + + if (heritageClause.types.length > 1) { + return grammarErrorOnFirstToken(heritageClause.types[1], Diagnostics.Classes_can_only_extend_a_single_class); + } + + seenExtendsClause = true; + } + else { + Debug.assert(heritageClause.token === SyntaxKind.ImplementsKeyword); + if (seenImplementsClause) { + return grammarErrorOnFirstToken(heritageClause, Diagnostics.implements_clause_already_seen); + } + + seenImplementsClause = true; + } + + // Grammar checking heritageClause inside class declaration + checkGrammarHeritageClause(heritageClause); + } + } + } + + function checkGrammarInterfaceDeclaration(node: InterfaceDeclaration) { + var seenExtendsClause = false; + + if (node.heritageClauses) { + for (var i = 0, n = node.heritageClauses.length; i < n; i++) { + Debug.assert(i <= 1); + var heritageClause = node.heritageClauses[i]; + + if (heritageClause.token === SyntaxKind.ExtendsKeyword) { + if (seenExtendsClause) { + return grammarErrorOnFirstToken(heritageClause, Diagnostics.extends_clause_already_seen); + } + + seenExtendsClause = true; + } + else { + Debug.assert(heritageClause.token === SyntaxKind.ImplementsKeyword); + return grammarErrorOnFirstToken(heritageClause, Diagnostics.Interface_declaration_cannot_have_implements_clause); + } + + // Grammar checking heritageClause inside class declaration + checkGrammarHeritageClause(heritageClause); + } + } + + return false; + } + + function checkGrammarComputedPropertyName(node: Node): void { + // If node is not a computedPropertyName, just skip the grammar checking + if (node.kind !== SyntaxKind.ComputedPropertyName) { + return; + } + // Since computed properties are not supported in the type checker, disallow them in TypeScript 1.4 + // Once full support is added, remove this error. + grammarErrorOnNode(node, Diagnostics.Computed_property_names_are_not_currently_supported); + return; + + var computedPropertyName = node; + if (compilerOptions.target < ScriptTarget.ES6) { + grammarErrorOnNode(node, Diagnostics.Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + else if (computedPropertyName.expression.kind === SyntaxKind.BinaryExpression && (computedPropertyName.expression).operator === SyntaxKind.CommaToken) { + grammarErrorOnNode(computedPropertyName.expression, Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); + } + } + + function checkGrammarForGenerator(node: FunctionLikeDeclaration) { + if (node.asteriskToken) { + return grammarErrorOnNode(node.asteriskToken, Diagnostics.Generators_are_not_currently_supported); + } + } + + function checkGrammarFunctionName(name: Node) { + // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a strict mode FunctionDeclaration or FunctionExpression (13.1)) + return checkGrammarEvalOrArgumentsInStrictMode(name, name); + } + + function checkGrammarForInvalidQuestionMark(node: Declaration, questionToken: Node, message: DiagnosticMessage): boolean { + if (questionToken) { + return grammarErrorOnNode(questionToken, message); + } + } + + function checkGrammarObjectLiteralExpression(node: ObjectLiteralExpression) { + var seen: Map = {}; + var Property = 1; + var GetAccessor = 2; + var SetAccesor = 4; + var GetOrSetAccessor = GetAccessor | SetAccesor; + var inStrictMode = (node.parserContextFlags & ParserContextFlags.StrictMode) !== 0; + + for (var i = 0, n = node.properties.length; i < n; i++) { + var prop = node.properties[i]; + var name = prop.name; + if (prop.kind === SyntaxKind.OmittedExpression || + name.kind === SyntaxKind.ComputedPropertyName) { + // If the name is not a ComputedPropertyName, the grammar checking will skip it + checkGrammarComputedPropertyName(name); + continue; + } + + // ECMA-262 11.1.5 Object Initialiser + // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true + // a.This production is contained in strict code and IsDataDescriptor(previous) is true and + // IsDataDescriptor(propId.descriptor) is true. + // b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true. + // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. + // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true + // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields + var currentKind: number; + if (prop.kind === SyntaxKind.PropertyAssignment || prop.kind === SyntaxKind.ShorthandPropertyAssignment) { + // Grammar checking for computedPropertName and shorthandPropertyAssignment + checkGrammarForInvalidQuestionMark(prop,(prop).questionToken, Diagnostics.An_object_member_cannot_be_declared_optional); + if (name.kind === SyntaxKind.NumericLiteral) { + checkGrammarNumbericLiteral(name); + } + currentKind = Property; + } + else if ( prop.kind === SyntaxKind.MethodDeclaration) { + currentKind = Property; + } + else if (prop.kind === SyntaxKind.GetAccessor) { + currentKind = GetAccessor; + } + else if (prop.kind === SyntaxKind.SetAccessor) { + currentKind = SetAccesor; + } + else { + Debug.fail("Unexpected syntax kind:" + prop.kind); + } + + if (!hasProperty(seen, (name).text)) { + seen[(name).text] = currentKind; + } + else { + var existingKind = seen[(name).text]; + if (currentKind === Property && existingKind === Property) { + if (inStrictMode) { + grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + } + } + else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { + if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { + seen[(name).text] = currentKind | existingKind; + } + else { + return grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + } + } + else { + return grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + } + } + } + } + + function checkGrammarAccessor(accessor: MethodDeclaration): boolean { + var kind = accessor.kind; + if (compilerOptions.target < ScriptTarget.ES5) { + return grammarErrorOnNode(accessor.name, Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); + } + else if (isInAmbientContext(accessor)) { + return grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); + } + else if (accessor.body === undefined) { + return grammarErrorAtPos(getSourceFileOfNode(accessor), accessor.end - 1, ";".length, Diagnostics._0_expected, "{"); + } + else if (accessor.typeParameters) { + return grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_have_type_parameters); + } + else if (kind === SyntaxKind.GetAccessor && accessor.parameters.length) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_get_accessor_cannot_have_parameters); + } + else if (kind === SyntaxKind.SetAccessor) { + if (accessor.type) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); + } + else if (accessor.parameters.length !== 1) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_must_have_exactly_one_parameter); + } + else { + var parameter = accessor.parameters[0]; + if (parameter.dotDotDotToken) { + return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.A_set_accessor_cannot_have_rest_parameter); + } + else if (parameter.flags & NodeFlags.Modifier) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); + } + else if (parameter.questionToken) { + return grammarErrorOnNode(parameter.questionToken, Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); + } + else if (parameter.initializer) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); + } + } + } + } + + function checkGrammarForDisallowedComputedProperty(node: DeclarationName, message: DiagnosticMessage) { + if (node.kind === SyntaxKind.ComputedPropertyName) { + return grammarErrorOnNode(node, message); + } + } + + function checkGrammarMethod(node: MethodDeclaration) { + if (checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || + checkGrammarFunctionLikeDeclaration(node) || + checkGrammarForGenerator(node)) { + return true; + } + + if (node.parent.kind === SyntaxKind.ObjectLiteralExpression) { + if (checkGrammarForInvalidQuestionMark(node, node.questionToken, Diagnostics.A_class_member_cannot_be_declared_optional)) { + return true; + } + else if (node.body === undefined) { + return grammarErrorAtPos(getSourceFile(node), node.end - 1, ";".length, Diagnostics._0_expected, "{"); + } + } + + if (node.parent.kind === SyntaxKind.ClassDeclaration) { + if (checkGrammarForInvalidQuestionMark(node, node.questionToken, Diagnostics.A_class_member_cannot_be_declared_optional)) { + return true; + } + // Technically, computed properties in ambient contexts is disallowed + // for property declarations and accessors too, not just methods. + // However, property declarations disallow computed names in general, + // and accessors are not allowed in ambient contexts in general, + // so this error only really matters for methods. + if (isInAmbientContext(node)) { + return checkGrammarForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_an_ambient_context); + } + else if (!node.body) { + return checkGrammarForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_method_overloads); + } + } + else if (node.parent.kind === SyntaxKind.InterfaceDeclaration) { + return checkGrammarForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_interfaces); + } + else if (node.parent.kind === SyntaxKind.TypeLiteral) { + return checkGrammarForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_type_literals); + } + } + + function isIterationStatement(node: Node, lookInLabeledStatements: boolean): boolean { + switch (node.kind) { + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + return true; + case SyntaxKind.LabeledStatement: + return lookInLabeledStatements && isIterationStatement((node).statement, lookInLabeledStatements); + } + + return false; + } + + function checkGrammarBreakOrContinueStatement(node: BreakOrContinueStatement): boolean { + var current: Node = node; + while (current) { + if (isAnyFunction(current)) { + return grammarErrorOnNode(node, Diagnostics.Jump_target_cannot_cross_function_boundary); + } + + switch (current.kind) { + case SyntaxKind.LabeledStatement: + if (node.label && (current).label.text === node.label.text) { + // found matching label - verify that label usage is correct + // continue can only target labels that are on iteration statements + var isMisplacedContinueLabel = node.kind === SyntaxKind.ContinueStatement + && !isIterationStatement((current).statement, /*lookInLabeledStatement*/ true); + + if (isMisplacedContinueLabel) { + return grammarErrorOnNode(node, Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); + } + + return false; + } + break; + case SyntaxKind.SwitchStatement: + if (node.kind === SyntaxKind.BreakStatement && !node.label) { + // unlabeled break within switch statement - ok + return false; + } + break; + default: + if (isIterationStatement(current, /*lookInLabeledStatement*/ false) && !node.label) { + // unlabeled break or continue within iteration statement - ok + return false; + } + break; + } + + current = current.parent; + } + + if (node.label) { + var message = node.kind === SyntaxKind.BreakStatement + ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement + : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; + + return grammarErrorOnNode(node, message) + } + else { + var message = node.kind === SyntaxKind.BreakStatement + ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement + : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; + return grammarErrorOnNode(node, message) + } + } + + function checkGrammarVariableDeclaration(node: VariableDeclaration) { + if (isInAmbientContext(node)) { + if (isBindingPattern(node.name)) { + return grammarErrorOnNode(node, Diagnostics.Destructuring_declarations_are_not_allowed_in_ambient_contexts); + } + if (node.initializer) { + // Error on equals token which immediate precedes the initializer + return grammarErrorAtPos(getSourceFileOfNode(node), node.initializer.pos - 1, 1, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + } + else { + if (!node.initializer) { + if (isBindingPattern(node.name) && !isBindingPattern(node.parent)) { + return grammarErrorOnNode(node, Diagnostics.A_destructuring_declaration_must_have_an_initializer); + } + if (isConst(node)) { + return grammarErrorOnNode(node, Diagnostics.const_declarations_must_be_initialized); + } + } + } + // It is a SyntaxError if a VariableDeclaration or VariableDeclarationNoIn occurs within strict code + // and its Identifier is eval or arguments + return checkGrammarEvalOrArgumentsInStrictMode(node, node.name); + } + + function checkGrammarVariableDeclarationList(declarationList: VariableDeclarationList): boolean { + var declarations = declarationList.declarations; + if (checkGrammarForDisallowedTrailingComma(declarationList.declarations)) { + return true; + } + + if (!declarationList.declarations.length) { + return grammarErrorAtPos(getSourceFileOfNode(declarationList), declarations.pos, declarations.end - declarations.pos, Diagnostics.Variable_declaration_list_cannot_be_empty); + } + + if (compilerOptions.target < ScriptTarget.ES6) { + if (isLet(declarationList)) { + return grammarErrorOnFirstToken(declarationList, Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + else if (isConst(declarationList)) { + return grammarErrorOnFirstToken(declarationList, Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + } + + function allowLetAndConstDeclarations(parent: Node): boolean { + switch (parent.kind) { + case SyntaxKind.IfStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + case SyntaxKind.WithStatement: + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + return false; + case SyntaxKind.LabeledStatement: + return allowLetAndConstDeclarations(parent.parent); + } + + return true; + } + + function checkGrammarForDisallowedLetOrConstStatement(node: VariableStatement) { + if (!allowLetAndConstDeclarations(node.parent)) { + if (isLet(node.declarationList)) { + return grammarErrorOnNode(node, Diagnostics.let_declarations_can_only_be_declared_inside_a_block); + } + else if (isConst(node.declarationList)) { + return grammarErrorOnNode(node, Diagnostics.const_declarations_can_only_be_declared_inside_a_block); + } + } + } + + function isIntegerLiteral(expression: Expression): boolean { + if (expression.kind === SyntaxKind.PrefixUnaryExpression) { + var unaryExpression = expression; + if (unaryExpression.operator === SyntaxKind.PlusToken || unaryExpression.operator === SyntaxKind.MinusToken) { + expression = unaryExpression.operand; + } + } + if (expression.kind === SyntaxKind.NumericLiteral) { + // Allows for scientific notation since literalExpression.text was formed by + // coercing a number to a string. Sometimes this coercion can yield a string + // in scientific notation. + // We also don't need special logic for hex because a hex integer is converted + // to decimal when it is coerced. + return /^[0-9]+([eE]\+?[0-9]+)?$/.test((expression).text); + } + + return false; + } + + function checkGrammarEnumDeclaration(enumDecl: EnumDeclaration): boolean { + var enumIsConst = (enumDecl.flags & NodeFlags.Const) !== 0; + + var hasError = false; + + // skip checks below for const enums - they allow arbitrary initializers as long as they can be evaluated to constant expressions. + // since all values are known in compile time - it is not necessary to check that constant enum section precedes computed enum members. + if (!enumIsConst) { + var inConstantEnumMemberSection = true; + var inAmbientContext = isInAmbientContext(enumDecl); + for (var i = 0, n = enumDecl.members.length; i < n; i++) { + var node = enumDecl.members[i]; + if (node.name.kind === SyntaxKind.ComputedPropertyName) { + hasError = grammarErrorOnNode(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums); + } + else if (inAmbientContext) { + if (node.initializer && !isIntegerLiteral(node.initializer)) { + hasError = grammarErrorOnNode(node.name, Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers) || hasError; + } + } + else if (node.initializer) { + inConstantEnumMemberSection = isIntegerLiteral(node.initializer); + } + else if (!inConstantEnumMemberSection) { + hasError = grammarErrorOnNode(node.name, Diagnostics.Enum_member_must_have_initializer) || hasError; + } + } + } + + return hasError; + } + + function hasParseDiagnostics(sourceFile: SourceFile): boolean { + return sourceFile.parseDiagnostics.length > 0; + } + + function scanToken(scanner: Scanner, pos: number) { + scanner.setTextPos(pos); + scanner.scan(); + var start = scanner.getTokenPos(); + return start; + } + + function grammarErrorOnFirstToken(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { + var sourceFile = getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + var scanner = createScanner(compilerOptions.target, /*skipTrivia*/ true, sourceFile.text); + var start = scanToken(scanner, node.pos); + diagnostics.push(createFileDiagnostic(sourceFile, start, scanner.getTextPos() - start, message, arg0, arg1, arg2)); + return true; + } + } + + function grammarErrorAtPos(sourceFile: SourceFile, start: number, length: number, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { + if (!hasParseDiagnostics(sourceFile)) { + diagnostics.push(createFileDiagnostic(sourceFile, start, length, message, arg0, arg1, arg2)); + return true; + } + } + + function grammarErrorOnNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { + var sourceFile = getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + var span = getErrorSpanForNode(node); + var start = span.end > span.pos ? skipTrivia(sourceFile.text, span.pos) : span.pos; + diagnostics.push(createFileDiagnostic(sourceFile, start, span.end - start, message, arg0, arg1, arg2)); + return true; + } + } + + function checkGrammarEvalOrArgumentsInStrictMode(contextNode: Node, identifier: Identifier): boolean { + if (contextNode && (contextNode.parserContextFlags & ParserContextFlags.StrictMode) && isEvalOrArgumentsIdentifier(identifier)) { + var name = declarationNameToString(identifier); + return grammarErrorOnNode(identifier, Diagnostics.Invalid_use_of_0_in_strict_mode, name); + } + } + + function checkGrammarConstructorTypeParameters(node: ConstructorDeclaration) { + if (node.typeParameters) { + return grammarErrorAtPos(getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + } + } + + function checkGrammarConstructorTypeAnnotation(node: ConstructorDeclaration) { + if (node.type) { + return grammarErrorOnNode(node.type, Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); + } + } + + function checkGrammarProperty(node: PropertyDeclaration) { + if (node.parent.kind === SyntaxKind.ClassDeclaration) { + if (checkGrammarForInvalidQuestionMark(node, node.questionToken, Diagnostics.A_class_member_cannot_be_declared_optional) || + checkGrammarForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_class_property_declarations)) { + return true; + } + } + else if (node.parent.kind === SyntaxKind.InterfaceDeclaration) { + if (checkGrammarForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_interfaces)) { + return true; + } + } + else if (node.parent.kind === SyntaxKind.TypeLiteral) { + if (checkGrammarForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_type_literals)) { + return true; + } + } + + if (isInAmbientContext(node) && node.initializer) { + return grammarErrorOnFirstToken(node.initializer, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + } + + function checkGrammarTopLevelElementForRequiredDeclareModifier(node: Node): boolean { + // A declare modifier is required for any top level .d.ts declaration except export=, interfaces and imports: + // categories: + // + // DeclarationElement: + // ExportAssignment + // export_opt InterfaceDeclaration + // export_opt ImportDeclaration + // export_opt ExternalImportDeclaration + // export_opt AmbientDeclaration + // + if (node.kind === SyntaxKind.InterfaceDeclaration || + node.kind === SyntaxKind.ImportDeclaration || + node.kind === SyntaxKind.ExportAssignment || + (node.flags & NodeFlags.Ambient)) { + + return false; + } + + return grammarErrorOnFirstToken(node, Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); + } + + function checkGrammarTopLevelElementsForRequiredDeclareModifier(file: SourceFile): boolean { + for (var i = 0, n = file.statements.length; i < n; i++) { + var decl = file.statements[i]; + if (isDeclaration(decl) || decl.kind === SyntaxKind.VariableStatement) { + if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { + return true; + } + } + } + } + + function checkGrammarSourceFile(node: SourceFile): boolean { + return isInAmbientContext(node) && checkGrammarTopLevelElementsForRequiredDeclareModifier(node); + } + + function checkGrammarForStatementInAmbientContext(node: Node): boolean { + if (isInAmbientContext(node)) { + // An accessors is already reported about the ambient context + if (isAccessor(node.parent.kind)) { + return getNodeLinks(node).hasReportedStatementInAmbientContext = true; + } + + // Find containing block which is either Block, ModuleBlock, SourceFile + var links = getNodeLinks(node); + if (!links.hasReportedStatementInAmbientContext && isAnyFunction(node.parent)) { + return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts) + } + + // We are either parented by another statement, or some sort of block. + // If we're in a block, we only want to really report an error once + // to prevent noisyness. So use a bit on the block to indicate if + // this has already been reported, and don't report if it has. + // + if (node.parent.kind === SyntaxKind.Block || node.parent.kind === SyntaxKind.ModuleBlock || node.parent.kind === SyntaxKind.SourceFile) { + var links = getNodeLinks(node.parent); + // Check if the containing block ever report this error + if (!links.hasReportedStatementInAmbientContext) { + return links.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + } + } + else { + // We must be parented by a statement. If so, there's no need + // to report the error as our parent will have already done it. + // Debug.assert(isStatement(node.parent)); + } + } + } + + function checkGrammarNumbericLiteral(node: Identifier): boolean { + // Grammar checking + if (node.flags & NodeFlags.OctalLiteral) { + if (node.parserContextFlags & ParserContextFlags.StrictMode) { + return grammarErrorOnNode(node, Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); + } + else if (compilerOptions.target >= ScriptTarget.ES5) { + return grammarErrorOnNode(node, Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); + } + } + } + + function grammarErrorAfterFirstToken(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { + var sourceFile = getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + var scanner = createScanner(compilerOptions.target, /*skipTrivia*/ true, sourceFile.text); + scanToken(scanner, node.pos); + diagnostics.push(createFileDiagnostic(sourceFile, scanner.getTextPos(), 0, message, arg0, arg1, arg2)); + return true; + } + } + initializeTypeChecker(); return checker; diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 938776ef4d0..1f3224927b5 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -4,89 +4,87 @@ module ts { export var Diagnostics = { Unterminated_string_literal: { code: 1002, category: DiagnosticCategory.Error, key: "Unterminated string literal." }, Identifier_expected: { code: 1003, category: DiagnosticCategory.Error, key: "Identifier expected." }, - _0_expected: { code: 1005, category: DiagnosticCategory.Error, key: "'{0}' expected." }, + _0_expected: { code: 1005, category: DiagnosticCategory.Error, key: "'{0}' expected.", isEarly: true }, A_file_cannot_have_a_reference_to_itself: { code: 1006, category: DiagnosticCategory.Error, key: "A file cannot have a reference to itself." }, - Trailing_comma_not_allowed: { code: 1009, category: DiagnosticCategory.Error, key: "Trailing comma not allowed." }, + Trailing_comma_not_allowed: { code: 1009, category: DiagnosticCategory.Error, key: "Trailing comma not allowed.", isEarly: true }, Asterisk_Slash_expected: { code: 1010, category: DiagnosticCategory.Error, key: "'*/' expected." }, Unexpected_token: { code: 1012, category: DiagnosticCategory.Error, key: "Unexpected token." }, - Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: DiagnosticCategory.Error, key: "Catch clause parameter cannot have a type annotation." }, - A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: DiagnosticCategory.Error, key: "A rest parameter must be last in a parameter list." }, - Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: DiagnosticCategory.Error, key: "Parameter cannot have question mark and initializer." }, - A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: DiagnosticCategory.Error, key: "A required parameter cannot follow an optional parameter." }, - An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: DiagnosticCategory.Error, key: "An index signature cannot have a rest parameter." }, - An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: DiagnosticCategory.Error, key: "An index signature parameter cannot have an accessibility modifier." }, - An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: DiagnosticCategory.Error, key: "An index signature parameter cannot have a question mark." }, - An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: DiagnosticCategory.Error, key: "An index signature parameter cannot have an initializer." }, - An_index_signature_must_have_a_type_annotation: { code: 1021, category: DiagnosticCategory.Error, key: "An index signature must have a type annotation." }, - An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: DiagnosticCategory.Error, key: "An index signature parameter must have a type annotation." }, - An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: DiagnosticCategory.Error, key: "An index signature parameter type must be 'string' or 'number'." }, + Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: DiagnosticCategory.Error, key: "Catch clause parameter cannot have a type annotation.", isEarly: true }, + A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: DiagnosticCategory.Error, key: "A rest parameter must be last in a parameter list.", isEarly: true }, + Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: DiagnosticCategory.Error, key: "Parameter cannot have question mark and initializer.", isEarly: true }, + A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: DiagnosticCategory.Error, key: "A required parameter cannot follow an optional parameter.", isEarly: true }, + An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: DiagnosticCategory.Error, key: "An index signature cannot have a rest parameter.", isEarly: true }, + An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: DiagnosticCategory.Error, key: "An index signature parameter cannot have an accessibility modifier.", isEarly: true }, + An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: DiagnosticCategory.Error, key: "An index signature parameter cannot have a question mark.", isEarly: true }, + An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: DiagnosticCategory.Error, key: "An index signature parameter cannot have an initializer.", isEarly: true }, + An_index_signature_must_have_a_type_annotation: { code: 1021, category: DiagnosticCategory.Error, key: "An index signature must have a type annotation.", isEarly: true }, + An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: DiagnosticCategory.Error, key: "An index signature parameter must have a type annotation.", isEarly: true }, + An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: DiagnosticCategory.Error, key: "An index signature parameter type must be 'string' or 'number'.", isEarly: true }, A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: DiagnosticCategory.Error, key: "A class or interface declaration can only have one 'extends' clause." }, An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: DiagnosticCategory.Error, key: "An 'extends' clause must precede an 'implements' clause." }, A_class_can_only_extend_a_single_class: { code: 1026, category: DiagnosticCategory.Error, key: "A class can only extend a single class." }, A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: DiagnosticCategory.Error, key: "A class declaration can only have one 'implements' clause." }, - Accessibility_modifier_already_seen: { code: 1028, category: DiagnosticCategory.Error, key: "Accessibility modifier already seen." }, - _0_modifier_must_precede_1_modifier: { code: 1029, category: DiagnosticCategory.Error, key: "'{0}' modifier must precede '{1}' modifier." }, - _0_modifier_already_seen: { code: 1030, category: DiagnosticCategory.Error, key: "'{0}' modifier already seen." }, - _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a class element." }, + Accessibility_modifier_already_seen: { code: 1028, category: DiagnosticCategory.Error, key: "Accessibility modifier already seen.", isEarly: true }, + _0_modifier_must_precede_1_modifier: { code: 1029, category: DiagnosticCategory.Error, key: "'{0}' modifier must precede '{1}' modifier.", isEarly: true }, + _0_modifier_already_seen: { code: 1030, category: DiagnosticCategory.Error, key: "'{0}' modifier already seen.", isEarly: true }, + _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a class element.", isEarly: true }, An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: DiagnosticCategory.Error, key: "An interface declaration cannot have an 'implements' clause." }, super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: DiagnosticCategory.Error, key: "'super' must be followed by an argument list or member access." }, - Only_ambient_modules_can_use_quoted_names: { code: 1035, category: DiagnosticCategory.Error, key: "Only ambient modules can use quoted names." }, - Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: DiagnosticCategory.Error, key: "Statements are not allowed in ambient contexts." }, - A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: DiagnosticCategory.Error, key: "A function implementation cannot be declared in an ambient context." }, - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used in an already ambient context." }, - Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: DiagnosticCategory.Error, key: "Initializers are not allowed in ambient contexts." }, - _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a module element." }, - A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an interface declaration." }, + Only_ambient_modules_can_use_quoted_names: { code: 1035, category: DiagnosticCategory.Error, key: "Only ambient modules can use quoted names.", isEarly: true }, + Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: DiagnosticCategory.Error, key: "Statements are not allowed in ambient contexts.", isEarly: true }, + A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used in an already ambient context.", isEarly: true }, + Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: DiagnosticCategory.Error, key: "Initializers are not allowed in ambient contexts.", isEarly: true }, + _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a module element.", isEarly: true }, + A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an interface declaration.", isEarly: true }, A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: DiagnosticCategory.Error, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, - A_rest_parameter_cannot_be_optional: { code: 1047, category: DiagnosticCategory.Error, key: "A rest parameter cannot be optional." }, - A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: DiagnosticCategory.Error, key: "A rest parameter cannot have an initializer." }, - A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: DiagnosticCategory.Error, key: "A 'set' accessor must have exactly one parameter." }, - A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: DiagnosticCategory.Error, key: "A 'set' accessor cannot have an optional parameter." }, - A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: DiagnosticCategory.Error, key: "A 'set' accessor parameter cannot have an initializer." }, - A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: DiagnosticCategory.Error, key: "A 'set' accessor cannot have rest parameter." }, - A_get_accessor_cannot_have_parameters: { code: 1054, category: DiagnosticCategory.Error, key: "A 'get' accessor cannot have parameters." }, - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: DiagnosticCategory.Error, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, - Enum_member_must_have_initializer: { code: 1061, category: DiagnosticCategory.Error, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: DiagnosticCategory.Error, key: "An export assignment cannot be used in an internal module." }, - Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: DiagnosticCategory.Error, key: "Ambient enum elements can only have integer literal initializers." }, + A_rest_parameter_cannot_be_optional: { code: 1047, category: DiagnosticCategory.Error, key: "A rest parameter cannot be optional.", isEarly: true }, + A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: DiagnosticCategory.Error, key: "A rest parameter cannot have an initializer.", isEarly: true }, + A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: DiagnosticCategory.Error, key: "A 'set' accessor must have exactly one parameter.", isEarly: true }, + A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: DiagnosticCategory.Error, key: "A 'set' accessor cannot have an optional parameter.", isEarly: true }, + A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: DiagnosticCategory.Error, key: "A 'set' accessor parameter cannot have an initializer.", isEarly: true }, + A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: DiagnosticCategory.Error, key: "A 'set' accessor cannot have rest parameter.", isEarly: true }, + A_get_accessor_cannot_have_parameters: { code: 1054, category: DiagnosticCategory.Error, key: "A 'get' accessor cannot have parameters.", isEarly: true }, + Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: DiagnosticCategory.Error, key: "Accessors are only available when targeting ECMAScript 5 and higher.", isEarly: true }, + Enum_member_must_have_initializer: { code: 1061, category: DiagnosticCategory.Error, key: "Enum member must have initializer.", isEarly: true }, + An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: DiagnosticCategory.Error, key: "An export assignment cannot be used in an internal module.", isEarly: true }, + Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: DiagnosticCategory.Error, key: "Ambient enum elements can only have integer literal initializers.", isEarly: true }, Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: DiagnosticCategory.Error, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, - A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an import declaration." }, + A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an import declaration.", isEarly: true }, Invalid_reference_directive_syntax: { code: 1084, category: DiagnosticCategory.Error, key: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: DiagnosticCategory.Error, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, - An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: DiagnosticCategory.Error, key: "An accessor cannot be declared in an ambient context." }, - _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a constructor declaration." }, - _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a parameter." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, - Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: DiagnosticCategory.Error, key: "Type parameters cannot appear on a constructor declaration." }, - Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: DiagnosticCategory.Error, key: "Type annotation cannot appear on a constructor declaration." }, - An_accessor_cannot_have_type_parameters: { code: 1094, category: DiagnosticCategory.Error, key: "An accessor cannot have type parameters." }, - A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: DiagnosticCategory.Error, key: "A 'set' accessor cannot have a return type annotation." }, - An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: DiagnosticCategory.Error, key: "An index signature must have exactly one parameter." }, - _0_list_cannot_be_empty: { code: 1097, category: DiagnosticCategory.Error, key: "'{0}' list cannot be empty." }, - Type_parameter_list_cannot_be_empty: { code: 1098, category: DiagnosticCategory.Error, key: "Type parameter list cannot be empty." }, - Type_argument_list_cannot_be_empty: { code: 1099, category: DiagnosticCategory.Error, key: "Type argument list cannot be empty." }, - Invalid_use_of_0_in_strict_mode: { code: 1100, category: DiagnosticCategory.Error, key: "Invalid use of '{0}' in strict mode." }, - with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: DiagnosticCategory.Error, key: "'with' statements are not allowed in strict mode." }, - delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: DiagnosticCategory.Error, key: "'delete' cannot be called on an identifier in strict mode." }, - A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: DiagnosticCategory.Error, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, - A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: DiagnosticCategory.Error, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, - Jump_target_cannot_cross_function_boundary: { code: 1107, category: DiagnosticCategory.Error, key: "Jump target cannot cross function boundary." }, - A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: DiagnosticCategory.Error, key: "A 'return' statement can only be used within a function body." }, - Expression_expected: { code: 1109, category: DiagnosticCategory.Error, key: "Expression expected." }, - Type_expected: { code: 1110, category: DiagnosticCategory.Error, key: "Type expected." }, - A_constructor_implementation_cannot_be_declared_in_an_ambient_context: { code: 1111, category: DiagnosticCategory.Error, key: "A constructor implementation cannot be declared in an ambient context." }, - A_class_member_cannot_be_declared_optional: { code: 1112, category: DiagnosticCategory.Error, key: "A class member cannot be declared optional." }, - A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: DiagnosticCategory.Error, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: DiagnosticCategory.Error, key: "Duplicate label '{0}'" }, - A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: DiagnosticCategory.Error, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, - A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: DiagnosticCategory.Error, key: "A 'break' statement can only jump to a label of an enclosing statement." }, - An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: DiagnosticCategory.Error, key: "An object literal cannot have multiple properties with the same name in strict mode." }, - An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: DiagnosticCategory.Error, key: "An object literal cannot have multiple get/set accessors with the same name." }, - An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: DiagnosticCategory.Error, key: "An object literal cannot have property and accessor with the same name." }, - An_export_assignment_cannot_have_modifiers: { code: 1120, category: DiagnosticCategory.Error, key: "An export assignment cannot have modifiers." }, - Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: DiagnosticCategory.Error, key: "Octal literals are not allowed in strict mode." }, - A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: DiagnosticCategory.Error, key: "A tuple type element list cannot be empty." }, - Variable_declaration_list_cannot_be_empty: { code: 1123, category: DiagnosticCategory.Error, key: "Variable declaration list cannot be empty." }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: DiagnosticCategory.Error, key: "Octal literals are not available when targeting ECMAScript 5 and higher.", isEarly: true }, + An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: DiagnosticCategory.Error, key: "An accessor cannot be declared in an ambient context.", isEarly: true }, + _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a constructor declaration.", isEarly: true }, + _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a parameter.", isEarly: true }, + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...in' statement.", isEarly: true }, + Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: DiagnosticCategory.Error, key: "Type parameters cannot appear on a constructor declaration.", isEarly: true }, + Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: DiagnosticCategory.Error, key: "Type annotation cannot appear on a constructor declaration.", isEarly: true }, + An_accessor_cannot_have_type_parameters: { code: 1094, category: DiagnosticCategory.Error, key: "An accessor cannot have type parameters.", isEarly: true }, + A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: DiagnosticCategory.Error, key: "A 'set' accessor cannot have a return type annotation.", isEarly: true }, + An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: DiagnosticCategory.Error, key: "An index signature must have exactly one parameter.", isEarly: true }, + _0_list_cannot_be_empty: { code: 1097, category: DiagnosticCategory.Error, key: "'{0}' list cannot be empty.", isEarly: true }, + Type_parameter_list_cannot_be_empty: { code: 1098, category: DiagnosticCategory.Error, key: "Type parameter list cannot be empty.", isEarly: true }, + Type_argument_list_cannot_be_empty: { code: 1099, category: DiagnosticCategory.Error, key: "Type argument list cannot be empty.", isEarly: true }, + Invalid_use_of_0_in_strict_mode: { code: 1100, category: DiagnosticCategory.Error, key: "Invalid use of '{0}' in strict mode.", isEarly: true }, + with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: DiagnosticCategory.Error, key: "'with' statements are not allowed in strict mode.", isEarly: true }, + delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: DiagnosticCategory.Error, key: "'delete' cannot be called on an identifier in strict mode.", isEarly: true }, + A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: DiagnosticCategory.Error, key: "A 'continue' statement can only be used within an enclosing iteration statement.", isEarly: true }, + A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: DiagnosticCategory.Error, key: "A 'break' statement can only be used within an enclosing iteration or switch statement.", isEarly: true }, + Jump_target_cannot_cross_function_boundary: { code: 1107, category: DiagnosticCategory.Error, key: "Jump target cannot cross function boundary.", isEarly: true }, + A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: DiagnosticCategory.Error, key: "A 'return' statement can only be used within a function body.", isEarly: true }, + Expression_expected: { code: 1109, category: DiagnosticCategory.Error, key: "Expression expected.", isEarly: true }, + Type_expected: { code: 1110, category: DiagnosticCategory.Error, key: "Type expected.", isEarly: true }, + A_class_member_cannot_be_declared_optional: { code: 1112, category: DiagnosticCategory.Error, key: "A class member cannot be declared optional.", isEarly: true }, + A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: DiagnosticCategory.Error, key: "A 'default' clause cannot appear more than once in a 'switch' statement.", isEarly: true }, + Duplicate_label_0: { code: 1114, category: DiagnosticCategory.Error, key: "Duplicate label '{0}'", isEarly: true }, + A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: DiagnosticCategory.Error, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement.", isEarly: true }, + A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: DiagnosticCategory.Error, key: "A 'break' statement can only jump to a label of an enclosing statement.", isEarly: true }, + An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: DiagnosticCategory.Error, key: "An object literal cannot have multiple properties with the same name in strict mode.", isEarly: true }, + An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: DiagnosticCategory.Error, key: "An object literal cannot have multiple get/set accessors with the same name.", isEarly: true }, + An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: DiagnosticCategory.Error, key: "An object literal cannot have property and accessor with the same name.", isEarly: true }, + An_export_assignment_cannot_have_modifiers: { code: 1120, category: DiagnosticCategory.Error, key: "An export assignment cannot have modifiers.", isEarly: true }, + Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: DiagnosticCategory.Error, key: "Octal literals are not allowed in strict mode.", isEarly: true }, + A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: DiagnosticCategory.Error, key: "A tuple type element list cannot be empty.", isEarly: true }, + Variable_declaration_list_cannot_be_empty: { code: 1123, category: DiagnosticCategory.Error, key: "Variable declaration list cannot be empty.", isEarly: true }, Digit_expected: { code: 1124, category: DiagnosticCategory.Error, key: "Digit expected." }, Hexadecimal_digit_expected: { code: 1125, category: DiagnosticCategory.Error, key: "Hexadecimal digit expected." }, Unexpected_end_of_text: { code: 1126, category: DiagnosticCategory.Error, key: "Unexpected end of text." }, @@ -98,52 +96,53 @@ module ts { Enum_member_expected: { code: 1132, category: DiagnosticCategory.Error, key: "Enum member expected." }, Type_reference_expected: { code: 1133, category: DiagnosticCategory.Error, key: "Type reference expected." }, Variable_declaration_expected: { code: 1134, category: DiagnosticCategory.Error, key: "Variable declaration expected." }, - Argument_expression_expected: { code: 1135, category: DiagnosticCategory.Error, key: "Argument expression expected." }, + Argument_expression_expected: { code: 1135, category: DiagnosticCategory.Error, key: "Argument expression expected.", isEarly: true }, Property_assignment_expected: { code: 1136, category: DiagnosticCategory.Error, key: "Property assignment expected." }, Expression_or_comma_expected: { code: 1137, category: DiagnosticCategory.Error, key: "Expression or comma expected." }, Parameter_declaration_expected: { code: 1138, category: DiagnosticCategory.Error, key: "Parameter declaration expected." }, Type_parameter_declaration_expected: { code: 1139, category: DiagnosticCategory.Error, key: "Type parameter declaration expected." }, Type_argument_expected: { code: 1140, category: DiagnosticCategory.Error, key: "Type argument expected." }, - String_literal_expected: { code: 1141, category: DiagnosticCategory.Error, key: "String literal expected." }, - Line_break_not_permitted_here: { code: 1142, category: DiagnosticCategory.Error, key: "Line break not permitted here." }, + String_literal_expected: { code: 1141, category: DiagnosticCategory.Error, key: "String literal expected.", isEarly: true }, + Line_break_not_permitted_here: { code: 1142, category: DiagnosticCategory.Error, key: "Line break not permitted here.", isEarly: true }, or_expected: { code: 1144, category: DiagnosticCategory.Error, key: "'{' or ';' expected." }, - Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: DiagnosticCategory.Error, key: "Modifiers not permitted on index signature members." }, + Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: DiagnosticCategory.Error, key: "Modifiers not permitted on index signature members.", isEarly: true }, Declaration_expected: { code: 1146, category: DiagnosticCategory.Error, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: DiagnosticCategory.Error, key: "Import declarations in an internal module cannot reference an external module." }, + Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: DiagnosticCategory.Error, key: "Import declarations in an internal module cannot reference an external module.", isEarly: true }, Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: DiagnosticCategory.Error, key: "Cannot compile external modules unless the '--module' flag is provided." }, Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: DiagnosticCategory.Error, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, - new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: DiagnosticCategory.Error, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, + new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: DiagnosticCategory.Error, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", isEarly: true }, var_let_or_const_expected: { code: 1152, category: DiagnosticCategory.Error, key: "'var', 'let' or 'const' expected." }, - let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: DiagnosticCategory.Error, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: DiagnosticCategory.Error, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_must_be_initialized: { code: 1155, category: DiagnosticCategory.Error, key: "'const' declarations must be initialized" }, - const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: DiagnosticCategory.Error, key: "'const' declarations can only be declared inside a block." }, - let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: DiagnosticCategory.Error, key: "'let' declarations can only be declared inside a block." }, - Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: DiagnosticCategory.Error, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." }, + let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: DiagnosticCategory.Error, key: "'let' declarations are only available when targeting ECMAScript 6 and higher.", isEarly: true }, + const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: DiagnosticCategory.Error, key: "'const' declarations are only available when targeting ECMAScript 6 and higher.", isEarly: true }, + const_declarations_must_be_initialized: { code: 1155, category: DiagnosticCategory.Error, key: "'const' declarations must be initialized", isEarly: true }, + const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: DiagnosticCategory.Error, key: "'const' declarations can only be declared inside a block.", isEarly: true }, + let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: DiagnosticCategory.Error, key: "'let' declarations can only be declared inside a block.", isEarly: true }, + Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: DiagnosticCategory.Error, key: "Tagged templates are only available when targeting ECMAScript 6 and higher.", isEarly: true }, Unterminated_template_literal: { code: 1160, category: DiagnosticCategory.Error, key: "Unterminated template literal." }, Unterminated_regular_expression_literal: { code: 1161, category: DiagnosticCategory.Error, key: "Unterminated regular expression literal." }, - An_object_member_cannot_be_declared_optional: { code: 1162, category: DiagnosticCategory.Error, key: "An object member cannot be declared optional." }, - yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: DiagnosticCategory.Error, key: "'yield' expression must be contained_within a generator declaration." }, - Computed_property_names_are_not_allowed_in_enums: { code: 1164, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in enums." }, - Computed_property_names_are_not_allowed_in_an_ambient_context: { code: 1165, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in an ambient context." }, - Computed_property_names_are_not_allowed_in_class_property_declarations: { code: 1166, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in class property declarations." }, - Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1167, category: DiagnosticCategory.Error, key: "Computed property names are only available when targeting ECMAScript 6 and higher." }, - Computed_property_names_are_not_allowed_in_method_overloads: { code: 1168, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in method overloads." }, - Computed_property_names_are_not_allowed_in_interfaces: { code: 1169, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in interfaces." }, - Computed_property_names_are_not_allowed_in_type_literals: { code: 1170, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in type literals." }, + An_object_member_cannot_be_declared_optional: { code: 1162, category: DiagnosticCategory.Error, key: "An object member cannot be declared optional.", isEarly: true }, + yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: DiagnosticCategory.Error, key: "'yield' expression must be contained_within a generator declaration.", isEarly: true }, + Computed_property_names_are_not_allowed_in_enums: { code: 1164, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in enums.", isEarly: true }, + Computed_property_names_are_not_allowed_in_an_ambient_context: { code: 1165, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in an ambient context.", isEarly: true }, + Computed_property_names_are_not_allowed_in_class_property_declarations: { code: 1166, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in class property declarations.", isEarly: true }, + Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1167, category: DiagnosticCategory.Error, key: "Computed property names are only available when targeting ECMAScript 6 and higher.", isEarly: true }, + Computed_property_names_are_not_allowed_in_method_overloads: { code: 1168, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in method overloads.", isEarly: true }, + Computed_property_names_are_not_allowed_in_interfaces: { code: 1169, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in interfaces.", isEarly: true }, + Computed_property_names_are_not_allowed_in_type_literals: { code: 1170, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in type literals.", isEarly: true }, A_comma_expression_is_not_allowed_in_a_computed_property_name: { code: 1171, category: DiagnosticCategory.Error, key: "A comma expression is not allowed in a computed property name." }, - extends_clause_already_seen: { code: 1172, category: DiagnosticCategory.Error, key: "'extends' clause already seen." }, - extends_clause_must_precede_implements_clause: { code: 1173, category: DiagnosticCategory.Error, key: "'extends' clause must precede 'implements' clause." }, - Classes_can_only_extend_a_single_class: { code: 1174, category: DiagnosticCategory.Error, key: "Classes can only extend a single class." }, - implements_clause_already_seen: { code: 1175, category: DiagnosticCategory.Error, key: "'implements' clause already seen." }, - Interface_declaration_cannot_have_implements_clause: { code: 1176, category: DiagnosticCategory.Error, key: "Interface declaration cannot have 'implements' clause." }, + extends_clause_already_seen: { code: 1172, category: DiagnosticCategory.Error, key: "'extends' clause already seen.", isEarly: true }, + extends_clause_must_precede_implements_clause: { code: 1173, category: DiagnosticCategory.Error, key: "'extends' clause must precede 'implements' clause.", isEarly: true }, + Classes_can_only_extend_a_single_class: { code: 1174, category: DiagnosticCategory.Error, key: "Classes can only extend a single class.", isEarly: true }, + implements_clause_already_seen: { code: 1175, category: DiagnosticCategory.Error, key: "'implements' clause already seen.", isEarly: true }, + Interface_declaration_cannot_have_implements_clause: { code: 1176, category: DiagnosticCategory.Error, key: "Interface declaration cannot have 'implements' clause.", isEarly: true }, Binary_digit_expected: { code: 1177, category: DiagnosticCategory.Error, key: "Binary digit expected." }, Octal_digit_expected: { code: 1178, category: DiagnosticCategory.Error, key: "Octal digit expected." }, Unexpected_token_expected: { code: 1179, category: DiagnosticCategory.Error, key: "Unexpected token. '{' expected." }, Property_destructuring_pattern_expected: { code: 1180, category: DiagnosticCategory.Error, key: "Property destructuring pattern expected." }, Array_element_destructuring_pattern_expected: { code: 1181, category: DiagnosticCategory.Error, key: "Array element destructuring pattern expected." }, - A_destructuring_declaration_must_have_an_initializer: { code: 1182, category: DiagnosticCategory.Error, key: "A destructuring declaration must have an initializer." }, - Destructuring_declarations_are_not_allowed_in_ambient_contexts: { code: 1183, category: DiagnosticCategory.Error, key: "Destructuring declarations are not allowed in ambient contexts." }, + A_destructuring_declaration_must_have_an_initializer: { code: 1182, category: DiagnosticCategory.Error, key: "A destructuring declaration must have an initializer.", isEarly: true }, + Destructuring_declarations_are_not_allowed_in_ambient_contexts: { code: 1183, category: DiagnosticCategory.Error, key: "Destructuring declarations are not allowed in ambient contexts.", isEarly: true }, + An_implementation_cannot_be_declared_in_ambient_contexts: { code: 1184, category: DiagnosticCategory.Error, key: "An implementation cannot be declared in ambient contexts.", isEarly: true }, Modifiers_cannot_appear_here: { code: 1184, category: DiagnosticCategory.Error, key: "Modifiers cannot appear here." }, Merge_conflict_marker_encountered: { code: 1185, category: DiagnosticCategory.Error, key: "Merge conflict marker encountered." }, Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, @@ -436,8 +435,8 @@ module ts { _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7023, category: DiagnosticCategory.Error, key: "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: DiagnosticCategory.Error, key: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, You_cannot_rename_this_element: { code: 8000, category: DiagnosticCategory.Error, key: "You cannot rename this element." }, - yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported." }, - Generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "Generators are not currently supported." }, - Computed_property_names_are_not_currently_supported: { code: 9002, category: DiagnosticCategory.Error, key: "Computed property names are not currently supported." }, + yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported.", isEarly: true }, + Generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "Generators are not currently supported.", isEarly: true }, + Computed_property_names_are_not_currently_supported: { code: 9002, category: DiagnosticCategory.Error, key: "Computed property names are not currently supported.", isEarly: true }, }; } \ No newline at end of file diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index d9469b4ea77..6808d290ad4 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -9,7 +9,8 @@ }, "'{0}' expected.": { "category": "Error", - "code": 1005 + "code": 1005, + "isEarly": true }, "A file cannot have a reference to itself.": { "category": "Error", @@ -17,7 +18,8 @@ }, "Trailing comma not allowed.": { "category": "Error", - "code": 1009 + "code": 1009, + "isEarly": true }, "'*/' expected.": { "category": "Error", @@ -29,47 +31,58 @@ }, "Catch clause parameter cannot have a type annotation.": { "category": "Error", - "code": 1013 + "code": 1013, + "isEarly": true }, "A rest parameter must be last in a parameter list.": { "category": "Error", - "code": 1014 + "code": 1014, + "isEarly": true }, "Parameter cannot have question mark and initializer.": { "category": "Error", - "code": 1015 + "code": 1015, + "isEarly": true }, "A required parameter cannot follow an optional parameter.": { "category": "Error", - "code": 1016 + "code": 1016, + "isEarly": true }, "An index signature cannot have a rest parameter.": { "category": "Error", - "code": 1017 + "code": 1017, + "isEarly": true }, "An index signature parameter cannot have an accessibility modifier.": { "category": "Error", - "code": 1018 + "code": 1018, + "isEarly": true }, "An index signature parameter cannot have a question mark.": { "category": "Error", - "code": 1019 + "code": 1019, + "isEarly": true }, "An index signature parameter cannot have an initializer.": { "category": "Error", - "code": 1020 + "code": 1020, + "isEarly": true }, "An index signature must have a type annotation.": { "category": "Error", - "code": 1021 + "code": 1021, + "isEarly": true }, "An index signature parameter must have a type annotation.": { "category": "Error", - "code": 1022 + "code": 1022, + "isEarly": true }, "An index signature parameter type must be 'string' or 'number'.": { "category": "Error", - "code": 1023 + "code": 1023, + "isEarly": true }, "A class or interface declaration can only have one 'extends' clause.": { "category": "Error", @@ -89,19 +102,23 @@ }, "Accessibility modifier already seen.": { "category": "Error", - "code": 1028 + "code": 1028, + "isEarly": true }, "'{0}' modifier must precede '{1}' modifier.": { "category": "Error", - "code": 1029 + "code": 1029, + "isEarly": true }, "'{0}' modifier already seen.": { "category": "Error", - "code": 1030 + "code": 1030, + "isEarly": true }, "'{0}' modifier cannot appear on a class element.": { "category": "Error", - "code": 1031 + "code": 1031, + "isEarly": true }, "An interface declaration cannot have an 'implements' clause.": { "category": "Error", @@ -113,31 +130,33 @@ }, "Only ambient modules can use quoted names.": { "category": "Error", - "code": 1035 + "code": 1035, + "isEarly": true }, "Statements are not allowed in ambient contexts.": { "category": "Error", - "code": 1036 - }, - "A function implementation cannot be declared in an ambient context.": { - "category": "Error", - "code": 1037 + "code": 1036, + "isEarly": true }, "A 'declare' modifier cannot be used in an already ambient context.": { "category": "Error", - "code": 1038 + "code": 1038, + "isEarly": true }, "Initializers are not allowed in ambient contexts.": { "category": "Error", - "code": 1039 + "code": 1039, + "isEarly": true }, "'{0}' modifier cannot appear on a module element.": { "category": "Error", - "code": 1044 + "code": 1044, + "isEarly": true }, "A 'declare' modifier cannot be used with an interface declaration.": { "category": "Error", - "code": 1045 + "code": 1045, + "isEarly": true }, "A 'declare' modifier is required for a top level declaration in a .d.ts file.": { "category": "Error", @@ -145,47 +164,58 @@ }, "A rest parameter cannot be optional.": { "category": "Error", - "code": 1047 + "code": 1047, + "isEarly": true }, "A rest parameter cannot have an initializer.": { "category": "Error", - "code": 1048 + "code": 1048, + "isEarly": true }, "A 'set' accessor must have exactly one parameter.": { "category": "Error", - "code": 1049 + "code": 1049, + "isEarly": true }, "A 'set' accessor cannot have an optional parameter.": { "category": "Error", - "code": 1051 + "code": 1051, + "isEarly": true }, "A 'set' accessor parameter cannot have an initializer.": { "category": "Error", - "code": 1052 + "code": 1052, + "isEarly": true }, "A 'set' accessor cannot have rest parameter.": { "category": "Error", - "code": 1053 + "code": 1053, + "isEarly": true }, "A 'get' accessor cannot have parameters.": { "category": "Error", - "code": 1054 + "code": 1054, + "isEarly": true }, "Accessors are only available when targeting ECMAScript 5 and higher.": { "category": "Error", - "code": 1056 + "code": 1056, + "isEarly": true }, "Enum member must have initializer.": { "category": "Error", - "code": 1061 + "code": 1061, + "isEarly": true }, "An export assignment cannot be used in an internal module.": { "category": "Error", - "code": 1063 + "code": 1063, + "isEarly": true }, "Ambient enum elements can only have integer literal initializers.": { "category": "Error", - "code": 1066 + "code": 1066, + "isEarly": true }, "Unexpected token. A constructor, method, accessor, or property was expected.": { "category": "Error", @@ -193,7 +223,8 @@ }, "A 'declare' modifier cannot be used with an import declaration.": { "category": "Error", - "code": 1079 + "code": 1079, + "isEarly": true }, "Invalid 'reference' directive syntax.": { "category": "Error", @@ -201,143 +232,173 @@ }, "Octal literals are not available when targeting ECMAScript 5 and higher.": { "category": "Error", - "code": 1085 + "code": 1085, + "isEarly": true }, "An accessor cannot be declared in an ambient context.": { "category": "Error", - "code": 1086 + "code": 1086, + "isEarly": true }, "'{0}' modifier cannot appear on a constructor declaration.": { "category": "Error", - "code": 1089 + "code": 1089, + "isEarly": true }, "'{0}' modifier cannot appear on a parameter.": { "category": "Error", - "code": 1090 + "code": 1090, + "isEarly": true }, "Only a single variable declaration is allowed in a 'for...in' statement.": { "category": "Error", - "code": 1091 + "code": 1091, + "isEarly": true }, "Type parameters cannot appear on a constructor declaration.": { "category": "Error", - "code": 1092 + "code": 1092, + "isEarly": true }, "Type annotation cannot appear on a constructor declaration.": { "category": "Error", - "code": 1093 + "code": 1093, + "isEarly": true }, "An accessor cannot have type parameters.": { "category": "Error", - "code": 1094 + "code": 1094, + "isEarly": true }, "A 'set' accessor cannot have a return type annotation.": { "category": "Error", - "code": 1095 + "code": 1095, + "isEarly": true }, "An index signature must have exactly one parameter.": { "category": "Error", - "code": 1096 + "code": 1096, + "isEarly": true }, "'{0}' list cannot be empty.": { "category": "Error", - "code": 1097 + "code": 1097, + "isEarly": true }, "Type parameter list cannot be empty.": { "category": "Error", - "code": 1098 + "code": 1098, + "isEarly": true }, "Type argument list cannot be empty.": { "category": "Error", - "code": 1099 + "code": 1099, + "isEarly": true }, "Invalid use of '{0}' in strict mode.": { "category": "Error", - "code": 1100 + "code": 1100, + "isEarly": true }, "'with' statements are not allowed in strict mode.": { "category": "Error", - "code": 1101 + "code": 1101, + "isEarly": true }, "'delete' cannot be called on an identifier in strict mode.": { "category": "Error", - "code": 1102 + "code": 1102, + "isEarly": true }, "A 'continue' statement can only be used within an enclosing iteration statement.": { "category": "Error", - "code": 1104 + "code": 1104, + "isEarly": true }, "A 'break' statement can only be used within an enclosing iteration or switch statement.": { "category": "Error", - "code": 1105 + "code": 1105, + "isEarly": true }, "Jump target cannot cross function boundary.": { "category": "Error", - "code": 1107 + "code": 1107, + "isEarly": true }, "A 'return' statement can only be used within a function body.": { "category": "Error", - "code": 1108 + "code": 1108, + "isEarly": true }, "Expression expected.": { "category": "Error", - "code": 1109 + "code": 1109, + "isEarly": true }, "Type expected.": { "category": "Error", - "code": 1110 - }, - "A constructor implementation cannot be declared in an ambient context.": { - "category": "Error", - "code": 1111 + "code": 1110, + "isEarly": true }, "A class member cannot be declared optional.": { "category": "Error", - "code": 1112 + "code": 1112, + "isEarly": true }, "A 'default' clause cannot appear more than once in a 'switch' statement.": { "category": "Error", - "code": 1113 + "code": 1113, + "isEarly": true }, "Duplicate label '{0}'": { "category": "Error", - "code": 1114 + "code": 1114, + "isEarly": true }, "A 'continue' statement can only jump to a label of an enclosing iteration statement.": { "category": "Error", - "code": 1115 + "code": 1115, + "isEarly": true }, "A 'break' statement can only jump to a label of an enclosing statement.": { "category": "Error", - "code": 1116 + "code": 1116, + "isEarly": true }, "An object literal cannot have multiple properties with the same name in strict mode.": { "category": "Error", - "code": 1117 + "code": 1117, + "isEarly": true }, "An object literal cannot have multiple get/set accessors with the same name.": { "category": "Error", - "code": 1118 + "code": 1118, + "isEarly": true }, "An object literal cannot have property and accessor with the same name.": { "category": "Error", - "code": 1119 + "code": 1119, + "isEarly": true }, "An export assignment cannot have modifiers.": { "category": "Error", - "code": 1120 + "code": 1120, + "isEarly": true }, "Octal literals are not allowed in strict mode.": { "category": "Error", - "code": 1121 + "code": 1121, + "isEarly": true }, "A tuple type element list cannot be empty.": { "category": "Error", - "code": 1122 + "code": 1122, + "isEarly": true }, "Variable declaration list cannot be empty.": { "category": "Error", - "code": 1123 + "code": 1123, + "isEarly": true }, "Digit expected.": { "category": "Error", @@ -385,7 +446,8 @@ }, "Argument expression expected.": { "category": "Error", - "code": 1135 + "code": 1135, + "isEarly": true }, "Property assignment expected.": { "category": "Error", @@ -409,11 +471,13 @@ }, "String literal expected.": { "category": "Error", - "code": 1141 + "code": 1141, + "isEarly": true }, "Line break not permitted here.": { "category": "Error", - "code": 1142 + "code": 1142, + "isEarly": true }, "'{' or ';' expected.": { "category": "Error", @@ -421,7 +485,8 @@ }, "Modifiers not permitted on index signature members.": { "category": "Error", - "code": 1145 + "code": 1145, + "isEarly": true }, "Declaration expected.": { "category": "Error", @@ -429,7 +494,8 @@ }, "Import declarations in an internal module cannot reference an external module.": { "category": "Error", - "code": 1147 + "code": 1147, + "isEarly": true }, "Cannot compile external modules unless the '--module' flag is provided.": { "category": "Error", @@ -441,7 +507,8 @@ }, "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": { "category": "Error", - "code": 1150 + "code": 1150, + "isEarly": true }, "'var', 'let' or 'const' expected.": { "category": "Error", @@ -449,27 +516,33 @@ }, "'let' declarations are only available when targeting ECMAScript 6 and higher.": { "category": "Error", - "code": 1153 + "code": 1153, + "isEarly": true }, "'const' declarations are only available when targeting ECMAScript 6 and higher.": { "category": "Error", - "code": 1154 + "code": 1154, + "isEarly": true }, "'const' declarations must be initialized": { "category": "Error", - "code": 1155 + "code": 1155, + "isEarly": true }, "'const' declarations can only be declared inside a block.": { "category": "Error", - "code": 1156 + "code": 1156, + "isEarly": true }, "'let' declarations can only be declared inside a block.": { "category": "Error", - "code": 1157 + "code": 1157, + "isEarly": true }, "Tagged templates are only available when targeting ECMAScript 6 and higher.": { "category": "Error", - "code": 1159 + "code": 1159, + "isEarly": true }, "Unterminated template literal.": { "category": "Error", @@ -481,40 +554,48 @@ }, "An object member cannot be declared optional.": { "category": "Error", - "code": 1162 + "code": 1162, + "isEarly": true }, - "'yield' expression must be contained_within a generator declaration." - : { + "'yield' expression must be contained_within a generator declaration.": { "category": "Error", - "code": 1163 + "code": 1163, + "isEarly": true }, "Computed property names are not allowed in enums.": { "category": "Error", - "code": 1164 + "code": 1164, + "isEarly": true }, "Computed property names are not allowed in an ambient context.": { "category": "Error", - "code": 1165 + "code": 1165, + "isEarly": true }, "Computed property names are not allowed in class property declarations.": { "category": "Error", - "code": 1166 + "code": 1166, + "isEarly": true }, "Computed property names are only available when targeting ECMAScript 6 and higher.": { "category": "Error", - "code": 1167 + "code": 1167, + "isEarly": true }, "Computed property names are not allowed in method overloads.": { "category": "Error", - "code": 1168 + "code": 1168, + "isEarly": true }, "Computed property names are not allowed in interfaces.": { "category": "Error", - "code": 1169 + "code": 1169, + "isEarly": true }, "Computed property names are not allowed in type literals.": { "category": "Error", - "code": 1170 + "code": 1170, + "isEarly": true }, "A comma expression is not allowed in a computed property name.": { "category": "Error", @@ -522,23 +603,28 @@ }, "'extends' clause already seen.": { "category": "Error", - "code": 1172 + "code": 1172, + "isEarly": true }, "'extends' clause must precede 'implements' clause.": { "category": "Error", - "code": 1173 + "code": 1173, + "isEarly": true }, "Classes can only extend a single class.": { "category": "Error", - "code": 1174 + "code": 1174, + "isEarly": true }, "'implements' clause already seen.": { "category": "Error", - "code": 1175 + "code": 1175, + "isEarly": true }, "Interface declaration cannot have 'implements' clause.": { "category": "Error", - "code": 1176 + "code": 1176, + "isEarly": true }, "Binary digit expected.": { "category": "Error", @@ -562,11 +648,18 @@ }, "A destructuring declaration must have an initializer.": { "category": "Error", - "code": 1182 + "code": 1182, + "isEarly": true }, "Destructuring declarations are not allowed in ambient contexts.": { "category": "Error", - "code": 1183 + "code": 1183, + "isEarly": true + }, + "An implementation cannot be declared in ambient contexts.": { + "category": "Error", + "code": 1184, + "isEarly": true }, "Modifiers cannot appear here.": { "category": "Error", @@ -1746,14 +1839,17 @@ }, "'yield' expressions are not currently supported.": { "category": "Error", - "code": 9000 + "code": 9000, + "isEarly": true }, "Generators are not currently supported.": { "category": "Error", - "code": 9001 + "code": 9001, + "isEarly": true }, "Computed property names are not currently supported.": { "category": "Error", - "code": 9002 + "code": 9002, + "isEarly": true } -} +} \ No newline at end of file diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 784d0de907f..55312753d1e 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -13,7 +13,7 @@ module ts { export function createNode(kind: SyntaxKind): Node { return new (getNodeConstructor(kind))(); } - + // Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes // stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise, // embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns @@ -49,7 +49,8 @@ module ts { child((node).right); case SyntaxKind.TypeParameter: return child((node).name) || - child((node).constraint); + child((node).constraint) || + child((node).expression); case SyntaxKind.Parameter: case SyntaxKind.PropertyDeclaration: case SyntaxKind.PropertySignature: @@ -385,8 +386,8 @@ module ts { case ParsingContext.HeritageClauses: return Diagnostics.Unexpected_token_expected; } }; - - function modifierToFlag(token: SyntaxKind): NodeFlags { + + export function modifierToFlag(token: SyntaxKind): NodeFlags { switch (token) { case SyntaxKind.StaticKeyword: return NodeFlags.Static; case SyntaxKind.PublicKeyword: return NodeFlags.Public; @@ -421,7 +422,7 @@ module ts { forEachChild(sourceFile, walk); } - function isEvalOrArgumentsIdentifier(node: Node): boolean { + export function isEvalOrArgumentsIdentifier(node: Node): boolean { return node.kind === SyntaxKind.Identifier && ((node).text === "eval" || (node).text === "arguments"); } @@ -1260,7 +1261,7 @@ module ts { if (token === SyntaxKind.YieldKeyword && inYieldContext()) { return false; } - + return inStrictModeContext() ? token > SyntaxKind.LastFutureReservedWord : token > SyntaxKind.LastReservedWord; } @@ -1436,7 +1437,7 @@ module ts { parseExpected(SyntaxKind.CloseBracketToken); return finishNode(node); } - + function parseContextualModifier(t: SyntaxKind): boolean { return token === t && tryParse(nextTokenCanFollowModifier); } @@ -1522,7 +1523,7 @@ module ts { nextToken(); return isIdentifier(); } - + function isNotHeritageClauseTypeName(): boolean { if (token === SyntaxKind.ImplementsKeyword || token === SyntaxKind.ExtendsKeyword) { @@ -2085,12 +2086,12 @@ module ts { var templateSpans = >[]; templateSpans.pos = getNodePos(); - + do { templateSpans.push(parseTemplateSpan()); } while (templateSpans[templateSpans.length - 1].literal.kind === SyntaxKind.TemplateMiddle) - + templateSpans.end = getNodeEnd(); template.templateSpans = templateSpans; @@ -2494,7 +2495,7 @@ module ts { if (lookAhead(isStartOfConstructSignature)) { return parseSignatureMember(SyntaxKind.ConstructSignature); } - // fall through. + // fall through. case SyntaxKind.StringLiteral: case SyntaxKind.NumericLiteral: return parsePropertyOrMethodSignature(); @@ -3161,7 +3162,7 @@ module ts { if (newPrecedence <= precedence) { break; } - + if (token === SyntaxKind.InKeyword && inDisallowInContext()) { break; } @@ -3387,7 +3388,7 @@ module ts { // Because CallExpression and MemberExpression are left recursive, we need to bottom out // of the recursion immediately. So we parse out a primary expression to start with. var expression = parsePrimaryExpression(); - return parseMemberExpressionRest(expression); + return parseMemberExpressionRest(expression); } function parseSuperExpression(): MemberExpression { @@ -3515,7 +3516,7 @@ module ts { ? typeArguments : undefined; } - + function canFollowTypeArgumentsInExpression(): boolean { switch (token) { case SyntaxKind.OpenParenToken: // foo( @@ -4085,7 +4086,7 @@ module ts { if (isLetDeclaration()) { return parseVariableStatement(scanner.getStartPos(), /*modifiers:*/ undefined); } - // Else parse it like identifier - fall through + // Else parse it like identifier - fall through default: // Functions and variable statements are allowed as a statement. But as per // the grammar, they also allow modifiers. So we have to check for those @@ -4379,7 +4380,7 @@ module ts { modifiers.pos = modifierStart; } flags |= modifierToFlag(modifierKind); - modifiers.push(finishNode(createNode(modifierKind, modifierStart))); + modifiers.push(finishNode(createNode(modifierKind, modifierStart))); } if (modifiers) { modifiers.flags = flags; @@ -4563,9 +4564,9 @@ module ts { function parseModuleDeclaration(fullStart: number, modifiers: ModifiersArray): ModuleDeclaration { parseExpected(SyntaxKind.ModuleKeyword); - return token === SyntaxKind.StringLiteral + return token === SyntaxKind.StringLiteral ? parseAmbientExternalModuleDeclaration(fullStart, modifiers) - : parseInternalModuleTail(fullStart, modifiers, modifiers? modifiers.flags : 0); + : parseInternalModuleTail(fullStart, modifiers, modifiers ? modifiers.flags : 0); } function isExternalModuleReference() { @@ -4621,7 +4622,7 @@ module ts { parseSemicolon(); return finishNode(node); } - + function isLetDeclaration() { // It is let declaration if in strict mode or next token is identifier on same line. // otherwise it needs to be treated like identifier @@ -4635,7 +4636,7 @@ module ts { case SyntaxKind.FunctionKeyword: return true; case SyntaxKind.LetKeyword: - return isLetDeclaration(); + return isLetDeclaration(); case SyntaxKind.ClassKeyword: case SyntaxKind.InterfaceKeyword: case SyntaxKind.EnumKeyword: @@ -4771,8 +4772,8 @@ module ts { else { var amdModuleNameRegEx = /^\/\/\/\s* 0) { - // Don't bother doing any grammar checks if there are already parser errors. - // Otherwise we may end up with too many cascading errors. - syntacticDiagnostics = sourceFile.referenceDiagnostics.concat(sourceFile.parseDiagnostics); - } - else { - // No parser errors were reported. Perform our stricter grammar checks. - checkGrammar(sourceText, languageVersion, sourceFile); - syntacticDiagnostics = sourceFile.referenceDiagnostics.concat(sourceFile.grammarDiagnostics); - } + // Don't bother doing any grammar checks if there are already parser errors. + // Otherwise we may end up with too many cascading errors. + syntacticDiagnostics = sourceFile.referenceDiagnostics.concat(sourceFile.parseDiagnostics); } Debug.assert(syntacticDiagnostics !== undefined); @@ -4819,7 +4813,7 @@ module ts { } } - function isLeftHandSideExpression(expr: Expression): boolean { + export function isLeftHandSideExpression(expr: Expression): boolean { if (expr) { switch (expr.kind) { case SyntaxKind.PropertyAccessExpression: @@ -4849,1314 +4843,10 @@ module ts { return false; } - function isAssignmentOperator(token: SyntaxKind): boolean { + export function isAssignmentOperator(token: SyntaxKind): boolean { return token >= SyntaxKind.FirstAssignment && token <= SyntaxKind.LastAssignment; } - function checkGrammar(sourceText: string, languageVersion: ScriptTarget, file: SourceFile) { - var grammarDiagnostics = file.grammarDiagnostics; - - // Create a scanner so we can find the start of tokens to report errors on. - var scanner = createScanner(languageVersion, /*skipTrivia*/ true, sourceText); - - // We're automatically in an ambient context if this is a .d.ts file. - var inAmbientContext = fileExtensionIs(file.filename, ".d.ts"); - var inFunctionBlock = false; - var inObjectLiteralExpression = false; - var inBlock = false; - var parent: Node; - visitNode(file); - - function visitNode(node: Node): void { - // Store and restore our recursive state here. - var savedParent = parent; - node.parent = parent; - parent = node; - - if (!checkModifiers(node)) { - var savedInFunctionBlock = inFunctionBlock; - if (isFunctionBlock(node)) { - inFunctionBlock = true; - } - var savedInBlock = inBlock; - if (node.kind === SyntaxKind.Block) { - inBlock = true; - } - var savedInObjectLiteralExpression = inObjectLiteralExpression; - if (node.kind === SyntaxKind.ObjectLiteralExpression) { - inObjectLiteralExpression = true; - } - var savedInAmbientContext = inAmbientContext - if (node.flags & NodeFlags.Ambient) { - inAmbientContext = true; - } - - checkNodeAndChildren(node); - - inAmbientContext = savedInAmbientContext; - inFunctionBlock = savedInFunctionBlock; - inBlock = savedInBlock; - inObjectLiteralExpression = savedInObjectLiteralExpression; - } - - parent = savedParent; - } - - function checkNodeAndChildren(node: Node) { - var nodeKind = node.kind; - // First, check if you have a statement in a place where it is not allowed. We want - // to do this before recursing, because we'd prefer to report these errors at the top - // level instead of at some nested level. - if (inAmbientContext && checkForStatementInAmbientContext(node, nodeKind)) { - return; - } - - // if we got any errors, just stop performing any more checks on this node or higher. - if (checkNode(node, nodeKind)) { - return; - } - - // Otherwise, recurse and see if we have any errors below us. - forEachChild(node, visitNode); - } - - function checkNode(node: Node, nodeKind: SyntaxKind): boolean { - // Now do node specific checks. - switch (nodeKind) { - case SyntaxKind.ArrowFunction: - case SyntaxKind.CallSignature: - case SyntaxKind.ConstructorType: - case SyntaxKind.ConstructSignature: - case SyntaxKind.FunctionType: - return checkAnySignatureDeclaration(node); - case SyntaxKind.BreakStatement: - case SyntaxKind.ContinueStatement: - return checkBreakOrContinueStatement(node); - case SyntaxKind.CallExpression: - case SyntaxKind.NewExpression: - return checkCallOrNewExpression(node); - - case SyntaxKind.EnumDeclaration: return checkEnumDeclaration(node); - case SyntaxKind.BinaryExpression: return checkBinaryExpression(node); - case SyntaxKind.BindingElement: return checkBindingElement(node); - case SyntaxKind.CatchClause: return checkCatchClause(node); - case SyntaxKind.ClassDeclaration: return checkClassDeclaration(node); - case SyntaxKind.ComputedPropertyName: return checkComputedPropertyName(node); - case SyntaxKind.Constructor: return checkConstructor(node); - case SyntaxKind.DeleteExpression: return checkDeleteExpression( node); - case SyntaxKind.ElementAccessExpression: return checkElementAccessExpression(node); - case SyntaxKind.ExportAssignment: return checkExportAssignment(node); - case SyntaxKind.ExternalModuleReference: return checkExternalModuleReference(node); - case SyntaxKind.FunctionDeclaration: return checkFunctionDeclaration(node); - case SyntaxKind.FunctionExpression: return checkFunctionExpression(node); - case SyntaxKind.GetAccessor: return checkGetAccessor(node); - case SyntaxKind.HeritageClause: return checkHeritageClause(node); - case SyntaxKind.IndexSignature: return checkIndexSignature(node); - case SyntaxKind.InterfaceDeclaration: return checkInterfaceDeclaration(node); - case SyntaxKind.LabeledStatement: return checkLabeledStatement(node); - case SyntaxKind.PropertyAssignment: return checkPropertyAssignment(node); - case SyntaxKind.MethodDeclaration: - case SyntaxKind.MethodSignature: - return checkMethod(node); - case SyntaxKind.ModuleDeclaration: return checkModuleDeclaration(node); - case SyntaxKind.ObjectLiteralExpression: return checkObjectLiteralExpression(node); - case SyntaxKind.NumericLiteral: return checkNumericLiteral(node); - case SyntaxKind.Parameter: return checkParameter(node); - case SyntaxKind.PostfixUnaryExpression: return checkPostfixUnaryExpression(node); - case SyntaxKind.PrefixUnaryExpression: return checkPrefixUnaryExpression(node); - case SyntaxKind.PropertyDeclaration: - case SyntaxKind.PropertySignature: - return checkProperty(node); - case SyntaxKind.ReturnStatement: return checkReturnStatement(node); - case SyntaxKind.SetAccessor: return checkSetAccessor(node); - case SyntaxKind.SourceFile: return checkSourceFile(node); - case SyntaxKind.ShorthandPropertyAssignment: return checkShorthandPropertyAssignment(node); - case SyntaxKind.SwitchStatement: return checkSwitchStatement(node); - case SyntaxKind.TaggedTemplateExpression: return checkTaggedTemplateExpression(node); - case SyntaxKind.ThrowStatement: return checkThrowStatement(node); - case SyntaxKind.TupleType: return checkTupleType(node); - case SyntaxKind.TypeParameter: return checkTypeParameter(node); - case SyntaxKind.TypeReference: return checkTypeReference(node); - case SyntaxKind.VariableDeclaration: return checkVariableDeclaration(node); - case SyntaxKind.VariableDeclarationList: return checkVariableDeclarationList(node); - case SyntaxKind.VariableStatement: return checkVariableStatement(node); - case SyntaxKind.WithStatement: return checkWithStatement(node); - case SyntaxKind.YieldExpression: return checkYieldExpression(node); - } - } - - function scanToken(pos: number) { - var start = skipTrivia(sourceText, pos); - scanner.setTextPos(start); - scanner.scan(); - return start; - } - - function grammarErrorOnFirstToken(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { - var start = scanToken(node.pos); - grammarDiagnostics.push(createFileDiagnostic(file, start, scanner.getTextPos() - start, message, arg0, arg1, arg2)); - return true; - } - - function grammarErrorAfterFirstToken(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { - scanToken(node.pos); - grammarDiagnostics.push(createFileDiagnostic(file, scanner.getTextPos(), 0, message, arg0, arg1, arg2)); - return true; - } - - function grammarErrorOnNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { - var span = getErrorSpanForNode(node); - var start = span.end > span.pos ? skipTrivia(file.text, span.pos) : span.pos; - var length = span.end - start; - - grammarDiagnostics.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - return true; - } - - function grammarErrorAtPos(start: number, length: number, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { - grammarDiagnostics.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - return true; - } - - function reportInvalidUseInStrictMode(node: Identifier): boolean { - // declarationNameToString cannot be used here since it uses a backreference to 'parent' that is not yet set - var name = sourceText.substring(skipTrivia(sourceText, node.pos), node.end); - return grammarErrorOnNode(node, Diagnostics.Invalid_use_of_0_in_strict_mode, name); - } - - function checkForStatementInAmbientContext(node: Node, kind: SyntaxKind): boolean { - switch (kind) { - case SyntaxKind.Block: - case SyntaxKind.EmptyStatement: - case SyntaxKind.IfStatement: - case SyntaxKind.DoStatement: - case SyntaxKind.WhileStatement: - case SyntaxKind.ForStatement: - case SyntaxKind.ForInStatement: - case SyntaxKind.ContinueStatement: - case SyntaxKind.BreakStatement: - case SyntaxKind.ReturnStatement: - case SyntaxKind.WithStatement: - case SyntaxKind.SwitchStatement: - case SyntaxKind.ThrowStatement: - case SyntaxKind.TryStatement: - case SyntaxKind.DebuggerStatement: - case SyntaxKind.LabeledStatement: - case SyntaxKind.ExpressionStatement: - return grammarErrorOnFirstToken(node, Diagnostics.Statements_are_not_allowed_in_ambient_contexts); - } - } - - function checkAnySignatureDeclaration(node: SignatureDeclaration): boolean { - return checkTypeParameterList(node.typeParameters) || - checkParameterList(node.parameters); - } - - function checkBinaryExpression(node: BinaryExpression) { - if (node.parserContextFlags & ParserContextFlags.StrictMode) { - if (isLeftHandSideExpression(node.left) && isAssignmentOperator(node.operator)) { - if (isEvalOrArgumentsIdentifier(node.left)) { - // ECMA 262 (Annex C) The identifier eval or arguments may not appear as the LeftHandSideExpression of an - // Assignment operator(11.13) or of a PostfixExpression(11.3) - return reportInvalidUseInStrictMode(node.left); - } - } - } - } - - function isIterationStatement(node: Node, lookInLabeledStatements: boolean): boolean { - switch (node.kind) { - case SyntaxKind.ForStatement: - case SyntaxKind.ForInStatement: - case SyntaxKind.DoStatement: - case SyntaxKind.WhileStatement: - return true; - case SyntaxKind.LabeledStatement: - return lookInLabeledStatements && isIterationStatement((node).statement, lookInLabeledStatements); - } - - return false; - } - - function checkLabeledStatement(node: LabeledStatement): boolean { - // ensure that label is unique - var current = node.parent; - while (current) { - if (isAnyFunction(current)) { - break; - } - if (current.kind === SyntaxKind.LabeledStatement && (current).label.text === node.label.text) { - return grammarErrorOnNode(node.label, Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); - } - current = current.parent; - } - } - - function checkBreakOrContinueStatement(node: BreakOrContinueStatement): boolean { - var current: Node = node; - while (current) { - if (isAnyFunction(current)) { - return grammarErrorOnNode(node, Diagnostics.Jump_target_cannot_cross_function_boundary); - } - - switch (current.kind) { - case SyntaxKind.LabeledStatement: - if (node.label && (current).label.text === node.label.text) { - // found matching label - verify that label usage is correct - // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === SyntaxKind.ContinueStatement - && !isIterationStatement((current).statement, /*lookInLabeledStatement*/ true); - - if (isMisplacedContinueLabel) { - return grammarErrorOnNode(node, Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); - } - - return false; - } - break; - case SyntaxKind.SwitchStatement: - if (node.kind === SyntaxKind.BreakStatement && !node.label) { - // unlabeled break within switch statement - ok - return false; - } - break; - default: - if (isIterationStatement(current, /*lookInLabeledStatement*/ false) && !node.label) { - // unlabeled break or continue within iteration statement - ok - return false; - } - break; - } - - current = current.parent; - } - - if (node.label) { - var message = node.kind === SyntaxKind.BreakStatement - ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement - : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; - - return grammarErrorOnNode(node, message) - } - else { - var message = node.kind === SyntaxKind.BreakStatement - ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement - : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; - return grammarErrorOnNode(node, message) - } - } - - function checkCallOrNewExpression(node: CallExpression) { - return checkTypeArguments(node.typeArguments) || - checkArguments(node.arguments); - } - - function checkArguments(arguments: NodeArray) { - return checkForDisallowedTrailingComma(arguments) || - checkForOmittedArgument(arguments); - } - - function checkTypeArguments(typeArguments: NodeArray) { - return checkForDisallowedTrailingComma(typeArguments) || - checkForAtLeastOneTypeArgument(typeArguments); - } - - function checkForOmittedArgument(arguments: NodeArray) { - if (arguments) { - for (var i = 0, n = arguments.length; i < n; i++) { - var arg = arguments[i]; - if (arg.kind === SyntaxKind.OmittedExpression) { - return grammarErrorAtPos(arg.pos, 0, Diagnostics.Argument_expression_expected); - } - } - } - } - - function checkForAtLeastOneTypeArgument(typeArguments: NodeArray) { - if (typeArguments && typeArguments.length === 0) { - var start = typeArguments.pos - "<".length; - var end = skipTrivia(sourceText, typeArguments.end) + ">".length; - return grammarErrorAtPos(start, end - start, Diagnostics.Type_argument_list_cannot_be_empty); - } - } - - function checkForDisallowedTrailingComma(list: NodeArray): boolean { - if (list && list.hasTrailingComma) { - var start = list.end - ",".length; - var end = list.end; - return grammarErrorAtPos(start, end - start, Diagnostics.Trailing_comma_not_allowed); - } - } - - function checkCatchClause(node: CatchClause) { - if (node.type) { - var colonStart = skipTrivia(sourceText, node.name.end); - return grammarErrorAtPos(colonStart, ":".length, Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); - } - if (node.parserContextFlags & ParserContextFlags.StrictMode && isEvalOrArgumentsIdentifier(node.name)) { - // It is a SyntaxError if a TryStatement with a Catch occurs within strict code and the Identifier of the - // Catch production is eval or arguments - return reportInvalidUseInStrictMode(node.name); - } - } - - function checkClassDeclaration(node: ClassDeclaration) { - return checkClassDeclarationHeritageClauses(node); - } - - function checkClassDeclarationHeritageClauses(node: ClassDeclaration): boolean { - var seenExtendsClause = false; - var seenImplementsClause = false; - - if (node.heritageClauses) { - for (var i = 0, n = node.heritageClauses.length; i < n; i++) { - Debug.assert(i <= 2); - var heritageClause = node.heritageClauses[i]; - - if (heritageClause.token === SyntaxKind.ExtendsKeyword) { - if (seenExtendsClause) { - return grammarErrorOnFirstToken(heritageClause, Diagnostics.extends_clause_already_seen); - } - - if (seenImplementsClause) { - return grammarErrorOnFirstToken(heritageClause, Diagnostics.extends_clause_must_precede_implements_clause); - } - - if (heritageClause.types.length > 1) { - return grammarErrorOnFirstToken(heritageClause.types[1], Diagnostics.Classes_can_only_extend_a_single_class); - } - - seenExtendsClause = true; - } - else { - Debug.assert(heritageClause.token === SyntaxKind.ImplementsKeyword); - if (seenImplementsClause) { - return grammarErrorOnFirstToken(heritageClause, Diagnostics.implements_clause_already_seen); - } - - seenImplementsClause = true; - } - } - } - - return false; - } - - function checkForAtLeastOneHeritageClause(types: NodeArray, listType: string): boolean { - if (types && types.length === 0) { - return grammarErrorAtPos(types.pos, 0, Diagnostics._0_list_cannot_be_empty, listType) - } - } - - function checkConstructor(node: ConstructorDeclaration) { - return checkAnySignatureDeclaration(node) || - checkConstructorTypeParameters(node) || - checkConstructorTypeAnnotation(node) || - checkForBodyInAmbientContext(node.body, /*isConstructor:*/ true); - } - - function checkConstructorTypeParameters(node: ConstructorDeclaration) { - if (node.typeParameters) { - return grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); - } - } - - function checkConstructorTypeAnnotation(node: ConstructorDeclaration) { - if (node.type) { - return grammarErrorOnNode(node.type, Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); - } - } - - function checkDeleteExpression(node: DeleteExpression) { - if (node.parserContextFlags & ParserContextFlags.StrictMode && node.expression.kind === SyntaxKind.Identifier) { - // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its - // UnaryExpression is a direct reference to a variable, function argument, or function name - return grammarErrorOnNode(node.expression, Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); - } - } - - function checkEnumDeclaration(enumDecl: EnumDeclaration): boolean { - var enumIsConst = (enumDecl.flags & NodeFlags.Const) !== 0; - - var hasError = false; - - // skip checks below for const enums - they allow arbitrary initializers as long as they can be evaluated to constant expressions. - // since all values are known in compile time - it is not necessary to check that constant enum section precedes computed enum members. - if (!enumIsConst) { - var inConstantEnumMemberSection = true; - for (var i = 0, n = enumDecl.members.length; i < n; i++) { - var node = enumDecl.members[i]; - if (node.name.kind === SyntaxKind.ComputedPropertyName) { - hasError = grammarErrorOnNode(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums); - } - else if (inAmbientContext) { - if (node.initializer && !isIntegerLiteral(node.initializer)) { - hasError = grammarErrorOnNode(node.name, Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers) || hasError; - } - } - else if (node.initializer) { - inConstantEnumMemberSection = isIntegerLiteral(node.initializer); - } - else if (!inConstantEnumMemberSection) { - hasError = grammarErrorOnNode(node.name, Diagnostics.Enum_member_must_have_initializer) || hasError; - } - } - } - - return hasError; - } - - function isIntegerLiteral(expression: Expression): boolean { - function isInteger(literalExpression: LiteralExpression): boolean { - // Allows for scientific notation since literalExpression.text was formed by - // coercing a number to a string. Sometimes this coercion can yield a string - // in scientific notation. - // We also don't need special logic for hex because a hex integer is converted - // to decimal when it is coerced. - return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); - } - - if (expression.kind === SyntaxKind.PrefixUnaryExpression) { - var unaryExpression = expression; - if (unaryExpression.operator === SyntaxKind.PlusToken || unaryExpression.operator === SyntaxKind.MinusToken) { - expression = unaryExpression.operand; - } - } - if (expression.kind === SyntaxKind.NumericLiteral) { - return isInteger(expression); - } - - return false; - } - - function checkExportAssignment(node: ExportAssignment) { - if (node.flags & NodeFlags.Modifier) { - return grammarErrorOnFirstToken(node, Diagnostics.An_export_assignment_cannot_have_modifiers); - } - } - - function checkExternalModuleReference(node: ExternalModuleReference) { - if (node.expression.kind !== SyntaxKind.StringLiteral) { - return grammarErrorOnNode(node.expression, Diagnostics.String_literal_expected); - } - } - - function checkForMoreThanOneDeclaration(declarations: NodeArray) { - if (declarations && declarations.length > 1) { - return grammarErrorOnFirstToken(declarations[1], Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); - } - } - - function checkFunctionDeclaration(node: FunctionLikeDeclaration) { - return checkForDisallowedModifiersInBlockOrObjectLiteral(node) || - checkAnySignatureDeclaration(node) || - checkFunctionName(node.name) || - checkForBodyInAmbientContext(node.body, /*isConstructor:*/ false) || - checkForGenerator(node); - } - - function checkForGenerator(node: FunctionLikeDeclaration) { - if (node.asteriskToken) { - return grammarErrorOnNode(node.asteriskToken, Diagnostics.Generators_are_not_currently_supported); - } - } - - function checkFunctionExpression(node: FunctionExpression) { - return checkAnySignatureDeclaration(node) || - checkFunctionName(node.name) || - checkForGenerator(node); - } - - function checkFunctionName(name: Node) { - if (name && name.parserContextFlags & ParserContextFlags.StrictMode && isEvalOrArgumentsIdentifier(name)) { - // It is a SyntaxError to use within strict mode code the identifiers eval or arguments as the - // Identifier of a FunctionLikeDeclaration or FunctionExpression or as a formal parameter name(13.1) - return reportInvalidUseInStrictMode(name); - } - } - - function checkGetAccessor(node: MethodDeclaration) { - return checkForDisallowedModifiersInBlockOrObjectLiteral(node) || - checkAnySignatureDeclaration(node) || - checkAccessor(node); - } - - function checkElementAccessExpression(node: ElementAccessExpression) { - if (!node.argumentExpression) { - if (node.parent.kind === SyntaxKind.NewExpression && (node.parent).expression === node) { - var start = skipTrivia(sourceText, node.expression.end); - var end = node.end; - return grammarErrorAtPos(start, end - start, Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); - } - else { - var start = node.end - "]".length; - var end = node.end; - return grammarErrorAtPos(start, end - start, Diagnostics.Expression_expected); - } - } - } - - function checkHeritageClause(node: HeritageClause): boolean { - return checkForDisallowedTrailingComma(node.types) || - checkForAtLeastOneHeritageClause(node.types, tokenToString(node.token)); - } - - function checkIndexSignature(node: SignatureDeclaration): boolean { - return checkIndexSignatureParameters(node) || - checkForIndexSignatureModifiers(node); - } - - function checkForIndexSignatureModifiers(node: SignatureDeclaration): boolean { - if (node.flags & NodeFlags.Modifier) { - return grammarErrorOnFirstToken(node, Diagnostics.Modifiers_not_permitted_on_index_signature_members); - } - } - - function checkIndexSignatureParameters(node: SignatureDeclaration): boolean { - var parameter = node.parameters[0]; - if (node.parameters.length !== 1) { - if (parameter) { - return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_must_have_exactly_one_parameter); - } - else { - return grammarErrorOnNode(node, Diagnostics.An_index_signature_must_have_exactly_one_parameter); - } - } - else if (parameter.dotDotDotToken) { - return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.An_index_signature_cannot_have_a_rest_parameter); - } - else if (parameter.flags & NodeFlags.Modifier) { - return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); - } - else if (parameter.questionToken) { - return grammarErrorOnNode(parameter.questionToken, Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); - } - else if (parameter.initializer) { - return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); - } - else if (!parameter.type) { - return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); - } - else if (parameter.type.kind !== SyntaxKind.StringKeyword && parameter.type.kind !== SyntaxKind.NumberKeyword) { - return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); - } - else if (!node.type) { - return grammarErrorOnNode(node, Diagnostics.An_index_signature_must_have_a_type_annotation); - } - } - - function checkInterfaceDeclaration(node: InterfaceDeclaration) { - return checkInterfaceDeclarationHeritageClauses(node); - } - - function checkInterfaceDeclarationHeritageClauses(node: InterfaceDeclaration): boolean { - var seenExtendsClause = false; - - if (node.heritageClauses) { - for (var i = 0, n = node.heritageClauses.length; i < n; i++) { - Debug.assert(i <= 1); - var heritageClause = node.heritageClauses[i]; - - if (heritageClause.token === SyntaxKind.ExtendsKeyword) { - if (seenExtendsClause) { - return grammarErrorOnFirstToken(heritageClause, Diagnostics.extends_clause_already_seen); - } - - seenExtendsClause = true; - } - else { - Debug.assert(heritageClause.token === SyntaxKind.ImplementsKeyword); - return grammarErrorOnFirstToken(heritageClause, Diagnostics.Interface_declaration_cannot_have_implements_clause); - } - } - } - - return false; - } - - function checkMethod(node: MethodDeclaration) { - if (checkForDisallowedModifiersInBlockOrObjectLiteral(node) || - checkAnySignatureDeclaration(node) || - checkForBodyInAmbientContext(node.body, /*isConstructor:*/ false) || - checkForGenerator(node)) { - return true; - } - - if (node.parent.kind === SyntaxKind.ObjectLiteralExpression) { - if (checkForInvalidQuestionMark(node, node.questionToken, Diagnostics.A_class_member_cannot_be_declared_optional)) { - return true; - } - else if (node.body === undefined) { - return grammarErrorAtPos(node.end - 1, ";".length, Diagnostics._0_expected, "{"); - } - } - - if (node.parent.kind === SyntaxKind.ClassDeclaration) { - if (checkForInvalidQuestionMark(node, node.questionToken, Diagnostics.A_class_member_cannot_be_declared_optional)) { - return true; - } - // Technically, computed properties in ambient contexts is disallowed - // for property declarations and accessors too, not just methods. - // However, property declarations disallow computed names in general, - // and accessors are not allowed in ambient contexts in general, - // so this error only really matters for methods. - if (inAmbientContext) { - return checkForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_an_ambient_context); - } - else if (nodeIsMissing(node.body)) { - return checkForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_method_overloads); - } - } - else if (node.parent.kind === SyntaxKind.InterfaceDeclaration) { - return checkForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_interfaces); - } - else if (node.parent.kind === SyntaxKind.TypeLiteral) { - return checkForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_type_literals); - } - } - - function checkForBodyInAmbientContext(body: Block | Expression, isConstructor: boolean): boolean { - if (inAmbientContext && body && body.kind === SyntaxKind.Block) { - var diagnostic = isConstructor - ? Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context - : Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; - return grammarErrorOnFirstToken(body, diagnostic); - } - } - - function checkModuleDeclaration(node: ModuleDeclaration): boolean { - return checkModuleDeclarationName(node) || - checkModuleDeclarationStatements(node); - } - - function checkModuleDeclarationName(node: ModuleDeclaration) { - if (!inAmbientContext && node.name.kind === SyntaxKind.StringLiteral) { - return grammarErrorOnNode(node.name, Diagnostics.Only_ambient_modules_can_use_quoted_names); - } - } - - function checkModuleDeclarationStatements(node: ModuleDeclaration): boolean { - if (node.name.kind === SyntaxKind.Identifier && node.body.kind === SyntaxKind.ModuleBlock) { - var statements = (node.body).statements; - for (var i = 0, n = statements.length; i < n; i++) { - var statement = statements[i]; - - if (statement.kind === SyntaxKind.ExportAssignment) { - // Export assignments are not allowed in an internal module - return grammarErrorOnNode(statement, Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); - } - else if (isExternalModuleImportDeclaration(statement)) { - return grammarErrorOnNode(getExternalModuleImportDeclarationExpression(statement), Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); - } - } - } - } - - function checkObjectLiteralExpression(node: ObjectLiteralExpression): boolean { - var seen: Map = {}; - var Property = 1; - var GetAccessor = 2; - var SetAccesor = 4; - var GetOrSetAccessor = GetAccessor | SetAccesor; - var inStrictMode = (node.parserContextFlags & ParserContextFlags.StrictMode) !== 0; - - for (var i = 0, n = node.properties.length; i < n; i++) { - var prop = node.properties[i]; - var name = prop.name; - if (prop.kind === SyntaxKind.OmittedExpression || name.kind === SyntaxKind.ComputedPropertyName) { - continue; - } - - // ECMA-262 11.1.5 Object Initialiser - // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true - // a.This production is contained in strict code and IsDataDescriptor(previous) is true and - // IsDataDescriptor(propId.descriptor) is true. - // b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true. - // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. - // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true - // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind: number; - if (prop.kind === SyntaxKind.PropertyAssignment || - prop.kind === SyntaxKind.ShorthandPropertyAssignment || - prop.kind === SyntaxKind.MethodDeclaration) { - currentKind = Property; - } - else if (prop.kind === SyntaxKind.GetAccessor) { - currentKind = GetAccessor; - } - else if (prop.kind === SyntaxKind.SetAccessor) { - currentKind = SetAccesor; - } - else { - Debug.fail("Unexpected syntax kind:" + prop.kind); - } - - if (!hasProperty(seen, name.text)) { - seen[name.text] = currentKind; - } - else { - var existingKind = seen[name.text]; - if (currentKind === Property && existingKind === Property) { - if (inStrictMode) { - grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); - } - } - else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { - if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[name.text] = currentKind | existingKind; - } - else { - return grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); - } - } - else { - return grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); - } - } - } - } - - function checkNumericLiteral(node: LiteralExpression): boolean { - if (node.flags & NodeFlags.OctalLiteral) { - if (node.parserContextFlags & ParserContextFlags.StrictMode) { - return grammarErrorOnNode(node, Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); - } - else if (languageVersion >= ScriptTarget.ES5) { - return grammarErrorOnNode(node, Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); - } - } - } - - function checkModifiers(node: Node): boolean { - switch (node.kind) { - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.Constructor: - case SyntaxKind.PropertyDeclaration: - case SyntaxKind.PropertySignature: - case SyntaxKind.MethodDeclaration: - case SyntaxKind.MethodSignature: - case SyntaxKind.IndexSignature: - case SyntaxKind.ClassDeclaration: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.ModuleDeclaration: - case SyntaxKind.EnumDeclaration: - case SyntaxKind.ExportAssignment: - case SyntaxKind.VariableStatement: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.TypeAliasDeclaration: - case SyntaxKind.ImportDeclaration: - case SyntaxKind.Parameter: - break; - default: - return false; - } - - if (!node.modifiers) { - return; - } - - var lastStatic: Node, lastPrivate: Node, lastProtected: Node, lastDeclare: Node; - var flags = 0; - for (var i = 0, n = node.modifiers.length; i < n; i++) { - var modifier = node.modifiers[i]; - - switch (modifier.kind) { - case SyntaxKind.PublicKeyword: - case SyntaxKind.ProtectedKeyword: - case SyntaxKind.PrivateKeyword: - var text: string; - if (modifier.kind === SyntaxKind.PublicKeyword) { - text = "public"; - } - else if (modifier.kind === SyntaxKind.ProtectedKeyword) { - text = "protected"; - lastProtected = modifier; - } - else { - text = "private"; - lastPrivate = modifier; - } - - if (flags & NodeFlags.AccessibilityModifier) { - return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & NodeFlags.Static) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); - } - else if (node.parent.kind === SyntaxKind.ModuleBlock || node.parent.kind === SyntaxKind.SourceFile) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); - } - flags |= modifierToFlag(modifier.kind); - break; - - case SyntaxKind.StaticKeyword: - if (flags & NodeFlags.Static) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static"); - } - else if (node.parent.kind === SyntaxKind.ModuleBlock || node.parent.kind === SyntaxKind.SourceFile) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); - } - else if (node.kind === SyntaxKind.Parameter) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); - } - flags |= NodeFlags.Static; - lastStatic = modifier; - break; - - case SyntaxKind.ExportKeyword: - if (flags & NodeFlags.Export) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export"); - } - else if (flags & NodeFlags.Ambient) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); - } - else if (node.parent.kind === SyntaxKind.ClassDeclaration) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); - } - else if (node.kind === SyntaxKind.Parameter) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); - } - flags |= NodeFlags.Export; - break; - - case SyntaxKind.DeclareKeyword: - if (flags & NodeFlags.Ambient) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare"); - } - else if (node.parent.kind === SyntaxKind.ClassDeclaration) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); - } - else if (node.kind === SyntaxKind.Parameter) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); - } - else if (inAmbientContext && node.parent.kind === SyntaxKind.ModuleBlock) { - return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); - } - flags |= NodeFlags.Ambient; - lastDeclare = modifier; - break; - } - } - - if (node.kind === SyntaxKind.Constructor) { - if (flags & NodeFlags.Static) { - return grammarErrorOnNode(lastStatic, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); - } - else if (flags & NodeFlags.Protected) { - return grammarErrorOnNode(lastProtected, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); - } - else if (flags & NodeFlags.Private) { - return grammarErrorOnNode(lastPrivate, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); - } - } - else if (node.kind === SyntaxKind.ImportDeclaration && flags & NodeFlags.Ambient) { - return grammarErrorOnNode(lastDeclare, Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); - } - else if (node.kind === SyntaxKind.InterfaceDeclaration && flags & NodeFlags.Ambient) { - return grammarErrorOnNode(lastDeclare, Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); - } - } - - function checkParameter(node: ParameterDeclaration): boolean { - // It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs as the - // Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code - // or if its FunctionBody is strict code(11.1.5). - // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a - // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) - if (node.parserContextFlags & ParserContextFlags.StrictMode && isEvalOrArgumentsIdentifier(node.name)) { - return reportInvalidUseInStrictMode(node.name); - } - } - - function checkTypeParameterList(typeParameters: NodeArray): boolean { - if (checkForDisallowedTrailingComma(typeParameters)) { - return true; - } - - if (typeParameters && typeParameters.length === 0) { - var start = typeParameters.pos - "<".length; - var end = skipTrivia(sourceText, typeParameters.end) + ">".length; - return grammarErrorAtPos(start, end - start, Diagnostics.Type_parameter_list_cannot_be_empty); - } - } - - function checkParameterList(parameters: NodeArray): boolean { - if (checkForDisallowedTrailingComma(parameters)) { - return true; - } - - var seenOptionalParameter = false; - var parameterCount = parameters.length; - - for (var i = 0; i < parameterCount; i++) { - var parameter = parameters[i]; - if (parameter.dotDotDotToken) { - if (i !== (parameterCount - 1)) { - return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); - } - - if (parameter.questionToken) { - return grammarErrorOnNode(parameter.questionToken, Diagnostics.A_rest_parameter_cannot_be_optional); - } - - if (parameter.initializer) { - return grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_cannot_have_an_initializer); - } - } - else if (parameter.questionToken || parameter.initializer) { - seenOptionalParameter = true; - - if (parameter.questionToken && parameter.initializer) { - return grammarErrorOnNode(parameter.name, Diagnostics.Parameter_cannot_have_question_mark_and_initializer); - } - } - else { - if (seenOptionalParameter) { - return grammarErrorOnNode(parameter.name, Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); - } - } - } - } - - function checkPostfixUnaryExpression(node: PostfixUnaryExpression) { - // The identifier eval or arguments may not appear as the LeftHandSideExpression of an - // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression - // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator. - if (node.parserContextFlags & ParserContextFlags.StrictMode && isEvalOrArgumentsIdentifier(node.operand)) { - return reportInvalidUseInStrictMode(node.operand); - } - } - - function checkPrefixUnaryExpression(node: PrefixUnaryExpression) { - if (node.parserContextFlags & ParserContextFlags.StrictMode) { - // The identifier eval or arguments may not appear as the LeftHandSideExpression of an - // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression - // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator - if ((node.operator === SyntaxKind.PlusPlusToken || node.operator === SyntaxKind.MinusMinusToken) && isEvalOrArgumentsIdentifier(node.operand)) { - return reportInvalidUseInStrictMode(node.operand); - } - } - } - - function checkProperty(node: PropertyDeclaration) { - if (node.parent.kind === SyntaxKind.ClassDeclaration) { - if (checkForInvalidQuestionMark(node, node.questionToken, Diagnostics.A_class_member_cannot_be_declared_optional) || - checkForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_class_property_declarations)) { - return true; - } - } - else if (node.parent.kind === SyntaxKind.InterfaceDeclaration) { - if (checkForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_interfaces)) { - return true; - } - } - else if (node.parent.kind === SyntaxKind.TypeLiteral) { - if (checkForDisallowedComputedProperty(node.name, Diagnostics.Computed_property_names_are_not_allowed_in_type_literals)) { - return true; - } - } - - return checkForInitializerInAmbientContext(node); - } - - function checkComputedPropertyName(node: ComputedPropertyName) { - // Since computed properties are not supported in the type checker, disallow them in TypeScript 1.4 - // Once full support is added, remove this error. - return grammarErrorOnNode(node, Diagnostics.Computed_property_names_are_not_currently_supported); - - if (languageVersion < ScriptTarget.ES6) { - return grammarErrorOnNode(node, Diagnostics.Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher); - } - else if (node.expression.kind === SyntaxKind.BinaryExpression && (node.expression).operator === SyntaxKind.CommaToken) { - return grammarErrorOnNode(node.expression, Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); - } - } - - function checkForDisallowedComputedProperty(node: DeclarationName, message: DiagnosticMessage) { - if (node.kind === SyntaxKind.ComputedPropertyName) { - return grammarErrorOnNode(node, message); - } - } - - function checkForInitializerInAmbientContext(node: PropertyDeclaration) { - if (inAmbientContext && node.initializer) { - return grammarErrorOnFirstToken(node.initializer, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } - } - - function checkPropertyAssignment(node: PropertyAssignment) { - return checkForInvalidQuestionMark(node, node.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional); - } - - function checkForInvalidQuestionMark(node: Declaration, questionToken: Node, message: DiagnosticMessage) { - if (questionToken) { - return grammarErrorOnNode(questionToken, message); - } - } - - function checkReturnStatement(node: ReturnStatement) { - if (!inFunctionBlock) { - return grammarErrorOnFirstToken(node, Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); - } - } - - function checkSetAccessor(node: MethodDeclaration) { - return checkForDisallowedModifiersInBlockOrObjectLiteral(node) || - checkAnySignatureDeclaration(node) || - checkAccessor(node); - } - - function checkAccessor(accessor: MethodDeclaration): boolean { - var kind = accessor.kind; - if (languageVersion < ScriptTarget.ES5) { - return grammarErrorOnNode(accessor.name, Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); - } - else if (inAmbientContext) { - return grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); - } - else if (accessor.body === undefined) { - return grammarErrorAtPos(accessor.end - 1, ";".length, Diagnostics._0_expected, "{"); - } - else if (accessor.typeParameters) { - return grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_have_type_parameters); - } - else if (kind === SyntaxKind.GetAccessor && accessor.parameters.length) { - return grammarErrorOnNode(accessor.name, Diagnostics.A_get_accessor_cannot_have_parameters); - } - else if (kind === SyntaxKind.SetAccessor) { - if (accessor.type) { - return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); - } - else if (accessor.parameters.length !== 1) { - return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_must_have_exactly_one_parameter); - } - else { - var parameter = accessor.parameters[0]; - if (parameter.dotDotDotToken) { - return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.A_set_accessor_cannot_have_rest_parameter); - } - else if (parameter.flags & NodeFlags.Modifier) { - return grammarErrorOnNode(accessor.name, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); - } - else if (parameter.questionToken) { - return grammarErrorOnNode(parameter.questionToken, Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); - } - else if (parameter.initializer) { - return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); - } - } - } - } - - function checkSourceFile(node: SourceFile): boolean { - return inAmbientContext && checkTopLevelElementsForRequiredDeclareModifier(file); - } - - function checkTopLevelElementsForRequiredDeclareModifier(file: SourceFile): boolean { - for (var i = 0, n = file.statements.length; i < n; i++) { - var decl = file.statements[i]; - if (isDeclaration(decl) || decl.kind === SyntaxKind.VariableStatement) { - if (checkTopLevelElementForRequiredDeclareModifier(decl)) { - return true; - } - } - } - } - - function checkTopLevelElementForRequiredDeclareModifier(node: Node): boolean { - // A declare modifier is required for any top level .d.ts declaration except export=, interfaces and imports: - // categories: - // - // DeclarationElement: - // ExportAssignment - // export_opt InterfaceDeclaration - // export_opt ImportDeclaration - // export_opt ExternalImportDeclaration - // export_opt AmbientDeclaration - // - if (node.kind === SyntaxKind.InterfaceDeclaration || - node.kind === SyntaxKind.ImportDeclaration || - node.kind === SyntaxKind.ExportAssignment || - (node.flags & NodeFlags.Ambient)) { - - return false; - } - - return grammarErrorOnFirstToken(node, Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); - } - - function checkShorthandPropertyAssignment(node: ShorthandPropertyAssignment): boolean { - return checkForInvalidQuestionMark(node, node.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional); - } - - function checkSwitchStatement(node: SwitchStatement) { - var firstDefaultClause: CaseOrDefaultClause; - - // Error on duplicate 'default' clauses. - for (var i = 0, n = node.clauses.length; i < n; i++) { - var clause = node.clauses[i]; - if (clause.kind === SyntaxKind.DefaultClause) { - if (firstDefaultClause === undefined) { - firstDefaultClause = clause; - } - else { - var start = skipTrivia(file.text, clause.pos); - var end = clause.statements.length > 0 ? clause.statements[0].pos : clause.end; - return grammarErrorAtPos(start, end - start, Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); - } - } - } - } - - function checkTaggedTemplateExpression(node: TaggedTemplateExpression) { - if (languageVersion < ScriptTarget.ES6) { - return grammarErrorOnFirstToken(node.template, Diagnostics.Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher); - } - } - - function checkThrowStatement(node: ThrowStatement) { - if (node.expression === undefined) { - return grammarErrorAfterFirstToken(node, Diagnostics.Line_break_not_permitted_here); - } - } - - function checkTupleType(node: TupleTypeNode) { - return checkForDisallowedTrailingComma(node.elementTypes) || - checkForAtLeastOneType(node); - } - - function checkForAtLeastOneType(node: TupleTypeNode): boolean { - if (node.elementTypes.length === 0) { - return grammarErrorOnNode(node, Diagnostics.A_tuple_type_element_list_cannot_be_empty) - } - } - - function checkTypeParameter(node: TypeParameterDeclaration) { - if (node.expression) { - return grammarErrorOnFirstToken(node.expression, Diagnostics.Type_expected); - } - } - - function checkTypeReference(node: TypeReferenceNode) { - return checkTypeArguments(node.typeArguments); - } - - function checkBindingElement(node: BindingElement) { - if (node.parserContextFlags & ParserContextFlags.StrictMode && isEvalOrArgumentsIdentifier(node.name)) { - // It is a SyntaxError if a VariableDeclaration or VariableDeclarationNoIn occurs within strict code - // and its Identifier is eval or arguments - return reportInvalidUseInStrictMode(node.name); - } - } - - function checkVariableDeclaration(node: VariableDeclaration) { - if (inAmbientContext) { - if (isBindingPattern(node.name)) { - return grammarErrorOnNode(node, Diagnostics.Destructuring_declarations_are_not_allowed_in_ambient_contexts); - } - if (node.initializer) { - // Error on equals token which immediate precedes the initializer - return grammarErrorAtPos(node.initializer.pos - 1, 1, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } - } - else { - if (!node.initializer) { - if (isBindingPattern(node.name) && !isBindingPattern(node.parent)) { - return grammarErrorOnNode(node, Diagnostics.A_destructuring_declaration_must_have_an_initializer); - } - if (isConst(node)) { - return grammarErrorOnNode(node, Diagnostics.const_declarations_must_be_initialized); - } - } - } - if (node.parserContextFlags & ParserContextFlags.StrictMode && isEvalOrArgumentsIdentifier(node.name)) { - // It is a SyntaxError if a VariableDeclaration or VariableDeclarationNoIn occurs within strict code - // and its Identifier is eval or arguments - return reportInvalidUseInStrictMode(node.name); - } - } - - function checkVariableDeclarationList(declarationList: VariableDeclarationList): boolean { - var declarations = declarationList.declarations; - if (checkForDisallowedTrailingComma(declarationList.declarations)) { - return true; - } - - if (!declarationList.declarations.length) { - return grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, Diagnostics.Variable_declaration_list_cannot_be_empty); - } - - if (declarationList.parent.kind === SyntaxKind.ForInStatement) { - checkForMoreThanOneDeclaration(declarationList.declarations); - } - - if (languageVersion < ScriptTarget.ES6) { - if (isLet(declarationList)) { - return grammarErrorOnFirstToken(declarationList, Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); - } - else if (isConst(declarationList)) { - return grammarErrorOnFirstToken(declarationList, Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); - } - } - } - - function checkVariableStatement(node: VariableStatement) { - return checkForDisallowedModifiersInBlockOrObjectLiteral(node) || - checkForDisallowedLetOrConstStatement(node); - } - - function checkForDisallowedModifiersInBlockOrObjectLiteral(node: Node) { - if (node.modifiers) { - if (inBlock || inObjectLiteralExpression) { - return grammarErrorOnFirstToken(node, Diagnostics.Modifiers_cannot_appear_here); - } - } - } - - function checkForDisallowedLetOrConstStatement(node: VariableStatement) { - if (!allowLetAndConstDeclarations(node.parent)) { - if (isLet(node.declarationList)) { - return grammarErrorOnNode(node, Diagnostics.let_declarations_can_only_be_declared_inside_a_block); - } - else if (isConst(node.declarationList)) { - return grammarErrorOnNode(node, Diagnostics.const_declarations_can_only_be_declared_inside_a_block); - } - } - } - - function allowLetAndConstDeclarations(parent: Node): boolean { - switch (parent.kind) { - case SyntaxKind.IfStatement: - case SyntaxKind.DoStatement: - case SyntaxKind.WhileStatement: - case SyntaxKind.WithStatement: - case SyntaxKind.ForStatement: - case SyntaxKind.ForInStatement: - return false; - case SyntaxKind.LabeledStatement: - return allowLetAndConstDeclarations(parent.parent); - } - - return true; - } - - function checkWithStatement(node: WithStatement): boolean { - if (node.parserContextFlags & ParserContextFlags.StrictMode) { - // Strict mode code may not include a WithStatement. The occurrence of a WithStatement in such - // a context is an - return grammarErrorOnFirstToken(node, Diagnostics.with_statements_are_not_allowed_in_strict_mode); - } - } - - function checkYieldExpression(node: YieldExpression): boolean { - if (!(node.parserContextFlags & ParserContextFlags.Yield)) { - return grammarErrorOnFirstToken(node, Diagnostics.yield_expression_must_be_contained_within_a_generator_declaration); - } - return grammarErrorOnFirstToken(node, Diagnostics.yield_expressions_are_not_currently_supported); - } - } - export function createProgram(rootNames: string[], options: CompilerOptions, host: CompilerHost): Program { var program: Program; var files: SourceFile[] = []; @@ -6254,8 +4944,13 @@ module ts { // We haven't looked for this file, do so now and cache result var file = filesByName[canonicalName] = host.getSourceFile(filename, options.target, hostErrorMessage => { - errors.push(createFileDiagnostic(refFile, refStart, refLength, - Diagnostics.Cannot_read_file_0_Colon_1, filename, hostErrorMessage)); + if (refFile) { + errors.push(createFileDiagnostic(refFile, refStart, refLength, + Diagnostics.Cannot_read_file_0_Colon_1, filename, hostErrorMessage)); + } + else { + errors.push(createCompilerDiagnostic(Diagnostics.Cannot_read_file_0_Colon_1, filename, hostErrorMessage)); + } }); if (file) { seenNoDefaultLib = seenNoDefaultLib || file.hasNoDefaultLib; @@ -6427,4 +5122,4 @@ module ts { } } } -} +} \ No newline at end of file diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 8f48008b641..573072efdcb 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1241,6 +1241,7 @@ module ts { isVisible?: boolean; // Is this node visible localModuleName?: string; // Local name for module instance assignmentChecks?: Map; // Cache of assignment checks + hasReportedStatementInAmbientContext?: boolean; // Cache boolean if we report statements in ambient context importOnRightSide?: Symbol; // for import declarations - import that appear on the right side } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index f71c96e6211..dc47cad5b62 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -1191,7 +1191,17 @@ module Harness { return errorOutput; } + function compareDiagnostics(d1: HarnessDiagnostic, d2: HarnessDiagnostic) { + return ts.compareValues(d1.filename, d2.filename) || + ts.compareValues(d1.start, d2.start) || + ts.compareValues(d1.end, d2.end) || + ts.compareValues(d1.code, d2.code) || + ts.compareValues(d1.message, d2.message) || + 0; + } + export function getErrorBaseline(inputFiles: { unitName: string; content: string }[], diagnostics: HarnessDiagnostic[]) { + diagnostics.sort(compareDiagnostics); var outputLines: string[] = []; // Count up all the errors we find so we don't miss any diff --git a/tests/baselines/reference/ArrowFunction2.errors.txt b/tests/baselines/reference/ArrowFunction2.errors.txt index 26e1f336cb6..3b9ba21f15a 100644 --- a/tests/baselines/reference/ArrowFunction2.errors.txt +++ b/tests/baselines/reference/ArrowFunction2.errors.txt @@ -1,12 +1,12 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction2.ts(1,14): error TS1009: Trailing comma not allowed. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction2.ts(1,13): error TS2304: Cannot find name 'b'. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction2.ts(1,14): error TS1009: Trailing comma not allowed. ==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction2.ts (2 errors) ==== var v = (a: b,) => { - ~ -!!! error TS1009: Trailing comma not allowed. ~ !!! error TS2304: Cannot find name 'b'. + ~ +!!! error TS1009: Trailing comma not allowed. }; \ No newline at end of file diff --git a/tests/baselines/reference/ArrowFunction3.errors.txt b/tests/baselines/reference/ArrowFunction3.errors.txt index a1287eca881..b931fcb1cd8 100644 --- a/tests/baselines/reference/ArrowFunction3.errors.txt +++ b/tests/baselines/reference/ArrowFunction3.errors.txt @@ -1,12 +1,12 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts(1,14): error TS1110: Type expected. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts(1,13): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts(1,14): error TS1110: Type expected. ==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts (2 errors) ==== var v = (a): => { - ~~ -!!! error TS1110: Type expected. !!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. + ~~ +!!! error TS1110: Type expected. }; \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration5_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration5_es6.errors.txt index 490f3bd9f22..c68a6cb2057 100644 --- a/tests/baselines/reference/FunctionDeclaration5_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration5_es6.errors.txt @@ -1,14 +1,14 @@ tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts(1,14): error TS1138: Parameter declaration expected. -tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts(1,19): error TS1005: ';' expected. tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts(1,14): error TS2304: Cannot find name 'yield'. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts(1,19): error TS1005: ';' expected. ==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts (3 errors) ==== function*foo(yield) { ~~~~~ !!! error TS1138: Parameter declaration expected. - ~ -!!! error TS1005: ';' expected. ~~~~~ !!! error TS2304: Cannot find name 'yield'. + ~ +!!! error TS1005: ';' expected. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt index 71aff1e2488..f129d3fa30b 100644 --- a/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt @@ -1,13 +1,16 @@ tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(1,9): error TS9001: Generators are not currently supported. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(3,11): error TS9001: Generators are not currently supported. tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(3,20): error TS2304: Cannot find name 'yield'. -==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts (2 errors) ==== +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts (3 errors) ==== function*bar() { ~ !!! error TS9001: Generators are not currently supported. // 'yield' here is an identifier, and not a yield expression. function*foo(a = yield) { + ~ +!!! error TS9001: Generators are not currently supported. ~~~~~ !!! error TS2304: Cannot find name 'yield'. } diff --git a/tests/baselines/reference/FunctionDeclaration9_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration9_es6.errors.txt index 8de32cf0a00..8333eceb267 100644 --- a/tests/baselines/reference/FunctionDeclaration9_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration9_es6.errors.txt @@ -1,9 +1,12 @@ tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(1,10): error TS9001: Generators are not currently supported. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(2,13): error TS9002: Computed property names are not currently supported. -==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts (1 errors) ==== +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts (2 errors) ==== function * foo() { ~ !!! error TS9001: Generators are not currently supported. var v = { [yield]: foo } + ~~~~~~~ +!!! error TS9002: Computed property names are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionPropertyAssignments5_es6.errors.txt b/tests/baselines/reference/FunctionPropertyAssignments5_es6.errors.txt index 393ede66a60..eff0c79d827 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments5_es6.errors.txt +++ b/tests/baselines/reference/FunctionPropertyAssignments5_es6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,11): error TS9001: Generators are not currently supported. +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,12): error TS9002: Computed property names are not currently supported. ==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts (1 errors) ==== var v = { *[foo()]() { } } - ~ -!!! error TS9001: Generators are not currently supported. \ No newline at end of file + ~~~~~~~ +!!! error TS9002: Computed property names are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration6_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration6_es6.errors.txt index b79a61c8866..911e91b8193 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration6_es6.errors.txt +++ b/tests/baselines/reference/MemberFunctionDeclaration6_es6.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration6_es6.ts(3,1): error TS1005: '(' expected. tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration6_es6.ts(2,5): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration6_es6.ts(3,1): error TS1005: '(' expected. ==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration6_es6.ts (2 errors) ==== diff --git a/tests/baselines/reference/MemberFunctionDeclaration8_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration8_es6.errors.txt index a946c17ff71..b21af664a69 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration8_es6.errors.txt +++ b/tests/baselines/reference/MemberFunctionDeclaration8_es6.errors.txt @@ -1,6 +1,6 @@ +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,9): error TS2304: Cannot find name 'a'. tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,12): error TS1127: Invalid character. tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,14): error TS1109: Expression expected. -tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,9): error TS2304: Cannot find name 'a'. tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,16): error TS2304: Cannot find name 'bar'. tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(5,12): error TS2304: Cannot find name 'bar'. @@ -10,12 +10,12 @@ tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration foo() { // Make sure we don't think of *bar as the start of a generator method. if (a) # * bar; + ~ +!!! error TS2304: Cannot find name 'a'. !!! error TS1127: Invalid character. ~ !!! error TS1109: Expression expected. - ~ -!!! error TS2304: Cannot find name 'a'. ~~~ !!! error TS2304: Cannot find name 'bar'. return bar; diff --git a/tests/baselines/reference/TemplateExpression1.errors.txt b/tests/baselines/reference/TemplateExpression1.errors.txt index c13b0fabd54..aa3b1674bf8 100644 --- a/tests/baselines/reference/TemplateExpression1.errors.txt +++ b/tests/baselines/reference/TemplateExpression1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/es6/templates/TemplateExpression1.ts(1,19): error TS1005: '}' expected. tests/cases/conformance/es6/templates/TemplateExpression1.ts(1,17): error TS2304: Cannot find name 'a'. +tests/cases/conformance/es6/templates/TemplateExpression1.ts(1,19): error TS1005: '}' expected. ==== tests/cases/conformance/es6/templates/TemplateExpression1.ts (2 errors) ==== var v = `foo ${ a - -!!! error TS1005: '}' expected. ~ -!!! error TS2304: Cannot find name 'a'. \ No newline at end of file +!!! error TS2304: Cannot find name 'a'. + +!!! error TS1005: '}' expected. \ No newline at end of file diff --git a/tests/baselines/reference/TypeArgumentList1.errors.txt b/tests/baselines/reference/TypeArgumentList1.errors.txt index 16550c3ed37..4138f3f8cc5 100644 --- a/tests/baselines/reference/TypeArgumentList1.errors.txt +++ b/tests/baselines/reference/TypeArgumentList1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/TypeArgumentLists/TypeArgumentList1.ts(1,9): error TS1127: Invalid character. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/TypeArgumentLists/TypeArgumentList1.ts(1,1): error TS2304: Cannot find name 'Foo'. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/TypeArgumentLists/TypeArgumentList1.ts(1,9): error TS1127: Invalid character. ==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/TypeArgumentLists/TypeArgumentList1.ts (2 errors) ==== Foo(4, 5, 6); - -!!! error TS1127: Invalid character. ~~~ -!!! error TS2304: Cannot find name 'Foo'. \ No newline at end of file +!!! error TS2304: Cannot find name 'Foo'. + +!!! error TS1127: Invalid character. \ No newline at end of file diff --git a/tests/baselines/reference/VariableDeclaration2_es6.errors.txt b/tests/baselines/reference/VariableDeclaration2_es6.errors.txt index 98c5ea9fce8..0d8214f5420 100644 --- a/tests/baselines/reference/VariableDeclaration2_es6.errors.txt +++ b/tests/baselines/reference/VariableDeclaration2_es6.errors.txt @@ -1,7 +1,10 @@ tests/cases/conformance/es6/variableDeclarations/VariableDeclaration2_es6.ts(1,1): error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/variableDeclarations/VariableDeclaration2_es6.ts(1,7): error TS1155: 'const' declarations must be initialized -==== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration2_es6.ts (1 errors) ==== +==== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration2_es6.ts (2 errors) ==== const a ~~~~~ -!!! error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. \ No newline at end of file +!!! error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. + ~ +!!! error TS1155: 'const' declarations must be initialized \ No newline at end of file diff --git a/tests/baselines/reference/VariableDeclaration4_es6.errors.txt b/tests/baselines/reference/VariableDeclaration4_es6.errors.txt index a411877f527..b4bb75b5658 100644 --- a/tests/baselines/reference/VariableDeclaration4_es6.errors.txt +++ b/tests/baselines/reference/VariableDeclaration4_es6.errors.txt @@ -1,7 +1,10 @@ tests/cases/conformance/es6/variableDeclarations/VariableDeclaration4_es6.ts(1,1): error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/variableDeclarations/VariableDeclaration4_es6.ts(1,7): error TS1155: 'const' declarations must be initialized -==== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration4_es6.ts (1 errors) ==== +==== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration4_es6.ts (2 errors) ==== const a: number ~~~~~ -!!! error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. \ No newline at end of file +!!! error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. + ~ +!!! error TS1155: 'const' declarations must be initialized \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression10_es6.errors.txt b/tests/baselines/reference/YieldExpression10_es6.errors.txt index 41d6bb5bf24..e0d7ea4ad27 100644 --- a/tests/baselines/reference/YieldExpression10_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression10_es6.errors.txt @@ -1,11 +1,14 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts(1,11): error TS9001: Generators are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts(2,5): error TS9000: 'yield' expressions are not currently supported. -==== tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts (1 errors) ==== +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts (2 errors) ==== var v = { * foo() { ~ !!! error TS9001: Generators are not currently supported. yield(foo); + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. } } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression11_es6.errors.txt b/tests/baselines/reference/YieldExpression11_es6.errors.txt index eea108619bc..3f322a81f2f 100644 --- a/tests/baselines/reference/YieldExpression11_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression11_es6.errors.txt @@ -1,11 +1,14 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(2,3): error TS9001: Generators are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(3,5): error TS9000: 'yield' expressions are not currently supported. -==== tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts (1 errors) ==== +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts (2 errors) ==== class C { *foo() { ~ !!! error TS9001: Generators are not currently supported. yield(foo); + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. } } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression13_es6.errors.txt b/tests/baselines/reference/YieldExpression13_es6.errors.txt index 185fb2f6193..fc2d885d381 100644 --- a/tests/baselines/reference/YieldExpression13_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression13_es6.errors.txt @@ -1,7 +1,10 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts(1,9): error TS9001: Generators are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts(1,19): error TS9000: 'yield' expressions are not currently supported. -==== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts (1 errors) ==== +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts (2 errors) ==== function* foo() { yield } ~ -!!! error TS9001: Generators are not currently supported. \ No newline at end of file +!!! error TS9001: Generators are not currently supported. + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression16_es6.errors.txt b/tests/baselines/reference/YieldExpression16_es6.errors.txt index 54536a7d4fe..c0d2e4c8fc8 100644 --- a/tests/baselines/reference/YieldExpression16_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression16_es6.errors.txt @@ -1,11 +1,14 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(1,9): error TS9001: Generators are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(3,5): error TS1163: 'yield' expression must be contained_within a generator declaration. -==== tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts (1 errors) ==== +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts (2 errors) ==== function* foo() { ~ !!! error TS9001: Generators are not currently supported. function bar() { yield foo; + ~~~~~ +!!! error TS1163: 'yield' expression must be contained_within a generator declaration. } } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression17_es6.errors.txt b/tests/baselines/reference/YieldExpression17_es6.errors.txt index 38969a9c6fb..b39f47b07f9 100644 --- a/tests/baselines/reference/YieldExpression17_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression17_es6.errors.txt @@ -1,10 +1,13 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts(1,15): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts(1,15): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts(1,23): error TS1163: 'yield' expression must be contained_within a generator declaration. -==== tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts (2 errors) ==== +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts (3 errors) ==== var v = { get foo() { yield foo; } } ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. \ No newline at end of file +!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. + ~~~~~ +!!! error TS1163: 'yield' expression must be contained_within a generator declaration. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression19_es6.errors.txt b/tests/baselines/reference/YieldExpression19_es6.errors.txt index 81cf0e2063c..9d04d9559b0 100644 --- a/tests/baselines/reference/YieldExpression19_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression19_es6.errors.txt @@ -1,13 +1,19 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(1,9): error TS9001: Generators are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(3,13): error TS9001: Generators are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(4,7): error TS9000: 'yield' expressions are not currently supported. -==== tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts (1 errors) ==== +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts (3 errors) ==== function*foo() { ~ !!! error TS9001: Generators are not currently supported. function bar() { function* quux() { + ~ +!!! error TS9001: Generators are not currently supported. yield(foo); + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. } } } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression3_es6.errors.txt b/tests/baselines/reference/YieldExpression3_es6.errors.txt index 91da79fbb53..1e284c92786 100644 --- a/tests/baselines/reference/YieldExpression3_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression3_es6.errors.txt @@ -1,10 +1,16 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts(1,9): error TS9001: Generators are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts(2,3): error TS9000: 'yield' expressions are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts(3,3): error TS9000: 'yield' expressions are not currently supported. -==== tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts (1 errors) ==== +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts (3 errors) ==== function* foo() { ~ !!! error TS9001: Generators are not currently supported. yield + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. yield + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression4_es6.errors.txt b/tests/baselines/reference/YieldExpression4_es6.errors.txt index ca7ed3d354c..2d2a7ca3257 100644 --- a/tests/baselines/reference/YieldExpression4_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression4_es6.errors.txt @@ -1,10 +1,16 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts(1,9): error TS9001: Generators are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts(2,3): error TS9000: 'yield' expressions are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts(3,3): error TS9000: 'yield' expressions are not currently supported. -==== tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts (1 errors) ==== +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts (3 errors) ==== function* foo() { ~ !!! error TS9001: Generators are not currently supported. yield; + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. yield; + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression6_es6.errors.txt b/tests/baselines/reference/YieldExpression6_es6.errors.txt index d8ce78a300f..a3d9481601a 100644 --- a/tests/baselines/reference/YieldExpression6_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression6_es6.errors.txt @@ -1,9 +1,12 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts(1,9): error TS9001: Generators are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts(2,3): error TS9000: 'yield' expressions are not currently supported. -==== tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts (1 errors) ==== +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts (2 errors) ==== function* foo() { ~ !!! error TS9001: Generators are not currently supported. yield*foo + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression7_es6.errors.txt b/tests/baselines/reference/YieldExpression7_es6.errors.txt index 87b15ac9f71..393a03ee269 100644 --- a/tests/baselines/reference/YieldExpression7_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression7_es6.errors.txt @@ -1,9 +1,12 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts(1,9): error TS9001: Generators are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts(2,3): error TS9000: 'yield' expressions are not currently supported. -==== tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts (1 errors) ==== +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts (2 errors) ==== function* foo() { ~ !!! error TS9001: Generators are not currently supported. yield foo + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression8_es6.errors.txt b/tests/baselines/reference/YieldExpression8_es6.errors.txt index 77bd03382aa..3f7933c5bb2 100644 --- a/tests/baselines/reference/YieldExpression8_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression8_es6.errors.txt @@ -1,8 +1,9 @@ -tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(2,9): error TS9001: Generators are not currently supported. tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(1,1): error TS2304: Cannot find name 'yield'. +tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(2,9): error TS9001: Generators are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(3,3): error TS9000: 'yield' expressions are not currently supported. -==== tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts (2 errors) ==== +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts (3 errors) ==== yield(foo); ~~~~~ !!! error TS2304: Cannot find name 'yield'. @@ -10,4 +11,6 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(1,1): error ~ !!! error TS9001: Generators are not currently supported. yield(foo); + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression9_es6.errors.txt b/tests/baselines/reference/YieldExpression9_es6.errors.txt index ae1b105903a..cd753647327 100644 --- a/tests/baselines/reference/YieldExpression9_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression9_es6.errors.txt @@ -1,9 +1,12 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts(1,17): error TS9001: Generators are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts(2,3): error TS9000: 'yield' expressions are not currently supported. -==== tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts (1 errors) ==== +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts (2 errors) ==== var v = function*() { ~ !!! error TS9001: Generators are not currently supported. yield(foo); + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt b/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt index 401a0107d89..fad1d8ff10a 100644 --- a/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt +++ b/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/accessorParameterAccessibilityModifier.ts(3,9): error TS2369: A parameter property is only allowed in a constructor implementation. -tests/cases/compiler/accessorParameterAccessibilityModifier.ts(4,16): error TS2369: A parameter property is only allowed in a constructor implementation. tests/cases/compiler/accessorParameterAccessibilityModifier.ts(3,11): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/accessorParameterAccessibilityModifier.ts(4,16): error TS2369: A parameter property is only allowed in a constructor implementation. tests/cases/compiler/accessorParameterAccessibilityModifier.ts(4,18): error TS2369: A parameter property is only allowed in a constructor implementation. diff --git a/tests/baselines/reference/accessorParameterAccessibilityModifier.js b/tests/baselines/reference/accessorParameterAccessibilityModifier.js new file mode 100644 index 00000000000..89a511e6c5c --- /dev/null +++ b/tests/baselines/reference/accessorParameterAccessibilityModifier.js @@ -0,0 +1,25 @@ +//// [accessorParameterAccessibilityModifier.ts] + +class C { + set X(public v) { } + static set X(public v2) { } +} + +//// [accessorParameterAccessibilityModifier.js] +var C = (function () { + function C() { + } + Object.defineProperty(C.prototype, "X", { + set: function (v) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(C, "X", { + set: function (v2) { + }, + enumerable: true, + configurable: true + }); + return C; +})(); diff --git a/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt index 22fdeb099bc..981cb525625 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt +++ b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt @@ -1,15 +1,15 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,55): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,54): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(6,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,55): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,54): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,52): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ==== tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts (12 errors) ==== diff --git a/tests/baselines/reference/aliasErrors.errors.txt b/tests/baselines/reference/aliasErrors.errors.txt index 20e68c5f800..a4c71fa9c5a 100644 --- a/tests/baselines/reference/aliasErrors.errors.txt +++ b/tests/baselines/reference/aliasErrors.errors.txt @@ -1,8 +1,8 @@ +tests/cases/compiler/aliasErrors.ts(11,1): error TS2304: Cannot find name 'no'. +tests/cases/compiler/aliasErrors.ts(12,1): error TS2304: Cannot find name 'no'. tests/cases/compiler/aliasErrors.ts(13,12): error TS1003: Identifier expected. tests/cases/compiler/aliasErrors.ts(14,12): error TS1003: Identifier expected. tests/cases/compiler/aliasErrors.ts(15,12): error TS1003: Identifier expected. -tests/cases/compiler/aliasErrors.ts(11,1): error TS2304: Cannot find name 'no'. -tests/cases/compiler/aliasErrors.ts(12,1): error TS2304: Cannot find name 'no'. tests/cases/compiler/aliasErrors.ts(16,1): error TS2304: Cannot find name 'undefined'. tests/cases/compiler/aliasErrors.ts(26,10): error TS2305: Module 'foo.bar.baz' has no exported member 'bar'. diff --git a/tests/baselines/reference/ambientErrors.errors.txt b/tests/baselines/reference/ambientErrors.errors.txt index 6fe7a25dfe9..c8159708dd8 100644 --- a/tests/baselines/reference/ambientErrors.errors.txt +++ b/tests/baselines/reference/ambientErrors.errors.txt @@ -1,16 +1,16 @@ tests/cases/conformance/ambient/ambientErrors.ts(2,15): error TS1039: Initializers are not allowed in ambient contexts. -tests/cases/conformance/ambient/ambientErrors.ts(20,24): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/conformance/ambient/ambientErrors.ts(6,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/conformance/ambient/ambientErrors.ts(17,22): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/conformance/ambient/ambientErrors.ts(20,24): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/conformance/ambient/ambientErrors.ts(24,5): error TS1066: Ambient enum elements can only have integer literal initializers. tests/cases/conformance/ambient/ambientErrors.ts(29,5): error TS1066: Ambient enum elements can only have integer literal initializers. tests/cases/conformance/ambient/ambientErrors.ts(34,11): error TS1039: Initializers are not allowed in ambient contexts. -tests/cases/conformance/ambient/ambientErrors.ts(35,19): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/conformance/ambient/ambientErrors.ts(35,19): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/conformance/ambient/ambientErrors.ts(37,20): error TS1039: Initializers are not allowed in ambient contexts. tests/cases/conformance/ambient/ambientErrors.ts(38,13): error TS1039: Initializers are not allowed in ambient contexts. -tests/cases/conformance/ambient/ambientErrors.ts(39,23): error TS1111: A constructor implementation cannot be declared in an ambient context. -tests/cases/conformance/ambient/ambientErrors.ts(40,14): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/conformance/ambient/ambientErrors.ts(41,22): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/conformance/ambient/ambientErrors.ts(6,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. -tests/cases/conformance/ambient/ambientErrors.ts(17,22): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/conformance/ambient/ambientErrors.ts(39,23): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/conformance/ambient/ambientErrors.ts(40,14): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/conformance/ambient/ambientErrors.ts(41,22): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/conformance/ambient/ambientErrors.ts(47,20): error TS2435: Ambient external modules cannot be nested in other modules. tests/cases/conformance/ambient/ambientErrors.ts(51,16): error TS2436: Ambient external module declaration cannot specify relative module name. tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export assignment cannot be used in a module with other exported elements. @@ -44,7 +44,7 @@ tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export // Ambient function with function body declare function fn4() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. // Ambient enum with non - integer literal constant member declare enum E1 { @@ -67,7 +67,7 @@ tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export !!! error TS1039: Initializers are not allowed in ambient contexts. function fn() { } ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. class C { static x = 3; ~ @@ -77,13 +77,13 @@ tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export !!! error TS1039: Initializers are not allowed in ambient contexts. constructor() { } ~ -!!! error TS1111: A constructor implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. fn() { } ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. static sfn() { } ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. } } diff --git a/tests/baselines/reference/ambientWithStatements.errors.txt b/tests/baselines/reference/ambientWithStatements.errors.txt index 4eef608bbec..023dd65f56d 100644 --- a/tests/baselines/reference/ambientWithStatements.errors.txt +++ b/tests/baselines/reference/ambientWithStatements.errors.txt @@ -1,74 +1,44 @@ tests/cases/compiler/ambientWithStatements.ts(2,5): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/ambientWithStatements.ts(3,5): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/ambientWithStatements.ts(4,5): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/ambientWithStatements.ts(5,5): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/ambientWithStatements.ts(7,5): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/ambientWithStatements.ts(8,5): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/ambientWithStatements.ts(9,5): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/ambientWithStatements.ts(10,5): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/ambientWithStatements.ts(11,5): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/ambientWithStatements.ts(12,5): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/ambientWithStatements.ts(18,5): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/ambientWithStatements.ts(19,5): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/ambientWithStatements.ts(25,5): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/ambientWithStatements.ts(3,5): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. tests/cases/compiler/ambientWithStatements.ts(7,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +tests/cases/compiler/ambientWithStatements.ts(11,5): error TS1108: A 'return' statement can only be used within a function body. tests/cases/compiler/ambientWithStatements.ts(25,11): error TS2410: All symbols within a 'with' block will be resolved to 'any'. -==== tests/cases/compiler/ambientWithStatements.ts (15 errors) ==== +==== tests/cases/compiler/ambientWithStatements.ts (5 errors) ==== declare module M { break; ~~~~~ !!! error TS1036: Statements are not allowed in ambient contexts. continue; - ~~~~~~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. + ~~~~~~~~~ +!!! error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. debugger; - ~~~~~~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. do { } while (true); - ~~ -!!! error TS1036: Statements are not allowed in ambient contexts. var x; for (x in null) { } - ~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. ~~~~ !!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. if (true) { } else { } - ~~ -!!! error TS1036: Statements are not allowed in ambient contexts. 1; - ~ -!!! error TS1036: Statements are not allowed in ambient contexts. L: var y; - ~ -!!! error TS1036: Statements are not allowed in ambient contexts. return; ~~~~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. +!!! error TS1108: A 'return' statement can only be used within a function body. switch (x) { - ~~~~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. case 1: break; default: break; } throw "nooo"; - ~~~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. try { - ~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. } catch (e) { } finally { } with (x) { - ~~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. ~ !!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. } diff --git a/tests/baselines/reference/ambiguousGenericAssertion1.errors.txt b/tests/baselines/reference/ambiguousGenericAssertion1.errors.txt index d97cdc95ac8..54b463109b1 100644 --- a/tests/baselines/reference/ambiguousGenericAssertion1.errors.txt +++ b/tests/baselines/reference/ambiguousGenericAssertion1.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/ambiguousGenericAssertion1.ts(4,10): error TS1109: Expression expected. +tests/cases/compiler/ambiguousGenericAssertion1.ts(4,15): error TS2304: Cannot find name 'x'. tests/cases/compiler/ambiguousGenericAssertion1.ts(4,16): error TS1005: ')' expected. tests/cases/compiler/ambiguousGenericAssertion1.ts(4,19): error TS1005: ',' expected. tests/cases/compiler/ambiguousGenericAssertion1.ts(4,21): error TS1005: ';' expected. -tests/cases/compiler/ambiguousGenericAssertion1.ts(4,15): error TS2304: Cannot find name 'x'. ==== tests/cases/compiler/ambiguousGenericAssertion1.ts (5 errors) ==== @@ -12,12 +12,12 @@ tests/cases/compiler/ambiguousGenericAssertion1.ts(4,15): error TS2304: Cannot f var r3 = <(x: T) => T>f; // ambiguous, appears to the parser as a << operation ~~ !!! error TS1109: Expression expected. + ~ +!!! error TS2304: Cannot find name 'x'. ~ !!! error TS1005: ')' expected. ~ !!! error TS1005: ',' expected. ~~ !!! error TS1005: ';' expected. - ~ -!!! error TS2304: Cannot find name 'x'. \ No newline at end of file diff --git a/tests/baselines/reference/anonymousModules.errors.txt b/tests/baselines/reference/anonymousModules.errors.txt index 1d63cc41c50..4893a0c80aa 100644 --- a/tests/baselines/reference/anonymousModules.errors.txt +++ b/tests/baselines/reference/anonymousModules.errors.txt @@ -1,34 +1,34 @@ -tests/cases/compiler/anonymousModules.ts(1,8): error TS1005: ';' expected. -tests/cases/compiler/anonymousModules.ts(4,9): error TS1005: ';' expected. -tests/cases/compiler/anonymousModules.ts(10,9): error TS1005: ';' expected. tests/cases/compiler/anonymousModules.ts(1,1): error TS2304: Cannot find name 'module'. +tests/cases/compiler/anonymousModules.ts(1,8): error TS1005: ';' expected. tests/cases/compiler/anonymousModules.ts(4,2): error TS2304: Cannot find name 'module'. +tests/cases/compiler/anonymousModules.ts(4,9): error TS1005: ';' expected. tests/cases/compiler/anonymousModules.ts(10,2): error TS2304: Cannot find name 'module'. +tests/cases/compiler/anonymousModules.ts(10,9): error TS1005: ';' expected. ==== tests/cases/compiler/anonymousModules.ts (6 errors) ==== module { - ~ -!!! error TS1005: ';' expected. ~~~~~~ !!! error TS2304: Cannot find name 'module'. + ~ +!!! error TS1005: ';' expected. export var foo = 1; module { - ~ -!!! error TS1005: ';' expected. ~~~~~~ !!! error TS2304: Cannot find name 'module'. + ~ +!!! error TS1005: ';' expected. export var bar = 1; } var bar = 2; module { - ~ -!!! error TS1005: ';' expected. ~~~~~~ !!! error TS2304: Cannot find name 'module'. + ~ +!!! error TS1005: ';' expected. var x = bar; } } \ No newline at end of file diff --git a/tests/baselines/reference/anyIdenticalToItself.errors.txt b/tests/baselines/reference/anyIdenticalToItself.errors.txt index ea8583a6a75..6b82f3af73c 100644 --- a/tests/baselines/reference/anyIdenticalToItself.errors.txt +++ b/tests/baselines/reference/anyIdenticalToItself.errors.txt @@ -1,6 +1,6 @@ +tests/cases/compiler/anyIdenticalToItself.ts(1,1): error TS2394: Overload signature is not compatible with function implementation. tests/cases/compiler/anyIdenticalToItself.ts(6,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/anyIdenticalToItself.ts(10,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/anyIdenticalToItself.ts(1,1): error TS2394: Overload signature is not compatible with function implementation. ==== tests/cases/compiler/anyIdenticalToItself.ts (3 errors) ==== diff --git a/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt b/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt index 0d294461592..41446dfceab 100644 --- a/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt +++ b/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,22): error TS1005: '=' expected. -tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,30): error TS1109: Expression expected. -tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,22): error TS1005: '=' expected. -tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,32): error TS1109: Expression expected. tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,5): error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'. Property 'isArray' is missing in type 'Number'. +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,22): error TS1005: '=' expected. +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,30): error TS1109: Expression expected. tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,5): error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'. +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,22): error TS1005: '=' expected. +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,32): error TS1109: Expression expected. ==== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts (6 errors) ==== @@ -14,17 +14,17 @@ tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts( var xs: typeof x[]; // Not an error. This is equivalent to Array var xs2: typeof Array; var xs3: typeof Array; + ~~~ +!!! error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'. +!!! error TS2322: Property 'isArray' is missing in type 'Number'. ~ !!! error TS1005: '=' expected. ~ !!! error TS1109: Expression expected. + var xs4: typeof Array; ~~~ !!! error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'. -!!! error TS2322: Property 'isArray' is missing in type 'Number'. - var xs4: typeof Array; ~ !!! error TS1005: '=' expected. ~ -!!! error TS1109: Expression expected. - ~~~ -!!! error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'. \ No newline at end of file +!!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt b/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt index 128e22d119e..ee87a6b8dd4 100644 --- a/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt +++ b/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt @@ -19,9 +19,9 @@ tests/cases/compiler/arrowFunctionsMissingTokens.ts(41,5): error TS1128: Declara tests/cases/compiler/arrowFunctionsMissingTokens.ts(42,1): error TS1128: Declaration or statement expected. tests/cases/compiler/arrowFunctionsMissingTokens.ts(45,14): error TS1109: Expression expected. tests/cases/compiler/arrowFunctionsMissingTokens.ts(47,21): error TS1005: '=>' expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(49,14): error TS2304: Cannot find name 'x'. tests/cases/compiler/arrowFunctionsMissingTokens.ts(51,35): error TS1005: '=>' expected. tests/cases/compiler/arrowFunctionsMissingTokens.ts(53,41): error TS1005: '=>' expected. -tests/cases/compiler/arrowFunctionsMissingTokens.ts(49,14): error TS2304: Cannot find name 'x'. ==== tests/cases/compiler/arrowFunctionsMissingTokens.ts (24 errors) ==== diff --git a/tests/baselines/reference/assertInWrapSomeTypeParameter.errors.txt b/tests/baselines/reference/assertInWrapSomeTypeParameter.errors.txt index f9019661fb5..c5492e42e42 100644 --- a/tests/baselines/reference/assertInWrapSomeTypeParameter.errors.txt +++ b/tests/baselines/reference/assertInWrapSomeTypeParameter.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assertInWrapSomeTypeParameter.ts(2,26): error TS1005: '>' expected. tests/cases/compiler/assertInWrapSomeTypeParameter.ts(1,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/assertInWrapSomeTypeParameter.ts(2,26): error TS1005: '>' expected. ==== tests/cases/compiler/assertInWrapSomeTypeParameter.ts (2 errors) ==== diff --git a/tests/baselines/reference/assignmentLHSIsValue.errors.txt b/tests/baselines/reference/assignmentLHSIsValue.errors.txt index f019bfdf6ca..cf747b44b3e 100644 --- a/tests/baselines/reference/assignmentLHSIsValue.errors.txt +++ b/tests/baselines/reference/assignmentLHSIsValue.errors.txt @@ -1,9 +1,3 @@ -tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(35,9): error TS1128: Declaration or statement expected. -tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(42,36): error TS1034: 'super' must be followed by an argument list or member access. -tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(44,19): error TS1034: 'super' must be followed by an argument list or member access. -tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(46,27): error TS1034: 'super' must be followed by an argument list or member access. -tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(50,20): error TS1128: Declaration or statement expected. -tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(51,11): error TS1005: ';' expected. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(6,21): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(7,13): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(8,21): error TS2364: Invalid left-hand side of assignment expression. @@ -19,8 +13,14 @@ tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(2 tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(30,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(31,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(32,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(35,9): error TS1128: Declaration or statement expected. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(38,2): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(38,6): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(42,36): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(44,19): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(46,27): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(50,20): error TS1128: Declaration or statement expected. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(51,11): error TS1005: ';' expected. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(54,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(57,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(58,1): error TS2364: Invalid left-hand side of assignment expression. diff --git a/tests/baselines/reference/autoLift2.errors.txt b/tests/baselines/reference/autoLift2.errors.txt index dbe9e98cd63..9af3d59420f 100644 --- a/tests/baselines/reference/autoLift2.errors.txt +++ b/tests/baselines/reference/autoLift2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/autoLift2.ts(5,17): error TS1005: ';' expected. -tests/cases/compiler/autoLift2.ts(6,17): error TS1005: ';' expected. tests/cases/compiler/autoLift2.ts(5,14): error TS2339: Property 'foo' does not exist on type 'A'. +tests/cases/compiler/autoLift2.ts(5,17): error TS1005: ';' expected. tests/cases/compiler/autoLift2.ts(5,19): error TS2304: Cannot find name 'any'. tests/cases/compiler/autoLift2.ts(6,14): error TS2339: Property 'bar' does not exist on type 'A'. +tests/cases/compiler/autoLift2.ts(6,17): error TS1005: ';' expected. tests/cases/compiler/autoLift2.ts(6,19): error TS2304: Cannot find name 'any'. tests/cases/compiler/autoLift2.ts(12,11): error TS2339: Property 'foo' does not exist on type 'A'. tests/cases/compiler/autoLift2.ts(14,11): error TS2339: Property 'bar' does not exist on type 'A'. @@ -16,17 +16,17 @@ tests/cases/compiler/autoLift2.ts(18,33): error TS2339: Property 'bar' does not { constructor() { this.foo: any; - ~ -!!! error TS1005: ';' expected. ~~~ !!! error TS2339: Property 'foo' does not exist on type 'A'. + ~ +!!! error TS1005: ';' expected. ~~~ !!! error TS2304: Cannot find name 'any'. this.bar: any; - ~ -!!! error TS1005: ';' expected. ~~~ !!! error TS2339: Property 'bar' does not exist on type 'A'. + ~ +!!! error TS1005: ';' expected. ~~~ !!! error TS2304: Cannot find name 'any'. } diff --git a/tests/baselines/reference/badArrayIndex.errors.txt b/tests/baselines/reference/badArrayIndex.errors.txt index 818870f6c26..4830ff1f693 100644 --- a/tests/baselines/reference/badArrayIndex.errors.txt +++ b/tests/baselines/reference/badArrayIndex.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/badArrayIndex.ts(1,22): error TS1109: Expression expected. tests/cases/compiler/badArrayIndex.ts(1,15): error TS2304: Cannot find name 'number'. +tests/cases/compiler/badArrayIndex.ts(1,22): error TS1109: Expression expected. ==== tests/cases/compiler/badArrayIndex.ts (2 errors) ==== var results = number[]; - ~ -!!! error TS1109: Expression expected. ~~~~~~ -!!! error TS2304: Cannot find name 'number'. \ No newline at end of file +!!! error TS2304: Cannot find name 'number'. + ~ +!!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/badArraySyntax.errors.txt b/tests/baselines/reference/badArraySyntax.errors.txt index b22097253fc..3c6b28408f2 100644 --- a/tests/baselines/reference/badArraySyntax.errors.txt +++ b/tests/baselines/reference/badArraySyntax.errors.txt @@ -2,10 +2,11 @@ tests/cases/compiler/badArraySyntax.ts(6,15): error TS1150: 'new T[]' cannot be tests/cases/compiler/badArraySyntax.ts(7,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/compiler/badArraySyntax.ts(8,20): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/compiler/badArraySyntax.ts(9,20): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/badArraySyntax.ts(10,36): error TS1109: Expression expected. tests/cases/compiler/badArraySyntax.ts(10,40): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -==== tests/cases/compiler/badArraySyntax.ts (5 errors) ==== +==== tests/cases/compiler/badArraySyntax.ts (6 errors) ==== class Z { public x = ""; } @@ -24,6 +25,8 @@ tests/cases/compiler/badArraySyntax.ts(10,40): error TS1150: 'new T[]' cannot be ~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var a6: Z[][] = new Z [ ] [ ]; + ~ +!!! error TS1109: Expression expected. ~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. \ No newline at end of file diff --git a/tests/baselines/reference/bases.errors.txt b/tests/baselines/reference/bases.errors.txt index c9eabafaf80..c03a47d7532 100644 --- a/tests/baselines/reference/bases.errors.txt +++ b/tests/baselines/reference/bases.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/bases.ts(7,15): error TS1005: ';' expected. -tests/cases/compiler/bases.ts(13,15): error TS1005: ';' expected. tests/cases/compiler/bases.ts(7,14): error TS2339: Property 'y' does not exist on type 'B'. +tests/cases/compiler/bases.ts(7,15): error TS1005: ';' expected. tests/cases/compiler/bases.ts(7,17): error TS2304: Cannot find name 'any'. tests/cases/compiler/bases.ts(11,7): error TS2420: Class 'C' incorrectly implements interface 'I'. Property 'x' is missing in type 'C'. tests/cases/compiler/bases.ts(12,5): error TS2377: Constructors for derived classes must contain a 'super' call. tests/cases/compiler/bases.ts(13,14): error TS2339: Property 'x' does not exist on type 'C'. +tests/cases/compiler/bases.ts(13,15): error TS1005: ';' expected. tests/cases/compiler/bases.ts(13,17): error TS2304: Cannot find name 'any'. tests/cases/compiler/bases.ts(17,9): error TS2339: Property 'x' does not exist on type 'C'. tests/cases/compiler/bases.ts(18,9): error TS2339: Property 'y' does not exist on type 'C'. @@ -19,10 +19,10 @@ tests/cases/compiler/bases.ts(18,9): error TS2339: Property 'y' does not exist o class B { constructor() { this.y: any; - ~ -!!! error TS1005: ';' expected. ~ !!! error TS2339: Property 'y' does not exist on type 'B'. + ~ +!!! error TS1005: ';' expected. ~~~ !!! error TS2304: Cannot find name 'any'. } @@ -35,11 +35,11 @@ tests/cases/compiler/bases.ts(18,9): error TS2339: Property 'y' does not exist o constructor() { ~~~~~~~~~~~~~~~ this.x: any; - ~ -!!! error TS1005: ';' expected. ~~~~~~~~~~~~~~~~~~~~ ~ !!! error TS2339: Property 'x' does not exist on type 'C'. + ~ +!!! error TS1005: ';' expected. ~~~ !!! error TS2304: Cannot find name 'any'. } diff --git a/tests/baselines/reference/callExpressionWithMissingTypeArgument1.errors.txt b/tests/baselines/reference/callExpressionWithMissingTypeArgument1.errors.txt index c7005ffcc22..aef540d958a 100644 --- a/tests/baselines/reference/callExpressionWithMissingTypeArgument1.errors.txt +++ b/tests/baselines/reference/callExpressionWithMissingTypeArgument1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/callExpressionWithMissingTypeArgument1.ts(1,7): error TS1110: Type expected. tests/cases/compiler/callExpressionWithMissingTypeArgument1.ts(1,1): error TS2304: Cannot find name 'Foo'. +tests/cases/compiler/callExpressionWithMissingTypeArgument1.ts(1,7): error TS1110: Type expected. ==== tests/cases/compiler/callExpressionWithMissingTypeArgument1.ts (2 errors) ==== Foo(); - ~ -!!! error TS1110: Type expected. ~~~ -!!! error TS2304: Cannot find name 'Foo'. \ No newline at end of file +!!! error TS2304: Cannot find name 'Foo'. + ~ +!!! error TS1110: Type expected. \ No newline at end of file diff --git a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt index 35718ca9612..63a63309c31 100644 --- a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt +++ b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt @@ -3,17 +3,17 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWith tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(5,22): error TS1015: Parameter cannot have question mark and initializer. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(15,9): error TS1015: Parameter cannot have question mark and initializer. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(23,6): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(23,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(24,20): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(24,20): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(34,6): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(34,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(35,9): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(35,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(44,9): error TS1015: Parameter cannot have question mark and initializer. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(45,32): error TS1015: Parameter cannot have question mark and initializer. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(46,9): error TS1015: Parameter cannot have question mark and initializer. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(23,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(24,20): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(34,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(35,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(45,32): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(46,9): error TS1015: Parameter cannot have question mark and initializer. ==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts (16 errors) ==== diff --git a/tests/baselines/reference/callSignaturesWithParameterInitializers2.errors.txt b/tests/baselines/reference/callSignaturesWithParameterInitializers2.errors.txt index c307f8ad5cf..22f8a563e71 100644 --- a/tests/baselines/reference/callSignaturesWithParameterInitializers2.errors.txt +++ b/tests/baselines/reference/callSignaturesWithParameterInitializers2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(20,15): error TS1005: '{' expected. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(4,14): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(11,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(20,5): error TS2300: Duplicate identifier 'foo'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(20,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(20,15): error TS1005: '{' expected. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(21,5): error TS2300: Duplicate identifier 'foo'. @@ -31,12 +31,12 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWit var b = { foo(x = 1), // error - ~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'foo'. ~~~~~ !!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. + ~ +!!! error TS1005: '{' expected. foo(x = 1) { }, // error ~~~ !!! error TS2300: Duplicate identifier 'foo'. diff --git a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt index cfb9287cdbc..fab981a8571 100644 --- a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt +++ b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,21): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,15): error TS2339: Property 'ClassA' does not exist on type 'typeof M'. +tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,21): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ==== tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts (2 errors) ==== @@ -8,7 +8,7 @@ tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,15): error TS2339: Pr class ClassA {} } var t = new M.ClassA[]; - ~~ -!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~ -!!! error TS2339: Property 'ClassA' does not exist on type 'typeof M'. \ No newline at end of file +!!! error TS2339: Property 'ClassA' does not exist on type 'typeof M'. + ~~ +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. \ No newline at end of file diff --git a/tests/baselines/reference/classExpression.errors.txt b/tests/baselines/reference/classExpression.errors.txt index 5a2bc4fd179..f5028814acc 100644 --- a/tests/baselines/reference/classExpression.errors.txt +++ b/tests/baselines/reference/classExpression.errors.txt @@ -1,10 +1,10 @@ tests/cases/conformance/classes/classExpression.ts(1,9): error TS1109: Expression expected. tests/cases/conformance/classes/classExpression.ts(5,10): error TS1109: Expression expected. tests/cases/conformance/classes/classExpression.ts(5,16): error TS1005: ':' expected. +tests/cases/conformance/classes/classExpression.ts(5,16): error TS2304: Cannot find name 'C2'. tests/cases/conformance/classes/classExpression.ts(5,19): error TS1005: ',' expected. tests/cases/conformance/classes/classExpression.ts(7,1): error TS1128: Declaration or statement expected. tests/cases/conformance/classes/classExpression.ts(10,13): error TS1109: Expression expected. -tests/cases/conformance/classes/classExpression.ts(5,16): error TS2304: Cannot find name 'C2'. ==== tests/cases/conformance/classes/classExpression.ts (7 errors) ==== @@ -19,10 +19,10 @@ tests/cases/conformance/classes/classExpression.ts(5,16): error TS2304: Cannot f !!! error TS1109: Expression expected. ~~ !!! error TS1005: ':' expected. - ~ -!!! error TS1005: ',' expected. ~~ !!! error TS2304: Cannot find name 'C2'. + ~ +!!! error TS1005: ',' expected. } } ~ diff --git a/tests/baselines/reference/classExtendingPrimitive.errors.txt b/tests/baselines/reference/classExtendingPrimitive.errors.txt index b27f1bc29d5..d46439eba1c 100644 --- a/tests/baselines/reference/classExtendingPrimitive.errors.txt +++ b/tests/baselines/reference/classExtendingPrimitive.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(7,19): error TS1133: Type reference expected. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,19): error TS1133: Type reference expected. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,24): error TS1005: ';' expected. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(3,17): error TS2304: Cannot find name 'number'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(4,18): error TS2304: Cannot find name 'string'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(5,18): error TS2304: Cannot find name 'boolean'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(6,18): error TS2304: Cannot find name 'Void'. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(7,19): error TS1133: Type reference expected. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(8,18): error TS2304: Cannot find name 'Null'. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,19): error TS1133: Type reference expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,24): error TS1005: ';' expected. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(10,18): error TS2304: Cannot find name 'undefined'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(11,18): error TS2304: Cannot find name 'Undefined'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(14,18): error TS2311: A class may only extend another class. diff --git a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt index 031caf19e26..f1870d71391 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt +++ b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,18): error TS1133: Type reference expected. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,20): error TS1005: ';' expected. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(4,17): error TS2311: A class may only extend another class. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(8,18): error TS2304: Cannot find name 'x'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(11,18): error TS2304: Cannot find name 'M'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(14,18): error TS2304: Cannot find name 'foo'. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,18): error TS1133: Type reference expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,20): error TS1005: ';' expected. ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts (6 errors) ==== diff --git a/tests/baselines/reference/classUpdateTests.errors.txt b/tests/baselines/reference/classUpdateTests.errors.txt index 6bfd7518855..5d5c4a36ab3 100644 --- a/tests/baselines/reference/classUpdateTests.errors.txt +++ b/tests/baselines/reference/classUpdateTests.errors.txt @@ -1,9 +1,3 @@ -tests/cases/compiler/classUpdateTests.ts(93,3): error TS1129: Statement expected. -tests/cases/compiler/classUpdateTests.ts(95,1): error TS1128: Declaration or statement expected. -tests/cases/compiler/classUpdateTests.ts(99,3): error TS1129: Statement expected. -tests/cases/compiler/classUpdateTests.ts(101,1): error TS1128: Declaration or statement expected. -tests/cases/compiler/classUpdateTests.ts(105,3): error TS1129: Statement expected. -tests/cases/compiler/classUpdateTests.ts(111,3): error TS1129: Statement expected. tests/cases/compiler/classUpdateTests.ts(34,2): error TS2377: Constructors for derived classes must contain a 'super' call. tests/cases/compiler/classUpdateTests.ts(43,18): error TS2335: 'super' can only be referenced in a derived class. tests/cases/compiler/classUpdateTests.ts(46,17): error TS2311: A class may only extend another class. @@ -14,7 +8,13 @@ tests/cases/compiler/classUpdateTests.ts(63,7): error TS2415: Class 'L' incorrec tests/cases/compiler/classUpdateTests.ts(69,7): error TS2415: Class 'M' incorrectly extends base class 'G'. Property 'p1' is private in type 'M' but not in type 'G'. tests/cases/compiler/classUpdateTests.ts(70,2): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. +tests/cases/compiler/classUpdateTests.ts(93,3): error TS1129: Statement expected. +tests/cases/compiler/classUpdateTests.ts(95,1): error TS1128: Declaration or statement expected. +tests/cases/compiler/classUpdateTests.ts(99,3): error TS1129: Statement expected. +tests/cases/compiler/classUpdateTests.ts(101,1): error TS1128: Declaration or statement expected. +tests/cases/compiler/classUpdateTests.ts(105,3): error TS1129: Statement expected. tests/cases/compiler/classUpdateTests.ts(105,15): error TS2339: Property 'p1' does not exist on type 'Q'. +tests/cases/compiler/classUpdateTests.ts(111,3): error TS1129: Statement expected. tests/cases/compiler/classUpdateTests.ts(111,16): error TS2339: Property 'p1' does not exist on type 'R'. diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.errors.txt b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.errors.txt index 15ad1e0e8e7..6a459b222c7 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.errors.txt +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.errors.txt @@ -1,12 +1,12 @@ tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(4,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(9,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(20,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(26,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(33,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(16,9): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(20,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(21,9): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(26,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(28,13): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(33,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(35,13): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.errors.txt b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.errors.txt index 47c52c2582e..7e0f80f0658 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.errors.txt +++ b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.errors.txt @@ -1,12 +1,12 @@ tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(3,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(7,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(16,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(21,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(27,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(13,13): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(16,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(17,13): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(21,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(23,17): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(27,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(29,17): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. diff --git a/tests/baselines/reference/collisionSuperAndParameter.errors.txt b/tests/baselines/reference/collisionSuperAndParameter.errors.txt index b3dcdbf1be8..65dddd95d48 100644 --- a/tests/baselines/reference/collisionSuperAndParameter.errors.txt +++ b/tests/baselines/reference/collisionSuperAndParameter.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/collisionSuperAndParameter.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/collisionSuperAndParameter.ts(26,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionSuperAndParameter.ts(17,22): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. tests/cases/compiler/collisionSuperAndParameter.ts(21,7): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndParameter.ts(26,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionSuperAndParameter.ts(26,11): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. tests/cases/compiler/collisionSuperAndParameter.ts(32,19): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. tests/cases/compiler/collisionSuperAndParameter.ts(35,17): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.errors.txt b/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.errors.txt index 951a349be2b..cbe371c5934 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.errors.txt @@ -1,10 +1,10 @@ tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(24,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(34,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(5,21): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(15,21): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(24,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(25,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(34,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(35,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt b/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt index af662869b5b..7b26fc4bf9e 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt @@ -1,15 +1,3 @@ -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(58,9): error TS1128: Declaration or statement expected. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(59,9): error TS1128: Declaration or statement expected. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(69,15): error TS1034: 'super' must be followed by an argument list or member access. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(70,15): error TS1034: 'super' must be followed by an argument list or member access. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(74,15): error TS1034: 'super' must be followed by an argument list or member access. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(75,15): error TS1034: 'super' must be followed by an argument list or member access. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(79,15): error TS1034: 'super' must be followed by an argument list or member access. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(80,15): error TS1034: 'super' must be followed by an argument list or member access. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(85,21): error TS1128: Declaration or statement expected. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(86,21): error TS1128: Declaration or statement expected. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(87,11): error TS1005: ';' expected. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(88,11): error TS1005: ';' expected. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(7,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(8,9): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(11,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. @@ -40,8 +28,20 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsVa tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(53,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(54,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(55,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(58,9): error TS1128: Declaration or statement expected. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(59,9): error TS1128: Declaration or statement expected. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(62,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(63,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(69,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(70,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(74,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(75,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(79,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(80,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(85,21): error TS1128: Declaration or statement expected. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(86,21): error TS1128: Declaration or statement expected. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(87,11): error TS1005: ';' expected. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(88,11): error TS1005: ';' expected. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(91,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(92,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(95,1): error TS2364: Invalid left-hand side of assignment expression. diff --git a/tests/baselines/reference/computedPropertyNames2.errors.txt b/tests/baselines/reference/computedPropertyNames2.errors.txt index e7cc84a8f6e..3dd4ac01d5f 100644 --- a/tests/baselines/reference/computedPropertyNames2.errors.txt +++ b/tests/baselines/reference/computedPropertyNames2.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(4,5): error TS9002: Computed property names are not currently supported. tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(5,12): error TS9002: Computed property names are not currently supported. +tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(6,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(6,9): error TS9002: Computed property names are not currently supported. tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(7,9): error TS9002: Computed property names are not currently supported. +tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(8,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(8,16): error TS9002: Computed property names are not currently supported. tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(9,16): error TS9002: Computed property names are not currently supported. -tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(6,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. -tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(8,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts (8 errors) ==== @@ -20,17 +20,17 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(8,16): !!! error TS9002: Computed property names are not currently supported. get [accessorName]() { } ~~~~~~~~~~~~~~ -!!! error TS9002: Computed property names are not currently supported. - ~~~~~~~~~~~~~~ !!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. + ~~~~~~~~~~~~~~ +!!! error TS9002: Computed property names are not currently supported. set [accessorName](v) { } ~~~~~~~~~~~~~~ !!! error TS9002: Computed property names are not currently supported. static get [accessorName]() { } ~~~~~~~~~~~~~~ -!!! error TS9002: Computed property names are not currently supported. - ~~~~~~~~~~~~~~ !!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. + ~~~~~~~~~~~~~~ +!!! error TS9002: Computed property names are not currently supported. static set [accessorName](v) { } ~~~~~~~~~~~~~~ !!! error TS9002: Computed property names are not currently supported. diff --git a/tests/baselines/reference/computedPropertyNames3.errors.txt b/tests/baselines/reference/computedPropertyNames3.errors.txt index a1d6e09421b..084a1f8889f 100644 --- a/tests/baselines/reference/computedPropertyNames3.errors.txt +++ b/tests/baselines/reference/computedPropertyNames3.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(3,5): error TS9002: Computed property names are not currently supported. tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(4,12): error TS9002: Computed property names are not currently supported. +tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(5,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(5,9): error TS9002: Computed property names are not currently supported. tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(6,9): error TS9002: Computed property names are not currently supported. +tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(7,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(7,16): error TS9002: Computed property names are not currently supported. tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(8,16): error TS9002: Computed property names are not currently supported. -tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(5,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. -tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(7,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts (8 errors) ==== @@ -19,17 +19,17 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(7,16): !!! error TS9002: Computed property names are not currently supported. get [delete id]() { } ~~~~~~~~~~~ -!!! error TS9002: Computed property names are not currently supported. - ~~~~~~~~~~~ !!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. + ~~~~~~~~~~~ +!!! error TS9002: Computed property names are not currently supported. set [[0, 1]](v) { } ~~~~~~~~ !!! error TS9002: Computed property names are not currently supported. static get [""]() { } ~~~~~~~~~~~~ -!!! error TS9002: Computed property names are not currently supported. - ~~~~~~~~~~~~ !!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. + ~~~~~~~~~~~~ +!!! error TS9002: Computed property names are not currently supported. static set [id.toString()](v) { } ~~~~~~~~~~~~~~~ !!! error TS9002: Computed property names are not currently supported. diff --git a/tests/baselines/reference/conflictMarkerTrivia1.errors.txt b/tests/baselines/reference/conflictMarkerTrivia1.errors.txt index cf78bdda91c..7c335a2bfc2 100644 --- a/tests/baselines/reference/conflictMarkerTrivia1.errors.txt +++ b/tests/baselines/reference/conflictMarkerTrivia1.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/conflictMarkerTrivia1.ts(2,1): error TS1185: Merge conflict marker encountered. -tests/cases/compiler/conflictMarkerTrivia1.ts(4,1): error TS1185: Merge conflict marker encountered. -tests/cases/compiler/conflictMarkerTrivia1.ts(6,1): error TS1185: Merge conflict marker encountered. tests/cases/compiler/conflictMarkerTrivia1.ts(3,5): error TS2300: Duplicate identifier 'v'. +tests/cases/compiler/conflictMarkerTrivia1.ts(4,1): error TS1185: Merge conflict marker encountered. tests/cases/compiler/conflictMarkerTrivia1.ts(5,5): error TS2300: Duplicate identifier 'v'. +tests/cases/compiler/conflictMarkerTrivia1.ts(6,1): error TS1185: Merge conflict marker encountered. ==== tests/cases/compiler/conflictMarkerTrivia1.ts (5 errors) ==== diff --git a/tests/baselines/reference/constDeclarations-errors.errors.txt b/tests/baselines/reference/constDeclarations-errors.errors.txt index d87007474a1..c0ae6635c5e 100644 --- a/tests/baselines/reference/constDeclarations-errors.errors.txt +++ b/tests/baselines/reference/constDeclarations-errors.errors.txt @@ -5,9 +5,9 @@ tests/cases/compiler/constDeclarations-errors.ts(5,11): error TS1155: 'const' de tests/cases/compiler/constDeclarations-errors.ts(5,15): error TS1155: 'const' declarations must be initialized tests/cases/compiler/constDeclarations-errors.ts(5,27): error TS1155: 'const' declarations must be initialized tests/cases/compiler/constDeclarations-errors.ts(8,11): error TS1155: 'const' declarations must be initialized +tests/cases/compiler/constDeclarations-errors.ts(11,27): error TS2449: The operand of an increment or decrement operator cannot be a constant. tests/cases/compiler/constDeclarations-errors.ts(14,11): error TS1155: 'const' declarations must be initialized tests/cases/compiler/constDeclarations-errors.ts(17,20): error TS1155: 'const' declarations must be initialized -tests/cases/compiler/constDeclarations-errors.ts(11,27): error TS2449: The operand of an increment or decrement operator cannot be a constant. ==== tests/cases/compiler/constDeclarations-errors.ts (10 errors) ==== diff --git a/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt b/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt index 745ef305ac6..20ec5b0c25b 100644 --- a/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt +++ b/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt @@ -2,15 +2,14 @@ tests/cases/compiler/constDeclarations-invalidContexts.ts(4,5): error TS1156: 'c tests/cases/compiler/constDeclarations-invalidContexts.ts(6,5): error TS1156: 'const' declarations can only be declared inside a block. tests/cases/compiler/constDeclarations-invalidContexts.ts(9,5): error TS1156: 'const' declarations can only be declared inside a block. tests/cases/compiler/constDeclarations-invalidContexts.ts(12,5): error TS1156: 'const' declarations can only be declared inside a block. -tests/cases/compiler/constDeclarations-invalidContexts.ts(17,5): error TS1156: 'const' declarations can only be declared inside a block. +tests/cases/compiler/constDeclarations-invalidContexts.ts(16,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. tests/cases/compiler/constDeclarations-invalidContexts.ts(20,5): error TS1156: 'const' declarations can only be declared inside a block. tests/cases/compiler/constDeclarations-invalidContexts.ts(23,5): error TS1156: 'const' declarations can only be declared inside a block. tests/cases/compiler/constDeclarations-invalidContexts.ts(26,12): error TS1156: 'const' declarations can only be declared inside a block. tests/cases/compiler/constDeclarations-invalidContexts.ts(29,29): error TS1156: 'const' declarations can only be declared inside a block. -tests/cases/compiler/constDeclarations-invalidContexts.ts(16,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. -==== tests/cases/compiler/constDeclarations-invalidContexts.ts (10 errors) ==== +==== tests/cases/compiler/constDeclarations-invalidContexts.ts (9 errors) ==== // Errors, const must be defined inside a block if (true) @@ -37,9 +36,7 @@ tests/cases/compiler/constDeclarations-invalidContexts.ts(16,7): error TS2410: A with (obj) ~~~ !!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. - const c5 = 0; - ~~~~~~~~~~~~~ -!!! error TS1156: 'const' declarations can only be declared inside a block. + const c5 = 0; // No Error will be reported here since we turn off all type checking for (var i = 0; i < 10; i++) const c6 = 0; diff --git a/tests/baselines/reference/constructorOverloads6.errors.txt b/tests/baselines/reference/constructorOverloads6.errors.txt index d5cf2486fe1..65827007a8e 100644 --- a/tests/baselines/reference/constructorOverloads6.errors.txt +++ b/tests/baselines/reference/constructorOverloads6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/constructorOverloads6.ts(4,25): error TS1111: A constructor implementation cannot be declared in an ambient context. +tests/cases/compiler/constructorOverloads6.ts(4,25): error TS1184: An implementation cannot be declared in ambient contexts. ==== tests/cases/compiler/constructorOverloads6.ts (1 errors) ==== @@ -7,7 +7,7 @@ tests/cases/compiler/constructorOverloads6.ts(4,25): error TS1111: A constructor constructor(n: number); constructor(x: any) { ~ -!!! error TS1111: A constructor implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. } bar1():void; diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index ed7843ad45e..6b394fec4d6 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -1,87 +1,87 @@ +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,1): error TS2304: Cannot find name 'module'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,19): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,35): error TS1005: ')' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(24,28): error TS1005: ':' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(24,29): error TS1005: ',' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(27,18): error TS1129: Statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(27,26): error TS2304: Cannot find name 'bfs'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,30): error TS1005: '=' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(31,18): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,26): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,28): error TS2304: Cannot find name 'bfs'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(38,17): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,28): error TS2304: Cannot find name 'bfs'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,41): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,45): error TS1002: Unterminated string literal. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(47,17): error TS2304: Cannot find name 'console'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(49,13): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(53,13): error TS2304: Cannot find name 'console'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(58,5): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(69,13): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(72,37): error TS1127: Invalid character. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(81,13): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(89,23): error TS2364: Invalid left-hand side of assignment expression. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(90,13): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(105,29): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(106,13): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,24): error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(138,13): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(141,32): error TS1005: '{' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(143,13): error TS1005: 'try' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,24): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,30): error TS1005: '(' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(205,28): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,10): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,36): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(227,13): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(234,14): error TS1005: '{' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,9): error TS1128: Declaration or statement expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,27): error TS1005: ',' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,36): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,9): error TS1128: Declaration or statement expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,26): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(241,5): error TS1128: Declaration or statement expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,69): error TS1110: Type expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,9): error TS1128: Declaration or statement expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,31): error TS1005: ',' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,9): error TS1128: Declaration or statement expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,27): error TS1135: Argument expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,33): error TS1005: '(' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,43): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,60): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,65): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,35): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,55): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,1): error TS2304: Cannot find name 'module'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(27,26): error TS2304: Cannot find name 'bfs'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,28): error TS2304: Cannot find name 'bfs'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,28): error TS2304: Cannot find name 'bfs'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(47,17): error TS2304: Cannot find name 'console'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(53,13): error TS2304: Cannot find name 'console'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(89,23): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,24): error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,31): error TS2304: Cannot find name 'Property'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(166,13): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(180,40): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(205,28): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(213,16): error TS2304: Cannot find name 'bool'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,10): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,29): error TS2304: Cannot find name 'yield'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,36): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(223,23): error TS2304: Cannot find name 'bool'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(227,13): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(234,14): error TS1005: '{' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,9): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,16): error TS2304: Cannot find name 'method1'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,24): error TS2304: Cannot find name 'val'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,27): error TS1005: ',' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,28): error TS2304: Cannot find name 'number'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,36): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,9): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,16): error TS2304: Cannot find name 'method2'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,26): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(241,5): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(246,25): error TS2339: Property 'method1' does not exist on type 'B'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,9): error TS2390: Constructor implementation is missing. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,21): error TS2369: A parameter property is only allowed in a constructor implementation. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,44): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,69): error TS1110: Type expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,9): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,16): error TS2304: Cannot find name 'Overloads'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,26): error TS2304: Cannot find name 'value'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,31): error TS1005: ',' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,33): error TS2304: Cannot find name 'string'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,9): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,16): error TS2304: Cannot find name 'Overloads'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,27): error TS1135: Argument expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,33): error TS1005: '(' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,35): error TS2304: Cannot find name 'string'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,43): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,52): error TS2304: Cannot find name 'string'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,60): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,65): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,9): error TS2304: Cannot find name 'public'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS2304: Cannot find name 'DefaultValue'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,29): error TS2304: Cannot find name 'value'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,35): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2304: Cannot find name 'string'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,55): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected. ==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (84 errors) ==== @@ -96,10 +96,10 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T } import fs = module("fs"); - ~ -!!! error TS1005: ';' expected. ~~~~~~~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'module'. + ~ +!!! error TS1005: ';' expected. module TypeScriptAllInOne { @@ -117,11 +117,11 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T return 1; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ !!! error TS1005: ':' expected. ~ !!! error TS1005: ',' expected. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~~~~~~~~~~~~~ !!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. @@ -142,10 +142,10 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T retValue = bfs.TYPES(); - ~ -!!! error TS1005: ';' expected. ~~~~~~~~ !!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! error TS1005: ';' expected. ~~~ !!! error TS2304: Cannot find name 'bfs'. if (retValue != 0) { @@ -158,12 +158,12 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T !!! error TS1109: Expression expected. retValue = bfs.OPERATOR ' ); + ~~~ +!!! error TS2304: Cannot find name 'bfs'. ~~~~ !!! error TS1005: ';' expected. !!! error TS1002: Unterminated string literal. - ~~~ -!!! error TS2304: Cannot find name 'bfs'. if (retValue != 0) { ~~~~~~~~~~~~~ !!! error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'. @@ -390,10 +390,10 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T case d = () => { yield 0; }; ~~~~ !!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~ -!!! error TS1005: ';' expected. ~~~~~ !!! error TS2304: Cannot find name 'yield'. + ~ +!!! error TS1005: ';' expected. public get Property() { return 0; } public Member() { return 0; @@ -419,25 +419,25 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T public method1(val:number) { ~~~~~~ !!! error TS1128: Declaration or statement expected. - ~ -!!! error TS1005: ',' expected. - ~ -!!! error TS1005: ';' expected. ~~~~~~~ !!! error TS2304: Cannot find name 'method1'. ~~~ !!! error TS2304: Cannot find name 'val'. + ~ +!!! error TS1005: ',' expected. ~~~~~~ !!! error TS2304: Cannot find name 'number'. + ~ +!!! error TS1005: ';' expected. return val; } public method2() { ~~~~~~ !!! error TS1128: Declaration or statement expected. - ~ -!!! error TS1005: ';' expected. ~~~~~~~ !!! error TS2304: Cannot find name 'method2'. + ~ +!!! error TS1005: ';' expected. return 2 * this.method1(2); } } @@ -458,61 +458,61 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T private otherValue = 42; constructor(private value: number, public name: string) : } - ~ -!!! error TS1110: Type expected. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2390: Constructor implementation is missing. ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~~~~~~~~~~~~ !!! error TS2369: A parameter property is only allowed in a constructor implementation. + ~ +!!! error TS1110: Type expected. public Overloads(value: string); ~~~~~~ !!! error TS1128: Declaration or statement expected. - ~ -!!! error TS1005: ',' expected. ~~~~~~~~~ !!! error TS2304: Cannot find name 'Overloads'. ~~~~~ !!! error TS2304: Cannot find name 'value'. + ~ +!!! error TS1005: ',' expected. ~~~~~~ !!! error TS2304: Cannot find name 'string'. public Overloads( while : string, ...rest: string[]) { & ~~~~~~ !!! error TS1128: Declaration or statement expected. + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'Overloads'. ~~~~~ !!! error TS1135: Argument expression expected. ~ !!! error TS1005: '(' expected. + ~~~~~~ +!!! error TS2304: Cannot find name 'string'. ~~~ !!! error TS1109: Expression expected. + ~~~~~~ +!!! error TS2304: Cannot find name 'string'. ~ !!! error TS1005: ';' expected. ~ !!! error TS1109: Expression expected. - ~~~~~~~~~ -!!! error TS2304: Cannot find name 'Overloads'. - ~~~~~~ -!!! error TS2304: Cannot find name 'string'. - ~~~~~~ -!!! error TS2304: Cannot find name 'string'. public DefaultValue(value?: string = "Hello") { } - ~~~~~~~~~~~~ -!!! error TS1005: ';' expected. - ~ -!!! error TS1109: Expression expected. - ~ -!!! error TS1005: ';' expected. ~~~~~~ !!! error TS2304: Cannot find name 'public'. ~~~~~~~~~~~~ +!!! error TS1005: ';' expected. + ~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'DefaultValue'. ~~~~~ !!! error TS2304: Cannot find name 'value'. + ~ +!!! error TS1109: Expression expected. ~~~~~~ !!! error TS2304: Cannot find name 'string'. + ~ +!!! error TS1005: ';' expected. } } ~ diff --git a/tests/baselines/reference/createArray.errors.txt b/tests/baselines/reference/createArray.errors.txt index 6f79c4b47d2..31f6b880030 100644 --- a/tests/baselines/reference/createArray.errors.txt +++ b/tests/baselines/reference/createArray.errors.txt @@ -1,18 +1,18 @@ +tests/cases/compiler/createArray.ts(1,12): error TS2304: Cannot find name 'number'. tests/cases/compiler/createArray.ts(1,18): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/compiler/createArray.ts(6,6): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/createArray.ts(7,19): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/createArray.ts(8,18): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/createArray.ts(1,12): error TS2304: Cannot find name 'number'. tests/cases/compiler/createArray.ts(7,12): error TS2304: Cannot find name 'boolean'. +tests/cases/compiler/createArray.ts(7,19): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/compiler/createArray.ts(8,12): error TS2304: Cannot find name 'string'. +tests/cases/compiler/createArray.ts(8,18): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ==== tests/cases/compiler/createArray.ts (7 errors) ==== var na=new number[]; - ~~ -!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~ !!! error TS2304: Cannot find name 'number'. + ~~ +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. class C { } @@ -21,15 +21,15 @@ tests/cases/compiler/createArray.ts(8,12): error TS2304: Cannot find name 'strin ~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var ba=new boolean[]; - ~~ -!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~~ !!! error TS2304: Cannot find name 'boolean'. - var sa=new string[]; - ~~ + ~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + var sa=new string[]; ~~~~~~ !!! error TS2304: Cannot find name 'string'. + ~~ +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. function f(s:string):number { return 0; } if (ba[14]) { diff --git a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.errors.txt b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.errors.txt index ca589fb13ed..f465afbccad 100644 --- a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.errors.txt +++ b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(8,8): error TS1110: Type expected. -tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(20,15): error TS1110: Type expected. tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(8,8): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(10,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(13,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(17,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(20,15): error TS1110: Type expected. tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(20,15): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(22,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(25,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt index bbe47bb9544..6aeb5a7ec23 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(7,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(18,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(19,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(12,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. Property 'x' is private in type 'Derived' but not in type 'Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(18,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(19,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(22,14): error TS2339: Property 'x' does not exist on type 'typeof Base'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(23,18): error TS2339: Property 'x' does not exist on type 'typeof Derived'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(25,15): error TS2339: Property 'fn' does not exist on type 'typeof Base'. diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt index cfdf1381282..2e5d6f57c86 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(7,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(8,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(19,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(20,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(13,7): error TS2417: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base'. Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(19,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(20,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(24,10): error TS2341: Property 'x' is private and only accessible within class 'Derived'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(27,10): error TS2341: Property 'fn' is private and only accessible within class 'Derived'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(32,10): error TS2341: Property 'a' is private and only accessible within class 'Derived'. diff --git a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt index 5f6f15791f6..c13a6b5fe2a 100644 --- a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt +++ b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,6): error TS1139: Type parameter declaration expected. -tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(4,1): error TS1109: Expression expected. tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(1,5): error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }'. Property 'x' is missing in type 'Number'. +tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,6): error TS1139: Type parameter declaration expected. +tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(4,1): error TS1109: Expression expected. ==== tests/cases/compiler/dontShowCompilerGeneratedMembers.ts (3 errors) ==== diff --git a/tests/baselines/reference/duplicateClassElements.errors.txt b/tests/baselines/reference/duplicateClassElements.errors.txt index 004e68314fd..9dfec7a2908 100644 --- a/tests/baselines/reference/duplicateClassElements.errors.txt +++ b/tests/baselines/reference/duplicateClassElements.errors.txt @@ -1,27 +1,27 @@ -tests/cases/compiler/duplicateClassElements.ts(9,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/duplicateClassElements.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/duplicateClassElements.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/duplicateClassElements.ts(18,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/duplicateClassElements.ts(23,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/duplicateClassElements.ts(26,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/duplicateClassElements.ts(29,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/duplicateClassElements.ts(32,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/duplicateClassElements.ts(36,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/duplicateClassElements.ts(39,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(2,12): error TS2300: Duplicate identifier 'a'. tests/cases/compiler/duplicateClassElements.ts(3,12): error TS2300: Duplicate identifier 'a'. tests/cases/compiler/duplicateClassElements.ts(4,12): error TS2393: Duplicate function implementation. tests/cases/compiler/duplicateClassElements.ts(6,12): error TS2393: Duplicate function implementation. tests/cases/compiler/duplicateClassElements.ts(8,12): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/duplicateClassElements.ts(9,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(9,9): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/duplicateClassElements.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(12,9): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/duplicateClassElements.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/duplicateClassElements.ts(18,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(21,12): error TS2300: Duplicate identifier 'z'. +tests/cases/compiler/duplicateClassElements.ts(23,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(23,9): error TS2300: Duplicate identifier 'z'. +tests/cases/compiler/duplicateClassElements.ts(26,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(26,9): error TS2300: Duplicate identifier 'z'. +tests/cases/compiler/duplicateClassElements.ts(29,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(29,9): error TS2300: Duplicate identifier 'x2'. +tests/cases/compiler/duplicateClassElements.ts(32,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(32,9): error TS2300: Duplicate identifier 'x2'. tests/cases/compiler/duplicateClassElements.ts(34,12): error TS2300: Duplicate identifier 'x2'. +tests/cases/compiler/duplicateClassElements.ts(36,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(36,9): error TS2300: Duplicate identifier 'z2'. +tests/cases/compiler/duplicateClassElements.ts(39,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(39,9): error TS2300: Duplicate identifier 'z2'. tests/cases/compiler/duplicateClassElements.ts(41,12): error TS2300: Duplicate identifier 'z2'. diff --git a/tests/baselines/reference/duplicateObjectLiteralProperty.errors.txt b/tests/baselines/reference/duplicateObjectLiteralProperty.errors.txt index 05dfdc82404..0dd5febe496 100644 --- a/tests/baselines/reference/duplicateObjectLiteralProperty.errors.txt +++ b/tests/baselines/reference/duplicateObjectLiteralProperty.errors.txt @@ -1,4 +1,3 @@ -tests/cases/compiler/duplicateObjectLiteralProperty.ts(16,9): error TS1118: An object literal cannot have multiple get/set accessors with the same name. tests/cases/compiler/duplicateObjectLiteralProperty.ts(2,5): error TS2300: Duplicate identifier 'a'. tests/cases/compiler/duplicateObjectLiteralProperty.ts(4,5): error TS2300: Duplicate identifier 'a'. tests/cases/compiler/duplicateObjectLiteralProperty.ts(5,5): error TS2300: Duplicate identifier '\u0061'. @@ -7,6 +6,7 @@ tests/cases/compiler/duplicateObjectLiteralProperty.ts(7,9): error TS2300: Dupli tests/cases/compiler/duplicateObjectLiteralProperty.ts(8,9): error TS2300: Duplicate identifier '"c"'. tests/cases/compiler/duplicateObjectLiteralProperty.ts(14,9): error TS2300: Duplicate identifier 'a'. tests/cases/compiler/duplicateObjectLiteralProperty.ts(15,9): error TS2300: Duplicate identifier 'a'. +tests/cases/compiler/duplicateObjectLiteralProperty.ts(16,9): error TS1118: An object literal cannot have multiple get/set accessors with the same name. tests/cases/compiler/duplicateObjectLiteralProperty.ts(16,9): error TS2300: Duplicate identifier 'a'. diff --git a/tests/baselines/reference/duplicatePropertiesInStrictMode.errors.txt b/tests/baselines/reference/duplicatePropertiesInStrictMode.errors.txt index 6ae8518677d..b3d868dbe7e 100644 --- a/tests/baselines/reference/duplicatePropertiesInStrictMode.errors.txt +++ b/tests/baselines/reference/duplicatePropertiesInStrictMode.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/duplicatePropertiesInStrictMode.ts(4,3): error TS1117: An object literal cannot have multiple properties with the same name in strict mode. tests/cases/compiler/duplicatePropertiesInStrictMode.ts(3,3): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/duplicatePropertiesInStrictMode.ts(4,3): error TS1117: An object literal cannot have multiple properties with the same name in strict mode. tests/cases/compiler/duplicatePropertiesInStrictMode.ts(4,3): error TS2300: Duplicate identifier 'x'. diff --git a/tests/baselines/reference/emptyGenericParamList.errors.txt b/tests/baselines/reference/emptyGenericParamList.errors.txt index 361e5a2fc21..ed1046d0f49 100644 --- a/tests/baselines/reference/emptyGenericParamList.errors.txt +++ b/tests/baselines/reference/emptyGenericParamList.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/emptyGenericParamList.ts(2,9): error TS1099: Type argument list cannot be empty. tests/cases/compiler/emptyGenericParamList.ts(2,8): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/compiler/emptyGenericParamList.ts(2,9): error TS1099: Type argument list cannot be empty. ==== tests/cases/compiler/emptyGenericParamList.ts (2 errors) ==== class I {} var x: I<>; - ~~ -!!! error TS1099: Type argument list cannot be empty. ~~~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). \ No newline at end of file +!!! error TS2314: Generic type 'I' requires 1 type argument(s). + ~~ +!!! error TS1099: Type argument list cannot be empty. \ No newline at end of file diff --git a/tests/baselines/reference/emptyTypeArgumentList.errors.txt b/tests/baselines/reference/emptyTypeArgumentList.errors.txt index 51efea14cb1..9f252b127a1 100644 --- a/tests/baselines/reference/emptyTypeArgumentList.errors.txt +++ b/tests/baselines/reference/emptyTypeArgumentList.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/emptyTypeArgumentList.ts(2,4): error TS1099: Type argument list cannot be empty. tests/cases/compiler/emptyTypeArgumentList.ts(2,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/emptyTypeArgumentList.ts(2,4): error TS1099: Type argument list cannot be empty. ==== tests/cases/compiler/emptyTypeArgumentList.ts (2 errors) ==== function foo() { } foo<>(); - ~~ -!!! error TS1099: Type argument list cannot be empty. ~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file +!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~ +!!! error TS1099: Type argument list cannot be empty. \ No newline at end of file diff --git a/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt b/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt index 538d0abb264..799e35d0d47 100644 --- a/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt +++ b/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/emptyTypeArgumentListWithNew.ts(2,8): error TS1099: Type argument list cannot be empty. tests/cases/compiler/emptyTypeArgumentListWithNew.ts(2,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/emptyTypeArgumentListWithNew.ts(2,8): error TS1099: Type argument list cannot be empty. ==== tests/cases/compiler/emptyTypeArgumentListWithNew.ts (2 errors) ==== class foo { } new foo<>(); - ~~ -!!! error TS1099: Type argument list cannot be empty. ~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file +!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~ +!!! error TS1099: Type argument list cannot be empty. \ No newline at end of file diff --git a/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt index e6859558f74..e2ae62fe5e0 100644 --- a/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt +++ b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,29): error TS1003: Identifier expected. tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,9): error TS2304: Cannot find name 'IgnoreRulesSpecific'. +tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,29): error TS1003: Identifier expected. ==== tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts (2 errors) ==== @@ -7,9 +7,9 @@ tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,9): error TS2304: Ca IgnoreRulesSpecific = 0, } var x = IgnoreRulesSpecific. - -!!! error TS1003: Identifier expected. ~~~~~~~~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'IgnoreRulesSpecific'. + +!!! error TS1003: Identifier expected. var y = Position.IgnoreRulesSpecific; \ No newline at end of file diff --git a/tests/baselines/reference/enumMemberResolution.errors.txt b/tests/baselines/reference/enumMemberResolution.errors.txt index f446c0d7909..5520c01873e 100644 --- a/tests/baselines/reference/enumMemberResolution.errors.txt +++ b/tests/baselines/reference/enumMemberResolution.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/enumMemberResolution.ts(4,29): error TS1003: Identifier expected. tests/cases/compiler/enumMemberResolution.ts(4,9): error TS2304: Cannot find name 'IgnoreRulesSpecific'. +tests/cases/compiler/enumMemberResolution.ts(4,29): error TS1003: Identifier expected. ==== tests/cases/compiler/enumMemberResolution.ts (2 errors) ==== @@ -7,10 +7,10 @@ tests/cases/compiler/enumMemberResolution.ts(4,9): error TS2304: Cannot find nam IgnoreRulesSpecific = 0 } var x = IgnoreRulesSpecific. // error - -!!! error TS1003: Identifier expected. ~~~~~~~~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'IgnoreRulesSpecific'. + +!!! error TS1003: Identifier expected. var y = 1; var z = Position2.IgnoreRulesSpecific; // no error \ No newline at end of file diff --git a/tests/baselines/reference/errorSuperCalls.errors.txt b/tests/baselines/reference/errorSuperCalls.errors.txt index 82c0a4e8279..cd1aa23f14d 100644 --- a/tests/baselines/reference/errorSuperCalls.errors.txt +++ b/tests/baselines/reference/errorSuperCalls.errors.txt @@ -1,4 +1,3 @@ -tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(46,14): error TS1034: 'super' must be followed by an argument list or member access. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(4,9): error TS2335: 'super' can only be referenced in a derived class. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(9,9): error TS2335: 'super' can only be referenced in a derived class. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(14,9): error TS2335: 'super' can only be referenced in a derived class. @@ -8,6 +7,7 @@ tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(26,9): error T tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(30,16): error TS2335: 'super' can only be referenced in a derived class. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(34,9): error TS2335: 'super' can only be referenced in a derived class. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(38,9): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(46,14): error TS1034: 'super' must be followed by an argument list or member access. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(58,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(62,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(67,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors diff --git a/tests/baselines/reference/errorSuperPropertyAccess.errors.txt b/tests/baselines/reference/errorSuperPropertyAccess.errors.txt index e192e99b87f..b273b1b6f45 100644 --- a/tests/baselines/reference/errorSuperPropertyAccess.errors.txt +++ b/tests/baselines/reference/errorSuperPropertyAccess.errors.txt @@ -1,11 +1,3 @@ -tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(24,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(29,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(64,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(68,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(94,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(98,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(113,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(119,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(6,17): error TS2335: 'super' can only be referenced in a derived class. tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(7,17): error TS2335: 'super' can only be referenced in a derived class. tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(11,17): error TS2335: 'super' can only be referenced in a derived class. @@ -13,24 +5,32 @@ tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(15,9): error TS2335: 'super' can only be referenced in a derived class. tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(16,9): error TS2335: 'super' can only be referenced in a derived class. tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(21,9): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(24,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(25,9): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(29,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(30,9): error TS2335: 'super' can only be referenced in a derived class. tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(57,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(61,23): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(64,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(65,23): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(68,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(69,19): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(73,13): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(76,40): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(87,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(91,23): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(94,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(95,23): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(98,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(99,19): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(109,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(110,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(111,9): error TS2341: Property 'privateStaticFunc' is private and only accessible within class 'SomeBase'. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(113,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(114,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(115,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(116,9): error TS2341: Property 'privateStaticFunc' is private and only accessible within class 'SomeBase'. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(119,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(120,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(121,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(122,9): error TS2341: Property 'privateStaticFunc' is private and only accessible within class 'SomeBase'. diff --git a/tests/baselines/reference/errorsInGenericTypeReference.errors.txt b/tests/baselines/reference/errorsInGenericTypeReference.errors.txt index dcb5018f035..729b4db5440 100644 --- a/tests/baselines/reference/errorsInGenericTypeReference.errors.txt +++ b/tests/baselines/reference/errorsInGenericTypeReference.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/errorsInGenericTypeReference.ts(25,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/errorsInGenericTypeReference.ts(12,17): error TS2304: Cannot find name 'V'. tests/cases/compiler/errorsInGenericTypeReference.ts(18,31): error TS2304: Cannot find name 'V'. tests/cases/compiler/errorsInGenericTypeReference.ts(23,29): error TS2304: Cannot find name 'V'. tests/cases/compiler/errorsInGenericTypeReference.ts(24,36): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(25,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/errorsInGenericTypeReference.ts(25,27): error TS2304: Cannot find name 'V'. tests/cases/compiler/errorsInGenericTypeReference.ts(26,24): error TS2304: Cannot find name 'V'. tests/cases/compiler/errorsInGenericTypeReference.ts(31,36): error TS2304: Cannot find name 'V'. diff --git a/tests/baselines/reference/es6ClassTest2.errors.txt b/tests/baselines/reference/es6ClassTest2.errors.txt index bf87a809b77..0b68e1cd784 100644 --- a/tests/baselines/reference/es6ClassTest2.errors.txt +++ b/tests/baselines/reference/es6ClassTest2.errors.txt @@ -1,6 +1,6 @@ +tests/cases/compiler/es6ClassTest2.ts(17,1): error TS2304: Cannot find name 'console'. tests/cases/compiler/es6ClassTest2.ts(30,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/es6ClassTest2.ts(35,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/es6ClassTest2.ts(17,1): error TS2304: Cannot find name 'console'. ==== tests/cases/compiler/es6ClassTest2.ts (3 errors) ==== diff --git a/tests/baselines/reference/es6ClassTest9.errors.txt b/tests/baselines/reference/es6ClassTest9.errors.txt index ae7d1ba92d5..21d9fccc2e5 100644 --- a/tests/baselines/reference/es6ClassTest9.errors.txt +++ b/tests/baselines/reference/es6ClassTest9.errors.txt @@ -1,17 +1,17 @@ +tests/cases/compiler/es6ClassTest9.ts(1,15): error TS2300: Duplicate identifier 'foo'. tests/cases/compiler/es6ClassTest9.ts(1,18): error TS1005: '{' expected. tests/cases/compiler/es6ClassTest9.ts(1,19): error TS1109: Expression expected. -tests/cases/compiler/es6ClassTest9.ts(1,15): error TS2300: Duplicate identifier 'foo'. tests/cases/compiler/es6ClassTest9.ts(2,10): error TS2300: Duplicate identifier 'foo'. ==== tests/cases/compiler/es6ClassTest9.ts (4 errors) ==== declare class foo(); + ~~~ +!!! error TS2300: Duplicate identifier 'foo'. ~ !!! error TS1005: '{' expected. ~ !!! error TS1109: Expression expected. - ~~~ -!!! error TS2300: Duplicate identifier 'foo'. function foo() {} ~~~ !!! error TS2300: Duplicate identifier 'foo'. diff --git a/tests/baselines/reference/exportAlreadySeen.errors.txt b/tests/baselines/reference/exportAlreadySeen.errors.txt index 707b34c8d25..eb9f0ce1a95 100644 --- a/tests/baselines/reference/exportAlreadySeen.errors.txt +++ b/tests/baselines/reference/exportAlreadySeen.errors.txt @@ -1,12 +1,16 @@ tests/cases/compiler/exportAlreadySeen.ts(2,12): error TS1030: 'export' modifier already seen. tests/cases/compiler/exportAlreadySeen.ts(3,12): error TS1030: 'export' modifier already seen. tests/cases/compiler/exportAlreadySeen.ts(5,12): error TS1030: 'export' modifier already seen. +tests/cases/compiler/exportAlreadySeen.ts(6,16): error TS1030: 'export' modifier already seen. +tests/cases/compiler/exportAlreadySeen.ts(7,16): error TS1030: 'export' modifier already seen. tests/cases/compiler/exportAlreadySeen.ts(12,12): error TS1030: 'export' modifier already seen. tests/cases/compiler/exportAlreadySeen.ts(13,12): error TS1030: 'export' modifier already seen. tests/cases/compiler/exportAlreadySeen.ts(15,12): error TS1030: 'export' modifier already seen. +tests/cases/compiler/exportAlreadySeen.ts(16,16): error TS1030: 'export' modifier already seen. +tests/cases/compiler/exportAlreadySeen.ts(17,16): error TS1030: 'export' modifier already seen. -==== tests/cases/compiler/exportAlreadySeen.ts (6 errors) ==== +==== tests/cases/compiler/exportAlreadySeen.ts (10 errors) ==== module M { export export var x = 1; ~~~~~~ @@ -19,7 +23,11 @@ tests/cases/compiler/exportAlreadySeen.ts(15,12): error TS1030: 'export' modifie ~~~~~~ !!! error TS1030: 'export' modifier already seen. export export class C { } + ~~~~~~ +!!! error TS1030: 'export' modifier already seen. export export interface I { } + ~~~~~~ +!!! error TS1030: 'export' modifier already seen. } } @@ -35,6 +43,10 @@ tests/cases/compiler/exportAlreadySeen.ts(15,12): error TS1030: 'export' modifie ~~~~~~ !!! error TS1030: 'export' modifier already seen. export export class C { } + ~~~~~~ +!!! error TS1030: 'export' modifier already seen. export export interface I { } + ~~~~~~ +!!! error TS1030: 'export' modifier already seen. } } \ No newline at end of file diff --git a/tests/baselines/reference/extension.errors.txt b/tests/baselines/reference/extension.errors.txt index e55f15f4381..d643cd9e30b 100644 --- a/tests/baselines/reference/extension.errors.txt +++ b/tests/baselines/reference/extension.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/extension.ts(16,5): error TS1128: Declaration or statement expected. -tests/cases/compiler/extension.ts(16,22): error TS1005: ';' expected. tests/cases/compiler/extension.ts(10,18): error TS2300: Duplicate identifier 'C'. +tests/cases/compiler/extension.ts(16,5): error TS1128: Declaration or statement expected. tests/cases/compiler/extension.ts(16,12): error TS2304: Cannot find name 'extension'. +tests/cases/compiler/extension.ts(16,22): error TS1005: ';' expected. tests/cases/compiler/extension.ts(16,28): error TS2300: Duplicate identifier 'C'. tests/cases/compiler/extension.ts(22,3): error TS2339: Property 'pe' does not exist on type 'C'. @@ -27,10 +27,10 @@ tests/cases/compiler/extension.ts(22,3): error TS2339: Property 'pe' does not ex export extension class C { ~~~~~~ !!! error TS1128: Declaration or statement expected. - ~~~~~ -!!! error TS1005: ';' expected. ~~~~~~~~~ !!! error TS2304: Cannot find name 'extension'. + ~~~~~ +!!! error TS1005: ';' expected. ~ !!! error TS2300: Duplicate identifier 'C'. public pe:string; diff --git a/tests/baselines/reference/externModule.errors.txt b/tests/baselines/reference/externModule.errors.txt index 49b1598f06e..eff17eb8586 100644 --- a/tests/baselines/reference/externModule.errors.txt +++ b/tests/baselines/reference/externModule.errors.txt @@ -1,28 +1,28 @@ +tests/cases/compiler/externModule.ts(1,1): error TS2304: Cannot find name 'declare'. tests/cases/compiler/externModule.ts(1,9): error TS1005: ';' expected. +tests/cases/compiler/externModule.ts(1,9): error TS2304: Cannot find name 'module'. tests/cases/compiler/externModule.ts(1,16): error TS1005: ';' expected. tests/cases/compiler/externModule.ts(2,5): error TS1129: Statement expected. tests/cases/compiler/externModule.ts(2,18): error TS1148: Cannot compile external modules unless the '--module' flag is provided. -tests/cases/compiler/externModule.ts(30,1): error TS1128: Declaration or statement expected. -tests/cases/compiler/externModule.ts(1,1): error TS2304: Cannot find name 'declare'. -tests/cases/compiler/externModule.ts(1,9): error TS2304: Cannot find name 'module'. tests/cases/compiler/externModule.ts(3,10): error TS2391: Function implementation is missing or not immediately following the declaration. tests/cases/compiler/externModule.ts(4,10): error TS2391: Function implementation is missing or not immediately following the declaration. tests/cases/compiler/externModule.ts(18,6): error TS2390: Constructor implementation is missing. tests/cases/compiler/externModule.ts(20,13): error TS2391: Function implementation is missing or not immediately following the declaration. tests/cases/compiler/externModule.ts(26,13): error TS2391: Function implementation is missing or not immediately following the declaration. tests/cases/compiler/externModule.ts(28,13): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/externModule.ts(30,1): error TS1128: Declaration or statement expected. ==== tests/cases/compiler/externModule.ts (13 errors) ==== declare module { - ~~~~~~ -!!! error TS1005: ';' expected. - ~ -!!! error TS1005: ';' expected. ~~~~~~~ !!! error TS2304: Cannot find name 'declare'. ~~~~~~ +!!! error TS1005: ';' expected. + ~~~~~~ !!! error TS2304: Cannot find name 'module'. + ~ +!!! error TS1005: ';' expected. export class XDate { ~~~~~~ !!! error TS1129: Statement expected. diff --git a/tests/baselines/reference/externSyntax.errors.txt b/tests/baselines/reference/externSyntax.errors.txt index 099c9fa3a99..1d3380b99d5 100644 --- a/tests/baselines/reference/externSyntax.errors.txt +++ b/tests/baselines/reference/externSyntax.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/externSyntax.ts(8,20): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/externSyntax.ts(8,20): error TS1184: An implementation cannot be declared in ambient contexts. ==== tests/cases/compiler/externSyntax.ts (1 errors) ==== @@ -11,7 +11,7 @@ tests/cases/compiler/externSyntax.ts(8,20): error TS1037: A function implementat public f(); public g() { } // error body ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. } } diff --git a/tests/baselines/reference/fatarrowfunctionsErrors.errors.txt b/tests/baselines/reference/fatarrowfunctionsErrors.errors.txt index c3ad9b9c159..35df1a5f397 100644 --- a/tests/baselines/reference/fatarrowfunctionsErrors.errors.txt +++ b/tests/baselines/reference/fatarrowfunctionsErrors.errors.txt @@ -1,21 +1,21 @@ +tests/cases/compiler/fatarrowfunctionsErrors.ts(1,1): error TS2304: Cannot find name 'foo'. +tests/cases/compiler/fatarrowfunctionsErrors.ts(2,1): error TS2304: Cannot find name 'foo'. tests/cases/compiler/fatarrowfunctionsErrors.ts(2,8): error TS1005: ',' expected. tests/cases/compiler/fatarrowfunctionsErrors.ts(2,18): error TS1005: ':' expected. tests/cases/compiler/fatarrowfunctionsErrors.ts(2,19): error TS1005: ',' expected. tests/cases/compiler/fatarrowfunctionsErrors.ts(2,20): error TS1128: Declaration or statement expected. tests/cases/compiler/fatarrowfunctionsErrors.ts(2,21): error TS1128: Declaration or statement expected. +tests/cases/compiler/fatarrowfunctionsErrors.ts(3,1): error TS2304: Cannot find name 'foo'. +tests/cases/compiler/fatarrowfunctionsErrors.ts(4,1): error TS2304: Cannot find name 'foo'. +tests/cases/compiler/fatarrowfunctionsErrors.ts(5,9): error TS2304: Cannot find name 'x'. tests/cases/compiler/fatarrowfunctionsErrors.ts(5,10): error TS1005: ',' expected. tests/cases/compiler/fatarrowfunctionsErrors.ts(5,18): error TS1005: ';' expected. +tests/cases/compiler/fatarrowfunctionsErrors.ts(5,21): error TS2304: Cannot find name 'x'. +tests/cases/compiler/fatarrowfunctionsErrors.ts(5,23): error TS2304: Cannot find name 'x'. tests/cases/compiler/fatarrowfunctionsErrors.ts(9,19): error TS1005: '=>' expected. tests/cases/compiler/fatarrowfunctionsErrors.ts(10,27): error TS1005: '=>' expected. tests/cases/compiler/fatarrowfunctionsErrors.ts(11,21): error TS1005: '=>' expected. tests/cases/compiler/fatarrowfunctionsErrors.ts(12,23): error TS1005: '=>' expected. -tests/cases/compiler/fatarrowfunctionsErrors.ts(1,1): error TS2304: Cannot find name 'foo'. -tests/cases/compiler/fatarrowfunctionsErrors.ts(2,1): error TS2304: Cannot find name 'foo'. -tests/cases/compiler/fatarrowfunctionsErrors.ts(3,1): error TS2304: Cannot find name 'foo'. -tests/cases/compiler/fatarrowfunctionsErrors.ts(4,1): error TS2304: Cannot find name 'foo'. -tests/cases/compiler/fatarrowfunctionsErrors.ts(5,9): error TS2304: Cannot find name 'x'. -tests/cases/compiler/fatarrowfunctionsErrors.ts(5,21): error TS2304: Cannot find name 'x'. -tests/cases/compiler/fatarrowfunctionsErrors.ts(5,23): error TS2304: Cannot find name 'x'. ==== tests/cases/compiler/fatarrowfunctionsErrors.ts (18 errors) ==== @@ -23,6 +23,8 @@ tests/cases/compiler/fatarrowfunctionsErrors.ts(5,23): error TS2304: Cannot find ~~~ !!! error TS2304: Cannot find name 'foo'. foo((1)=>{return 0;}); + ~~~ +!!! error TS2304: Cannot find name 'foo'. ~~ !!! error TS1005: ',' expected. ~ @@ -33,8 +35,6 @@ tests/cases/compiler/fatarrowfunctionsErrors.ts(5,23): error TS2304: Cannot find !!! error TS1128: Declaration or statement expected. ~ !!! error TS1128: Declaration or statement expected. - ~~~ -!!! error TS2304: Cannot find name 'foo'. foo((x?)=>{return x;}) ~~~ !!! error TS2304: Cannot find name 'foo'. @@ -42,12 +42,12 @@ tests/cases/compiler/fatarrowfunctionsErrors.ts(5,23): error TS2304: Cannot find ~~~ !!! error TS2304: Cannot find name 'foo'. var y = x:number => x*x; + ~ +!!! error TS2304: Cannot find name 'x'. ~ !!! error TS1005: ',' expected. ~~ !!! error TS1005: ';' expected. - ~ -!!! error TS2304: Cannot find name 'x'. ~ !!! error TS2304: Cannot find name 'x'. ~ diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt index ce237236ca7..6ac472e0e02 100644 --- a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt @@ -1,32 +1,32 @@ -tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,23): error TS1005: ';' expected. -tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,23): error TS1005: ';' expected. -tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,17): error TS1005: ';' expected. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,12): error TS2304: Cannot find name 'a'. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,16): error TS2304: Cannot find name 'b'. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,19): error TS2304: Cannot find name 'c'. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,23): error TS1005: ';' expected. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,26): error TS2304: Cannot find name 'a'. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,28): error TS2304: Cannot find name 'b'. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,30): error TS2304: Cannot find name 'c'. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,13): error TS2304: Cannot find name 'a'. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,17): error TS2304: Cannot find name 'b'. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,20): error TS2304: Cannot find name 'c'. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,23): error TS1005: ';' expected. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,26): error TS2304: Cannot find name 'a'. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,28): error TS2304: Cannot find name 'b'. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,30): error TS2304: Cannot find name 'c'. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,13): error TS2304: Cannot find name 'a'. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,17): error TS1005: ';' expected. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,20): error TS2304: Cannot find name 'a'. ==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts (17 errors) ==== var tt1 = (a, (b, c)) => a+b+c; - ~~ -!!! error TS1005: ';' expected. ~ !!! error TS2304: Cannot find name 'a'. ~ !!! error TS2304: Cannot find name 'b'. ~ !!! error TS2304: Cannot find name 'c'. + ~~ +!!! error TS1005: ';' expected. ~ !!! error TS2304: Cannot find name 'a'. ~ @@ -34,14 +34,14 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,20): error TS2304 ~ !!! error TS2304: Cannot find name 'c'. var tt2 = ((a), b, c) => a+b+c; - ~~ -!!! error TS1005: ';' expected. ~ !!! error TS2304: Cannot find name 'a'. ~ !!! error TS2304: Cannot find name 'b'. ~ !!! error TS2304: Cannot find name 'c'. + ~~ +!!! error TS1005: ';' expected. ~ !!! error TS2304: Cannot find name 'a'. ~ @@ -50,9 +50,9 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,20): error TS2304 !!! error TS2304: Cannot find name 'c'. var tt3 = ((a)) => a; - ~~ -!!! error TS1005: ';' expected. ~ !!! error TS2304: Cannot find name 'a'. + ~~ +!!! error TS1005: ';' expected. ~ !!! error TS2304: Cannot find name 'a'. \ No newline at end of file diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors4.errors.txt b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors4.errors.txt index 8de0eb92a02..fe9df3c2fb3 100644 --- a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors4.errors.txt +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors4.errors.txt @@ -3,9 +3,9 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(2,15): error TS1015 tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(3,21): error TS1015: Parameter cannot have question mark and initializer. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(4,7): error TS1015: Parameter cannot have question mark and initializer. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(4,39): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(6,5): error TS2304: Cannot find name 'foo'. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(17,10): error TS1015: Parameter cannot have question mark and initializer. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(19,13): error TS1015: Parameter cannot have question mark and initializer. -tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(6,5): error TS2304: Cannot find name 'foo'. ==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts (8 errors) ==== diff --git a/tests/baselines/reference/fieldAndGetterWithSameName.errors.txt b/tests/baselines/reference/fieldAndGetterWithSameName.errors.txt index dd2374f2447..e78ccce2b83 100644 --- a/tests/baselines/reference/fieldAndGetterWithSameName.errors.txt +++ b/tests/baselines/reference/fieldAndGetterWithSameName.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/fieldAndGetterWithSameName.ts(3,7): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/fieldAndGetterWithSameName.ts(2,5): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/fieldAndGetterWithSameName.ts(3,7): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/fieldAndGetterWithSameName.ts(3,7): error TS2300: Duplicate identifier 'x'. diff --git a/tests/baselines/reference/functionAndPropertyNameConflict.errors.txt b/tests/baselines/reference/functionAndPropertyNameConflict.errors.txt index 640844064c4..a976048d0e3 100644 --- a/tests/baselines/reference/functionAndPropertyNameConflict.errors.txt +++ b/tests/baselines/reference/functionAndPropertyNameConflict.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/functionAndPropertyNameConflict.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/functionAndPropertyNameConflict.ts(2,12): error TS2300: Duplicate identifier 'aaaaa'. +tests/cases/compiler/functionAndPropertyNameConflict.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/functionAndPropertyNameConflict.ts(3,16): error TS2300: Duplicate identifier 'aaaaa'. diff --git a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt index 11ceb2aa3dd..2c5ff15f863 100644 --- a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt +++ b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(117,5): error TS1003: Identifier expected. tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(2,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(64,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(94,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(112,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(117,5): error TS1003: Identifier expected. ==== tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts (5 errors) ==== diff --git a/tests/baselines/reference/functionsWithModifiersInBlocks1.errors.txt b/tests/baselines/reference/functionsWithModifiersInBlocks1.errors.txt index 557c67e496a..94e246f8972 100644 --- a/tests/baselines/reference/functionsWithModifiersInBlocks1.errors.txt +++ b/tests/baselines/reference/functionsWithModifiersInBlocks1.errors.txt @@ -1,26 +1,35 @@ tests/cases/compiler/functionsWithModifiersInBlocks1.ts(2,4): error TS1184: Modifiers cannot appear here. -tests/cases/compiler/functionsWithModifiersInBlocks1.ts(3,4): error TS1184: Modifiers cannot appear here. -tests/cases/compiler/functionsWithModifiersInBlocks1.ts(4,12): error TS1029: 'export' modifier must precede 'declare' modifier. tests/cases/compiler/functionsWithModifiersInBlocks1.ts(2,21): error TS2393: Duplicate function implementation. +tests/cases/compiler/functionsWithModifiersInBlocks1.ts(2,25): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/functionsWithModifiersInBlocks1.ts(3,4): error TS1184: Modifiers cannot appear here. tests/cases/compiler/functionsWithModifiersInBlocks1.ts(3,20): error TS2393: Duplicate function implementation. +tests/cases/compiler/functionsWithModifiersInBlocks1.ts(4,4): error TS1184: Modifiers cannot appear here. +tests/cases/compiler/functionsWithModifiersInBlocks1.ts(4,12): error TS1029: 'export' modifier must precede 'declare' modifier. tests/cases/compiler/functionsWithModifiersInBlocks1.ts(4,28): error TS2393: Duplicate function implementation. +tests/cases/compiler/functionsWithModifiersInBlocks1.ts(4,32): error TS1184: An implementation cannot be declared in ambient contexts. -==== tests/cases/compiler/functionsWithModifiersInBlocks1.ts (6 errors) ==== +==== tests/cases/compiler/functionsWithModifiersInBlocks1.ts (9 errors) ==== { declare function f() { } ~~~~~~~ !!! error TS1184: Modifiers cannot appear here. ~ !!! error TS2393: Duplicate function implementation. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. export function f() { } ~~~~~~ !!! error TS1184: Modifiers cannot appear here. ~ !!! error TS2393: Duplicate function implementation. declare export function f() { } + ~~~~~~~ +!!! error TS1184: Modifiers cannot appear here. ~~~~~~ !!! error TS1029: 'export' modifier must precede 'declare' modifier. ~ !!! error TS2393: Duplicate function implementation. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. } \ No newline at end of file diff --git a/tests/baselines/reference/genericReturnTypeFromGetter1.errors.txt b/tests/baselines/reference/genericReturnTypeFromGetter1.errors.txt index 8215d687443..6f5f68064a6 100644 --- a/tests/baselines/reference/genericReturnTypeFromGetter1.errors.txt +++ b/tests/baselines/reference/genericReturnTypeFromGetter1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/genericReturnTypeFromGetter1.ts(6,7): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/genericReturnTypeFromGetter1.ts(5,18): error TS2314: Generic type 'A' requires 1 type argument(s). +tests/cases/compiler/genericReturnTypeFromGetter1.ts(6,7): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ==== tests/cases/compiler/genericReturnTypeFromGetter1.ts (2 errors) ==== diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt index f646ac4725e..6c98d419dec 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(12,19): error TS1023: An index signature parameter type must be 'string' or 'number'. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(8,16): error TS2314: Generic type 'C' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(10,21): error TS2314: Generic type 'C' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(11,22): error TS2314: Generic type 'C' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(11,26): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(12,19): error TS1023: An index signature parameter type must be 'string' or 'number'. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(12,22): error TS2314: Generic type 'C' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(12,26): error TS2314: Generic type 'C' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(14,23): error TS2314: Generic type 'C' requires 1 type argument(s). diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt index a8627f3f18e..d57f3c2fc0d 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(12,11): error TS1023: An index signature parameter type must be 'string' or 'number'. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(8,8): error TS2314: Generic type 'C' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(10,13): error TS2314: Generic type 'C' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(11,14): error TS2314: Generic type 'C' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(11,18): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(12,11): error TS1023: An index signature parameter type must be 'string' or 'number'. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(12,14): error TS2314: Generic type 'C' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(12,18): error TS2314: Generic type 'C' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(14,13): error TS2314: Generic type 'C' requires 1 type argument(s). diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt index 1802d0385c4..745da9aa106 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(12,11): error TS1023: An index signature parameter type must be 'string' or 'number'. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(8,8): error TS2314: Generic type 'I' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(10,13): error TS2314: Generic type 'I' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(11,14): error TS2314: Generic type 'I' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(11,18): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(12,11): error TS1023: An index signature parameter type must be 'string' or 'number'. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(12,14): error TS2314: Generic type 'I' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(12,18): error TS2314: Generic type 'I' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(14,13): error TS2314: Generic type 'I' requires 1 type argument(s). diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt index 41774da0d00..1fec52356a2 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(12,19): error TS1023: An index signature parameter type must be 'string' or 'number'. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(8,16): error TS2314: Generic type 'C' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(10,21): error TS2314: Generic type 'C' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(11,22): error TS2314: Generic type 'C' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(11,26): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(12,19): error TS1023: An index signature parameter type must be 'string' or 'number'. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(12,22): error TS2314: Generic type 'C' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(12,26): error TS2314: Generic type 'C' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(14,23): error TS2314: Generic type 'C' requires 1 type argument(s). diff --git a/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.errors.txt b/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.errors.txt index a7e8155c220..a11b0f0ad9e 100644 --- a/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.errors.txt +++ b/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(21,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(1,18): error TS2300: Duplicate identifier '_'. tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(1,41): error TS2304: Cannot find name '_'. tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(2,18): error TS2300: Duplicate identifier '_'. tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(2,34): error TS2304: Cannot find name '_'. tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(4,16): error TS2300: Duplicate identifier '_'. tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(15,15): error TS2300: Duplicate identifier '_'. +tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(21,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ==== tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts (7 errors) ==== diff --git a/tests/baselines/reference/getAndSetNotIdenticalType.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType.errors.txt index 5fe2e7ae321..6c55f966eee 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType.errors.txt +++ b/tests/baselines/reference/getAndSetNotIdenticalType.errors.txt @@ -1,23 +1,23 @@ -tests/cases/compiler/getAndSetNotIdenticalType.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/getAndSetNotIdenticalType.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/getAndSetNotIdenticalType.ts(2,5): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/compiler/getAndSetNotIdenticalType.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/getAndSetNotIdenticalType.ts(5,5): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/compiler/getAndSetNotIdenticalType.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ==== tests/cases/compiler/getAndSetNotIdenticalType.ts (4 errors) ==== class C { get x(): number { + ~~~~~~~~~~~~~~~~~ ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~~~~~~~~~~~~~~~~~ return 1; ~~~~~~~~~~~~~~~~~ } ~~~~~ !!! error TS2380: 'get' and 'set' accessor must have the same type. set x(v: string) { } - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~~~~~~~~~~~~~ !!! error TS2380: 'get' and 'set' accessor must have the same type. + ~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt index 69d367bb21c..5cdb9b3a36f 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt +++ b/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/getAndSetNotIdenticalType2.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/getAndSetNotIdenticalType2.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/getAndSetNotIdenticalType2.ts(5,5): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/compiler/getAndSetNotIdenticalType2.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/getAndSetNotIdenticalType2.ts(8,5): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/compiler/getAndSetNotIdenticalType2.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/getAndSetNotIdenticalType2.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A'. Type 'string' is not assignable to type 'T'. @@ -12,18 +12,18 @@ tests/cases/compiler/getAndSetNotIdenticalType2.ts(9,9): error TS2322: Type 'A { data: A; get x(): A { + ~~~~~~~~~~~~~~~ ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~~~~~~~~~~~~~~~ return this.data; ~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~ !!! error TS2380: 'get' and 'set' accessor must have the same type. set x(v: A) { + ~~~~~~~~~~~~~~~~~~~~~ ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~~~~~~~~~~~~~~~~~~~~~ this.data = v; ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~ diff --git a/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt index bca86419f62..0aac384f7c3 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt +++ b/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/getAndSetNotIdenticalType3.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/getAndSetNotIdenticalType3.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/getAndSetNotIdenticalType3.ts(5,5): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/compiler/getAndSetNotIdenticalType3.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/getAndSetNotIdenticalType3.ts(8,5): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/compiler/getAndSetNotIdenticalType3.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/getAndSetNotIdenticalType3.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A'. Type 'string' is not assignable to type 'number'. @@ -12,18 +12,18 @@ tests/cases/compiler/getAndSetNotIdenticalType3.ts(9,9): error TS2322: Type 'A { data: A; get x(): A { + ~~~~~~~~~~~~~~~~~~~~ ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~~~~~~~~~~~~~~~~~~~~ return this.data; ~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~ !!! error TS2380: 'get' and 'set' accessor must have the same type. set x(v: A) { + ~~~~~~~~~~~~~~~~~~~~~ ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~~~~~~~~~~~~~~~~~~~~~ this.data = v; ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~ diff --git a/tests/baselines/reference/gettersAndSetters.errors.txt b/tests/baselines/reference/gettersAndSetters.errors.txt index 2c287f30497..a4cc4b585e2 100644 --- a/tests/baselines/reference/gettersAndSetters.errors.txt +++ b/tests/baselines/reference/gettersAndSetters.errors.txt @@ -2,10 +2,10 @@ tests/cases/compiler/gettersAndSetters.ts(7,16): error TS1056: Accessors are onl tests/cases/compiler/gettersAndSetters.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/gettersAndSetters.ts(10,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/gettersAndSetters.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/gettersAndSetters.ts(29,30): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/gettersAndSetters.ts(29,53): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/gettersAndSetters.ts(25,13): error TS2339: Property 'Baz' does not exist on type 'C'. tests/cases/compiler/gettersAndSetters.ts(26,3): error TS2339: Property 'Baz' does not exist on type 'C'. +tests/cases/compiler/gettersAndSetters.ts(29,30): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSetters.ts(29,53): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ==== tests/cases/compiler/gettersAndSetters.ts (8 errors) ==== diff --git a/tests/baselines/reference/gettersAndSettersAccessibility.errors.txt b/tests/baselines/reference/gettersAndSettersAccessibility.errors.txt index ddb8e95e5eb..faccaab8fdf 100644 --- a/tests/baselines/reference/gettersAndSettersAccessibility.errors.txt +++ b/tests/baselines/reference/gettersAndSettersAccessibility.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/gettersAndSettersAccessibility.ts(2,14): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/gettersAndSettersAccessibility.ts(3,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/gettersAndSettersAccessibility.ts(2,14): error TS2379: Getter and setter accessors do not agree in visibility. +tests/cases/compiler/gettersAndSettersAccessibility.ts(3,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/gettersAndSettersAccessibility.ts(3,13): error TS2379: Getter and setter accessors do not agree in visibility. diff --git a/tests/baselines/reference/gettersAndSettersErrors.errors.txt b/tests/baselines/reference/gettersAndSettersErrors.errors.txt index 95fb571d9b8..db2d4c5bc87 100644 --- a/tests/baselines/reference/gettersAndSettersErrors.errors.txt +++ b/tests/baselines/reference/gettersAndSettersErrors.errors.txt @@ -1,13 +1,13 @@ tests/cases/compiler/gettersAndSettersErrors.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSettersErrors.ts(2,16): error TS2300: Duplicate identifier 'Foo'. tests/cases/compiler/gettersAndSettersErrors.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSettersErrors.ts(3,16): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/gettersAndSettersErrors.ts(5,12): error TS2300: Duplicate identifier 'Foo'. tests/cases/compiler/gettersAndSettersErrors.ts(6,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/gettersAndSettersErrors.ts(7,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/gettersAndSettersErrors.ts(11,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/gettersAndSettersErrors.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/gettersAndSettersErrors.ts(2,16): error TS2300: Duplicate identifier 'Foo'. -tests/cases/compiler/gettersAndSettersErrors.ts(3,16): error TS2300: Duplicate identifier 'Foo'. -tests/cases/compiler/gettersAndSettersErrors.ts(5,12): error TS2300: Duplicate identifier 'Foo'. tests/cases/compiler/gettersAndSettersErrors.ts(11,17): error TS2379: Getter and setter accessors do not agree in visibility. +tests/cases/compiler/gettersAndSettersErrors.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/gettersAndSettersErrors.ts(12,16): error TS2379: Getter and setter accessors do not agree in visibility. diff --git a/tests/baselines/reference/giant.errors.txt b/tests/baselines/reference/giant.errors.txt index f971c067768..fbe05bbfc79 100644 --- a/tests/baselines/reference/giant.errors.txt +++ b/tests/baselines/reference/giant.errors.txt @@ -1,268 +1,263 @@ +tests/cases/compiler/giant.ts(23,12): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(24,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(24,16): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(25,12): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(26,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(26,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(27,13): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(28,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(28,17): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(29,13): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(30,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(30,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(33,12): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(34,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(34,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(35,12): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(36,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(36,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(61,5): error TS1169: Computed property names are not allowed in interfaces. tests/cases/compiler/giant.ts(62,5): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(63,6): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(76,5): error TS2386: Overload signatures must all be optional or required. +tests/cases/compiler/giant.ts(87,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(88,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(88,20): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(89,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(90,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(90,20): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(91,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(92,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(92,21): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(93,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(94,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(94,21): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(97,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(98,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(98,20): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(99,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(100,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(100,20): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(125,9): error TS1169: Computed property names are not allowed in interfaces. tests/cases/compiler/giant.ts(126,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(127,10): error TS1096: An index signature must have exactly one parameter. -tests/cases/compiler/giant.ts(154,39): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(140,9): error TS2386: Overload signatures must all be optional or required. +tests/cases/compiler/giant.ts(154,39): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(166,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(167,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(167,20): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(168,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(169,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(169,20): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(170,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(171,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(171,21): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(172,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(173,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(173,21): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(176,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(177,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(177,20): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(178,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(179,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(179,20): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(204,9): error TS1169: Computed property names are not allowed in interfaces. tests/cases/compiler/giant.ts(205,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(206,10): error TS1096: An index signature must have exactly one parameter. -tests/cases/compiler/giant.ts(233,39): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(238,35): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(240,24): error TS1111: A constructor implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(243,21): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(244,22): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(245,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(219,9): error TS2386: Overload signatures must all be optional or required. +tests/cases/compiler/giant.ts(233,39): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(238,35): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(240,24): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(243,21): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(244,22): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(245,16): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(245,22): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(246,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(247,31): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(246,20): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(247,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(247,31): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(248,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(249,23): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(248,20): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(249,17): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(249,23): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(250,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(251,32): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(250,21): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(251,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(251,32): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(252,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(254,21): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(255,31): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(252,21): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(254,21): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(255,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(255,31): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(256,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(257,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(256,20): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(257,16): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(257,22): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(258,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(262,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(258,20): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(262,22): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(262,25): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/giant.ts(267,30): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(267,33): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(267,30): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(281,12): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(282,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(282,16): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(283,12): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(284,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(284,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(285,13): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(286,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(286,17): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(287,13): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(288,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(288,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(291,12): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(292,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(292,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(293,12): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(294,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(294,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(319,5): error TS1169: Computed property names are not allowed in interfaces. tests/cases/compiler/giant.ts(320,5): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(321,6): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(334,5): error TS2386: Overload signatures must all be optional or required. +tests/cases/compiler/giant.ts(345,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(346,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(346,20): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(347,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(348,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(348,20): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(349,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(350,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(350,21): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(351,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(352,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(352,21): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(355,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(356,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(356,20): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(357,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(358,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(358,20): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(383,9): error TS1169: Computed property names are not allowed in interfaces. tests/cases/compiler/giant.ts(384,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(385,10): error TS1096: An index signature must have exactly one parameter. -tests/cases/compiler/giant.ts(412,39): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(398,9): error TS2386: Overload signatures must all be optional or required. +tests/cases/compiler/giant.ts(412,39): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(424,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(425,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(425,20): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(426,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(427,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(427,20): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(428,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(429,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(429,21): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(430,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(431,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(431,21): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(434,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(435,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(435,20): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(436,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(437,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(437,20): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(462,9): error TS1169: Computed property names are not allowed in interfaces. tests/cases/compiler/giant.ts(463,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(464,10): error TS1096: An index signature must have exactly one parameter. -tests/cases/compiler/giant.ts(491,39): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(496,35): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(498,24): error TS1111: A constructor implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(501,21): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(502,22): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(503,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(477,9): error TS2386: Overload signatures must all be optional or required. +tests/cases/compiler/giant.ts(491,39): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(496,35): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(498,24): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(501,21): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(502,22): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(503,16): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(503,22): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(504,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(505,31): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(504,20): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(505,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(505,31): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(506,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(507,23): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(506,20): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(507,17): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(507,23): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(508,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(509,32): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(508,21): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(509,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(509,32): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(510,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(512,21): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(513,31): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(510,21): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(512,21): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(513,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(513,31): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(514,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(515,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(514,20): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(515,16): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(515,22): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(516,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(520,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(516,20): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(520,22): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(520,25): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/giant.ts(525,30): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(525,33): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/giant.ts(532,31): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(534,20): error TS1111: A constructor implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(537,17): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(538,18): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(539,18): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(525,30): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(532,31): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(534,20): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(537,17): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(538,18): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(539,12): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(539,18): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(540,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(541,27): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(540,16): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(541,12): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(541,27): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(542,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(543,19): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(542,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(543,13): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(543,19): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(544,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(545,28): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(544,17): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(545,13): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(545,28): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(546,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(548,17): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(549,27): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(546,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(548,17): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(549,12): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(549,27): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(550,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(551,18): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(550,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(551,12): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(551,18): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(552,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(556,18): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(552,16): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(556,18): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(556,21): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/giant.ts(558,24): error TS1111: A constructor implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(561,21): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(563,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(558,24): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(561,21): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(563,21): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(587,9): error TS1169: Computed property names are not allowed in interfaces. tests/cases/compiler/giant.ts(588,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(589,10): error TS1096: An index signature must have exactly one parameter. -tests/cases/compiler/giant.ts(606,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(602,9): error TS2386: Overload signatures must all be optional or required. +tests/cases/compiler/giant.ts(606,22): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(606,25): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/giant.ts(611,30): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(611,33): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(611,30): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(615,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. tests/cases/compiler/giant.ts(616,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. -tests/cases/compiler/giant.ts(616,42): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(616,39): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(617,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. tests/cases/compiler/giant.ts(618,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. -tests/cases/compiler/giant.ts(621,26): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(621,29): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/giant.ts(623,24): error TS1111: A constructor implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(626,21): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(628,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(621,26): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(623,24): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(626,21): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(628,21): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(653,9): error TS1169: Computed property names are not allowed in interfaces. tests/cases/compiler/giant.ts(654,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(655,10): error TS1096: An index signature must have exactly one parameter. -tests/cases/compiler/giant.ts(672,22): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(672,25): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/giant.ts(676,30): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(676,33): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/giant.ts(23,12): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(24,16): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(25,12): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(26,16): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(27,13): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(28,17): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(29,13): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(30,17): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(33,12): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(34,16): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(35,12): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(36,16): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(76,5): error TS2386: Overload signatures must all be optional or required. -tests/cases/compiler/giant.ts(87,16): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(88,20): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(89,16): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(90,20): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(91,17): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(92,21): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(93,17): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(94,21): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(97,16): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(98,20): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(99,16): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(100,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(140,9): error TS2386: Overload signatures must all be optional or required. -tests/cases/compiler/giant.ts(166,16): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(167,20): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(168,16): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(169,20): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(170,17): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(171,21): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(172,17): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(173,21): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(176,16): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(177,20): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(178,16): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(179,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(219,9): error TS2386: Overload signatures must all be optional or required. -tests/cases/compiler/giant.ts(245,16): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(246,20): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(247,16): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(248,20): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(249,17): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(250,21): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(251,17): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(252,21): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(255,16): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(256,20): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(257,16): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(258,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(281,12): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(282,16): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(283,12): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(284,16): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(285,13): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(286,17): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(287,13): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(288,17): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(291,12): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(292,16): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(293,12): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(294,16): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(334,5): error TS2386: Overload signatures must all be optional or required. -tests/cases/compiler/giant.ts(345,16): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(346,20): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(347,16): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(348,20): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(349,17): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(350,21): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(351,17): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(352,21): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(355,16): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(356,20): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(357,16): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(358,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(398,9): error TS2386: Overload signatures must all be optional or required. -tests/cases/compiler/giant.ts(424,16): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(425,20): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(426,16): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(427,20): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(428,17): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(429,21): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(430,17): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(431,21): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(434,16): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(435,20): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(436,16): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(437,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(477,9): error TS2386: Overload signatures must all be optional or required. -tests/cases/compiler/giant.ts(503,16): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(504,20): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(505,16): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(506,20): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(507,17): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(508,21): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(509,17): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(510,21): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(513,16): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(514,20): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(515,16): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(516,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(539,12): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(540,16): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(541,12): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(542,16): error TS2300: Duplicate identifier 'psF'. -tests/cases/compiler/giant.ts(543,13): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(544,17): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(545,13): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(546,17): error TS2300: Duplicate identifier 'rsF'. -tests/cases/compiler/giant.ts(549,12): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(550,16): error TS2300: Duplicate identifier 'tsF'. -tests/cases/compiler/giant.ts(551,12): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(552,16): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(602,9): error TS2386: Overload signatures must all be optional or required. tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all be optional or required. +tests/cases/compiler/giant.ts(672,22): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(672,25): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be declared in ambient contexts. -==== tests/cases/compiler/giant.ts (262 errors) ==== +==== tests/cases/compiler/giant.ts (257 errors) ==== /* Prefixes @@ -506,7 +501,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all export declare var eaV; export declare function eaF() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. export declare class eaC { }; export declare module eaM { }; } @@ -631,61 +626,61 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all export declare var eaV; export declare function eaF() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. export declare class eaC { }; export declare module eaM { }; } export declare var eaV; export declare function eaF() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. export declare class eaC { constructor () { } ~ -!!! error TS1111: A constructor implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. public pV; private rV; public pF() { } ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. private rF() { } ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. public pgF() { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'pgF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. public get pgF() ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'psF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. public set psF(param:any) ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. private get rgF() ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. private set rsF(param:any) ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -694,22 +689,22 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all static tV; static tF() { } ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. static tsF(param:any) { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. static set tsF(param:any) ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. static get tgF() ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -720,7 +715,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all var V; function F() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. ~ !!! error TS1036: Statements are not allowed in ambient contexts. class C { } @@ -729,9 +724,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all export var eV; export function eF() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. - ~ -!!! error TS1036: Statements are not allowed in ambient contexts. +!!! error TS1184: An implementation cannot be declared in ambient contexts. export class eC { } export interface eI { } export module eM { } @@ -966,7 +959,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all export declare var eaV; export declare function eaF() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. export declare class eaC { }; export declare module eaM { }; } @@ -1091,61 +1084,61 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all export declare var eaV; export declare function eaF() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. export declare class eaC { }; export declare module eaM { }; } export declare var eaV; export declare function eaF() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. export declare class eaC { constructor () { } ~ -!!! error TS1111: A constructor implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. public pV; private rV; public pF() { } ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. private rF() { } ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. public pgF() { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'pgF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. public get pgF() ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'psF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. public set psF(param:any) ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. private get rgF() ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. private set rsF(param:any) ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -1154,22 +1147,22 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all static tV; static tF() { } ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. static tsF(param:any) { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. static set tsF(param:any) ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. static get tgF() ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -1180,7 +1173,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all var V; function F() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. ~ !!! error TS1036: Statements are not allowed in ambient contexts. class C { } @@ -1189,9 +1182,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all export var eV; export function eF() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. - ~ -!!! error TS1036: Statements are not allowed in ambient contexts. +!!! error TS1184: An implementation cannot be declared in ambient contexts. export class eC { } export interface eI { } export module eM { } @@ -1200,54 +1191,54 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all export declare var eaV; export declare function eaF() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. export declare class eaC { constructor () { } ~ -!!! error TS1111: A constructor implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. public pV; private rV; public pF() { } ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. private rF() { } ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. public pgF() { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'pgF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. public get pgF() ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'psF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. public set psF(param:any) ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. private get rgF() ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. private set rsF(param:any) ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -1256,22 +1247,22 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all static tV; static tF() { } ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. static tsF(param:any) { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. static set tsF(param:any) ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. static get tgF() ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -1282,22 +1273,22 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all var V; function F() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. ~ !!! error TS1036: Statements are not allowed in ambient contexts. class C { constructor () { } ~ -!!! error TS1111: A constructor implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. public pV; private rV; public pF() { } ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. static tV; static tF() { } ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. } interface I { //Call Signature @@ -1350,7 +1341,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all var V; function F() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. ~ !!! error TS1036: Statements are not allowed in ambient contexts. class C { } @@ -1359,9 +1350,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all export var eV; export function eF() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. - ~ -!!! error TS1036: Statements are not allowed in ambient contexts. +!!! error TS1184: An implementation cannot be declared in ambient contexts. export class eC { } export interface eI { } export module eM { } @@ -1371,8 +1360,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all export declare function eaF() { }; ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. - ~ -!!! error TS1036: Statements are not allowed in ambient contexts. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. export declare class eaC { } ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. @@ -1383,22 +1372,20 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all export var eV; export function eF() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. - ~ -!!! error TS1036: Statements are not allowed in ambient contexts. +!!! error TS1184: An implementation cannot be declared in ambient contexts. export class eC { constructor () { } ~ -!!! error TS1111: A constructor implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. public pV; private rV; public pF() { } ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. static tV static tF() { } ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. } export interface eI { //Call Signature @@ -1452,7 +1439,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all var V; function F() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. ~ !!! error TS1036: Statements are not allowed in ambient contexts. class C { } @@ -1460,9 +1447,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all export var eV; export function eF() { }; ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. - ~ -!!! error TS1036: Statements are not allowed in ambient contexts. +!!! error TS1184: An implementation cannot be declared in ambient contexts. export class eC { } export interface eI { } export module eM { } diff --git a/tests/baselines/reference/illegalSuperCallsInConstructor.errors.txt b/tests/baselines/reference/illegalSuperCallsInConstructor.errors.txt index 6b86209b5b1..a07fbea75d8 100644 --- a/tests/baselines/reference/illegalSuperCallsInConstructor.errors.txt +++ b/tests/baselines/reference/illegalSuperCallsInConstructor.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/illegalSuperCallsInConstructor.ts(11,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/illegalSuperCallsInConstructor.ts(15,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/illegalSuperCallsInConstructor.ts(6,5): error TS2377: Constructors for derived classes must contain a 'super' call. tests/cases/compiler/illegalSuperCallsInConstructor.ts(7,24): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors tests/cases/compiler/illegalSuperCallsInConstructor.ts(8,26): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors tests/cases/compiler/illegalSuperCallsInConstructor.ts(9,32): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/compiler/illegalSuperCallsInConstructor.ts(11,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/illegalSuperCallsInConstructor.ts(12,17): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/compiler/illegalSuperCallsInConstructor.ts(15,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/illegalSuperCallsInConstructor.ts(16,17): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors @@ -31,9 +31,9 @@ tests/cases/compiler/illegalSuperCallsInConstructor.ts(16,17): error TS2337: Sup var r5 = { ~~~~~~~~~~~~~~~~~~ get foo() { + ~~~~~~~~~~~~~~~~~~~~~~~ ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~~~~~~~~~~~~~~~~~~~~~~~ super(); ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ @@ -43,9 +43,9 @@ tests/cases/compiler/illegalSuperCallsInConstructor.ts(16,17): error TS2337: Sup }, ~~~~~~~~~~~~~~ set foo(v: number) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ super(); ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ diff --git a/tests/baselines/reference/implicitAnyCastedValue.errors.txt b/tests/baselines/reference/implicitAnyCastedValue.errors.txt index 4b88cb0a8b4..613aa4820d2 100644 --- a/tests/baselines/reference/implicitAnyCastedValue.errors.txt +++ b/tests/baselines/reference/implicitAnyCastedValue.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/implicitAnyCastedValue.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/implicitAnyCastedValue.ts(28,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/implicitAnyCastedValue.ts(32,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/implicitAnyCastedValue.ts(10,5): error TS7008: Member 'bar' implicitly has an 'any' type. tests/cases/compiler/implicitAnyCastedValue.ts(11,5): error TS7008: Member 'foo' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyCastedValue.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/implicitAnyCastedValue.ts(26,5): error TS7008: Member 'getValue' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyCastedValue.ts(28,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/implicitAnyCastedValue.ts(32,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/implicitAnyCastedValue.ts(41,1): error TS7010: 'notCastedNull', which lacks return-type annotation, implicitly has an 'any' return type. tests/cases/compiler/implicitAnyCastedValue.ts(53,24): error TS7006: Parameter 'x' implicitly has an 'any' type. tests/cases/compiler/implicitAnyCastedValue.ts(62,24): error TS7006: Parameter 'x' implicitly has an 'any' type. diff --git a/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt b/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt index 9f2dc9ce949..4d9008cd56a 100644 --- a/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt +++ b/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt @@ -1,11 +1,11 @@ +tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(3,5): error TS7008: Member 'getAndSet' implicitly has an 'any' type. tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(4,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(9,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(15,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(20,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(3,5): error TS7008: Member 'getAndSet' implicitly has an 'any' type. tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(15,5): error TS7016: Property 'haveOnlySet' implicitly has type 'any', because its 'set' accessor lacks a type annotation. +tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(15,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(15,28): error TS7006: Parameter 'newXValue' implicitly has an 'any' type. tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(20,5): error TS7010: 'haveOnlyGet', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(20,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ==== tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts (8 errors) ==== @@ -30,9 +30,9 @@ tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(20,5): err class SetterOnly { public set haveOnlySet(newXValue) { // error at "haveOnlySet, newXValue" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~ !!! error TS7006: Parameter 'newXValue' implicitly has an 'any' type. } @@ -42,9 +42,9 @@ tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(20,5): err class GetterOnly { public get haveOnlyGet() { // error at "haveOnlyGet" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ return null; ~~~~~~~~~~~~~~~~~~~~ } diff --git a/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt b/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt index 6ec975e33ea..4775ec0511b 100644 --- a/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt +++ b/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/implicitAnyInAmbientDeclaration.ts(8,9): error TS1089: 'private' modifier cannot appear on a constructor declaration. tests/cases/compiler/implicitAnyInAmbientDeclaration.ts(3,9): error TS7008: Member 'publicMember' implicitly has an 'any' type. tests/cases/compiler/implicitAnyInAmbientDeclaration.ts(6,9): error TS7010: 'publicFunction', which lacks return-type annotation, implicitly has an 'any' return type. tests/cases/compiler/implicitAnyInAmbientDeclaration.ts(6,31): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyInAmbientDeclaration.ts(8,9): error TS1089: 'private' modifier cannot appear on a constructor declaration. ==== tests/cases/compiler/implicitAnyInAmbientDeclaration.ts (4 errors) ==== diff --git a/tests/baselines/reference/implicitAnyInAmbientDeclaration2.d.errors.txt b/tests/baselines/reference/implicitAnyInAmbientDeclaration2.d.errors.txt index 726c408aced..260dc6c9899 100644 --- a/tests/baselines/reference/implicitAnyInAmbientDeclaration2.d.errors.txt +++ b/tests/baselines/reference/implicitAnyInAmbientDeclaration2.d.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(9,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(1,1): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(1,22): error TS7006: Parameter 'x' implicitly has an 'any' type. tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(2,13): error TS7005: Variable 'bar' implicitly has an 'any' type. tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(4,5): error TS7008: Member 'publicMember' implicitly has an 'any' type. tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(7,5): error TS7010: 'publicFunction', which lacks return-type annotation, implicitly has an 'any' return type. tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(7,27): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(9,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(13,24): error TS7006: Parameter 'publicConsParam' implicitly has an 'any' type. diff --git a/tests/baselines/reference/importDeclWithClassModifiers.errors.txt b/tests/baselines/reference/importDeclWithClassModifiers.errors.txt index 7555ac366c4..19d30ae1b63 100644 --- a/tests/baselines/reference/importDeclWithClassModifiers.errors.txt +++ b/tests/baselines/reference/importDeclWithClassModifiers.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/importDeclWithClassModifiers.ts(5,8): error TS1044: 'public' modifier cannot appear on a module element. -tests/cases/compiler/importDeclWithClassModifiers.ts(6,8): error TS1044: 'private' modifier cannot appear on a module element. -tests/cases/compiler/importDeclWithClassModifiers.ts(7,8): error TS1044: 'static' modifier cannot appear on a module element. tests/cases/compiler/importDeclWithClassModifiers.ts(5,1): error TS2305: Module 'x' has no exported member 'c'. +tests/cases/compiler/importDeclWithClassModifiers.ts(5,8): error TS1044: 'public' modifier cannot appear on a module element. tests/cases/compiler/importDeclWithClassModifiers.ts(6,1): error TS2305: Module 'x' has no exported member 'c'. +tests/cases/compiler/importDeclWithClassModifiers.ts(6,8): error TS1044: 'private' modifier cannot appear on a module element. tests/cases/compiler/importDeclWithClassModifiers.ts(7,1): error TS2305: Module 'x' has no exported member 'c'. +tests/cases/compiler/importDeclWithClassModifiers.ts(7,8): error TS1044: 'static' modifier cannot appear on a module element. ==== tests/cases/compiler/importDeclWithClassModifiers.ts (6 errors) ==== @@ -12,19 +12,19 @@ tests/cases/compiler/importDeclWithClassModifiers.ts(7,1): error TS2305: Module } } export public import a = x.c; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2305: Module 'x' has no exported member 'c'. ~~~~~~ !!! error TS1044: 'public' modifier cannot appear on a module element. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'x' has no exported member 'c'. export private import b = x.c; - ~~~~~~~ -!!! error TS1044: 'private' modifier cannot appear on a module element. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2305: Module 'x' has no exported member 'c'. + ~~~~~~~ +!!! error TS1044: 'private' modifier cannot appear on a module element. export static import c = x.c; - ~~~~~~ -!!! error TS1044: 'static' modifier cannot appear on a module element. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2305: Module 'x' has no exported member 'c'. + ~~~~~~ +!!! error TS1044: 'static' modifier cannot appear on a module element. var b: a; \ No newline at end of file diff --git a/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt b/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt index 35c91e38dc5..dc7462a699f 100644 --- a/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt +++ b/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/importDeclWithDeclareModifier.ts(5,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. -tests/cases/compiler/importDeclWithDeclareModifier.ts(5,9): error TS1029: 'export' modifier must precede 'declare' modifier. tests/cases/compiler/importDeclWithDeclareModifier.ts(5,1): error TS2305: Module 'x' has no exported member 'c'. +tests/cases/compiler/importDeclWithDeclareModifier.ts(5,9): error TS1029: 'export' modifier must precede 'declare' modifier. ==== tests/cases/compiler/importDeclWithDeclareModifier.ts (3 errors) ==== @@ -11,9 +11,9 @@ tests/cases/compiler/importDeclWithDeclareModifier.ts(5,1): error TS2305: Module declare export import a = x.c; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. - ~~~~~~ -!!! error TS1029: 'export' modifier must precede 'declare' modifier. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2305: Module 'x' has no exported member 'c'. + ~~~~~~ +!!! error TS1029: 'export' modifier must precede 'declare' modifier. var b: a; \ No newline at end of file diff --git a/tests/baselines/reference/incompleteDottedExpressionAtEOF.errors.txt b/tests/baselines/reference/incompleteDottedExpressionAtEOF.errors.txt index b338129db8c..fe5d93ec6c1 100644 --- a/tests/baselines/reference/incompleteDottedExpressionAtEOF.errors.txt +++ b/tests/baselines/reference/incompleteDottedExpressionAtEOF.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/incompleteDottedExpressionAtEOF.ts(2,18): error TS1003: Identifier expected. tests/cases/compiler/incompleteDottedExpressionAtEOF.ts(2,10): error TS2304: Cannot find name 'window'. +tests/cases/compiler/incompleteDottedExpressionAtEOF.ts(2,18): error TS1003: Identifier expected. ==== tests/cases/compiler/incompleteDottedExpressionAtEOF.ts (2 errors) ==== // used to leak __missing into error message var p2 = window. - -!!! error TS1003: Identifier expected. ~~~~~~ -!!! error TS2304: Cannot find name 'window'. \ No newline at end of file +!!! error TS2304: Cannot find name 'window'. + +!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/incrementAndDecrement.errors.txt b/tests/baselines/reference/incrementAndDecrement.errors.txt index f8a718c5f06..7cbf8cbc0fe 100644 --- a/tests/baselines/reference/incrementAndDecrement.errors.txt +++ b/tests/baselines/reference/incrementAndDecrement.errors.txt @@ -1,8 +1,8 @@ +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(5,9): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(8,5): error TS1005: ';' expected. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(11,5): error TS1005: ';' expected. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(14,5): error TS1005: ';' expected. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(17,5): error TS1005: ';' expected. -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(5,9): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(24,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(25,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(26,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. diff --git a/tests/baselines/reference/indexSignatureWithAccessibilityModifier.errors.txt b/tests/baselines/reference/indexSignatureWithAccessibilityModifier.errors.txt index 6c836e268d6..84577dd5cae 100644 --- a/tests/baselines/reference/indexSignatureWithAccessibilityModifier.errors.txt +++ b/tests/baselines/reference/indexSignatureWithAccessibilityModifier.errors.txt @@ -1,22 +1,22 @@ -tests/cases/compiler/indexSignatureWithAccessibilityModifier.ts(2,13): error TS1018: An index signature parameter cannot have an accessibility modifier. -tests/cases/compiler/indexSignatureWithAccessibilityModifier.ts(6,13): error TS1018: An index signature parameter cannot have an accessibility modifier. tests/cases/compiler/indexSignatureWithAccessibilityModifier.ts(2,6): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/indexSignatureWithAccessibilityModifier.ts(2,13): error TS1018: An index signature parameter cannot have an accessibility modifier. tests/cases/compiler/indexSignatureWithAccessibilityModifier.ts(6,6): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/indexSignatureWithAccessibilityModifier.ts(6,13): error TS1018: An index signature parameter cannot have an accessibility modifier. ==== tests/cases/compiler/indexSignatureWithAccessibilityModifier.ts (4 errors) ==== interface I { [public x: string]: string; - ~ -!!! error TS1018: An index signature parameter cannot have an accessibility modifier. ~~~~~~~~~~~~~~~~ !!! error TS2369: A parameter property is only allowed in a constructor implementation. + ~ +!!! error TS1018: An index signature parameter cannot have an accessibility modifier. } class C { [public x: string]: string - ~ -!!! error TS1018: An index signature parameter cannot have an accessibility modifier. ~~~~~~~~~~~~~~~~ !!! error TS2369: A parameter property is only allowed in a constructor implementation. + ~ +!!! error TS1018: An index signature parameter cannot have an accessibility modifier. } \ No newline at end of file diff --git a/tests/baselines/reference/indexTypeCheck.errors.txt b/tests/baselines/reference/indexTypeCheck.errors.txt index efa02c3ff1f..03d0e2ce8ed 100644 --- a/tests/baselines/reference/indexTypeCheck.errors.txt +++ b/tests/baselines/reference/indexTypeCheck.errors.txt @@ -1,10 +1,10 @@ tests/cases/compiler/indexTypeCheck.ts(2,2): error TS1021: An index signature must have a type annotation. tests/cases/compiler/indexTypeCheck.ts(3,2): error TS1021: An index signature must have a type annotation. -tests/cases/compiler/indexTypeCheck.ts(32,3): error TS1096: An index signature must have exactly one parameter. -tests/cases/compiler/indexTypeCheck.ts(36,3): error TS1023: An index signature parameter type must be 'string' or 'number'. tests/cases/compiler/indexTypeCheck.ts(17,2): error TS2413: Numeric index type 'number' is not assignable to string index type 'string'. tests/cases/compiler/indexTypeCheck.ts(22,2): error TS2413: Numeric index type 'Orange' is not assignable to string index type 'Yellow'. tests/cases/compiler/indexTypeCheck.ts(27,2): error TS2413: Numeric index type 'number' is not assignable to string index type 'string'. +tests/cases/compiler/indexTypeCheck.ts(32,3): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/indexTypeCheck.ts(36,3): error TS1023: An index signature parameter type must be 'string' or 'number'. tests/cases/compiler/indexTypeCheck.ts(51,1): error TS2342: An index expression argument must be of type 'string', 'number', or 'any'. diff --git a/tests/baselines/reference/inferSetterParamType.errors.txt b/tests/baselines/reference/inferSetterParamType.errors.txt index c9232d3fac7..2ae2a16f9d2 100644 --- a/tests/baselines/reference/inferSetterParamType.errors.txt +++ b/tests/baselines/reference/inferSetterParamType.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/inferSetterParamType.ts(3,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inferSetterParamType.ts(6,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inferSetterParamType.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/inferSetterParamType.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inferSetterParamType.ts(13,16): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/inferSetterParamType.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ==== tests/cases/compiler/inferSetterParamType.ts (5 errors) ==== diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt index 54f5fcc2a34..6fde83e08b0 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(11,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(7,7): error TS2415: Class 'b' incorrectly extends base class 'a'. Types of property 'x' are incompatible. Type 'string' is not assignable to type '() => string'. +tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(8,9): error TS2423: Class 'a' defines instance member function 'x', but extended class 'b' defines it as instance member accessor. +tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(11,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ==== tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts (4 errors) ==== diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt index 026c2b51ac9..38b1ed61fac 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(7,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. Types of property 'x' are incompatible. Type 'string' is not assignable to type '() => string'. +tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ==== tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts (3 errors) ==== diff --git a/tests/baselines/reference/initializerReferencingConstructorLocals.errors.txt b/tests/baselines/reference/initializerReferencingConstructorLocals.errors.txt index 896552cabd5..a3909e481f6 100644 --- a/tests/baselines/reference/initializerReferencingConstructorLocals.errors.txt +++ b/tests/baselines/reference/initializerReferencingConstructorLocals.errors.txt @@ -1,13 +1,13 @@ -tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(7,15): error TS1003: Identifier expected. -tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(17,15): error TS1003: Identifier expected. tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(4,9): error TS2304: Cannot find name 'z'. tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(5,15): error TS2304: Cannot find name 'z'. tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(6,14): error TS2339: Property 'z' does not exist on type 'C'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(7,15): error TS1003: Identifier expected. tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(7,20): error TS2339: Property 'z' does not exist on type 'C'. tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(9,9): error TS2304: Cannot find name 'z'. tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(14,9): error TS2304: Cannot find name 'z'. tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(15,15): error TS2304: Cannot find name 'z'. tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(16,14): error TS2339: Property 'z' does not exist on type 'D'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(17,15): error TS1003: Identifier expected. tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(17,20): error TS2339: Property 'z' does not exist on type 'D'. tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(19,9): error TS2304: Cannot find name 'z'. diff --git a/tests/baselines/reference/initializerReferencingConstructorParameters.errors.txt b/tests/baselines/reference/initializerReferencingConstructorParameters.errors.txt index 465e3c42167..623bd535745 100644 --- a/tests/baselines/reference/initializerReferencingConstructorParameters.errors.txt +++ b/tests/baselines/reference/initializerReferencingConstructorParameters.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(17,15): error TS1003: Identifier expected. tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(4,9): error TS2304: Cannot find name 'x'. tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(5,15): error TS2304: Cannot find name 'x'. tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(10,9): error TS2304: Cannot find name 'x'. tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(11,15): error TS2304: Cannot find name 'x'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(17,15): error TS1003: Identifier expected. tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(23,9): error TS2304: Cannot find name 'x'. diff --git a/tests/baselines/reference/initializersInDeclarations.errors.txt b/tests/baselines/reference/initializersInDeclarations.errors.txt index 5ab9ae5d2bc..9840181e092 100644 --- a/tests/baselines/reference/initializersInDeclarations.errors.txt +++ b/tests/baselines/reference/initializersInDeclarations.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/externalModules/initializersInDeclarations.ts(5,9): error TS1039: Initializers are not allowed in ambient contexts. tests/cases/conformance/externalModules/initializersInDeclarations.ts(6,16): error TS1039: Initializers are not allowed in ambient contexts. -tests/cases/conformance/externalModules/initializersInDeclarations.ts(7,16): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/conformance/externalModules/initializersInDeclarations.ts(7,16): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/conformance/externalModules/initializersInDeclarations.ts(12,15): error TS1039: Initializers are not allowed in ambient contexts. tests/cases/conformance/externalModules/initializersInDeclarations.ts(13,15): error TS1039: Initializers are not allowed in ambient contexts. tests/cases/conformance/externalModules/initializersInDeclarations.ts(16,2): error TS1036: Statements are not allowed in ambient contexts. @@ -20,7 +20,7 @@ tests/cases/conformance/externalModules/initializersInDeclarations.ts(18,16): er !!! error TS1039: Initializers are not allowed in ambient contexts. fn(): boolean { ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. +!!! error TS1184: An implementation cannot be declared in ambient contexts. return false; } } diff --git a/tests/baselines/reference/innerModExport1.errors.txt b/tests/baselines/reference/innerModExport1.errors.txt index 9e5840f2ccd..b4f06cc998a 100644 --- a/tests/baselines/reference/innerModExport1.errors.txt +++ b/tests/baselines/reference/innerModExport1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/innerModExport1.ts(5,12): error TS1005: ';' expected. tests/cases/compiler/innerModExport1.ts(5,5): error TS2304: Cannot find name 'module'. +tests/cases/compiler/innerModExport1.ts(5,12): error TS1005: ';' expected. ==== tests/cases/compiler/innerModExport1.ts (2 errors) ==== @@ -8,10 +8,10 @@ tests/cases/compiler/innerModExport1.ts(5,5): error TS2304: Cannot find name 'mo // inner mod 1 var non_export_var: number; module { - ~ -!!! error TS1005: ';' expected. ~~~~~~ !!! error TS2304: Cannot find name 'module'. + ~ +!!! error TS1005: ';' expected. var non_export_var = 0; export var export_var = 1; diff --git a/tests/baselines/reference/innerModExport2.errors.txt b/tests/baselines/reference/innerModExport2.errors.txt index 79ba22e58ab..52a9d01c997 100644 --- a/tests/baselines/reference/innerModExport2.errors.txt +++ b/tests/baselines/reference/innerModExport2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/innerModExport2.ts(5,12): error TS1005: ';' expected. tests/cases/compiler/innerModExport2.ts(5,5): error TS2304: Cannot find name 'module'. +tests/cases/compiler/innerModExport2.ts(5,12): error TS1005: ';' expected. tests/cases/compiler/innerModExport2.ts(7,20): error TS2395: Individual declarations in merged declaration export_var must be all exported or all local. tests/cases/compiler/innerModExport2.ts(13,9): error TS2395: Individual declarations in merged declaration export_var must be all exported or all local. tests/cases/compiler/innerModExport2.ts(20,7): error TS2339: Property 'NonExportFunc' does not exist on type 'typeof Outer'. @@ -11,10 +11,10 @@ tests/cases/compiler/innerModExport2.ts(20,7): error TS2339: Property 'NonExport // inner mod 1 var non_export_var: number; module { - ~ -!!! error TS1005: ';' expected. ~~~~~~ !!! error TS2304: Cannot find name 'module'. + ~ +!!! error TS1005: ';' expected. var non_export_var = 0; export var export_var = 1; ~~~~~~~~~~ diff --git a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt index fbd64e5018e..340b5081866 100644 --- a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt +++ b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(4,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(7,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(19,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(26,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(29,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(19,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(41,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. diff --git a/tests/baselines/reference/instancePropertyInClassType.errors.txt b/tests/baselines/reference/instancePropertyInClassType.errors.txt index 9a7dce0f0cd..d14607d81bc 100644 --- a/tests/baselines/reference/instancePropertyInClassType.errors.txt +++ b/tests/baselines/reference/instancePropertyInClassType.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(4,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(7,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(17,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(24,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(27,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(17,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(37,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. diff --git a/tests/baselines/reference/instantiateTypeParameter.errors.txt b/tests/baselines/reference/instantiateTypeParameter.errors.txt index f56f8a761dd..e8685251f9c 100644 --- a/tests/baselines/reference/instantiateTypeParameter.errors.txt +++ b/tests/baselines/reference/instantiateTypeParameter.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/instantiateTypeParameter.ts(2,5): error TS1131: Property or signature expected. -tests/cases/compiler/instantiateTypeParameter.ts(3,1): error TS1128: Declaration or statement expected. tests/cases/compiler/instantiateTypeParameter.ts(2,12): error TS2304: Cannot find name 'T'. +tests/cases/compiler/instantiateTypeParameter.ts(3,1): error TS1128: Declaration or statement expected. ==== tests/cases/compiler/instantiateTypeParameter.ts (3 errors) ==== diff --git a/tests/baselines/reference/intTypeCheck.errors.txt b/tests/baselines/reference/intTypeCheck.errors.txt index 64655f1bd35..5f7c213a916 100644 --- a/tests/baselines/reference/intTypeCheck.errors.txt +++ b/tests/baselines/reference/intTypeCheck.errors.txt @@ -1,11 +1,3 @@ -tests/cases/compiler/intTypeCheck.ts(104,20): error TS1109: Expression expected. -tests/cases/compiler/intTypeCheck.ts(118,21): error TS1109: Expression expected. -tests/cases/compiler/intTypeCheck.ts(132,21): error TS1109: Expression expected. -tests/cases/compiler/intTypeCheck.ts(146,21): error TS1109: Expression expected. -tests/cases/compiler/intTypeCheck.ts(160,21): error TS1109: Expression expected. -tests/cases/compiler/intTypeCheck.ts(174,21): error TS1109: Expression expected. -tests/cases/compiler/intTypeCheck.ts(188,21): error TS1109: Expression expected. -tests/cases/compiler/intTypeCheck.ts(202,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(83,5): error TS2386: Overload signatures must all be optional or required. tests/cases/compiler/intTypeCheck.ts(97,5): error TS2322: Type 'Object' is not assignable to type 'i1'. Property 'p' is missing in type 'Object'. @@ -16,6 +8,7 @@ tests/cases/compiler/intTypeCheck.ts(101,5): error TS2322: Type '() => void' is Property 'p' is missing in type '() => void'. tests/cases/compiler/intTypeCheck.ts(104,5): error TS2322: Type 'boolean' is not assignable to type 'i1'. Property 'p' is missing in type 'Boolean'. +tests/cases/compiler/intTypeCheck.ts(104,20): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(104,21): error TS2304: Cannot find name 'i1'. tests/cases/compiler/intTypeCheck.ts(105,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(110,5): error TS2322: Type '{}' is not assignable to type 'i2'. @@ -23,6 +16,7 @@ tests/cases/compiler/intTypeCheck.ts(111,5): error TS2322: Type 'Object' is not tests/cases/compiler/intTypeCheck.ts(112,17): error TS2350: Only a void function can be called with the 'new' keyword. tests/cases/compiler/intTypeCheck.ts(113,5): error TS2322: Type 'Base' is not assignable to type 'i2'. tests/cases/compiler/intTypeCheck.ts(118,5): error TS2322: Type 'boolean' is not assignable to type 'i2'. +tests/cases/compiler/intTypeCheck.ts(118,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(118,22): error TS2304: Cannot find name 'i2'. tests/cases/compiler/intTypeCheck.ts(119,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(124,5): error TS2322: Type '{}' is not assignable to type 'i3'. @@ -30,6 +24,7 @@ tests/cases/compiler/intTypeCheck.ts(125,5): error TS2322: Type 'Object' is not tests/cases/compiler/intTypeCheck.ts(127,5): error TS2322: Type 'Base' is not assignable to type 'i3'. tests/cases/compiler/intTypeCheck.ts(129,5): error TS2322: Type '() => void' is not assignable to type 'i3'. tests/cases/compiler/intTypeCheck.ts(132,5): error TS2322: Type 'boolean' is not assignable to type 'i3'. +tests/cases/compiler/intTypeCheck.ts(132,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(132,22): error TS2304: Cannot find name 'i3'. tests/cases/compiler/intTypeCheck.ts(133,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(139,5): error TS2322: Type 'Object' is not assignable to type 'i4'. @@ -41,6 +36,7 @@ tests/cases/compiler/intTypeCheck.ts(143,5): error TS2322: Type '() => void' is Index signature is missing in type '() => void'. tests/cases/compiler/intTypeCheck.ts(146,5): error TS2322: Type 'boolean' is not assignable to type 'i4'. Index signature is missing in type 'Boolean'. +tests/cases/compiler/intTypeCheck.ts(146,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(146,22): error TS2304: Cannot find name 'i4'. tests/cases/compiler/intTypeCheck.ts(147,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(152,5): error TS2322: Type '{}' is not assignable to type 'i5'. @@ -54,6 +50,7 @@ tests/cases/compiler/intTypeCheck.ts(157,5): error TS2322: Type '() => void' is Property 'p' is missing in type '() => void'. tests/cases/compiler/intTypeCheck.ts(160,5): error TS2322: Type 'boolean' is not assignable to type 'i5'. Property 'p' is missing in type 'Boolean'. +tests/cases/compiler/intTypeCheck.ts(160,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(160,22): error TS2304: Cannot find name 'i5'. tests/cases/compiler/intTypeCheck.ts(161,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(166,5): error TS2322: Type '{}' is not assignable to type 'i6'. @@ -63,6 +60,7 @@ tests/cases/compiler/intTypeCheck.ts(169,5): error TS2322: Type 'Base' is not as tests/cases/compiler/intTypeCheck.ts(171,5): error TS2322: Type '() => void' is not assignable to type 'i6'. Type 'void' is not assignable to type 'number'. tests/cases/compiler/intTypeCheck.ts(174,5): error TS2322: Type 'boolean' is not assignable to type 'i6'. +tests/cases/compiler/intTypeCheck.ts(174,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(174,22): error TS2304: Cannot find name 'i6'. tests/cases/compiler/intTypeCheck.ts(175,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(180,5): error TS2322: Type '{}' is not assignable to type 'i7'. @@ -70,6 +68,7 @@ tests/cases/compiler/intTypeCheck.ts(181,5): error TS2322: Type 'Object' is not tests/cases/compiler/intTypeCheck.ts(183,17): error TS2352: Neither type 'Base' nor type 'i7' is assignable to the other. tests/cases/compiler/intTypeCheck.ts(185,5): error TS2322: Type '() => void' is not assignable to type 'i7'. tests/cases/compiler/intTypeCheck.ts(188,5): error TS2322: Type 'boolean' is not assignable to type 'i7'. +tests/cases/compiler/intTypeCheck.ts(188,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(188,22): error TS2304: Cannot find name 'i7'. tests/cases/compiler/intTypeCheck.ts(189,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(195,5): error TS2322: Type 'Object' is not assignable to type 'i8'. @@ -81,6 +80,7 @@ tests/cases/compiler/intTypeCheck.ts(199,5): error TS2322: Type '() => void' is Index signature is missing in type '() => void'. tests/cases/compiler/intTypeCheck.ts(202,5): error TS2322: Type 'boolean' is not assignable to type 'i8'. Index signature is missing in type 'Boolean'. +tests/cases/compiler/intTypeCheck.ts(202,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(202,22): error TS2304: Cannot find name 'i8'. tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -203,11 +203,11 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit //var obj7: i1 = function foo() { }; var obj8: i1 = anyVar; var obj9: i1 = new anyVar; - ~ -!!! error TS1109: Expression expected. ~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i1'. !!! error TS2322: Property 'p' is missing in type 'Boolean'. + ~ +!!! error TS1109: Expression expected. ~~ !!! error TS2304: Cannot find name 'i1'. var obj10: i1 = new {}; @@ -234,10 +234,10 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit //var obj18: i2 = function foo() { }; var obj19: i2 = anyVar; var obj20: i2 = new anyVar; - ~ -!!! error TS1109: Expression expected. ~~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i2'. + ~ +!!! error TS1109: Expression expected. ~~ !!! error TS2304: Cannot find name 'i2'. var obj21: i2 = new {}; @@ -264,10 +264,10 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit //var obj29: i3 = function foo() { }; var obj30: i3 = anyVar; var obj31: i3 = new anyVar; - ~ -!!! error TS1109: Expression expected. ~~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i3'. + ~ +!!! error TS1109: Expression expected. ~~ !!! error TS2304: Cannot find name 'i3'. var obj32: i3 = new {}; @@ -297,11 +297,11 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit //var obj40: i4 = function foo() { }; var obj41: i4 = anyVar; var obj42: i4 = new anyVar; - ~ -!!! error TS1109: Expression expected. ~~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i4'. !!! error TS2322: Index signature is missing in type 'Boolean'. + ~ +!!! error TS1109: Expression expected. ~~ !!! error TS2304: Cannot find name 'i4'. var obj43: i4 = new {}; @@ -334,11 +334,11 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit //var obj51: i5 = function foo() { }; var obj52: i5 = anyVar; var obj53: i5 = new anyVar; - ~ -!!! error TS1109: Expression expected. ~~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i5'. !!! error TS2322: Property 'p' is missing in type 'Boolean'. + ~ +!!! error TS1109: Expression expected. ~~ !!! error TS2304: Cannot find name 'i5'. var obj54: i5 = new {}; @@ -368,10 +368,10 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit //var obj62: i6 = function foo() { }; var obj63: i6 = anyVar; var obj64: i6 = new anyVar; - ~ -!!! error TS1109: Expression expected. ~~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i6'. + ~ +!!! error TS1109: Expression expected. ~~ !!! error TS2304: Cannot find name 'i6'. var obj65: i6 = new {}; @@ -398,10 +398,10 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit //var obj73: i7 = function foo() { }; var obj74: i7 = anyVar; var obj75: i7 = new anyVar; - ~ -!!! error TS1109: Expression expected. ~~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i7'. + ~ +!!! error TS1109: Expression expected. ~~ !!! error TS2304: Cannot find name 'i7'. var obj76: i7 = new {}; @@ -431,11 +431,11 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit //var obj84: i8 = function foo() { }; var obj85: i8 = anyVar; var obj86: i8 = new anyVar; - ~ -!!! error TS1109: Expression expected. ~~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i8'. !!! error TS2322: Index signature is missing in type 'Boolean'. + ~ +!!! error TS1109: Expression expected. ~~ !!! error TS2304: Cannot find name 'i8'. var obj87: i8 = new {}; diff --git a/tests/baselines/reference/interfaceDeclaration4.errors.txt b/tests/baselines/reference/interfaceDeclaration4.errors.txt index 520c0c2cadf..d59f063ea11 100644 --- a/tests/baselines/reference/interfaceDeclaration4.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration4.errors.txt @@ -1,5 +1,3 @@ -tests/cases/compiler/interfaceDeclaration4.ts(39,14): error TS1005: '{' expected. -tests/cases/compiler/interfaceDeclaration4.ts(39,18): error TS1005: ';' expected. tests/cases/compiler/interfaceDeclaration4.ts(18,11): error TS2430: Interface 'I3' incorrectly extends interface 'I1'. Types of property 'item' are incompatible. Type 'number' is not assignable to type 'string'. @@ -7,7 +5,9 @@ tests/cases/compiler/interfaceDeclaration4.ts(27,7): error TS2420: Class 'C2' in Property 'item' is missing in type 'C2'. tests/cases/compiler/interfaceDeclaration4.ts(36,7): error TS2420: Class 'C3' incorrectly implements interface 'I1'. Property 'item' is missing in type 'C3'. +tests/cases/compiler/interfaceDeclaration4.ts(39,14): error TS1005: '{' expected. tests/cases/compiler/interfaceDeclaration4.ts(39,15): error TS2304: Cannot find name 'I1'. +tests/cases/compiler/interfaceDeclaration4.ts(39,18): error TS1005: ';' expected. ==== tests/cases/compiler/interfaceDeclaration4.ts (6 errors) ==== @@ -62,8 +62,8 @@ tests/cases/compiler/interfaceDeclaration4.ts(39,15): error TS2304: Cannot find interface Foo.I1 { } ~ !!! error TS1005: '{' expected. - ~ -!!! error TS1005: ';' expected. ~~ !!! error TS2304: Cannot find name 'I1'. + ~ +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendingClass2.errors.txt b/tests/baselines/reference/interfaceExtendingClass2.errors.txt index 1e07199686b..3b394d4922a 100644 --- a/tests/baselines/reference/interfaceExtendingClass2.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClass2.errors.txt @@ -1,7 +1,7 @@ +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(11,5): error TS2411: Property 'a' of type '{ toString: () => {}; }' is not assignable to string index type 'Object'. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(13,13): error TS1131: Property or signature expected. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(14,9): error TS1128: Declaration or statement expected. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(15,5): error TS1128: Declaration or statement expected. -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(11,5): error TS2411: Property 'a' of type '{ toString: () => {}; }' is not assignable to string index type 'Object'. ==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts (4 errors) ==== diff --git a/tests/baselines/reference/interfaceNaming1.errors.txt b/tests/baselines/reference/interfaceNaming1.errors.txt index 67158ce6109..99e0b5c02fa 100644 --- a/tests/baselines/reference/interfaceNaming1.errors.txt +++ b/tests/baselines/reference/interfaceNaming1.errors.txt @@ -1,15 +1,15 @@ -tests/cases/compiler/interfaceNaming1.ts(1,11): error TS1005: ';' expected. tests/cases/compiler/interfaceNaming1.ts(1,1): error TS2304: Cannot find name 'interface'. +tests/cases/compiler/interfaceNaming1.ts(1,11): error TS1005: ';' expected. tests/cases/compiler/interfaceNaming1.ts(3,1): error TS2304: Cannot find name 'interface'. tests/cases/compiler/interfaceNaming1.ts(3,13): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ==== tests/cases/compiler/interfaceNaming1.ts (4 errors) ==== interface { } - ~ -!!! error TS1005: ';' expected. ~~~~~~~~~ !!! error TS2304: Cannot find name 'interface'. + ~ +!!! error TS1005: ';' expected. interface interface{ } interface & { } ~~~~~~~~~ diff --git a/tests/baselines/reference/interfaceThatInheritsFromItself.errors.txt b/tests/baselines/reference/interfaceThatInheritsFromItself.errors.txt index 440650717bd..b1e47347117 100644 --- a/tests/baselines/reference/interfaceThatInheritsFromItself.errors.txt +++ b/tests/baselines/reference/interfaceThatInheritsFromItself.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(10,15): error TS1176: Interface declaration cannot have 'implements' clause. tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(1,11): error TS2310: Type 'Foo' recursively references itself as a base type. tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(4,11): error TS2310: Type 'Foo2' recursively references itself as a base type. tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(7,11): error TS2310: Type 'Foo3' recursively references itself as a base type. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(10,15): error TS1176: Interface declaration cannot have 'implements' clause. ==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts (4 errors) ==== diff --git a/tests/baselines/reference/interfaceWithPrivateMember.errors.txt b/tests/baselines/reference/interfaceWithPrivateMember.errors.txt index e019ff9d9a1..7f2542b45a1 100644 --- a/tests/baselines/reference/interfaceWithPrivateMember.errors.txt +++ b/tests/baselines/reference/interfaceWithPrivateMember.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(4,5): error TS1131: Property or signature expected. tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(8,5): error TS1131: Property or signature expected. tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(12,5): error TS1131: Property or signature expected. -tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(13,1): error TS1128: Declaration or statement expected. tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(12,16): error TS2304: Cannot find name 'string'. +tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(13,1): error TS1128: Declaration or statement expected. ==== tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts (5 errors) ==== diff --git a/tests/baselines/reference/interfacesWithPredefinedTypesAsNames.errors.txt b/tests/baselines/reference/interfacesWithPredefinedTypesAsNames.errors.txt index 20ef6f7a39d..91cd267b596 100644 --- a/tests/baselines/reference/interfacesWithPredefinedTypesAsNames.errors.txt +++ b/tests/baselines/reference/interfacesWithPredefinedTypesAsNames.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(5,11): error TS1003: Identifier expected. tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(1,11): error TS2427: Interface name cannot be 'any' tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(2,11): error TS2427: Interface name cannot be 'number' tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(3,11): error TS2427: Interface name cannot be 'string' tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(4,11): error TS2427: Interface name cannot be 'boolean' +tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(5,11): error TS1003: Identifier expected. ==== tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts (5 errors) ==== diff --git a/tests/baselines/reference/invalidUnicodeEscapeSequance3.errors.txt b/tests/baselines/reference/invalidUnicodeEscapeSequance3.errors.txt index 93120be44bd..45674e698b6 100644 --- a/tests/baselines/reference/invalidUnicodeEscapeSequance3.errors.txt +++ b/tests/baselines/reference/invalidUnicodeEscapeSequance3.errors.txt @@ -1,13 +1,13 @@ -tests/cases/compiler/invalidUnicodeEscapeSequance3.ts(1,2): error TS1127: Invalid character. tests/cases/compiler/invalidUnicodeEscapeSequance3.ts(1,1): error TS2304: Cannot find name 'a'. +tests/cases/compiler/invalidUnicodeEscapeSequance3.ts(1,2): error TS1127: Invalid character. tests/cases/compiler/invalidUnicodeEscapeSequance3.ts(1,3): error TS2304: Cannot find name 'u'. ==== tests/cases/compiler/invalidUnicodeEscapeSequance3.ts (3 errors) ==== a\u - -!!! error TS1127: Invalid character. ~ !!! error TS2304: Cannot find name 'a'. + +!!! error TS1127: Invalid character. ~ !!! error TS2304: Cannot find name 'u'. \ No newline at end of file diff --git a/tests/baselines/reference/letAsIdentifierInStrictMode.errors.txt b/tests/baselines/reference/letAsIdentifierInStrictMode.errors.txt index e332535e23b..65411f23da9 100644 --- a/tests/baselines/reference/letAsIdentifierInStrictMode.errors.txt +++ b/tests/baselines/reference/letAsIdentifierInStrictMode.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/letAsIdentifierInStrictMode.ts(2,5): error TS1134: Variable declaration expected. tests/cases/compiler/letAsIdentifierInStrictMode.ts(2,9): error TS1134: Variable declaration expected. tests/cases/compiler/letAsIdentifierInStrictMode.ts(2,11): error TS1134: Variable declaration expected. +tests/cases/compiler/letAsIdentifierInStrictMode.ts(3,5): error TS2300: Duplicate identifier 'a'. tests/cases/compiler/letAsIdentifierInStrictMode.ts(4,5): error TS1134: Variable declaration expected. tests/cases/compiler/letAsIdentifierInStrictMode.ts(4,7): error TS1134: Variable declaration expected. -tests/cases/compiler/letAsIdentifierInStrictMode.ts(3,5): error TS2300: Duplicate identifier 'a'. tests/cases/compiler/letAsIdentifierInStrictMode.ts(6,1): error TS2300: Duplicate identifier 'a'. diff --git a/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt b/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt index ad0c0f741b5..1ece1f31433 100644 --- a/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt +++ b/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt @@ -2,15 +2,14 @@ tests/cases/compiler/letDeclarations-invalidContexts.ts(4,5): error TS1157: 'let tests/cases/compiler/letDeclarations-invalidContexts.ts(6,5): error TS1157: 'let' declarations can only be declared inside a block. tests/cases/compiler/letDeclarations-invalidContexts.ts(9,5): error TS1157: 'let' declarations can only be declared inside a block. tests/cases/compiler/letDeclarations-invalidContexts.ts(12,5): error TS1157: 'let' declarations can only be declared inside a block. -tests/cases/compiler/letDeclarations-invalidContexts.ts(17,5): error TS1157: 'let' declarations can only be declared inside a block. +tests/cases/compiler/letDeclarations-invalidContexts.ts(16,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. tests/cases/compiler/letDeclarations-invalidContexts.ts(20,5): error TS1157: 'let' declarations can only be declared inside a block. tests/cases/compiler/letDeclarations-invalidContexts.ts(23,5): error TS1157: 'let' declarations can only be declared inside a block. tests/cases/compiler/letDeclarations-invalidContexts.ts(26,12): error TS1157: 'let' declarations can only be declared inside a block. tests/cases/compiler/letDeclarations-invalidContexts.ts(29,29): error TS1157: 'let' declarations can only be declared inside a block. -tests/cases/compiler/letDeclarations-invalidContexts.ts(16,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. -==== tests/cases/compiler/letDeclarations-invalidContexts.ts (10 errors) ==== +==== tests/cases/compiler/letDeclarations-invalidContexts.ts (9 errors) ==== // Errors, let must be defined inside a block if (true) @@ -38,8 +37,6 @@ tests/cases/compiler/letDeclarations-invalidContexts.ts(16,7): error TS2410: All ~~~ !!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. let l5 = 0; - ~~~~~~~~~~~ -!!! error TS1157: 'let' declarations can only be declared inside a block. for (var i = 0; i < 10; i++) let l6 = 0; diff --git a/tests/baselines/reference/libMembers.errors.txt b/tests/baselines/reference/libMembers.errors.txt index a6af67821b3..4b025b9a95b 100644 --- a/tests/baselines/reference/libMembers.errors.txt +++ b/tests/baselines/reference/libMembers.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/libMembers.ts(9,16): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/compiler/libMembers.ts(4,3): error TS2339: Property 'subby' does not exist on type 'string'. +tests/cases/compiler/libMembers.ts(9,16): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/compiler/libMembers.ts(12,15): error TS2339: Property 'prototype' does not exist on type 'C'. diff --git a/tests/baselines/reference/literals.errors.txt b/tests/baselines/reference/literals.errors.txt index f33d26af7a4..d43e89bb4db 100644 --- a/tests/baselines/reference/literals.errors.txt +++ b/tests/baselines/reference/literals.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/expressions/literals/literals.ts(20,9): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/literals/literals.ts(25,10): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/literals/literals.ts(9,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/literals/literals.ts(9,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/literals/literals.ts(10,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/literals/literals.ts(10,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/literals/literals.ts(20,9): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/literals/literals.ts(25,10): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. ==== tests/cases/conformance/expressions/literals/literals.ts (6 errors) ==== diff --git a/tests/baselines/reference/logicalNotOperatorInvalidOperations.errors.txt b/tests/baselines/reference/logicalNotOperatorInvalidOperations.errors.txt index 3267d60a13a..07262962b08 100644 --- a/tests/baselines/reference/logicalNotOperatorInvalidOperations.errors.txt +++ b/tests/baselines/reference/logicalNotOperatorInvalidOperations.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorInvalidOperations.ts(5,17): error TS1005: ',' expected. tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorInvalidOperations.ts(5,18): error TS1109: Expression expected. -tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorInvalidOperations.ts(11,16): error TS1109: Expression expected. tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorInvalidOperations.ts(8,16): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorInvalidOperations.ts(11,16): error TS1109: Expression expected. ==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorInvalidOperations.ts (4 errors) ==== diff --git a/tests/baselines/reference/methodInAmbientClass1.errors.txt b/tests/baselines/reference/methodInAmbientClass1.errors.txt index 3bf8f8af12a..05183378a85 100644 --- a/tests/baselines/reference/methodInAmbientClass1.errors.txt +++ b/tests/baselines/reference/methodInAmbientClass1.errors.txt @@ -1,13 +1,13 @@ -tests/cases/compiler/methodInAmbientClass1.ts(2,20): error TS1037: A function implementation cannot be declared in an ambient context. tests/cases/compiler/methodInAmbientClass1.ts(2,12): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/compiler/methodInAmbientClass1.ts(2,20): error TS1184: An implementation cannot be declared in ambient contexts. ==== tests/cases/compiler/methodInAmbientClass1.ts (2 errors) ==== declare class Foo { fn(): boolean { - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~~~~~ !!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. } } \ No newline at end of file diff --git a/tests/baselines/reference/missingArgument1.errors.txt b/tests/baselines/reference/missingArgument1.errors.txt index 02911e3c9b5..ba2bb0892f2 100644 --- a/tests/baselines/reference/missingArgument1.errors.txt +++ b/tests/baselines/reference/missingArgument1.errors.txt @@ -1,16 +1,16 @@ -tests/cases/compiler/missingArgument1.ts(1,7): error TS1135: Argument expression expected. tests/cases/compiler/missingArgument1.ts(1,1): error TS2304: Cannot find name 'foo'. tests/cases/compiler/missingArgument1.ts(1,5): error TS2304: Cannot find name 'a'. +tests/cases/compiler/missingArgument1.ts(1,7): error TS1135: Argument expression expected. tests/cases/compiler/missingArgument1.ts(1,8): error TS2304: Cannot find name 'b'. ==== tests/cases/compiler/missingArgument1.ts (4 errors) ==== foo(a,,b); - -!!! error TS1135: Argument expression expected. ~~~ !!! error TS2304: Cannot find name 'foo'. ~ !!! error TS2304: Cannot find name 'a'. + +!!! error TS1135: Argument expression expected. ~ !!! error TS2304: Cannot find name 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/missingRequiredDeclare.d.errors.txt b/tests/baselines/reference/missingRequiredDeclare.d.errors.txt index 1e52fa92fe5..dc713c86d89 100644 --- a/tests/baselines/reference/missingRequiredDeclare.d.errors.txt +++ b/tests/baselines/reference/missingRequiredDeclare.d.errors.txt @@ -1,7 +1,10 @@ tests/cases/compiler/missingRequiredDeclare.d.ts(1,1): error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. +tests/cases/compiler/missingRequiredDeclare.d.ts(1,7): error TS1039: Initializers are not allowed in ambient contexts. -==== tests/cases/compiler/missingRequiredDeclare.d.ts (1 errors) ==== +==== tests/cases/compiler/missingRequiredDeclare.d.ts (2 errors) ==== var x = 1; ~~~ -!!! error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. \ No newline at end of file +!!! error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. \ No newline at end of file diff --git a/tests/baselines/reference/moduleKeywordRepeatError.errors.txt b/tests/baselines/reference/moduleKeywordRepeatError.errors.txt index d3f5924e193..d77acf4f4d1 100644 --- a/tests/baselines/reference/moduleKeywordRepeatError.errors.txt +++ b/tests/baselines/reference/moduleKeywordRepeatError.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/moduleKeywordRepeatError.ts(3,15): error TS1005: ';' expected. tests/cases/compiler/moduleKeywordRepeatError.ts(3,1): error TS2304: Cannot find name 'module'. +tests/cases/compiler/moduleKeywordRepeatError.ts(3,15): error TS1005: ';' expected. ==== tests/cases/compiler/moduleKeywordRepeatError.ts (2 errors) ==== // "module.module { }" should raise a syntax error module.module { } - ~ -!!! error TS1005: ';' expected. ~~~~~~ -!!! error TS2304: Cannot find name 'module'. \ No newline at end of file +!!! error TS2304: Cannot find name 'module'. + ~ +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt b/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt index ac59b71bbc3..3bc5689d170 100644 --- a/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt +++ b/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt @@ -1,13 +1,13 @@ tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(4,15): error TS1109: Expression expected. tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(4,25): error TS1005: '=' expected. tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(4,26): error TS1109: Expression expected. -tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(12,14): error TS1109: Expression expected. tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(7,17): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(7,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(8,17): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(8,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(9,17): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(9,29): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(12,14): error TS1109: Expression expected. ==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts (10 errors) ==== diff --git a/tests/baselines/reference/nestedClassDeclaration.errors.txt b/tests/baselines/reference/nestedClassDeclaration.errors.txt index f3145467231..f5c5e41ad99 100644 --- a/tests/baselines/reference/nestedClassDeclaration.errors.txt +++ b/tests/baselines/reference/nestedClassDeclaration.errors.txt @@ -3,9 +3,9 @@ tests/cases/conformance/classes/nestedClassDeclaration.ts(7,1): error TS1128: De tests/cases/conformance/classes/nestedClassDeclaration.ts(10,5): error TS1129: Statement expected. tests/cases/conformance/classes/nestedClassDeclaration.ts(12,1): error TS1128: Declaration or statement expected. tests/cases/conformance/classes/nestedClassDeclaration.ts(15,11): error TS1005: ':' expected. +tests/cases/conformance/classes/nestedClassDeclaration.ts(15,11): error TS2304: Cannot find name 'C4'. tests/cases/conformance/classes/nestedClassDeclaration.ts(15,14): error TS1005: ',' expected. tests/cases/conformance/classes/nestedClassDeclaration.ts(17,1): error TS1128: Declaration or statement expected. -tests/cases/conformance/classes/nestedClassDeclaration.ts(15,11): error TS2304: Cannot find name 'C4'. ==== tests/cases/conformance/classes/nestedClassDeclaration.ts (8 errors) ==== @@ -34,10 +34,10 @@ tests/cases/conformance/classes/nestedClassDeclaration.ts(15,11): error TS2304: class C4 { ~~ !!! error TS1005: ':' expected. - ~ -!!! error TS1005: ',' expected. ~~ !!! error TS2304: Cannot find name 'C4'. + ~ +!!! error TS1005: ',' expected. } } ~ diff --git a/tests/baselines/reference/newExpressionWithCast.errors.txt b/tests/baselines/reference/newExpressionWithCast.errors.txt index 858fd81f0ee..c8f44b96ae2 100644 --- a/tests/baselines/reference/newExpressionWithCast.errors.txt +++ b/tests/baselines/reference/newExpressionWithCast.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/newExpressionWithCast.ts(8,17): error TS1109: Expression expected. tests/cases/compiler/newExpressionWithCast.ts(4,12): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. tests/cases/compiler/newExpressionWithCast.ts(8,13): error TS2365: Operator '>' cannot be applied to types 'boolean' and 'void'. +tests/cases/compiler/newExpressionWithCast.ts(8,17): error TS1109: Expression expected. tests/cases/compiler/newExpressionWithCast.ts(8,18): error TS2304: Cannot find name 'any'. @@ -15,10 +15,10 @@ tests/cases/compiler/newExpressionWithCast.ts(8,18): error TS2304: Cannot find n function Test2() { } // parse error var test2 = new Test2(); - ~ -!!! error TS1109: Expression expected. ~~~~~~~~~~~~~~~~ !!! error TS2365: Operator '>' cannot be applied to types 'boolean' and 'void'. + ~ +!!! error TS1109: Expression expected. ~~~ !!! error TS2304: Cannot find name 'any'. diff --git a/tests/baselines/reference/newOperator.errors.txt b/tests/baselines/reference/newOperator.errors.txt index 33e2d806d3e..7998217f2e5 100644 --- a/tests/baselines/reference/newOperator.errors.txt +++ b/tests/baselines/reference/newOperator.errors.txt @@ -1,17 +1,18 @@ -tests/cases/compiler/newOperator.ts(18,20): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/newOperator.ts(22,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/newOperator.ts(44,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/newOperator.ts(3,13): error TS2304: Cannot find name 'ifc'. tests/cases/compiler/newOperator.ts(10,10): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/newOperator.ts(11,10): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/newOperator.ts(12,5): error TS2304: Cannot find name 'string'. tests/cases/compiler/newOperator.ts(18,14): error TS2304: Cannot find name 'string'. +tests/cases/compiler/newOperator.ts(18,20): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/compiler/newOperator.ts(21,1): error TS2304: Cannot find name 'string'. +tests/cases/compiler/newOperator.ts(22,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/compiler/newOperator.ts(28,13): error TS2304: Cannot find name 'q'. tests/cases/compiler/newOperator.ts(31,10): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +tests/cases/compiler/newOperator.ts(44,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/newOperator.ts(45,23): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -==== tests/cases/compiler/newOperator.ts (11 errors) ==== +==== tests/cases/compiler/newOperator.ts (12 errors) ==== interface ifc { } // Attempting to 'new' an interface yields poor error var i = new ifc(); @@ -38,10 +39,10 @@ tests/cases/compiler/newOperator.ts(31,10): error TS2351: Cannot use 'new' with // Various spacing var t3 = new string[]( ); - ~~ -!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~ !!! error TS2304: Cannot find name 'string'. + ~~ +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var t4 = new string @@ -80,6 +81,8 @@ tests/cases/compiler/newOperator.ts(31,10): error TS2351: Cannot use 'new' with ~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return new M.T[]; + ~~ +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. } } \ No newline at end of file diff --git a/tests/baselines/reference/noDefaultLib.errors.txt b/tests/baselines/reference/noDefaultLib.errors.txt index 02098950055..b8f42ba7c33 100644 --- a/tests/baselines/reference/noDefaultLib.errors.txt +++ b/tests/baselines/reference/noDefaultLib.errors.txt @@ -1,10 +1,10 @@ -error TS2318: Cannot find global type 'Boolean'. error TS2318: Cannot find global type 'IArguments'. +error TS2318: Cannot find global type 'Boolean'. tests/cases/compiler/noDefaultLib.ts(4,11): error TS2317: Global type 'Array' must have 1 type parameter(s). -!!! error TS2318: Cannot find global type 'Boolean'. !!! error TS2318: Cannot find global type 'IArguments'. +!!! error TS2318: Cannot find global type 'Boolean'. ==== tests/cases/compiler/noDefaultLib.ts (1 errors) ==== /// var x; diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt index bd9a0bcbc93..35673eb3072 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt @@ -1,10 +1,8 @@ +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(18,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(21,5): error TS2412: Property '3.0' of type 'MyNumber' is not assignable to numeric index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(23,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(26,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(36,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(90,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(93,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(18,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(21,5): error TS2412: Property '3.0' of type 'MyNumber' is not assignable to numeric index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(50,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(68,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo(): string; }' is not assignable to type '{ [x: number]: string; }'. @@ -12,6 +10,8 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo Type 'string | number' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(88,9): error TS2304: Cannot find name 'Myn'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(90,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(93,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts (11 errors) ==== diff --git a/tests/baselines/reference/numericNamedPropertyDuplicates.errors.txt b/tests/baselines/reference/numericNamedPropertyDuplicates.errors.txt index c5890d7c98c..1c5eeb36b27 100644 --- a/tests/baselines/reference/numericNamedPropertyDuplicates.errors.txt +++ b/tests/baselines/reference/numericNamedPropertyDuplicates.errors.txt @@ -1,4 +1,3 @@ -tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(20,5): error TS1005: ',' expected. tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(2,5): error TS2300: Duplicate identifier '1'. tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(3,5): error TS2300: Duplicate identifier '1.0'. tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(4,12): error TS2300: Duplicate identifier '2'. @@ -8,6 +7,7 @@ tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedP tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(14,5): error TS2300: Duplicate identifier '1'. tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(15,5): error TS2300: Duplicate identifier '1'. tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(19,5): error TS2300: Duplicate identifier '2'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(20,5): error TS1005: ',' expected. tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(20,5): error TS2300: Duplicate identifier '2'. diff --git a/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt b/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt index 89693f4bced..bd9e021494c 100644 --- a/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt +++ b/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/objectCreationExpressionInFunctionParameter.ts(6,2): error TS1128: Declaration or statement expected. tests/cases/compiler/objectCreationExpressionInFunctionParameter.ts(5,24): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/objectCreationExpressionInFunctionParameter.ts(6,2): error TS1128: Declaration or statement expected. ==== tests/cases/compiler/objectCreationExpressionInFunctionParameter.ts (2 errors) ==== diff --git a/tests/baselines/reference/objectLiteralErrors.errors.txt b/tests/baselines/reference/objectLiteralErrors.errors.txt index 97cbdc32266..19935f52bdc 100644 --- a/tests/baselines/reference/objectLiteralErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralErrors.errors.txt @@ -1,22 +1,3 @@ -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(17,19): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,22): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(24,23): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(25,22): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(26,25): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(27,23): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(28,22): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(29,24): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(30,24): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(31,24): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(32,25): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,25): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,23): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,23): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,23): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,23): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,27): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,26): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,46): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(3,12): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(3,18): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(4,12): error TS2300: Duplicate identifier 'a'. @@ -46,6 +27,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(15,19) tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(16,13): error TS2300: Duplicate identifier '0'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(16,19): error TS2300: Duplicate identifier '0x0'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(17,13): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(17,19): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(17,19): error TS2300: Duplicate identifier '000'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(18,13): error TS2300: Duplicate identifier '"100"'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(18,23): error TS2300: Duplicate identifier '1e2'. @@ -54,40 +36,58 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(19,22) tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(20,13): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(20,25): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,22): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,22): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(24,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(24,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(24,23): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(25,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(25,22): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(25,22): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(26,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(26,25): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(26,25): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(27,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(27,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(27,23): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(28,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(28,22): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(28,22): error TS2300: Duplicate identifier ''a''. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(29,12): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(29,24): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(29,24): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(30,12): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(30,24): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(30,24): error TS2300: Duplicate identifier '"a"'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(31,12): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(31,24): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(31,24): error TS2300: Duplicate identifier ''a''. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(32,13): error TS2300: Duplicate identifier '"a"'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(32,25): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(32,25): error TS2300: Duplicate identifier ''a''. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,13): error TS2300: Duplicate identifier '1.0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,25): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,25): error TS2300: Duplicate identifier ''1''. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,13): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,23): error TS2300: Duplicate identifier '0'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,13): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,23): error TS2300: Duplicate identifier '0'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,13): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,23): error TS2300: Duplicate identifier '0x0'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,13): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,23): error TS2300: Duplicate identifier '000'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,13): error TS2300: Duplicate identifier '"100"'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,27): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,27): error TS2300: Duplicate identifier '1e2'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,13): error TS2300: Duplicate identifier '0x20'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,26): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,26): error TS2300: Duplicate identifier '3.2e1'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,13): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,46): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,46): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,12): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,43): error TS2380: 'get' and 'set' accessor must have the same type. @@ -170,11 +170,11 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,51) ~~~ !!! error TS2300: Duplicate identifier '0x0'. var e14 = { 0: 0, 000: 0 }; - ~~~ -!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. ~ !!! error TS2300: Duplicate identifier '0'. ~~~ +!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier '000'. var e15 = { "100": 0, 1e2: 0 }; ~~~~~ @@ -194,130 +194,130 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,51) // Accessor and property with the same name var f1 = { a: 0, get a() { return 0; } }; - ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~ !!! error TS2300: Duplicate identifier 'a'. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier 'a'. var f2 = { a: '', get a() { return ''; } }; - ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~ !!! error TS2300: Duplicate identifier 'a'. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier 'a'. var f3 = { a: 0, get a() { return ''; } }; - ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~ !!! error TS2300: Duplicate identifier 'a'. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier 'a'. var f4 = { a: true, get a() { return false; } }; - ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~ !!! error TS2300: Duplicate identifier 'a'. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier 'a'. var f5 = { a: {}, get a() { return {}; } }; - ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~ !!! error TS2300: Duplicate identifier 'a'. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier 'a'. var f6 = { a: 0, get 'a'() { return 0; } }; - ~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~ !!! error TS2300: Duplicate identifier 'a'. ~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ !!! error TS2300: Duplicate identifier ''a''. var f7 = { 'a': 0, get a() { return 0; } }; - ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~~~ !!! error TS2300: Duplicate identifier ''a''. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier 'a'. var f8 = { 'a': 0, get "a"() { return 0; } }; - ~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~~~ !!! error TS2300: Duplicate identifier ''a''. ~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ !!! error TS2300: Duplicate identifier '"a"'. var f9 = { 'a': 0, get 'a'() { return 0; } }; - ~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~~~ !!! error TS2300: Duplicate identifier ''a''. ~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ !!! error TS2300: Duplicate identifier ''a''. var f10 = { "a": 0, get 'a'() { return 0; } }; - ~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~~~ !!! error TS2300: Duplicate identifier '"a"'. ~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ !!! error TS2300: Duplicate identifier ''a''. var f11 = { 1.0: 0, get '1'() { return 0; } }; - ~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~~~ !!! error TS2300: Duplicate identifier '1.0'. ~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ !!! error TS2300: Duplicate identifier ''1''. var f12 = { 0: 0, get 0() { return 0; } }; - ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~ !!! error TS2300: Duplicate identifier '0'. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier '0'. var f13 = { 0: 0, get 0() { return 0; } }; - ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~ !!! error TS2300: Duplicate identifier '0'. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier '0'. var f14 = { 0: 0, get 0x0() { return 0; } }; - ~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~ !!! error TS2300: Duplicate identifier '0'. ~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ !!! error TS2300: Duplicate identifier '0x0'. var f14 = { 0: 0, get 000() { return 0; } }; - ~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~ !!! error TS2300: Duplicate identifier '0'. ~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ !!! error TS2300: Duplicate identifier '000'. var f15 = { "100": 0, get 1e2() { return 0; } }; - ~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~~~~~ !!! error TS2300: Duplicate identifier '"100"'. ~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ !!! error TS2300: Duplicate identifier '1e2'. var f16 = { 0x20: 0, get 3.2e1() { return 0; } }; - ~~~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~~~~ !!! error TS2300: Duplicate identifier '0x20'. ~~~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~~~ !!! error TS2300: Duplicate identifier '3.2e1'. var f17 = { a: 0, get b() { return 1; }, get a() { return 0; } }; - ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. ~ !!! error TS2300: Duplicate identifier 'a'. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier 'a'. // Get and set accessor with mismatched type annotations diff --git a/tests/baselines/reference/objectLiteralMemberWithModifiers1.js b/tests/baselines/reference/objectLiteralMemberWithModifiers1.js new file mode 100644 index 00000000000..8b8c76be518 --- /dev/null +++ b/tests/baselines/reference/objectLiteralMemberWithModifiers1.js @@ -0,0 +1,6 @@ +//// [objectLiteralMemberWithModifiers1.ts] +var v = { public foo() { } } + +//// [objectLiteralMemberWithModifiers1.js] +var v = { foo: function () { +} }; diff --git a/tests/baselines/reference/objectLiteralMemberWithModifiers2.js b/tests/baselines/reference/objectLiteralMemberWithModifiers2.js new file mode 100644 index 00000000000..fd8e0a68430 --- /dev/null +++ b/tests/baselines/reference/objectLiteralMemberWithModifiers2.js @@ -0,0 +1,6 @@ +//// [objectLiteralMemberWithModifiers2.ts] +var v = { public get foo() { } } + +//// [objectLiteralMemberWithModifiers2.js] +var v = { get foo() { +} }; diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt index 2db47d0f7ae..ef762013989 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(5,16): error TS1131: Property or signature expected. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(5,25): error TS1128: Declaration or statement expected. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(6,53): error TS1005: ';' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(4,5): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'. Property 'b' is missing in type '{ name: string; id: number; }'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(5,16): error TS1131: Property or signature expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(5,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(5,25): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(6,53): error TS1005: ';' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(6,79): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ id: string; name: number; }'. Types of property 'id' are incompatible. Type 'number' is not assignable to type 'string'. @@ -23,10 +23,10 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr var person1: { name, id }; // error: can't use short-hand property assignment in type position ~~~~ !!! error TS1131: Property or signature expected. - ~ -!!! error TS1128: Declaration or statement expected. ~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'. + ~ +!!! error TS1128: Declaration or statement expected. function foo(name: string, id: number): { id: string, name: number } { return { name, id }; } // error ~ !!! error TS1005: ';' expected. diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt index 708bbb0935f..b10ef656cd0 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt @@ -1,17 +1,17 @@ -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(5,55): error TS1005: ';' expected. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(6,55): error TS1005: ';' expected. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(7,16): error TS1131: Property or signature expected. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(7,25): error TS1128: Declaration or statement expected. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(8,28): error TS1005: ';' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(4,5): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'. Property 'b' is missing in type '{ name: string; id: number; }'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(5,55): error TS1005: ';' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(5,79): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ name: number; id: string; }'. Types of property 'name' are incompatible. Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(6,55): error TS1005: ';' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(7,16): error TS1131: Property or signature expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(7,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(7,25): error TS1128: Declaration or statement expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(8,5): error TS2322: Type '{ name: number; id: string; }' is not assignable to type '{ name: string; id: number; }'. Types of property 'name' are incompatible. Type 'number' is not assignable to type 'string'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(8,28): error TS1005: ';' expected. ==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts (9 errors) ==== @@ -35,14 +35,14 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr var person1: { name, id }; // error : Can't use shorthand in the type position ~~~~ !!! error TS1131: Property or signature expected. - ~ -!!! error TS1128: Declaration or statement expected. ~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'. + ~ +!!! error TS1128: Declaration or statement expected. var person2: { name: string, id: number } = bar("hello", 5); - ~ -!!! error TS1005: ';' expected. ~~~~~~~ !!! error TS2322: Type '{ name: number; id: string; }' is not assignable to type '{ name: string; id: number; }'. !!! error TS2322: Types of property 'name' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'string'. + ~ +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt index cc92b9a0381..80bfb49883b 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt @@ -7,13 +7,13 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(9,8): error TS1005: ':' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(10,10): error TS1005: ':' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(12,1): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(15,5): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(15,6): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(16,5): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(16,6): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(17,5): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(17,6): error TS1005: ':' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(20,17): error TS1005: ':' expected. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(15,5): error TS2300: Duplicate identifier 'a'. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(16,5): error TS2300: Duplicate identifier 'a'. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(17,5): error TS2300: Duplicate identifier 'a'. ==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts (16 errors) ==== @@ -50,20 +50,20 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr var x = { a.b, - ~ -!!! error TS1005: ':' expected. ~ !!! error TS2300: Duplicate identifier 'a'. + ~ +!!! error TS1005: ':' expected. a["ss"], - ~ -!!! error TS1005: ':' expected. ~ !!! error TS2300: Duplicate identifier 'a'. + ~ +!!! error TS1005: ':' expected. a[1], - ~ -!!! error TS1005: ':' expected. ~ !!! error TS2300: Duplicate identifier 'a'. + ~ +!!! error TS1005: ':' expected. }; var v = { class }; // error diff --git a/tests/baselines/reference/optionalParamArgsTest.errors.txt b/tests/baselines/reference/optionalParamArgsTest.errors.txt index a8ce88e494e..3c4d2e37be9 100644 --- a/tests/baselines/reference/optionalParamArgsTest.errors.txt +++ b/tests/baselines/reference/optionalParamArgsTest.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/optionalParamArgsTest.ts(35,47): error TS1016: A required parameter cannot follow an optional parameter. tests/cases/compiler/optionalParamArgsTest.ts(31,12): error TS2393: Duplicate function implementation. tests/cases/compiler/optionalParamArgsTest.ts(35,12): error TS2393: Duplicate function implementation. +tests/cases/compiler/optionalParamArgsTest.ts(35,47): error TS1016: A required parameter cannot follow an optional parameter. tests/cases/compiler/optionalParamArgsTest.ts(99,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/optionalParamArgsTest.ts(100,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/optionalParamArgsTest.ts(101,1): error TS2346: Supplied parameters do not match any signature of call target. @@ -61,10 +61,10 @@ tests/cases/compiler/optionalParamArgsTest.ts(118,1): error TS2346: Supplied par // Negative test // "Optional parameters may only be followed by other optional parameters" public C1M5(C1M5A1:number,C1M5A2:number=0,C1M5A3:number) { return C1M5A1 + C1M5A2; } - ~~~~~~ -!!! error TS1016: A required parameter cannot follow an optional parameter. ~~~~ !!! error TS2393: Duplicate function implementation. + ~~~~~~ +!!! error TS1016: A required parameter cannot follow an optional parameter. } class C2 extends C1 { diff --git a/tests/baselines/reference/optionalPropertiesSyntax.errors.txt b/tests/baselines/reference/optionalPropertiesSyntax.errors.txt index daeb7c7a268..f0a9995ba6f 100644 --- a/tests/baselines/reference/optionalPropertiesSyntax.errors.txt +++ b/tests/baselines/reference/optionalPropertiesSyntax.errors.txt @@ -1,15 +1,15 @@ +tests/cases/compiler/optionalPropertiesSyntax.ts(4,5): error TS2386: Overload signatures must all be optional or required. tests/cases/compiler/optionalPropertiesSyntax.ts(11,7): error TS1005: ';' expected. tests/cases/compiler/optionalPropertiesSyntax.ts(11,8): error TS1131: Property or signature expected. tests/cases/compiler/optionalPropertiesSyntax.ts(12,5): error TS1131: Property or signature expected. tests/cases/compiler/optionalPropertiesSyntax.ts(18,11): error TS1005: ';' expected. tests/cases/compiler/optionalPropertiesSyntax.ts(18,12): error TS1131: Property or signature expected. -tests/cases/compiler/optionalPropertiesSyntax.ts(32,18): error TS1005: ';' expected. -tests/cases/compiler/optionalPropertiesSyntax.ts(32,19): error TS1131: Property or signature expected. -tests/cases/compiler/optionalPropertiesSyntax.ts(33,5): error TS1131: Property or signature expected. -tests/cases/compiler/optionalPropertiesSyntax.ts(4,5): error TS2386: Overload signatures must all be optional or required. tests/cases/compiler/optionalPropertiesSyntax.ts(24,5): error TS2300: Duplicate identifier 'prop'. tests/cases/compiler/optionalPropertiesSyntax.ts(25,5): error TS2300: Duplicate identifier 'prop'. tests/cases/compiler/optionalPropertiesSyntax.ts(32,5): error TS2375: Duplicate number index signature. +tests/cases/compiler/optionalPropertiesSyntax.ts(32,18): error TS1005: ';' expected. +tests/cases/compiler/optionalPropertiesSyntax.ts(32,19): error TS1131: Property or signature expected. +tests/cases/compiler/optionalPropertiesSyntax.ts(33,5): error TS1131: Property or signature expected. tests/cases/compiler/optionalPropertiesSyntax.ts(33,7): error TS2375: Duplicate number index signature. tests/cases/compiler/optionalPropertiesSyntax.ts(34,5): error TS2375: Duplicate number index signature. @@ -63,12 +63,12 @@ tests/cases/compiler/optionalPropertiesSyntax.ts(34,5): error TS2375: Duplicate //Index signatures can't be optional [idx: number]: any; [idx: number]?: any; //err + ~~~~~~~~~~~~~ +!!! error TS2375: Duplicate number index signature. ~ !!! error TS1005: ';' expected. ~ !!! error TS1131: Property or signature expected. - ~~~~~~~~~~~~~ -!!! error TS2375: Duplicate number index signature. ? [idx: number]: any; //err ~ !!! error TS1131: Property or signature expected. diff --git a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt index 70530d409b3..079951880ab 100644 --- a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt +++ b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(1,37): error TS1005: ';' expected. tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(1,8): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(1,37): error TS1005: ';' expected. ==== tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts (2 errors) ==== var f: (x: 'hi') => number = ('hi') => { return 1; }; - ~~ -!!! error TS1005: ';' expected. ~~~~~~~~~~~~~~~~~~~ -!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. \ No newline at end of file +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + ~~ +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/overloadingStaticFunctionsInFunctions.errors.txt b/tests/baselines/reference/overloadingStaticFunctionsInFunctions.errors.txt index 7d101598129..e340e5596cd 100644 --- a/tests/baselines/reference/overloadingStaticFunctionsInFunctions.errors.txt +++ b/tests/baselines/reference/overloadingStaticFunctionsInFunctions.errors.txt @@ -1,17 +1,17 @@ tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(1,14): error TS1005: '(' expected. tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(2,3): error TS1129: Statement expected. -tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,3): error TS1129: Statement expected. -tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,19): error TS1005: ',' expected. -tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,3): error TS1129: Statement expected. -tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,20): error TS1109: Expression expected. -tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,25): error TS1005: ';' expected. tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(2,10): error TS2304: Cannot find name 'test'. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,3): error TS1129: Statement expected. tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,10): error TS2304: Cannot find name 'test'. tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,15): error TS2304: Cannot find name 'name'. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,19): error TS1005: ',' expected. tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,20): error TS2304: Cannot find name 'string'. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,3): error TS1129: Statement expected. tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,10): error TS2304: Cannot find name 'test'. tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,15): error TS2304: Cannot find name 'name'. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,20): error TS1109: Expression expected. tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,21): error TS2304: Cannot find name 'any'. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,25): error TS1005: ';' expected. ==== tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts (14 errors) ==== @@ -26,25 +26,25 @@ tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,21): error TS230 static test(name:string) ~~~~~~ !!! error TS1129: Statement expected. - ~ -!!! error TS1005: ',' expected. ~~~~ !!! error TS2304: Cannot find name 'test'. ~~~~ !!! error TS2304: Cannot find name 'name'. + ~ +!!! error TS1005: ',' expected. ~~~~~~ !!! error TS2304: Cannot find name 'string'. static test(name?:any){ } ~~~~~~ !!! error TS1129: Statement expected. - ~ -!!! error TS1109: Expression expected. - ~ -!!! error TS1005: ';' expected. ~~~~ !!! error TS2304: Cannot find name 'test'. ~~~~ !!! error TS2304: Cannot find name 'name'. + ~ +!!! error TS1109: Expression expected. ~~~ !!! error TS2304: Cannot find name 'any'. + ~ +!!! error TS1005: ';' expected. } \ No newline at end of file diff --git a/tests/baselines/reference/parseErrorInHeritageClause1.errors.txt b/tests/baselines/reference/parseErrorInHeritageClause1.errors.txt index 944cdd78e24..67564442b3a 100644 --- a/tests/baselines/reference/parseErrorInHeritageClause1.errors.txt +++ b/tests/baselines/reference/parseErrorInHeritageClause1.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/parseErrorInHeritageClause1.ts(1,19): error TS1127: Invalid character. tests/cases/compiler/parseErrorInHeritageClause1.ts(1,17): error TS2304: Cannot find name 'A'. +tests/cases/compiler/parseErrorInHeritageClause1.ts(1,19): error TS1127: Invalid character. ==== tests/cases/compiler/parseErrorInHeritageClause1.ts (2 errors) ==== class C extends A # { - -!!! error TS1127: Invalid character. ~ !!! error TS2304: Cannot find name 'A'. + +!!! error TS1127: Invalid character. } \ No newline at end of file diff --git a/tests/baselines/reference/parser0_004152.errors.txt b/tests/baselines/reference/parser0_004152.errors.txt index cfd6161a48e..97b9bfe34a6 100644 --- a/tests/baselines/reference/parser0_004152.errors.txt +++ b/tests/baselines/reference/parser0_004152.errors.txt @@ -1,38 +1,38 @@ tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(1,14): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,28): error TS2304: Cannot find name 'DisplayPosition'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,45): error TS1137: Expression or comma expected. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,46): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,48): error TS2300: Duplicate identifier '3'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,49): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,51): error TS2300: Duplicate identifier '3'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,52): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,54): error TS2300: Duplicate identifier '3'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,55): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,57): error TS2300: Duplicate identifier '3'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,58): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,60): error TS2300: Duplicate identifier '3'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,61): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,63): error TS2300: Duplicate identifier '0'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,64): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,66): error TS2300: Duplicate identifier '3'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,67): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,69): error TS2300: Duplicate identifier '3'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,70): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,72): error TS2300: Duplicate identifier '3'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,73): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,75): error TS2300: Duplicate identifier '3'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,76): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,78): error TS2300: Duplicate identifier '3'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,79): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,81): error TS2300: Duplicate identifier '3'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,82): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,84): error TS2300: Duplicate identifier '0'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,85): error TS1005: ';' expected. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,86): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,94): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,96): error TS2300: Duplicate identifier '0'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,97): error TS1005: ';' expected. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,98): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,28): error TS2304: Cannot find name 'DisplayPosition'. -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,48): error TS2300: Duplicate identifier '3'. -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,51): error TS2300: Duplicate identifier '3'. -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,54): error TS2300: Duplicate identifier '3'. -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,57): error TS2300: Duplicate identifier '3'. -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,60): error TS2300: Duplicate identifier '3'. -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,63): error TS2300: Duplicate identifier '0'. -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,66): error TS2300: Duplicate identifier '3'. -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,69): error TS2300: Duplicate identifier '3'. -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,72): error TS2300: Duplicate identifier '3'. -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,75): error TS2300: Duplicate identifier '3'. -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,78): error TS2300: Duplicate identifier '3'. -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,81): error TS2300: Duplicate identifier '3'. -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,84): error TS2300: Duplicate identifier '0'. -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,96): error TS2300: Duplicate identifier '0'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(3,25): error TS2304: Cannot find name 'SeedCoords'. @@ -41,74 +41,74 @@ tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(3,25): error T ~~~~ !!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. private position = new DisplayPosition([), 3, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 3, 0], NoMove, 0); + ~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'DisplayPosition'. ~ !!! error TS1137: Expression or comma expected. ~ !!! error TS1005: ';' expected. + ~ +!!! error TS2300: Duplicate identifier '3'. ~ !!! error TS1005: ';' expected. + ~ +!!! error TS2300: Duplicate identifier '3'. ~ !!! error TS1005: ';' expected. + ~ +!!! error TS2300: Duplicate identifier '3'. ~ !!! error TS1005: ';' expected. + ~ +!!! error TS2300: Duplicate identifier '3'. ~ !!! error TS1005: ';' expected. + ~ +!!! error TS2300: Duplicate identifier '3'. ~ !!! error TS1005: ';' expected. + ~ +!!! error TS2300: Duplicate identifier '0'. ~ !!! error TS1005: ';' expected. + ~ +!!! error TS2300: Duplicate identifier '3'. ~ !!! error TS1005: ';' expected. + ~ +!!! error TS2300: Duplicate identifier '3'. ~ !!! error TS1005: ';' expected. + ~ +!!! error TS2300: Duplicate identifier '3'. ~ !!! error TS1005: ';' expected. + ~ +!!! error TS2300: Duplicate identifier '3'. ~ !!! error TS1005: ';' expected. + ~ +!!! error TS2300: Duplicate identifier '3'. ~ !!! error TS1005: ';' expected. + ~ +!!! error TS2300: Duplicate identifier '3'. ~ !!! error TS1005: ';' expected. + ~ +!!! error TS2300: Duplicate identifier '0'. ~ !!! error TS1005: ';' expected. ~ !!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. ~ !!! error TS1005: ';' expected. + ~ +!!! error TS2300: Duplicate identifier '0'. ~ !!! error TS1005: ';' expected. ~ !!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'DisplayPosition'. - ~ -!!! error TS2300: Duplicate identifier '3'. - ~ -!!! error TS2300: Duplicate identifier '3'. - ~ -!!! error TS2300: Duplicate identifier '3'. - ~ -!!! error TS2300: Duplicate identifier '3'. - ~ -!!! error TS2300: Duplicate identifier '3'. - ~ -!!! error TS2300: Duplicate identifier '0'. - ~ -!!! error TS2300: Duplicate identifier '3'. - ~ -!!! error TS2300: Duplicate identifier '3'. - ~ -!!! error TS2300: Duplicate identifier '3'. - ~ -!!! error TS2300: Duplicate identifier '3'. - ~ -!!! error TS2300: Duplicate identifier '3'. - ~ -!!! error TS2300: Duplicate identifier '3'. - ~ -!!! error TS2300: Duplicate identifier '0'. - ~ -!!! error TS2300: Duplicate identifier '0'. private prevConfig: SeedCoords[][]; ~~~~~~~~~~ !!! error TS2304: Cannot find name 'SeedCoords'. diff --git a/tests/baselines/reference/parser10.1.1-8gs.errors.txt b/tests/baselines/reference/parser10.1.1-8gs.errors.txt index 459ad40ab72..c396c982bb8 100644 --- a/tests/baselines/reference/parser10.1.1-8gs.errors.txt +++ b/tests/baselines/reference/parser10.1.1-8gs.errors.txt @@ -1,7 +1,7 @@ +tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(16,7): error TS2304: Cannot find name 'NotEarlyError'. tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,5): error TS1134: Variable declaration expected. tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,12): error TS1134: Variable declaration expected. tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,14): error TS1134: Variable declaration expected. -tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(16,7): error TS2304: Cannot find name 'NotEarlyError'. ==== tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts (4 errors) ==== diff --git a/tests/baselines/reference/parser509698.errors.txt b/tests/baselines/reference/parser509698.errors.txt index 2aaaec18dc2..85485dd6501 100644 --- a/tests/baselines/reference/parser509698.errors.txt +++ b/tests/baselines/reference/parser509698.errors.txt @@ -1,21 +1,21 @@ -error TS2318: Cannot find global type 'Array'. -error TS2318: Cannot find global type 'Boolean'. -error TS2318: Cannot find global type 'Function'. -error TS2318: Cannot find global type 'IArguments'. -error TS2318: Cannot find global type 'Number'. -error TS2318: Cannot find global type 'Object'. -error TS2318: Cannot find global type 'RegExp'. error TS2318: Cannot find global type 'String'. +error TS2318: Cannot find global type 'RegExp'. +error TS2318: Cannot find global type 'Object'. +error TS2318: Cannot find global type 'Number'. +error TS2318: Cannot find global type 'IArguments'. +error TS2318: Cannot find global type 'Function'. +error TS2318: Cannot find global type 'Boolean'. +error TS2318: Cannot find global type 'Array'. -!!! error TS2318: Cannot find global type 'Array'. -!!! error TS2318: Cannot find global type 'Boolean'. -!!! error TS2318: Cannot find global type 'Function'. -!!! error TS2318: Cannot find global type 'IArguments'. -!!! error TS2318: Cannot find global type 'Number'. -!!! error TS2318: Cannot find global type 'Object'. -!!! error TS2318: Cannot find global type 'RegExp'. !!! error TS2318: Cannot find global type 'String'. +!!! error TS2318: Cannot find global type 'RegExp'. +!!! error TS2318: Cannot find global type 'Object'. +!!! error TS2318: Cannot find global type 'Number'. +!!! error TS2318: Cannot find global type 'IArguments'. +!!! error TS2318: Cannot find global type 'Function'. +!!! error TS2318: Cannot find global type 'Boolean'. +!!! error TS2318: Cannot find global type 'Array'. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509698.ts (0 errors) ==== ///