diff --git a/bin/tsc.js b/bin/tsc.js index f8d31c0153..df74c76f50 100644 --- a/bin/tsc.js +++ b/bin/tsc.js @@ -2806,13 +2806,12 @@ var ts; if (matchResult) { var start = commentRange.pos; var end = commentRange.end; - var fileRef = { - pos: start, - end: end, - filename: matchResult[3] - }; return { - fileReference: fileRef, + fileReference: { + pos: start, + end: end, + filename: matchResult[3] + }, isNoDefaultLib: false }; } @@ -9063,25 +9062,25 @@ var ts; diagnostics.sort(ts.compareDiagnostics); diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); var hasEmitterError = ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1 /* Error */; }); - var returnCode; + var emitResultStatus; if (isEmitBlocked) { - returnCode = 1 /* AllOutputGenerationSkipped */; + emitResultStatus = 1 /* AllOutputGenerationSkipped */; } else if (hasEmitterError) { - returnCode = 4 /* EmitErrorsEncountered */; + emitResultStatus = 4 /* EmitErrorsEncountered */; } else if (hasSemanticErrors && compilerOptions.declaration) { - returnCode = 3 /* DeclarationGenerationSkipped */; + emitResultStatus = 3 /* DeclarationGenerationSkipped */; } else if (hasSemanticErrors && !compilerOptions.declaration) { - returnCode = 2 /* JSGeneratedWithSemanticErrors */; + emitResultStatus = 2 /* JSGeneratedWithSemanticErrors */; } else { - returnCode = 0 /* Succeeded */; + emitResultStatus = 0 /* Succeeded */; } return { - emitResultStatus: returnCode, - errors: diagnostics, + emitResultStatus: emitResultStatus, + diagnostics: diagnostics, sourceMaps: sourceMapDataList }; } @@ -9140,14 +9139,16 @@ var ts; var compilerOptions = program.getCompilerOptions(); var checker = { getProgram: function () { return program; }, - getDiagnostics: getDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, getNodeCount: function () { return ts.sum(program.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(program.getSourceFiles(), "identifierCount"); }, getSymbolCount: function () { return ts.sum(program.getSourceFiles(), "symbolCount"); }, getTypeCount: function () { return typeCount; }, + isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, + isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + getDiagnostics: getDiagnostics, + getGlobalDiagnostics: getGlobalDiagnostics, checkProgram: checkProgram, - emitFiles: invokeEmitter, + invokeEmitter: invokeEmitter, getParentOfSymbol: getParentOfSymbol, getNarrowedTypeOfSymbol: getNarrowedTypeOfSymbol, getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, @@ -9173,8 +9174,6 @@ var ts; getSignatureFromDeclaration: getSignatureFromDeclaration, isImplementationOfOverload: isImplementationOfOverload, getAliasedSymbol: resolveImport, - isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, - isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, hasEarlyErrors: hasEarlyErrors, isEmitBlocked: isEmitBlocked }; @@ -16864,8 +16863,8 @@ var ts; } else { var emitStart = new Date().getTime(); - var emitOutput = checker.emitFiles(); - var emitErrors = emitOutput.errors; + var emitOutput = checker.invokeEmitter(); + var emitErrors = emitOutput.diagnostics; exitStatus = emitOutput.emitResultStatus; var reportStart = new Date().getTime(); errors = ts.concatenate(errors, emitErrors); diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index c95e38c7b9..ca2b7ec031 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -2611,13 +2611,12 @@ var ts; if (matchResult) { var start = commentRange.pos; var end = commentRange.end; - var fileRef = { - pos: start, - end: end, - filename: matchResult[3] - }; return { - fileReference: fileRef, + fileReference: { + pos: start, + end: end, + filename: matchResult[3] + }, isNoDefaultLib: false }; } @@ -8868,25 +8867,25 @@ var ts; diagnostics.sort(ts.compareDiagnostics); diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); var hasEmitterError = ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1 /* Error */; }); - var returnCode; + var emitResultStatus; if (isEmitBlocked) { - returnCode = 1 /* AllOutputGenerationSkipped */; + emitResultStatus = 1 /* AllOutputGenerationSkipped */; } else if (hasEmitterError) { - returnCode = 4 /* EmitErrorsEncountered */; + emitResultStatus = 4 /* EmitErrorsEncountered */; } else if (hasSemanticErrors && compilerOptions.declaration) { - returnCode = 3 /* DeclarationGenerationSkipped */; + emitResultStatus = 3 /* DeclarationGenerationSkipped */; } else if (hasSemanticErrors && !compilerOptions.declaration) { - returnCode = 2 /* JSGeneratedWithSemanticErrors */; + emitResultStatus = 2 /* JSGeneratedWithSemanticErrors */; } else { - returnCode = 0 /* Succeeded */; + emitResultStatus = 0 /* Succeeded */; } return { - emitResultStatus: returnCode, - errors: diagnostics, + emitResultStatus: emitResultStatus, + diagnostics: diagnostics, sourceMaps: sourceMapDataList }; } @@ -8945,14 +8944,16 @@ var ts; var compilerOptions = program.getCompilerOptions(); var checker = { getProgram: function () { return program; }, - getDiagnostics: getDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, getNodeCount: function () { return ts.sum(program.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(program.getSourceFiles(), "identifierCount"); }, getSymbolCount: function () { return ts.sum(program.getSourceFiles(), "symbolCount"); }, getTypeCount: function () { return typeCount; }, + isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, + isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + getDiagnostics: getDiagnostics, + getGlobalDiagnostics: getGlobalDiagnostics, checkProgram: checkProgram, - emitFiles: invokeEmitter, + invokeEmitter: invokeEmitter, getParentOfSymbol: getParentOfSymbol, getNarrowedTypeOfSymbol: getNarrowedTypeOfSymbol, getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, @@ -8978,8 +8979,6 @@ var ts; getSignatureFromDeclaration: getSignatureFromDeclaration, isImplementationOfOverload: isImplementationOfOverload, getAliasedSymbol: resolveImport, - isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, - isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, hasEarlyErrors: hasEarlyErrors, isEmitBlocked: isEmitBlocked }; @@ -16739,33 +16738,33 @@ var ts; var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeInfoResolver, callTargetSymbol, undefined, undefined); var items = ts.map(candidates, function (candidateSignature) { var signatureHelpParameters; - var prefixParts = []; - var suffixParts = []; + var prefixDisplayParts = []; + var suffixDisplayParts = []; if (callTargetDisplayParts) { - prefixParts.push.apply(prefixParts, callTargetDisplayParts); + prefixDisplayParts.push.apply(prefixDisplayParts, callTargetDisplayParts); } if (isTypeParameterHelp) { - prefixParts.push(ts.punctuationPart(23 /* LessThanToken */)); + prefixDisplayParts.push(ts.punctuationPart(23 /* LessThanToken */)); var typeParameters = candidateSignature.typeParameters; signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray; - suffixParts.push(ts.punctuationPart(24 /* GreaterThanToken */)); + suffixDisplayParts.push(ts.punctuationPart(24 /* GreaterThanToken */)); var parameterParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, argumentListOrTypeArgumentList); }); - suffixParts.push.apply(suffixParts, parameterParts); + suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts); } else { var typeParameterParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, argumentListOrTypeArgumentList); }); - prefixParts.push.apply(prefixParts, typeParameterParts); - prefixParts.push(ts.punctuationPart(15 /* OpenParenToken */)); + prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts); + prefixDisplayParts.push(ts.punctuationPart(15 /* OpenParenToken */)); var parameters = candidateSignature.parameters; signatureHelpParameters = parameters.length > 0 ? ts.map(parameters, createSignatureHelpParameterForParameter) : emptyArray; - suffixParts.push(ts.punctuationPart(16 /* CloseParenToken */)); + suffixDisplayParts.push(ts.punctuationPart(16 /* CloseParenToken */)); } var returnTypeParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, argumentListOrTypeArgumentList); }); - suffixParts.push.apply(suffixParts, returnTypeParts); + suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts); return { isVariadic: candidateSignature.hasRestParameter, - prefixDisplayParts: prefixParts, - suffixDisplayParts: suffixParts, + prefixDisplayParts: prefixDisplayParts, + suffixDisplayParts: suffixDisplayParts, separatorDisplayParts: [ts.punctuationPart(22 /* CommaToken */), ts.spacePart()], parameters: signatureHelpParameters, documentation: candidateSignature.getDocumentationComment() @@ -16865,15 +16864,15 @@ var ts; } ts.startEndOverlapsWithStartEnd = startEndOverlapsWithStartEnd; function findListItemInfo(node) { - var syntaxList = findContainingList(node); - if (!syntaxList) { + var list = findContainingList(node); + if (!list) { return undefined; } - var children = syntaxList.getChildren(); - var index = ts.indexOf(children, node); + var children = list.getChildren(); + var listItemIndex = ts.indexOf(children, node); return { - listItemIndex: index, - list: syntaxList + listItemIndex: listItemIndex, + list: list }; } ts.findListItemInfo = findListItemInfo; @@ -20503,7 +20502,7 @@ var ts; var savedWriter = writer; writer = function (filename, data, writeByteOrderMark) { }; - allDiagnostics = allDiagnostics.concat(checker.emitFiles(targetSourceFile).errors); + allDiagnostics = allDiagnostics.concat(checker.invokeEmitter(targetSourceFile).diagnostics); writer = savedWriter; } return allDiagnostics; @@ -22267,7 +22266,7 @@ var ts; writer = undefined; return emitOutput; } - var emitFilesResult = getFullTypeCheckChecker().emitFiles(targetSourceFile); + var emitFilesResult = getFullTypeCheckChecker().invokeEmitter(targetSourceFile); emitOutput.emitOutputStatus = emitFilesResult.emitResultStatus; writer = undefined; return emitOutput; @@ -22829,7 +22828,6 @@ var ts; getDefinitionAtPosition: getDefinitionAtPosition, getReferencesAtPosition: getReferencesAtPosition, getOccurrencesAtPosition: getOccurrencesAtPosition, - getImplementorsAtPosition: function (filename, position) { return []; }, getNameOrDottedNameSpan: getNameOrDottedNameSpan, getBreakpointStatementAtPosition: getBreakpointStatementAtPosition, getNavigateToItems: getNavigateToItems, @@ -23049,9 +23047,7 @@ var ts; return 5 /* Identifier */; } } - return { - getClassificationsForLine: getClassificationsForLine - }; + return { getClassificationsForLine: getClassificationsForLine }; } ts.createClassifier = createClassifier; function initializeServices() { @@ -23774,12 +23770,6 @@ var ts; return _this.languageService.getOccurrencesAtPosition(fileName, position); }); }; - LanguageServiceShimObject.prototype.getImplementorsAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getImplementorsAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getImplementorsAtPosition(fileName, position); - }); - }; LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, isMemberCompletion) { var _this = this; return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + isMemberCompletion + ")", function () { diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index b947a271be..117422366a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -75,43 +75,43 @@ module ts { var checker: TypeChecker = { getProgram: () => program, - getDiagnostics: getDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, getNodeCount: () => sum(program.getSourceFiles(), "nodeCount"), getIdentifierCount: () => sum(program.getSourceFiles(), "identifierCount"), getSymbolCount: () => sum(program.getSourceFiles(), "symbolCount"), getTypeCount: () => typeCount, - checkProgram: checkProgram, - emitFiles: invokeEmitter, - getParentOfSymbol: getParentOfSymbol, - getNarrowedTypeOfSymbol: getNarrowedTypeOfSymbol, - getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, - getPropertiesOfType: getPropertiesOfType, - getPropertyOfType: getPropertyOfType, - getSignaturesOfType: getSignaturesOfType, - getIndexTypeOfType: getIndexTypeOfType, - getReturnTypeOfSignature: getReturnTypeOfSignature, - getSymbolsInScope: getSymbolsInScope, - getSymbolInfo: getSymbolInfo, - getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol, - getTypeOfNode: getTypeOfNode, - typeToString: typeToString, - getSymbolDisplayBuilder: getSymbolDisplayBuilder, - symbolToString: symbolToString, - getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, - getRootSymbols: getRootSymbols, - getContextualType: getContextualType, - getFullyQualifiedName: getFullyQualifiedName, - getResolvedSignature: getResolvedSignature, - getEnumMemberValue: getEnumMemberValue, - isValidPropertyAccess: isValidPropertyAccess, - getSignatureFromDeclaration: getSignatureFromDeclaration, - isImplementationOfOverload: isImplementationOfOverload, - getAliasedSymbol: resolveImport, isUndefinedSymbol: symbol => symbol === undefinedSymbol, isArgumentsSymbol: symbol => symbol === argumentsSymbol, - hasEarlyErrors: hasEarlyErrors, - isEmitBlocked: isEmitBlocked + getDiagnostics, + getGlobalDiagnostics, + checkProgram, + invokeEmitter, + getParentOfSymbol, + getNarrowedTypeOfSymbol, + getDeclaredTypeOfSymbol, + getPropertiesOfType, + getPropertyOfType, + getSignaturesOfType, + getIndexTypeOfType, + getReturnTypeOfSignature, + getSymbolsInScope, + getSymbolInfo, + getShorthandAssignmentValueSymbol, + getTypeOfNode, + typeToString, + getSymbolDisplayBuilder, + symbolToString, + getAugmentedPropertiesOfType, + getRootSymbols, + getContextualType, + getFullyQualifiedName, + getResolvedSignature, + getEnumMemberValue, + isValidPropertyAccess, + getSignatureFromDeclaration, + isImplementationOfOverload, + getAliasedSymbol: resolveImport, + hasEarlyErrors, + isEmitBlocked, }; var undefinedSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "undefined"); @@ -953,7 +953,7 @@ module ts { if (forEach(symbol.declarations, declaration => !getIsDeclarationVisible(declaration))) { return undefined; } - return { aliasesToMakeVisible: aliasesToMakeVisible }; + return { aliasesToMakeVisible }; function getIsDeclarationVisible(declaration: Declaration) { if (!isDeclarationVisible(declaration)) { @@ -9121,22 +9121,22 @@ module ts { function invokeEmitter(targetSourceFile?: SourceFile) { var resolver: EmitResolver = { getProgram: () => program, - getLocalNameOfContainer: getLocalNameOfContainer, - getExpressionNamePrefix: getExpressionNamePrefix, - getExportAssignmentName: getExportAssignmentName, - isReferencedImportDeclaration: isReferencedImportDeclaration, - getNodeCheckFlags: getNodeCheckFlags, - getEnumMemberValue: getEnumMemberValue, - isTopLevelValueImportWithEntityName: isTopLevelValueImportWithEntityName, - hasSemanticErrors: hasSemanticErrors, - isEmitBlocked: isEmitBlocked, - isDeclarationVisible: isDeclarationVisible, - isImplementationOfOverload: isImplementationOfOverload, - writeTypeAtLocation: writeTypeAtLocation, - writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, - isSymbolAccessible: isSymbolAccessible, - isImportDeclarationEntityNameReferenceDeclarationVisibile: isImportDeclarationEntityNameReferenceDeclarationVisibile, - getConstantValue: getConstantValue, + getLocalNameOfContainer, + getExpressionNamePrefix, + getExportAssignmentName, + isReferencedImportDeclaration, + getNodeCheckFlags, + getEnumMemberValue, + isTopLevelValueImportWithEntityName, + hasSemanticErrors, + isEmitBlocked, + isDeclarationVisible, + isImplementationOfOverload, + writeTypeAtLocation, + writeReturnTypeOfSignatureDeclaration, + isSymbolAccessible, + isImportDeclarationEntityNameReferenceDeclarationVisibile, + getConstantValue, }; checkProgram(); return emitFiles(resolver, targetSourceFile); diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 5e61e9e1cb..3fabf6c858 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -153,9 +153,9 @@ module ts { parseStrings(commandLine); return { - options: options, - filenames: filenames, - errors: errors + options, + filenames, + errors }; function parseStrings(args: string[]) { diff --git a/src/compiler/core.ts b/src/compiler/core.ts index e512688fee..2c61399668 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -258,9 +258,9 @@ module ts { } return { - file: file, - start: start, - length: length, + file, + start, + length, messageText: text, category: message.category, @@ -335,12 +335,12 @@ module ts { } return { - file: file, - start: start, - length: length, - code: code, - category: category, - messageText: messageText + file, + start, + length, + code, + category, + messageText }; } diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 213661fdd6..80a32ba330 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -122,9 +122,9 @@ module ts { let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: DiagnosticCategory.Error, key: "'let' declarations can only be declared inside a block." }, Invalid_template_literal_expected: { code: 1158, category: DiagnosticCategory.Error, key: "Invalid template literal; expected '}'" }, Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: DiagnosticCategory.Error, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." }, - 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." }, - A_object_member_cannot_be_declared_optional: { code: 1160, category: DiagnosticCategory.Error, key: "A object member cannot be declared optional." }, + An_object_member_cannot_be_declared_optional: { code: 1160, category: DiagnosticCategory.Error, key: "An object member cannot be declared optional." }, + Unterminated_template_literal: { code: 1161, category: DiagnosticCategory.Error, key: "Unterminated template literal." }, + Unterminated_regular_expression_literal: { code: 1162, category: DiagnosticCategory.Error, key: "Unterminated regular expression literal." }, Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index cd2e209e3e..c05770bdd8 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -479,18 +479,17 @@ "category": "Error", "code": 1159 }, - "Unterminated template literal.": { + "An object member cannot be declared optional.": { "category": "Error", - "code": 1160 + "code": 1160 }, - "Unterminated regular expression literal.": { + "Unterminated template literal.": { "category": "Error", "code": 1161 }, - - "A object member cannot be declared optional.": { + "Unterminated regular expression literal.": { "category": "Error", - "code": 1160 + "code": 1162 }, "Duplicate identifier '{0}'.": { diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index ef4d02edd1..2666a0fd47 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -104,9 +104,9 @@ module ts { } }); return { - firstAccessor: firstAccessor, - getAccessor: getAccessor, - setAccessor: setAccessor + firstAccessor, + getAccessor, + setAccessor }; } @@ -2790,7 +2790,7 @@ module ts { Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1; return { - diagnosticMessage: diagnosticMessage, + diagnosticMessage, errorNode: node, typeName: node.name }; @@ -2887,7 +2887,7 @@ module ts { } return { - diagnosticMessage: diagnosticMessage, + diagnosticMessage, errorNode: node, typeName: node.name }; @@ -2952,7 +2952,7 @@ module ts { } return { - diagnosticMessage: diagnosticMessage, + diagnosticMessage, errorNode: node, typeName: (node.parent).name }; @@ -3134,7 +3134,7 @@ module ts { Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; } return { - diagnosticMessage: diagnosticMessage, + diagnosticMessage, errorNode: node.parameters[0], // TODO(jfreeman): Investigate why we are passing node.name instead of node.parameters[0].name typeName: node.name @@ -3156,7 +3156,7 @@ module ts { Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; } return { - diagnosticMessage: diagnosticMessage, + diagnosticMessage, errorNode: node.name, typeName: undefined }; @@ -3286,7 +3286,7 @@ module ts { } return { - diagnosticMessage: diagnosticMessage, + diagnosticMessage, errorNode: node.name || node, }; } @@ -3371,7 +3371,7 @@ module ts { } return { - diagnosticMessage: diagnosticMessage, + diagnosticMessage, errorNode: node, typeName: node.name }; @@ -3556,22 +3556,22 @@ module ts { var hasEmitterError = forEach(diagnostics, diagnostic => diagnostic.category === DiagnosticCategory.Error); // Check and update returnCode for syntactic and semantic - var returnCode: EmitReturnStatus; + var emitResultStatus: EmitReturnStatus; if (isEmitBlocked) { - returnCode = EmitReturnStatus.AllOutputGenerationSkipped; + emitResultStatus = EmitReturnStatus.AllOutputGenerationSkipped; } else if (hasEmitterError) { - returnCode = EmitReturnStatus.EmitErrorsEncountered; + emitResultStatus = EmitReturnStatus.EmitErrorsEncountered; } else if (hasSemanticErrors && compilerOptions.declaration) { - returnCode = EmitReturnStatus.DeclarationGenerationSkipped; + emitResultStatus = EmitReturnStatus.DeclarationGenerationSkipped; } else if (hasSemanticErrors && !compilerOptions.declaration) { - returnCode = EmitReturnStatus.JSGeneratedWithSemanticErrors; + emitResultStatus = EmitReturnStatus.JSGeneratedWithSemanticErrors; } else { - returnCode = EmitReturnStatus.Succeeded; + emitResultStatus = EmitReturnStatus.Succeeded; } return { - emitResultStatus: returnCode, - errors: diagnostics, + emitResultStatus, + diagnostics, sourceMaps: sourceMapDataList }; } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 5b0e48593a..e418858b89 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -759,13 +759,12 @@ module ts { if (matchResult) { var start = commentRange.pos; var end = commentRange.end; - var fileRef = { - pos: start, - end: end, - filename: matchResult[3] - }; return { - fileReference: fileRef, + fileReference: { + pos: start, + end: end, + filename: matchResult[3] + }, isNoDefaultLib: false }; } @@ -847,7 +846,6 @@ module ts { var lookAheadMode = LookAheadMode.NotLookingAhead; var inAmbientContext = false; - var inFunctionBody = false; function getLineStarts(): number[] { return lineStarts || (lineStarts = computeLineStarts(sourceText)); @@ -868,23 +866,6 @@ module ts { errorAtPos(start, length, message, arg0, arg1, arg2); } - // This is just like createDiagnosticForNode except that it uses the current file - // being parsed instead of the file containing the node. This is because during - // parse, the nodes do not have parent pointers to get to the file. - // - // It is very intentional that we are not checking or changing the lookAheadMode value - // here. 'grammarErrorOnNode' is called when we are doing extra grammar checks and not - // when we are doing the actual parsing to determine what the user wrote. In other - // words, this function is called once we have already parsed the node, and are just - // applying some stricter checks on that node. - function grammarErrorOnNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): void { - var span = getErrorSpanForNode(node); - var start = span.end > span.pos ? skipTrivia(file.text, span.pos) : span.pos; - var length = span.end - start; - - file.parseDiagnostics.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } - function grammarErrorAtPos(start: number, length: number, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): void { file.parseDiagnostics.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); } @@ -1040,7 +1021,10 @@ module ts { function createNode(kind: SyntaxKind, pos?: number): Node { nodeCount++; var node = new (nodeConstructors[kind] || (nodeConstructors[kind] = objectAllocator.getNodeConstructor(kind)))(); - if (!(pos >= 0)) pos = scanner.getStartPos(); + if (!(pos >= 0)) { + pos = scanner.getStartPos(); + } + node.pos = pos; node.end = pos; return node; @@ -1056,8 +1040,8 @@ module ts { return node; } - function createMissingNode(): Node { - return createNode(SyntaxKind.Missing); + function createMissingNode(pos?: number): Node { + return createNode(SyntaxKind.Missing, pos); } function internIdentifier(text: string): string { @@ -1416,16 +1400,11 @@ module ts { // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. // We also do not need to check for negatives because any prefix operator would be part of a // parent unary expression. - if (node.kind === SyntaxKind.NumericLiteral - && sourceText.charCodeAt(tokenPos) === CharacterCodes._0 - && isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { + if (node.kind === SyntaxKind.NumericLiteral && + sourceText.charCodeAt(tokenPos) === CharacterCodes._0 && + isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - if (isInStrictMode) { - grammarErrorOnNode(node, Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); - } - else if (languageVersion >= ScriptTarget.ES5) { - grammarErrorOnNode(node, Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); - } + node.flags |= NodeFlags.OctalLiteral; } return node; @@ -1476,8 +1455,7 @@ module ts { // // // We do *not* want to consume the > as we're consuming the expression for "". - var expr = parseUnaryExpression(); - grammarErrorOnNode(expr, Diagnostics.Type_expected); + node.expression = parseUnaryExpression(); } } @@ -1557,8 +1535,8 @@ module ts { } return { - typeParameters: typeParameters, - parameters: parameters, + typeParameters, + parameters, type: type }; } @@ -1579,8 +1557,13 @@ module ts { return finishNode(node); } - function parseIndexSignatureMember(): SignatureDeclaration { - var node = createNode(SyntaxKind.IndexSignature); + function parseIndexSignatureMember(modifiers: ModifiersArray, pos?: number): SignatureDeclaration { + var node = createNode(SyntaxKind.IndexSignature, pos); + if (modifiers) { + node.modifiers = modifiers; + node.flags = modifiers.flags; + } + node.parameters = parseParameterList(SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken); node.type = parseTypeAnnotation(); parseSemicolon(); @@ -1626,7 +1609,7 @@ module ts { case SyntaxKind.LessThanToken: return parseSignatureMember(SyntaxKind.CallSignature, SyntaxKind.ColonToken); case SyntaxKind.OpenBracketToken: - return parseIndexSignatureMember(); + return parseIndexSignatureMember(/*modifiers:*/ undefined); case SyntaxKind.NewKeyword: if (lookAhead(() => nextToken() === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken)) { return parseSignatureMember(SyntaxKind.ConstructSignature, SyntaxKind.ColonToken); @@ -1655,12 +1638,7 @@ module ts { function parseTupleType(): TupleTypeNode { var node = createNode(SyntaxKind.TupleType); - var startTokenPos = scanner.getTokenPos(); - var startErrorCount = file.parseDiagnostics.length; node.elementTypes = parseBracketedList(ParsingContext.TupleElementTypes, parseType, SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken); - if (!node.elementTypes.length && file.parseDiagnostics.length === startErrorCount) { - grammarErrorAtPos(startTokenPos, scanner.getStartPos() - startTokenPos, Diagnostics.A_tuple_type_element_list_cannot_be_empty); - } return finishNode(node); } @@ -2083,7 +2061,7 @@ module ts { var body: Node; if (token === SyntaxKind.OpenBraceToken) { - body = parseBody(/* ignoreMissingOpenBrace */ false); + body = parseFunctionBlock(/* ignoreMissingOpenBrace */ false); } else if (isStatement(/* inErrorRecovery */ true) && !isStartOfExpressionStatement() && token !== SyntaxKind.FunctionKeyword) { // Check if we got a plain statement (i.e. no expression-statements, no functions expressions/declarations) @@ -2100,7 +2078,7 @@ module ts { // up preemptively closing the containing construct. // // Note: even when 'ignoreMissingOpenBrace' is passed as true, parseBody will still error. - body = parseBody(/* ignoreMissingOpenBrace */ true); + body = parseFunctionBlock(/* ignoreMissingOpenBrace */ true); } else { body = parseAssignmentExpression(noIn); @@ -2270,22 +2248,26 @@ module ts { // the code would be implicitly: "name.keyword; identifierNameOrKeyword". // In the first case though, ASI will not take effect because there is not a // line terminator after the keyword. - if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord() && lookAhead(() => scanner.isReservedWord())) { - grammarErrorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, Diagnostics.Identifier_expected); - var id = createMissingNode(); - } - else { - var id = parseIdentifierName(); + var id: Identifier; + if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord()) { + var matchesPattern = lookAhead(() => { + nextToken(); + return !scanner.hasPrecedingLineBreak() && (scanner.isIdentifier() || scanner.isReservedWord); + }); + + if (matchesPattern) { + errorAtPos(dotOrBracketStart + 1, 0, Diagnostics.Identifier_expected); + id = createMissingNode(); + } } propertyAccess.left = expr; - propertyAccess.right = id; + propertyAccess.right = id || parseIdentifierName(); expr = finishNode(propertyAccess); continue; } if (parseOptional(SyntaxKind.OpenBracketToken)) { - var indexedAccess = createNode(SyntaxKind.IndexedAccess, expr.pos); indexedAccess.object = expr; @@ -2293,7 +2275,6 @@ module ts { // Check for that common pattern and report a better error message. if (inNewExpression && parseOptional(SyntaxKind.CloseBracketToken)) { indexedAccess.index = createMissingNode(); - grammarErrorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); } else { indexedAccess.index = parseExpression(); @@ -2356,10 +2337,11 @@ module ts { } function parseSingleTypeArgument(): TypeNode { + // Be resilient to something like: Foo<,,>(); + // We want to parse this out as a type argument list (esp. for signature help), and we + // don't want to rollback just because we were missing a type arg. The grammar checker + // will report the actual error later on. if (token === SyntaxKind.CommaToken) { - var errorStart = scanner.getTokenPos(); - var errorLength = scanner.getTextPos() - errorStart; - grammarErrorAtPos(errorStart, errorLength, Diagnostics.Type_expected); return createNode(SyntaxKind.Missing); } @@ -2414,25 +2396,18 @@ module ts { return finishNode(node); } - function parseAssignmentExpressionOrOmittedExpression(omittedExpressionDiagnostic: DiagnosticMessage): Expression { - if (token === SyntaxKind.CommaToken) { - if (omittedExpressionDiagnostic) { - var errorStart = scanner.getTokenPos(); - var errorLength = scanner.getTextPos() - errorStart; - grammarErrorAtPos(errorStart, errorLength, omittedExpressionDiagnostic); - } - return createNode(SyntaxKind.OmittedExpression); - } - - return parseAssignmentExpression(); + function parseAssignmentExpressionOrOmittedExpression(): Expression { + return token === SyntaxKind.CommaToken + ? createNode(SyntaxKind.OmittedExpression) + : parseAssignmentExpression(); } function parseArrayLiteralElement(): Expression { - return parseAssignmentExpressionOrOmittedExpression(/*omittedExpressionDiagnostic*/ undefined); + return parseAssignmentExpressionOrOmittedExpression(); } function parseArgumentExpression(): Expression { - return parseAssignmentExpressionOrOmittedExpression(Diagnostics.Argument_expression_expected); + return parseAssignmentExpressionOrOmittedExpression(); } function parseArrayLiteral(): ArrayLiteral { @@ -2446,6 +2421,7 @@ module ts { function parsePropertyAssignment(): Declaration { var nodePos = scanner.getStartPos(); + var tokenIsIdentifier = isIdentifier(); var nameToken = token; var propertyName = parsePropertyName(); var node: Declaration; @@ -2453,7 +2429,7 @@ module ts { node = createNode(SyntaxKind.PropertyAssignment, nodePos); node.name = propertyName; var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false); - var body = parseBody(/* ignoreMissingOpenBrace */ false); + var body = parseFunctionBlock(/* ignoreMissingOpenBrace */ false); // do not propagate property name as name for function expression // for scenarios like // var x = 1; @@ -2462,15 +2438,17 @@ module ts { (node).initializer = makeFunctionExpression(SyntaxKind.FunctionExpression, node.pos, undefined, sig, body); return finishNode(node); } - // Disallow optional property assignment + + var flags: NodeFlags = 0; + + // Disallowing of optional property assignments happens in the grammar checker. if (token === SyntaxKind.QuestionToken) { - var questionStart = scanner.getTokenPos(); - grammarErrorAtPos(questionStart, scanner.getStartPos() - questionStart, Diagnostics.A_object_member_cannot_be_declared_optional); + flags |= NodeFlags.QuestionMark; nextToken(); } // Parse to check if it is short-hand property assignment or normal property assignment - if (token !== SyntaxKind.ColonToken && nameToken === SyntaxKind.Identifier) { + if ((token === SyntaxKind.CommaToken || token === SyntaxKind.CloseBraceToken) && tokenIsIdentifier) { node = createNode(SyntaxKind.ShorthandPropertyAssignment, nodePos); node.name = propertyName; } @@ -2480,6 +2458,8 @@ module ts { parseExpected(SyntaxKind.ColonToken); (node).initializer = parseAssignmentExpression(false); } + + node.flags = flags; return finishNode(node); } @@ -2510,7 +2490,7 @@ module ts { parseExpected(SyntaxKind.FunctionKeyword); var name = isIdentifier() ? parseIdentifier() : undefined; var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false); - var body = parseBody(/* ignoreMissingOpenBrace */ false); + var body = parseFunctionBlock(/* ignoreMissingOpenBrace */ false); return makeFunctionExpression(SyntaxKind.FunctionExpression, pos, name, sig, body); } @@ -2548,13 +2528,9 @@ module ts { return finishNode(node); } - function parseBody(ignoreMissingOpenBrace: boolean): Block { - var saveInFunctionBody = inFunctionBody; - - inFunctionBody = true; + function parseFunctionBlock(ignoreMissingOpenBrace: boolean): Block { var block = parseBlock(ignoreMissingOpenBrace, /*checkForStrictMode*/ true); block.kind = SyntaxKind.FunctionBlock; - inFunctionBody = saveInFunctionBody; return block; } @@ -2678,18 +2654,15 @@ module ts { function parseReturnStatement(): ReturnStatement { var node = createNode(SyntaxKind.ReturnStatement); - var errorCountBeforeReturnStatement = file.parseDiagnostics.length; var returnTokenStart = scanner.getTokenPos(); var returnTokenLength = scanner.getTextPos() - returnTokenStart; parseExpected(SyntaxKind.ReturnKeyword); - if (!canParseSemicolon()) node.expression = parseExpression(); - parseSemicolon(); - - // In an ambient context, we will already give an error for having a statement. - if (!inFunctionBody && !inAmbientContext && errorCountBeforeReturnStatement === file.parseDiagnostics.length) { - grammarErrorAtPos(returnTokenStart, returnTokenLength, Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + if (!canParseSemicolon()) { + node.expression = parseExpression(); } + + parseSemicolon(); return finishNode(node); } @@ -2932,7 +2905,7 @@ module ts { function parseFunctionBlockOrSemicolon(): Block { if (token === SyntaxKind.OpenBraceToken) { - return parseBody(/* ignoreMissingOpenBrace */ false); + return parseFunctionBlock(/* ignoreMissingOpenBrace */ false); } if (canParseSemicolon()) { @@ -3017,17 +2990,21 @@ module ts { function parsePropertyMemberDeclaration(pos: number, modifiers: ModifiersArray): Declaration { var errorCountBeforePropertyDeclaration = file.parseDiagnostics.length; var name = parsePropertyName(); - + var flags = modifiers ? modifiers.flags : 0; var questionStart = scanner.getTokenPos(); if (parseOptional(SyntaxKind.QuestionToken)) { - errorAtPos(questionStart, scanner.getStartPos() - questionStart, Diagnostics.A_class_member_cannot_be_declared_optional); + // Note: this is not legal as per the grammar. But we allow it in the parser and + // report an error in the grammar checker. + flags |= NodeFlags.QuestionMark; } if (token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { var method = createNode(SyntaxKind.Method, pos); if (modifiers) { method.modifiers = modifiers; - method.flags = modifiers.flags; + } + if (flags) { + method.flags = flags; } method.name = name; var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false); @@ -3042,7 +3019,9 @@ module ts { var property = createNode(SyntaxKind.Property, pos); if (modifiers) { property.modifiers = modifiers; - property.flags = modifiers.flags; + } + if (flags) { + property.flags = flags; } property.name = name; property.type = parseTypeAnnotation(); @@ -3052,9 +3031,6 @@ module ts { property.initializer = parseInitializer(/*inParameter*/ false); parseSemicolon(); - if (inAmbientContext && property.initializer && errorCountBeforePropertyDeclaration === file.parseDiagnostics.length) { - grammarErrorAtPos(initializerStart, initializerFirstTokenLength, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } return finishNode(property); } } @@ -3077,7 +3053,7 @@ module ts { node.body = createMissingNode(); } else { - node.body = parseBody(/* ignoreMissingOpenBrace */ false); + node.body = parseFunctionBlock(/* ignoreMissingOpenBrace */ false); } return finishNode(node); @@ -3170,12 +3146,7 @@ module ts { return parsePropertyMemberDeclaration(pos, modifiers); } if (token === SyntaxKind.OpenBracketToken) { - if (modifiers) { - var start = getTokenPos(pos); - var length = getNodePos() - start; - errorAtPos(start, length, Diagnostics.Modifiers_not_permitted_on_index_signature_members); - } - return parseIndexSignatureMember(); + return parseIndexSignatureMember(modifiers, pos); } // 'isClassMemberStart' should have hinted not to attempt parsing. @@ -3194,7 +3165,6 @@ module ts { if (parseOptional(SyntaxKind.ImplementsKeyword)) { node.implementedTypes = parseDelimitedList(ParsingContext.BaseTypeReferences, parseTypeReference); } - var errorCountBeforeClassBody = file.parseDiagnostics.length; if (parseExpected(SyntaxKind.OpenBraceToken)) { node.members = parseList(ParsingContext.ClassMembers, /*checkForStrictMode*/ false, parseClassMemberDeclaration); parseExpected(SyntaxKind.CloseBraceToken); @@ -3290,14 +3260,6 @@ module ts { var node = createNode(SyntaxKind.ModuleDeclaration, pos); node.flags = flags; node.name = parseStringLiteral(); - if (!inAmbientContext) { - var errorCount = file.parseDiagnostics.length; - // Only report this error if we have not already errored about a missing declare modifier, - // which would have been at or after pos - if (!errorCount || file.parseDiagnostics[errorCount - 1].start < getTokenPos(pos)) { - grammarErrorOnNode(node.name, Diagnostics.Only_ambient_modules_can_use_quoted_names); - } - } // For error recovery, just in case the user forgot the declare modifier on this ambient // external module, treat it as ambient anyway. @@ -3331,8 +3293,12 @@ module ts { return finishNode(node); } - function parseExportAssignmentTail(pos: number): ExportAssignment { + function parseExportAssignmentTail(pos: number, modifiers: ModifiersArray): ExportAssignment { var node = createNode(SyntaxKind.ExportAssignment, pos); + if (modifiers) { + node.modifiers = modifiers + node.flags = modifiers.flags; + } node.exportName = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -3370,18 +3336,12 @@ module ts { function parseDeclaration(modifierContext: ModifierContext): Statement { var pos = getNodePos(); - var errorCountBeforeModifiers = file.parseDiagnostics.length; var modifiers = parseModifiers(modifierContext); if (token === SyntaxKind.ExportKeyword) { var modifiersEnd = scanner.getStartPos(); nextToken(); if (parseOptional(SyntaxKind.EqualsToken)) { - var exportAssignmentTail = parseExportAssignmentTail(pos); - if (modifiers && errorCountBeforeModifiers === file.parseDiagnostics.length) { - var modifiersStart = skipTrivia(sourceText, pos); - grammarErrorAtPos(modifiersStart, modifiersEnd - modifiersStart, Diagnostics.An_export_assignment_cannot_have_modifiers); - } - return exportAssignmentTail; + return parseExportAssignmentTail(pos, modifiers); } } @@ -3497,9 +3457,9 @@ module ts { } commentRanges = undefined; return { - referencedFiles: referencedFiles, - amdDependencies: amdDependencies, - amdModuleName: amdModuleName + referencedFiles, + amdDependencies, + amdModuleName }; } @@ -3604,6 +3564,7 @@ module ts { // 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 parent: Node; visitNode(file); @@ -3614,6 +3575,11 @@ module ts { parent = node; if (!checkModifiers(node)) { + var savedInFunctionBlock = inFunctionBlock; + if (node.kind === SyntaxKind.FunctionBlock) { + inFunctionBlock = true; + } + var savedInAmbientContext = inAmbientContext if (node.flags & NodeFlags.Ambient) { inAmbientContext = true; @@ -3622,6 +3588,7 @@ module ts { checkNode(node); inAmbientContext = savedInAmbientContext; + inFunctionBlock = savedInFunctionBlock; } parent = savedParent; @@ -3631,7 +3598,7 @@ module ts { // 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 (checkForStatementInAmbientContext(node)) { + if (inAmbientContext && checkForStatementInAmbientContext(node)) { return; } @@ -3650,42 +3617,50 @@ module ts { function dispatch(node: Node): void { switch (node.kind) { - case SyntaxKind.ArrowFunction: return visitArrowFunction(node); - case SyntaxKind.BinaryExpression: return visitBinaryExpression(node); - case SyntaxKind.BreakStatement: return visitBreakOrContinueStatement(node); - case SyntaxKind.CallExpression: return visitCallExpression(node); - case SyntaxKind.CallSignature: return visitCallSignature(node); - case SyntaxKind.CatchBlock: return visitCatchBlock(node); - case SyntaxKind.ClassDeclaration: return visitClassDeclaration(node); - case SyntaxKind.Constructor: return visitConstructor(node); - case SyntaxKind.ConstructorType: return visitConstructorType(node); - case SyntaxKind.ConstructSignature: return visitConstructSignature(node); - case SyntaxKind.ContinueStatement: return visitBreakOrContinueStatement(node); - case SyntaxKind.EnumDeclaration: return visitEnumDeclaration(node); - case SyntaxKind.ForInStatement: return visitForInStatement(node); - case SyntaxKind.ForStatement: return visitForStatement(node); - case SyntaxKind.FunctionDeclaration: return visitFunctionDeclaration(node); - case SyntaxKind.FunctionExpression: return visitFunctionExpression(node); - case SyntaxKind.FunctionType: return visitFunctionType(node); - case SyntaxKind.GetAccessor: return visitGetAccessor(node); - case SyntaxKind.IndexSignature: return visitIndexSignature(node); - case SyntaxKind.InterfaceDeclaration: return visitInterfaceDeclaration(node); - case SyntaxKind.LabeledStatement: return visitLabeledStatement(node); - case SyntaxKind.Method: return visitMethod(node); - case SyntaxKind.ModuleDeclaration: return visitModuleDeclaration(node); - case SyntaxKind.NewExpression: return visitNewExpression(node); - case SyntaxKind.ObjectLiteral: return visitObjectLiteral(node); - case SyntaxKind.Parameter: return visitParameter(node); - case SyntaxKind.PostfixOperator: return visitPostfixOperator(node); - case SyntaxKind.PrefixOperator: return visitPrefixOperator(node); - case SyntaxKind.SetAccessor: return visitSetAccessor(node); - case SyntaxKind.SwitchStatement: return visitSwitchStatement(node); - case SyntaxKind.TaggedTemplateExpression: return visitTaggedTemplateExpression(node); - case SyntaxKind.TupleType: return visitTupleType(node); - case SyntaxKind.TypeReference: return visitTypeReference(node); - case SyntaxKind.VariableDeclaration: return visitVariableDeclaration(node); - case SyntaxKind.VariableStatement: return visitVariableStatement(node); - case SyntaxKind.WithStatement: return visitWithStatement(node); + case SyntaxKind.ArrowFunction: return visitArrowFunction(node); + case SyntaxKind.BinaryExpression: return visitBinaryExpression(node); + case SyntaxKind.BreakStatement: return visitBreakOrContinueStatement(node); + case SyntaxKind.CallExpression: return visitCallExpression(node); + case SyntaxKind.CallSignature: return visitCallSignature(node); + case SyntaxKind.CatchBlock: return visitCatchBlock(node); + case SyntaxKind.ClassDeclaration: return visitClassDeclaration(node); + case SyntaxKind.Constructor: return visitConstructor(node); + case SyntaxKind.ConstructorType: return visitConstructorType(node); + case SyntaxKind.ConstructSignature: return visitConstructSignature(node); + case SyntaxKind.ContinueStatement: return visitBreakOrContinueStatement(node); + case SyntaxKind.EnumDeclaration: return visitEnumDeclaration(node); + case SyntaxKind.ExportAssignment: return visitExportAssignment(node); + case SyntaxKind.ForInStatement: return visitForInStatement(node); + case SyntaxKind.ForStatement: return visitForStatement(node); + case SyntaxKind.FunctionDeclaration: return visitFunctionDeclaration(node); + case SyntaxKind.FunctionExpression: return visitFunctionExpression(node); + case SyntaxKind.FunctionType: return visitFunctionType(node); + case SyntaxKind.GetAccessor: return visitGetAccessor(node); + case SyntaxKind.IndexedAccess: return visitIndexedAccess(node); + case SyntaxKind.IndexSignature: return visitIndexSignature(node); + case SyntaxKind.InterfaceDeclaration: return visitInterfaceDeclaration(node); + case SyntaxKind.LabeledStatement: return visitLabeledStatement(node); + case SyntaxKind.Method: return visitMethod(node); + case SyntaxKind.ModuleDeclaration: return visitModuleDeclaration(node); + case SyntaxKind.NewExpression: return visitNewExpression(node); + case SyntaxKind.ObjectLiteral: return visitObjectLiteral(node); + case SyntaxKind.NumericLiteral: return visitNumericLiteral(node); + case SyntaxKind.Parameter: return visitParameter(node); + case SyntaxKind.PostfixOperator: return visitPostfixOperator(node); + case SyntaxKind.PrefixOperator: return visitPrefixOperator(node); + case SyntaxKind.Property: return visitProperty(node); + case SyntaxKind.PropertyAssignment: return visitPropertyAssignment(node); + case SyntaxKind.ReturnStatement: return visitReturnStatement(node); + case SyntaxKind.SetAccessor: return visitSetAccessor(node); + case SyntaxKind.ShorthandPropertyAssignment: return visitShorthandPropertyAssignment(node); + case SyntaxKind.SwitchStatement: return visitSwitchStatement(node); + case SyntaxKind.TaggedTemplateExpression: return visitTaggedTemplateExpression(node); + case SyntaxKind.TupleType: return visitTupleType(node); + case SyntaxKind.TypeParameter: return visitTypeParameter(node); + case SyntaxKind.TypeReference: return visitTypeReference(node); + case SyntaxKind.VariableDeclaration: return visitVariableDeclaration(node); + case SyntaxKind.VariableStatement: return visitVariableStatement(node); + case SyntaxKind.WithStatement: return visitWithStatement(node); } } @@ -3719,27 +3694,25 @@ module ts { } function checkForStatementInAmbientContext(node: Node): boolean { - if (inAmbientContext) { - switch (node.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); - } + switch (node.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); } } @@ -3851,9 +3824,41 @@ module ts { } function visitCallExpression(node: CallExpression) { - checkForTrailingComma(node.typeArguments) || - checkForAtLeastOneTypeArgument(node.typeArguments) || - checkForTrailingComma(node.arguments); + checkTypeArguments(node.typeArguments) || + checkArguments(node.arguments); + } + + function checkArguments(arguments: NodeArray) { + return checkForTrailingComma(arguments) || + checkForOmittedArgument(arguments); + } + + function checkTypeArguments(typeArguments: NodeArray) { + return checkForTrailingComma(typeArguments) || + checkForAtLeastOneTypeArgument(typeArguments) || + checkForMissingTypeArgument(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 checkForMissingTypeArgument(typeArguments: NodeArray) { + if (typeArguments) { + for (var i = 0, n = typeArguments.length; i < n; i++) { + var arg = typeArguments[i]; + if (arg.kind === SyntaxKind.Missing) { + return grammarErrorAtPos(arg.pos, 0, Diagnostics.Type_expected); + } + } + } } function checkForAtLeastOneTypeArgument(typeArguments: NodeArray) { @@ -3983,6 +3988,12 @@ module ts { return false; } + function visitExportAssignment(node: ExportAssignment) { + if (node.flags & NodeFlags.Modifier) { + grammarErrorOnFirstToken(node, Diagnostics.An_export_assignment_cannot_have_modifiers); + } + } + function visitForInStatement(node: ForInStatement) { checkVariableDeclarations(node.declarations) || checkForMoreThanOneDeclaration(node.declarations); @@ -3994,7 +4005,7 @@ module ts { function checkForMoreThanOneDeclaration(declarations: NodeArray) { if (declarations && declarations.length > 1) { - return grammarErrorOnNode(declarations[1], Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); + return grammarErrorOnFirstToken(declarations[1], Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); } } @@ -4030,8 +4041,26 @@ module ts { checkAccessor(node); } + function visitIndexedAccess(node: IndexedAccess): void { + if (node.index.kind === SyntaxKind.Missing && + node.parent.kind === SyntaxKind.NewExpression && + (node.parent).func === node) { + + var start = skipTrivia(sourceText, node.parent.pos); + var end = node.end; + grammarErrorAtPos(start, end - start, Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + } + } + function visitIndexSignature(node: SignatureDeclaration): void { - checkIndexSignatureParameters(node); + 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 { @@ -4075,7 +4104,8 @@ module ts { function visitMethod(node: MethodDeclaration) { checkTypeParameterList(node.typeParameters) || checkParameterList(node.parameters) || - checkForBodyInAmbientContext(node.body, /*isConstructor:*/ false); + checkForBodyInAmbientContext(node.body, /*isConstructor:*/ false) || + (node.parent.kind === SyntaxKind.ClassDeclaration && checkForInvalidQuestionMark(node, Diagnostics.A_class_member_cannot_be_declared_optional)); } function checkForBodyInAmbientContext(body: Block | Expression, isConstructor: boolean): boolean { @@ -4088,27 +4118,36 @@ module ts { } function visitModuleDeclaration(node: ModuleDeclaration): void { - checkInternalModule(node); + 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 checkInternalModule(node: ModuleDeclaration): boolean { + function checkModuleDeclarationStatements(node: ModuleDeclaration): boolean { if (node.name.kind === SyntaxKind.Identifier && node.body.kind === SyntaxKind.ModuleBlock) { - return forEach((node.body).statements, s => { - if (s.kind === SyntaxKind.ExportAssignment) { + 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(s, Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); + return grammarErrorOnFirstToken(statement, Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); } - else if (s.kind === SyntaxKind.ImportDeclaration && (s).externalModuleName) { - return grammarErrorOnNode(s, Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + else if (statement.kind === SyntaxKind.ImportDeclaration && (statement).externalModuleName) { + return grammarErrorOnFirstToken(statement, Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); } - }); + } } } function visitNewExpression(node: NewExpression): void { - checkForTrailingComma(node.typeArguments) || - checkForAtLeastOneTypeArgument(node.typeArguments) || - checkForTrailingComma(node.arguments); + checkTypeArguments(node.typeArguments) || + checkArguments(node.arguments); } function visitObjectLiteral(node: ObjectLiteral): void { @@ -4118,12 +4157,15 @@ module ts { var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; var inStrictMode = (node.flags & NodeFlags.ParsedInStrictMode) !== 0; - forEach(node.properties, (p: Declaration) => { + + for (var i = 0, n = node.properties.length; i < n; i++) { + var prop = node.properties[i]; // TODO(jfreeman): continue if we have a computed property - if (p.kind === SyntaxKind.OmittedExpression) { - return; + if (prop.kind === SyntaxKind.OmittedExpression) { + continue; } + var p = prop; var name = p.name; // ECMA-262 11.1.5 Object Initialiser @@ -4173,9 +4215,18 @@ module ts { grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } - }); + } } - + function visitNumericLiteral(node: LiteralExpression): void { + if (node.flags & NodeFlags.OctalLiteral) { + if (node.flags & NodeFlags.ParsedInStrictMode) { + grammarErrorOnNode(node, Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); + } + else if (languageVersion >= ScriptTarget.ES5) { + grammarErrorOnNode(node, Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); + } + } + } function checkTopLevelDeclareModifierInAmbientContext(node: Node): boolean { // A declare modifier is required for any top level .d.ts declaration except export=, interfaces and imports: // categories: @@ -4408,6 +4459,34 @@ module ts { } } + function visitProperty(node: PropertyDeclaration) { + (node.parent.kind === SyntaxKind.ClassDeclaration && checkForInvalidQuestionMark(node, Diagnostics.A_class_member_cannot_be_declared_optional)) || + checkForInitializerInAmbientContext(node); + } + + function checkForInitializerInAmbientContext(node: PropertyDeclaration) { + if (inAmbientContext && node.initializer) { + return grammarErrorOnFirstToken(node.initializer, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + } + + function visitPropertyAssignment(node: PropertyDeclaration) { + checkForInvalidQuestionMark(node, Diagnostics.An_object_member_cannot_be_declared_optional); + } + + function checkForInvalidQuestionMark(node: Declaration, message: DiagnosticMessage) { + if (node.flags & NodeFlags.QuestionMark) { + var pos = skipTrivia(sourceText, node.name.end); + return grammarErrorAtPos(pos, "?".length, message); + } + } + + function visitReturnStatement(node: ReturnStatement) { + if (!inFunctionBlock) { + grammarErrorOnFirstToken(node, Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + } + } + function visitSetAccessor(node: MethodDeclaration) { checkTypeParameterList(node.typeParameters) || checkParameterList(node.parameters) || @@ -4453,6 +4532,10 @@ module ts { } } + function visitShorthandPropertyAssignment(node: ShortHandPropertyDeclaration): void { + checkForInvalidQuestionMark(node, Diagnostics.An_object_member_cannot_be_declared_optional); + } + function visitSwitchStatement(node: SwitchStatement) { var firstDefaultClause: CaseOrDefaultClause; @@ -4474,16 +4557,29 @@ module ts { function visitTaggedTemplateExpression(node: TaggedTemplateExpression) { if (languageVersion < ScriptTarget.ES6) { - grammarErrorOnNode(node, Diagnostics.Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher); + grammarErrorOnFirstToken(node.template, Diagnostics.Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher); } } function visitTupleType(node: TupleTypeNode) { - checkForTrailingComma(node.elementTypes); + checkForTrailingComma(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 visitTypeParameter(node: TypeParameterDeclaration) { + if (node.expression) { + grammarErrorOnFirstToken(node.expression, Diagnostics.Type_expected); + } } function visitTypeReference(node: TypeReferenceNode) { - checkForAtLeastOneTypeArgument(node.typeArguments); + checkTypeArguments(node.typeArguments); } function visitVariableDeclaration(node: VariableDeclaration) { @@ -4514,10 +4610,10 @@ module ts { var decl = declarations[0]; if (languageVersion < ScriptTarget.ES6) { if (decl.flags & NodeFlags.Let) { - return grammarErrorOnNode(decl, Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + return grammarErrorOnFirstToken(decl, Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); } else if (decl.flags & NodeFlags.Const) { - return grammarErrorOnNode(decl, Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + return grammarErrorOnFirstToken(decl, Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); } } } diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 0647d61f24..e08f481ba9 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -1167,13 +1167,13 @@ module ts { hasPrecedingLineBreak: () => precedingLineBreak, isIdentifier: () => token === SyntaxKind.Identifier || token > SyntaxKind.LastReservedWord, isReservedWord: () => token >= SyntaxKind.FirstReservedWord && token <= SyntaxKind.LastReservedWord, - reScanGreaterToken: reScanGreaterToken, - reScanSlashToken: reScanSlashToken, - reScanTemplateToken: reScanTemplateToken, - scan: scan, - setText: setText, - setTextPos: setTextPos, - tryScan: tryScan, + reScanGreaterToken, + reScanSlashToken, + reScanTemplateToken, + scan, + setText, + setTextPos, + tryScan, }; } } diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index d685a30d95..e58d08589b 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -99,14 +99,14 @@ var sys: System = (function () { } return { - args: args, + args, newLine: "\r\n", useCaseSensitiveFileNames: false, write(s: string): void { WScript.StdOut.Write(s); }, - readFile: readFile, - writeFile: writeFile, + readFile, + writeFile, resolvePath(path: string): string { return fso.GetAbsolutePathName(path); }, @@ -191,8 +191,8 @@ var sys: System = (function () { // 1 is a standard descriptor for stdout _fs.writeSync(1, s); }, - readFile: readFile, - writeFile: writeFile, + readFile, + writeFile, watchFile: (fileName, callback) => { // watchFile polls a file every 250ms, picking up file notifications. _fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged); diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index e5291c9d7f..79972c7a89 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -192,12 +192,12 @@ module ts { } return { - getSourceFile: getSourceFile, + getSourceFile, getDefaultLibFilename: () => combinePaths(getDirectoryPath(normalizePath(sys.getExecutingFilePath())), "lib.d.ts"), - writeFile: writeFile, + writeFile, getCurrentDirectory: () => currentDirectory || (currentDirectory = sys.getCurrentDirectory()), useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames, - getCanonicalFileName: getCanonicalFileName, + getCanonicalFileName, getNewLine: () => sys.newLine }; } @@ -367,8 +367,8 @@ module ts { } else { var emitStart = new Date().getTime(); - var emitOutput = checker.emitFiles(); - var emitErrors = emitOutput.errors; + var emitOutput = checker.invokeEmitter(); + var emitErrors = emitOutput.diagnostics; exitStatus = emitOutput.emitResultStatus; var reportStart = new Date().getTime(); errors = concatenate(errors, emitErrors); @@ -394,7 +394,7 @@ module ts { reportTimeStatistic("Total time", reportStart - parseStart); } - return { program: program, exitStatus: exitStatus } + return { program, exitStatus }; } function printVersion() { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 6e7beb531f..9b05f98b8f 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -273,6 +273,7 @@ module ts { // Set if this node was parsed in strict mode. Used for grammar error checks, as well as // checking if the node can be reused in incremental settings. ParsedInStrictMode = 0x00002000, + OctalLiteral = 0x00004000, Modifier = Export | Ambient | Public | Private | Protected | Static, AccessibilityModifier = Public | Private | Protected, @@ -330,6 +331,9 @@ module ts { export interface TypeParameterDeclaration extends Declaration { name: Identifier; constraint?: TypeNode; + + // For error recovery purposes. + expression?: Expression; } export interface SignatureDeclaration extends Declaration, ParsedSignature { } @@ -720,7 +724,7 @@ module ts { export interface EmitResult { emitResultStatus: EmitReturnStatus; - errors: Diagnostic[]; + diagnostics: Diagnostic[]; sourceMaps: SourceMapData[]; // Array of sourceMapData if compiler emitted sourcemaps } @@ -733,7 +737,7 @@ module ts { getSymbolCount(): number; getTypeCount(): number; checkProgram(): void; - emitFiles(targetSourceFile?: SourceFile): EmitResult; + invokeEmitter(targetSourceFile?: SourceFile): EmitResult; getParentOfSymbol(symbol: Symbol): Symbol; getNarrowedTypeOfSymbol(symbol: Symbol, node: Node): Type; getDeclaredTypeOfSymbol(symbol: Symbol): Type; diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 144cc9745d..88fb3639d1 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -749,29 +749,6 @@ module FourSlash { } } - public verifyImplementorsCountIs(count: number, localFilesOnly: boolean = true) { - var implementors = this.getImplementorsAtCaret(); - var implementorsCount = 0; - - if (localFilesOnly) { - var localFiles = this.testData.files.map(file => file.fileName); - // Count only the references in local files. Filter the ones in lib and other files. - implementors.forEach((entry) => { - if (localFiles.some((filename) => filename === entry.fileName)) { - ++implementorsCount; - } - }); - } - else { - implementorsCount = implementors.length; - } - - if (implementorsCount !== count) { - var condition = localFilesOnly ? "excluding libs" : "including libs"; - this.raiseError("Expected implementors count (" + condition + ") to be " + count + ", but is actually " + implementors.length); - } - } - private getMemberListAtCaret() { return this.languageService.getCompletionsAtPosition(this.activeFile.fileName, this.currentCaretPosition, true); } @@ -788,10 +765,6 @@ module FourSlash { return this.languageService.getReferencesAtPosition(this.activeFile.fileName, this.currentCaretPosition); } - private getImplementorsAtCaret() { - return this.languageService.getImplementorsAtPosition(this.activeFile.fileName, this.currentCaretPosition); - } - private assertionMessage(name: string, actualValue: any, expectedValue: any) { return "\nActual " + name + ":\n\t" + actualValue + "\nExpected value:\n\t" + expectedValue; } @@ -2250,7 +2223,7 @@ module FourSlash { if (errs.length > 0) { throw new Error('Error compiling ' + fileName + ': ' + errs.map(e => e.messageText).join('\r\n')); } - checker.emitFiles(); + checker.invokeEmitter(); result = result || ''; // Might have an empty fourslash file // Compile and execute the test @@ -2284,7 +2257,7 @@ module FourSlash { // List of all the subfiles we've parsed out var files: FourSlashFile[] = []; // Global options - var opts: { [s: string]: string; } = {}; + var globalOptions: { [s: string]: string; } = {}; // Marker positions // Split up the input file by line @@ -2292,7 +2265,7 @@ module FourSlash { // we have to string-based splitting instead and try to figure out the delimiting chars var lines = contents.split('\n'); - var markerMap: MarkerMap = {}; + var markerPositions: MarkerMap = {}; var markers: Marker[] = []; var ranges: Range[] = []; @@ -2333,7 +2306,7 @@ module FourSlash { } else if (fileMetadataNamesIndex === fileMetadataNames.indexOf(testOptMetadataNames.filename)) { // Found an @Filename directive, if this is not the first then create a new subfile if (currentFileContent) { - var file = parseFileContent(currentFileContent, currentFileName, markerMap, markers, ranges); + var file = parseFileContent(currentFileContent, currentFileName, markerPositions, markers, ranges); file.fileOptions = currentFileOptions; // Store result file @@ -2353,10 +2326,10 @@ module FourSlash { } } else { // Check if the match is already existed in the global options - if (opts[match[1]] !== undefined) { + if (globalOptions[match[1]] !== undefined) { throw new Error("Global Option : '" + match[1] + "' is already existed"); } - opts[match[1]] = match[2]; + globalOptions[match[1]] = match[2]; } } } else if (line == '' || lineLength === 0) { @@ -2365,7 +2338,7 @@ module FourSlash { } else { // Empty line or code line, terminate current subfile if there is one if (currentFileContent) { - var file = parseFileContent(currentFileContent, currentFileName, markerMap, markers, ranges); + var file = parseFileContent(currentFileContent, currentFileName, markerPositions, markers, ranges); file.fileOptions = currentFileOptions; // Store result file @@ -2380,11 +2353,11 @@ module FourSlash { } return { - markerPositions: markerMap, - markers: markers, - globalOptions: opts, - files: files, - ranges: ranges + markerPositions, + markers, + globalOptions, + files, + ranges }; } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index aee0ef3c53..5b6db22e1d 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -589,8 +589,8 @@ module Harness { } }, getDefaultLibFilename: () => defaultLibFileName, - writeFile: writeFile, - getCanonicalFileName: getCanonicalFileName, + writeFile, + getCanonicalFileName, useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, getNewLine: ()=> sys.newLine }; @@ -806,11 +806,11 @@ module Harness { // only emit if there weren't parse errors var emitResult: ts.EmitResult; if (!isEmitBlocked) { - emitResult = checker.emitFiles(); + emitResult = checker.invokeEmitter(); } var errors: HarnessDiagnostic[] = []; - program.getDiagnostics().concat(checker.getDiagnostics()).concat(emitResult ? emitResult.errors : []).forEach(err => { + program.getDiagnostics().concat(checker.getDiagnostics()).concat(emitResult ? emitResult.diagnostics : []).forEach(err => { // TODO: new compiler formats errors after this point to add . and newlines so we'll just do it manually for now errors.push(getMinimalDiagnostic(err)); }); @@ -845,7 +845,7 @@ module Harness { declResult = compileResult; }, settingsCallback, options); - return { declInputFiles: declInputFiles, declOtherFiles: declOtherFiles, declResult: declResult }; + return { declInputFiles, declOtherFiles, declResult }; } function addDtsFile(file: { unitName: string; content: string }, dtsFiles: { unitName: string; content: string }[]) { @@ -1169,7 +1169,7 @@ module Harness { var settings = extractCompilerSettings(code); // List of all the subfiles we've parsed out - var files: TestUnitData[] = []; + var testUnitData: TestUnitData[] = []; var lines = Utils.splitContentByNewlines(code); @@ -1205,7 +1205,7 @@ module Harness { originalFilePath: fileName, references: refs }; - files.push(newTestFile); + testUnitData.push(newTestFile); // Reset local data currentFileContent = null; @@ -1230,7 +1230,7 @@ module Harness { } // normalize the fileName for the single file case - currentFileName = files.length > 0 ? currentFileName : Path.getFileName(fileName); + currentFileName = testUnitData.length > 0 ? currentFileName : Path.getFileName(fileName); // EOF, push whatever remains var newTestFile2 = { @@ -1240,9 +1240,9 @@ module Harness { originalFilePath: fileName, references: refs }; - files.push(newTestFile2); + testUnitData.push(newTestFile2); - return { settings: settings, testUnitData: files }; + return { settings, testUnitData }; } } @@ -1338,7 +1338,7 @@ module Harness { actual = actual.replace(/\r\n?/g, '\n'); } - return { expected: expected, actual: actual }; + return { expected, actual }; } function writeComparison(expected: string, actual: string, relativeFilename: string, actualFilename: string, descriptionForDescribe: string) { diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index 797bc12a42..e402c7c680 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -131,8 +131,8 @@ class ProjectRunner extends RunnerBase { if (!errors.length) { var checker = program.getTypeChecker(/*fullTypeCheck*/ true); errors = checker.getDiagnostics(); - var emitResult = checker.emitFiles(); - errors = ts.concatenate(errors, emitResult.errors); + var emitResult = checker.invokeEmitter(); + errors = ts.concatenate(errors, emitResult.diagnostics); sourceMapData = emitResult.sourceMaps; // Clean up source map data that will be used in baselining @@ -148,10 +148,10 @@ class ProjectRunner extends RunnerBase { } return { - moduleKind: moduleKind, - program: program, - errors: errors, - sourceMapData: sourceMapData + moduleKind, + program, + errors, + sourceMapData }; function createCompilerOptions(): ts.CompilerOptions { @@ -183,10 +183,10 @@ class ProjectRunner extends RunnerBase { function createCompilerHost(): ts.CompilerHost { return { - getSourceFile: getSourceFile, + getSourceFile, getDefaultLibFilename: () => "lib.d.ts", - writeFile: writeFile, - getCurrentDirectory: getCurrentDirectory, + writeFile, + getCurrentDirectory, getCanonicalFileName: Harness.Compiler.getCanonicalFileName, useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames, getNewLine: () => sys.newLine @@ -201,12 +201,12 @@ class ProjectRunner extends RunnerBase { var projectCompilerResult = compileProjectFiles(moduleKind, () => testCase.inputFiles, getSourceFileText, writeFile); return { - moduleKind: moduleKind, + moduleKind, program: projectCompilerResult.program, sourceMapData: projectCompilerResult.sourceMapData, - outputFiles: outputFiles, + outputFiles, errors: projectCompilerResult.errors, - nonSubfolderDiskFiles: nonSubfolderDiskFiles, + nonSubfolderDiskFiles, }; function getSourceFileText(filename: string): string { diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts index bfb139fa71..606672e406 100644 --- a/src/harness/rwcRunner.ts +++ b/src/harness/rwcRunner.ts @@ -117,14 +117,14 @@ module RWC { }); function getHarnessCompilerInputUnit(fileName: string) { - var resolvedPath = ts.normalizeSlashes(sys.resolvePath(fileName)); + var unitName = ts.normalizeSlashes(sys.resolvePath(fileName)); try { - var content = sys.readFile(resolvedPath); + var content = sys.readFile(unitName); } catch (e) { // Leave content undefined. } - return { unitName: resolvedPath, content: content }; + return { unitName, content }; } }); diff --git a/src/services/formatting.ts b/src/services/formatting.ts index 337468803c..2fdbebad79 100644 --- a/src/services/formatting.ts +++ b/src/services/formatting.ts @@ -361,8 +361,8 @@ module ts.formatting { delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta() + delta); } return { - indentation: indentation, - delta: delta + indentation, + delta } } @@ -834,7 +834,7 @@ module ts.formatting { } function newTextChange(start: number, len: number, newText: string): TextChange { - return { span: new TextSpan(start, len), newText: newText } + return { span: new TextSpan(start, len), newText } } function recordDelete(start: number, len: number) { diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index c0ec80c98e..fd4ae0d2f9 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -262,12 +262,12 @@ module ts.NavigationBar { } return { - text: text, - kind: kind, - kindModifiers: kindModifiers, - spans: spans, - childItems: childItems, - indent: indent, + text, + kind, + kindModifiers, + spans, + childItems, + indent, bolded: false, grayed: false }; diff --git a/src/services/services.ts b/src/services/services.ts index f05f9dd77b..7f7a05cd3a 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -899,7 +899,6 @@ module ts { getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - getImplementorsAtPosition(fileName: string, position: number): ReferenceEntry[]; getNavigateToItems(searchValue: string): NavigateToItem[]; getNavigationBarItems(fileName: string): NavigationBarItem[]; @@ -1376,8 +1375,8 @@ module ts { writeSpace: text => writeKind(text, SymbolDisplayPartKind.space), writeStringLiteral: text => writeKind(text, SymbolDisplayPartKind.stringLiteral), writeParameter: text => writeKind(text, SymbolDisplayPartKind.parameterName), - writeSymbol: writeSymbol, - writeLine: writeLine, + writeSymbol, + writeLine, increaseIndent: () => { indent++; }, decreaseIndent: () => { indent--; }, clear: resetWriter, @@ -1767,7 +1766,7 @@ module ts { sourceFiles.sort((x, y) => y.refCount - x.refCount); return { bucket: name, - sourceFiles: sourceFiles + sourceFiles }; }); return JSON.stringify(bucketInfoArray, null, 2); @@ -1833,10 +1832,10 @@ module ts { } return { - acquireDocument: acquireDocument, - updateDocument: updateDocument, - releaseDocument: releaseDocument, - reportStats: reportStats + acquireDocument, + updateDocument, + releaseDocument, + reportStats }; } @@ -1899,7 +1898,7 @@ module ts { processImport(); } processTripleSlashDirectives(); - return { referencedFiles: referencedFiles, importedFiles: importedFiles, isLibFile: isNoDefaultLib }; + return { referencedFiles, importedFiles, isLibFile: isNoDefaultLib }; } /// Helpers @@ -2298,7 +2297,7 @@ module ts { // Get emitter-diagnostics requires calling TypeChecker.emitFiles so we have to define CompilerHost.writer which does nothing because emitFiles function has side effects defined by CompilerHost.writer var savedWriter = writer; writer = (filename: string, data: string, writeByteOrderMark: boolean) => { }; - allDiagnostics = allDiagnostics.concat(checker.emitFiles(targetSourceFile).errors); + allDiagnostics = allDiagnostics.concat(checker.invokeEmitter(targetSourceFile).diagnostics); writer = savedWriter; } return allDiagnostics @@ -2503,7 +2502,7 @@ module ts { host.log("getCompletionsAtPosition: Semantic work: " + (new Date().getTime() - semanticStart)); return { - isMemberCompletion: isMemberCompletion, + isMemberCompletion, entries: activeCompletionSession.entries }; @@ -2758,7 +2757,7 @@ module ts { while (true) { node = node.parent; if (!node) { - return node; + return undefined; } switch (node.kind) { case SyntaxKind.SourceFile: @@ -3163,7 +3162,7 @@ module ts { documentation = symbol.getDocumentationComment(); } - return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind }; + return { displayParts, documentation, symbolKind }; function addNewLineIfDisplayPartsExist() { if (displayParts.length) { @@ -3264,7 +3263,7 @@ module ts { kind: symbolKind, name: symbolName, containerKind: undefined, - containerName: containerName + containerName }; } @@ -3973,6 +3972,10 @@ module ts { for (var i = 0, n = declarations.length; i < n; i++) { var container = getContainerNode(declarations[i]); + if (!container) { + return undefined; + } + if (scope && scope !== container) { // Different declarations have different containers, bail out return undefined; @@ -4537,8 +4540,8 @@ module ts { fileName: filename, textSpan: TextSpan.fromBounds(declaration.getStart(), declaration.getEnd()), // TODO(jfreeman): What should be the containerName when the container has a computed name? - containerName: container.name ? (container.name).text : "", - containerKind: container.name ? getNodeKind(container) : "" + containerName: container && container.name ? (container.name).text : "", + containerKind: container && container.name ? getNodeKind(container) : "" }); } } @@ -4646,7 +4649,7 @@ module ts { // Perform semantic and force a type check before emit to ensure that all symbols are updated // EmitFiles will report if there is an error from TypeChecker and Emitter // Depend whether we will have to emit into a single file or not either emit only selected file in the project, emit all files into a single file - var emitFilesResult = getFullTypeCheckChecker().emitFiles(targetSourceFile); + var emitFilesResult = getFullTypeCheckChecker().invokeEmitter(targetSourceFile); emitOutput.emitOutputStatus = emitFilesResult.emitResultStatus; // Reset writer back to undefined to make sure that we produce an error message if CompilerHost.writeFile method is called when we are not in getEmitOutput @@ -4692,10 +4695,13 @@ module ts { else { return SemanticMeaning.Namespace; } - break; case SyntaxKind.ImportDeclaration: return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace; + + // An external module can be a Value + case SyntaxKind.SourceFile: + return SemanticMeaning.Namespace | SemanticMeaning.Value; } Debug.fail("Unknown declaration type"); } @@ -5427,46 +5433,45 @@ module ts { return { canRename: true, localizedErrorMessage: undefined, - displayName: displayName, - fullDisplayName: fullDisplayName, - kind: kind, - kindModifiers: kindModifiers, - triggerSpan: triggerSpan + displayName, + fullDisplayName, + kind, + kindModifiers, + triggerSpan }; } } return { - dispose: dispose, - cleanupSemanticCache: cleanupSemanticCache, - getSyntacticDiagnostics: getSyntacticDiagnostics, - getSemanticDiagnostics: getSemanticDiagnostics, - getCompilerOptionsDiagnostics: getCompilerOptionsDiagnostics, - getSyntacticClassifications: getSyntacticClassifications, - getSemanticClassifications: getSemanticClassifications, - getCompletionsAtPosition: getCompletionsAtPosition, - getCompletionEntryDetails: getCompletionEntryDetails, - getSignatureHelpItems: getSignatureHelpItems, - getQuickInfoAtPosition: getQuickInfoAtPosition, - getDefinitionAtPosition: getDefinitionAtPosition, - getReferencesAtPosition: getReferencesAtPosition, - getOccurrencesAtPosition: getOccurrencesAtPosition, - getImplementorsAtPosition: (filename, position) => [], - getNameOrDottedNameSpan: getNameOrDottedNameSpan, - getBreakpointStatementAtPosition: getBreakpointStatementAtPosition, - getNavigateToItems: getNavigateToItems, - getRenameInfo: getRenameInfo, - findRenameLocations: findRenameLocations, - getNavigationBarItems: getNavigationBarItems, - getOutliningSpans: getOutliningSpans, - getTodoComments: getTodoComments, - getBraceMatchingAtPosition: getBraceMatchingAtPosition, - getIndentationAtPosition: getIndentationAtPosition, - getFormattingEditsForRange: getFormattingEditsForRange, - getFormattingEditsForDocument: getFormattingEditsForDocument, - getFormattingEditsAfterKeystroke: getFormattingEditsAfterKeystroke, - getEmitOutput: getEmitOutput, - getSignatureAtPosition: getSignatureAtPosition, + dispose, + cleanupSemanticCache, + getSyntacticDiagnostics, + getSemanticDiagnostics, + getCompilerOptionsDiagnostics, + getSyntacticClassifications, + getSemanticClassifications, + getCompletionsAtPosition, + getCompletionEntryDetails, + getSignatureHelpItems, + getQuickInfoAtPosition, + getDefinitionAtPosition, + getReferencesAtPosition, + getOccurrencesAtPosition, + getNameOrDottedNameSpan, + getBreakpointStatementAtPosition, + getNavigateToItems, + getRenameInfo, + findRenameLocations, + getNavigationBarItems, + getOutliningSpans, + getTodoComments, + getBraceMatchingAtPosition, + getIndentationAtPosition, + getFormattingEditsForRange, + getFormattingEditsForDocument, + getFormattingEditsAfterKeystroke, + getEmitOutput, + getSignatureAtPosition, }; } @@ -5764,9 +5769,7 @@ module ts { } } - return { - getClassificationsForLine: getClassificationsForLine - }; + return { getClassificationsForLine }; } function initializeServices() { diff --git a/src/services/shims.ts b/src/services/shims.ts index 38c68c067f..a355ddafab 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -133,12 +133,6 @@ module ts { */ getOccurrencesAtPosition(fileName: string, position: number): string; - /** - * Returns a JSON-encoded value of the type: - * { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[] - */ - getImplementorsAtPosition(fileName: string, position: number): string; - /** * Returns a JSON-encoded value of the type: * { name: string; kind: string; kindModifiers: string; containerName: string; containerKind: string; matchKind: string; fileName: string; textSpan: { start: number; length: number}; } [] = []; @@ -696,16 +690,6 @@ module ts { }); } - /// GET IMPLEMENTORS - public getImplementorsAtPosition(fileName: string, position: number): string { - return this.forwardJSONCall( - "getImplementorsAtPosition('" + fileName + "', " + position + ")", - () => { - return this.languageService.getImplementorsAtPosition(fileName, position); - }); - } - - /// COMPLETION LISTS /** diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts index a4580582ed..7d063ae069 100644 --- a/src/services/signatureHelp.ts +++ b/src/services/signatureHelp.ts @@ -221,7 +221,7 @@ module ts.SignatureHelp { var list = getChildListThatStartsWithOpenerToken(parent, node, sourceFile); Debug.assert(list !== undefined); return { - list: list, + list, listItemIndex: 0 }; } @@ -303,40 +303,40 @@ module ts.SignatureHelp { var callTargetDisplayParts = callTargetSymbol && symbolToDisplayParts(typeInfoResolver, callTargetSymbol, /*enclosingDeclaration*/ undefined, /*meaning*/ undefined); var items: SignatureHelpItem[] = map(candidates, candidateSignature => { var signatureHelpParameters: SignatureHelpParameter[]; - var prefixParts: SymbolDisplayPart[] = []; - var suffixParts: SymbolDisplayPart[] = []; + var prefixDisplayParts: SymbolDisplayPart[] = []; + var suffixDisplayParts: SymbolDisplayPart[] = []; if (callTargetDisplayParts) { - prefixParts.push.apply(prefixParts, callTargetDisplayParts); + prefixDisplayParts.push.apply(prefixDisplayParts, callTargetDisplayParts); } if (isTypeParameterHelp) { - prefixParts.push(punctuationPart(SyntaxKind.LessThanToken)); + prefixDisplayParts.push(punctuationPart(SyntaxKind.LessThanToken)); var typeParameters = candidateSignature.typeParameters; signatureHelpParameters = typeParameters && typeParameters.length > 0 ? map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray; - suffixParts.push(punctuationPart(SyntaxKind.GreaterThanToken)); + suffixDisplayParts.push(punctuationPart(SyntaxKind.GreaterThanToken)); var parameterParts = mapToDisplayParts(writer => typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, argumentListOrTypeArgumentList)); - suffixParts.push.apply(suffixParts, parameterParts); + suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts); } else { var typeParameterParts = mapToDisplayParts(writer => typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, argumentListOrTypeArgumentList)); - prefixParts.push.apply(prefixParts, typeParameterParts); - prefixParts.push(punctuationPart(SyntaxKind.OpenParenToken)); + prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts); + prefixDisplayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); var parameters = candidateSignature.parameters; signatureHelpParameters = parameters.length > 0 ? map(parameters, createSignatureHelpParameterForParameter) : emptyArray; - suffixParts.push(punctuationPart(SyntaxKind.CloseParenToken)); + suffixDisplayParts.push(punctuationPart(SyntaxKind.CloseParenToken)); } var returnTypeParts = mapToDisplayParts(writer => typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, argumentListOrTypeArgumentList)); - suffixParts.push.apply(suffixParts, returnTypeParts); + suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts); return { isVariadic: candidateSignature.hasRestParameter, - prefixDisplayParts: prefixParts, - suffixDisplayParts: suffixParts, + prefixDisplayParts, + suffixDisplayParts, separatorDisplayParts: [punctuationPart(SyntaxKind.CommaToken), spacePart()], parameters: signatureHelpParameters, documentation: candidateSignature.getDocumentationComment() @@ -378,11 +378,11 @@ module ts.SignatureHelp { } return { - items: items, - applicableSpan: applicableSpan, - selectedItemIndex: selectedItemIndex, - argumentIndex: argumentIndex, - argumentCount: argumentCount + items, + applicableSpan, + selectedItemIndex, + argumentIndex, + argumentCount }; function createSignatureHelpParameterForParameter(parameter: Symbol): SignatureHelpParameter { @@ -394,8 +394,8 @@ module ts.SignatureHelp { return { name: parameter.name, documentation: parameter.getDocumentationComment(), - displayParts: displayParts, - isOptional: isOptional + displayParts, + isOptional }; } @@ -406,7 +406,7 @@ module ts.SignatureHelp { return { name: typeParameter.symbol.name, documentation: emptyArray, - displayParts: displayParts, + displayParts, isOptional: false }; } diff --git a/src/services/smartIndenter.ts b/src/services/smartIndenter.ts index 7a56ea07be..e593c6cfd6 100644 --- a/src/services/smartIndenter.ts +++ b/src/services/smartIndenter.ts @@ -222,7 +222,8 @@ module ts.formatting { if (node.parent) { switch (node.parent.kind) { case SyntaxKind.TypeReference: - if ((node.parent).typeArguments) { + if ((node.parent).typeArguments && + rangeContainsStartEnd((node.parent).typeArguments, node.getStart(sourceFile), node.getEnd())) { return (node.parent).typeArguments; } break; @@ -236,21 +237,28 @@ module ts.formatting { case SyntaxKind.Method: case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: - if ((node.parent).typeParameters && node.end < (node.parent).typeParameters.end) { + var start = node.getStart(sourceFile); + if ((node.parent).typeParameters && + rangeContainsStartEnd((node.parent).typeParameters, start, node.getEnd())) { return (node.parent).typeParameters; } - - return (node.parent).parameters; + if (rangeContainsStartEnd((node.parent).parameters, start, node.getEnd())) { + return (node.parent).parameters; + } + break; case SyntaxKind.NewExpression: case SyntaxKind.CallExpression: - if ((node.parent).typeArguments && node.end < (node.parent).typeArguments.end) { + var start = node.getStart(sourceFile); + if ((node.parent).typeArguments && + rangeContainsStartEnd((node.parent).typeArguments, start, node.getEnd())) { return (node.parent).typeArguments; } - - return (node.parent).arguments; + if (rangeContainsStartEnd((node.parent).arguments, start, node.getEnd())) { + return (node.parent).arguments; + } + break; } } - return undefined; } diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 8620f8d192..b0a216c7dc 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -66,22 +66,22 @@ module ts { } export function findListItemInfo(node: Node): ListItemInfo { - var syntaxList = findContainingList(node); + var list = findContainingList(node); // It is possible at this point for syntaxList to be undefined, either if // node.parent had no list child, or if none of its list children contained // the span of node. If this happens, return undefined. The caller should // handle this case. - if (!syntaxList) { + if (!list) { return undefined; } - var children = syntaxList.getChildren(); - var index = indexOf(children, node); + var children = list.getChildren(); + var listItemIndex = indexOf(children, node); return { - listItemIndex: index, - list: syntaxList + listItemIndex, + list }; } diff --git a/tests/baselines/reference/ambientErrors.errors.txt b/tests/baselines/reference/ambientErrors.errors.txt index a1e85be740..6fe7a25dfe 100644 --- a/tests/baselines/reference/ambientErrors.errors.txt +++ b/tests/baselines/reference/ambientErrors.errors.txt @@ -1,5 +1,14 @@ -tests/cases/conformance/ambient/ambientErrors.ts(37,18): error TS1039: Initializers are not allowed in ambient contexts. -tests/cases/conformance/ambient/ambientErrors.ts(38,11): error TS1039: Initializers are not allowed in ambient contexts. +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(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(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(47,20): error TS2435: Ambient external modules cannot be nested in other modules. @@ -7,9 +16,11 @@ tests/cases/conformance/ambient/ambientErrors.ts(51,16): error TS2436: Ambient e tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== tests/cases/conformance/ambient/ambientErrors.ts (7 errors) ==== +==== tests/cases/conformance/ambient/ambientErrors.ts (16 errors) ==== // Ambient variable with an initializer declare var x = 4; + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. // Ambient functions with invalid overloads declare function fn(x: number): string; @@ -32,31 +43,47 @@ 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. // Ambient enum with non - integer literal constant member declare enum E1 { y = 4.23 + ~ +!!! error TS1066: Ambient enum elements can only have integer literal initializers. } // Ambient enum with computer member declare enum E2 { x = 'foo'.length + ~ +!!! error TS1066: Ambient enum elements can only have integer literal initializers. } // Ambient module with initializers for values, bodies for functions / classes declare module M1 { var x = 3; - function fn() { } - class C { - static x = 3; - ~ -!!! error TS1039: Initializers are not allowed in ambient contexts. - y = 4; ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. + function fn() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. + class C { + static x = 3; + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. + y = 4; + ~ !!! error TS1039: Initializers are not allowed in ambient contexts. constructor() { } + ~ +!!! error TS1111: A constructor implementation cannot be declared in an ambient context. fn() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. static sfn() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. } } diff --git a/tests/baselines/reference/badArraySyntax.errors.txt b/tests/baselines/reference/badArraySyntax.errors.txt index 8c9bd45fba..500a89d85a 100644 --- a/tests/baselines/reference/badArraySyntax.errors.txt +++ b/tests/baselines/reference/badArraySyntax.errors.txt @@ -1,32 +1,29 @@ -tests/cases/compiler/badArraySyntax.ts(6,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -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,29): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -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(6,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/badArraySyntax.ts(7,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/badArraySyntax.ts(8,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/badArraySyntax.ts(9,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/badArraySyntax.ts(10,17): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -==== tests/cases/compiler/badArraySyntax.ts (6 errors) ==== +==== tests/cases/compiler/badArraySyntax.ts (5 errors) ==== class Z { public x = ""; } var a1: Z[] = []; var a2 = new Z[]; - ~~ + ~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var a3 = new Z[](); - ~~ + ~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var a4: Z[] = new Z[]; - ~~ + ~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var a5: Z[] = new Z[](); - ~~ + ~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var a6: Z[][] = new Z [ ] [ ]; - ~~~~~~~~ -!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. - ~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! 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/cannotInvokeNewOnErrorExpression.errors.txt b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt index cfb9287cdb..f0397f5ee6 100644 --- a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt +++ b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt @@ -1,4 +1,4 @@ -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,9): 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'. @@ -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 diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index c18dfb8e35..53d24b3d0f 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -7,14 +7,11 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,30): error TS tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,33): error TS1138: Parameter declaration expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,34): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,36): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(30,21): error TS1108: A 'return' statement can only be used within a function body. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(31,18): error TS1129: Statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(38,17): error TS1109: Expression expected. 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(43,21): error TS1108: A 'return' statement can only be used within a function body. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(46,13): error TS1005: 'try' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(55,13): error TS1108: A 'return' statement can only be used within a function body. 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. @@ -35,10 +32,8 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(234,14): error T 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(236,13): error TS1108: A 'return' statement can only be used within a function body. 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(239,13): error TS1108: A 'return' statement can only be used within a function body. 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. @@ -93,7 +88,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,29): error T tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2304: Cannot find name 'string'. -==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (93 errors) ==== +==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (88 errors) ==== declare module "fs" { export class File { constructor(filename: string); @@ -153,8 +148,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T !!! error TS2391: Function implementation is missing or not immediately following the declaration. return 1; - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. ^ ~ !!! error TS1129: Statement expected. @@ -188,8 +181,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T !!! error TS2304: Cannot find name 'retValue'. return 1; - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. } } catch (e) { @@ -208,8 +199,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T !!! error TS2304: Cannot find name 'console'. return 0; - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. } } @@ -453,8 +442,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T ~~~~~~ !!! error TS2304: Cannot find name 'number'. return val; - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. } public method2() { ~~~~~~ @@ -464,8 +451,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T ~~~~~~~ !!! error TS2304: Cannot find name 'method2'. return 2 * this.method1(2); - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. } } ~ diff --git a/tests/baselines/reference/createArray.errors.txt b/tests/baselines/reference/createArray.errors.txt index 6f79c4b47d..2e2b456756 100644 --- a/tests/baselines/reference/createArray.errors.txt +++ b/tests/baselines/reference/createArray.errors.txt @@ -1,7 +1,7 @@ -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,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/createArray.ts(6,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/createArray.ts(7,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/createArray.ts(8,8): 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(8,12): error TS2304: Cannot find name 'string'. @@ -9,7 +9,7 @@ tests/cases/compiler/createArray.ts(8,12): error TS2304: Cannot find name 'strin ==== 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'. @@ -18,15 +18,15 @@ tests/cases/compiler/createArray.ts(8,12): error TS2304: Cannot find name 'strin } new C[]; - ~~ + ~~~~~~~ !!! 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. ~~~~~~ !!! error TS2304: Cannot find name 'string'. diff --git a/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt index 235b665cdc..e6859558f7 100644 --- a/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt +++ b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,28): error TS1003: Identifier expected. +tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,29): error TS1003: Identifier expected. tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,9): error TS2304: Cannot find name 'IgnoreRulesSpecific'. @@ -7,7 +7,7 @@ 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'. diff --git a/tests/baselines/reference/enumMemberResolution.errors.txt b/tests/baselines/reference/enumMemberResolution.errors.txt index 5c84c08d98..f446c0d790 100644 --- a/tests/baselines/reference/enumMemberResolution.errors.txt +++ b/tests/baselines/reference/enumMemberResolution.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/enumMemberResolution.ts(4,28): error TS1003: Identifier expected. +tests/cases/compiler/enumMemberResolution.ts(4,29): error TS1003: Identifier expected. tests/cases/compiler/enumMemberResolution.ts(4,9): error TS2304: Cannot find name 'IgnoreRulesSpecific'. @@ -7,7 +7,7 @@ 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'. diff --git a/tests/baselines/reference/exportAssignmentWithDeclareAndExportModifiers.errors.txt b/tests/baselines/reference/exportAssignmentWithDeclareAndExportModifiers.errors.txt index 20355aec05..f8dc011459 100644 --- a/tests/baselines/reference/exportAssignmentWithDeclareAndExportModifiers.errors.txt +++ b/tests/baselines/reference/exportAssignmentWithDeclareAndExportModifiers.errors.txt @@ -1,11 +1,8 @@ tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts(2,1): error TS1120: An export assignment cannot have modifiers. -tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. -==== tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts (2 errors) ==== +==== tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts (1 errors) ==== var x; export declare export = x; - ~~~~~~~~~~~~~~ -!!! error TS1120: An export assignment cannot have modifiers. - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file + ~~~~~~ +!!! error TS1120: An export assignment cannot have modifiers. \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentWithDeclareModifier.errors.txt b/tests/baselines/reference/exportAssignmentWithDeclareModifier.errors.txt index 1d2f2e265d..2f9d8d801a 100644 --- a/tests/baselines/reference/exportAssignmentWithDeclareModifier.errors.txt +++ b/tests/baselines/reference/exportAssignmentWithDeclareModifier.errors.txt @@ -1,11 +1,8 @@ tests/cases/compiler/exportAssignmentWithDeclareModifier.ts(2,1): error TS1120: An export assignment cannot have modifiers. -tests/cases/compiler/exportAssignmentWithDeclareModifier.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. -==== tests/cases/compiler/exportAssignmentWithDeclareModifier.ts (2 errors) ==== +==== tests/cases/compiler/exportAssignmentWithDeclareModifier.ts (1 errors) ==== var x; declare export = x; ~~~~~~~ -!!! error TS1120: An export assignment cannot have modifiers. - ~~~~~~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file +!!! error TS1120: An export assignment cannot have modifiers. \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentWithExportModifier.errors.txt b/tests/baselines/reference/exportAssignmentWithExportModifier.errors.txt index e19ce5bc85..275f4b0ba1 100644 --- a/tests/baselines/reference/exportAssignmentWithExportModifier.errors.txt +++ b/tests/baselines/reference/exportAssignmentWithExportModifier.errors.txt @@ -1,11 +1,8 @@ tests/cases/compiler/exportAssignmentWithExportModifier.ts(2,1): error TS1120: An export assignment cannot have modifiers. -tests/cases/compiler/exportAssignmentWithExportModifier.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. -==== tests/cases/compiler/exportAssignmentWithExportModifier.ts (2 errors) ==== +==== tests/cases/compiler/exportAssignmentWithExportModifier.ts (1 errors) ==== var x; export export = x; ~~~~~~ -!!! error TS1120: An export assignment cannot have modifiers. - ~~~~~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file +!!! error TS1120: An export assignment cannot have modifiers. \ No newline at end of file diff --git a/tests/baselines/reference/importDeclarationInModuleDeclaration1.errors.txt b/tests/baselines/reference/importDeclarationInModuleDeclaration1.errors.txt index 82132947ee..ba6aae1e36 100644 --- a/tests/baselines/reference/importDeclarationInModuleDeclaration1.errors.txt +++ b/tests/baselines/reference/importDeclarationInModuleDeclaration1.errors.txt @@ -4,6 +4,6 @@ tests/cases/compiler/importDeclarationInModuleDeclaration1.ts(2,5): error TS1147 ==== tests/cases/compiler/importDeclarationInModuleDeclaration1.ts (1 errors) ==== module m2 { import m3 = require("use_glo_M1_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. } \ No newline at end of file diff --git a/tests/baselines/reference/importInsideModule.errors.txt b/tests/baselines/reference/importInsideModule.errors.txt index dc89bb5e9c..4a7ab9d5b7 100644 --- a/tests/baselines/reference/importInsideModule.errors.txt +++ b/tests/baselines/reference/importInsideModule.errors.txt @@ -5,7 +5,7 @@ tests/cases/compiler/importInsideModule_file2.ts(2,26): error TS2307: Cannot fin ==== tests/cases/compiler/importInsideModule_file2.ts (2 errors) ==== export module myModule { import foo = require("importInsideModule_file1"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2307: Cannot find external module 'importInsideModule_file1'. diff --git a/tests/baselines/reference/incompleteObjectLiteral1.errors.txt b/tests/baselines/reference/incompleteObjectLiteral1.errors.txt index c37f308960..2e363de591 100644 --- a/tests/baselines/reference/incompleteObjectLiteral1.errors.txt +++ b/tests/baselines/reference/incompleteObjectLiteral1.errors.txt @@ -1,14 +1,11 @@ -tests/cases/compiler/incompleteObjectLiteral1.ts(1,14): error TS1005: ',' expected. +tests/cases/compiler/incompleteObjectLiteral1.ts(1,14): error TS1005: ':' expected. tests/cases/compiler/incompleteObjectLiteral1.ts(1,16): error TS1128: Declaration or statement expected. -tests/cases/compiler/incompleteObjectLiteral1.ts(1,12): error TS2304: Cannot find name 'aa'. -==== tests/cases/compiler/incompleteObjectLiteral1.ts (3 errors) ==== +==== tests/cases/compiler/incompleteObjectLiteral1.ts (2 errors) ==== var tt = { aa; } ~ -!!! error TS1005: ',' expected. +!!! error TS1005: ':' expected. ~ !!! error TS1128: Declaration or statement expected. - ~~ -!!! error TS2304: Cannot find name 'aa'. var x = tt; \ No newline at end of file diff --git a/tests/baselines/reference/initializersInDeclarations.errors.txt b/tests/baselines/reference/initializersInDeclarations.errors.txt index 9e02a1cd74..99798d749c 100644 --- a/tests/baselines/reference/initializersInDeclarations.errors.txt +++ b/tests/baselines/reference/initializersInDeclarations.errors.txt @@ -1,28 +1,43 @@ -tests/cases/conformance/externalModules/initializersInDeclarations.ts(5,7): error TS1039: Initializers are not allowed in ambient contexts. -tests/cases/conformance/externalModules/initializersInDeclarations.ts(6,14): error TS1039: Initializers are not allowed in ambient contexts. +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(8,3): error TS1036: Statements are not allowed 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. +tests/cases/conformance/externalModules/initializersInDeclarations.ts(18,16): error TS1039: Initializers are not allowed in ambient contexts. -==== tests/cases/conformance/externalModules/initializersInDeclarations.ts (2 errors) ==== +==== tests/cases/conformance/externalModules/initializersInDeclarations.ts (7 errors) ==== // Errors: Initializers & statements in declaration file declare class Foo { name = "test"; - ~ + ~~~~~~ !!! error TS1039: Initializers are not allowed in ambient contexts. "some prop" = 42; - ~ + ~~ !!! error TS1039: Initializers are not allowed in ambient contexts. fn(): boolean { return false; + ~~~~~~ +!!! error TS1036: Statements are not allowed in ambient contexts. } } declare var x = []; + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. declare var y = {}; + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. declare module M1 { while(true); + ~~~~~ +!!! error TS1036: Statements are not allowed in ambient contexts. export var v1 = () => false; + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendingClass2.errors.txt b/tests/baselines/reference/interfaceExtendingClass2.errors.txt index 83cd97c72c..1e07199686 100644 --- a/tests/baselines/reference/interfaceExtendingClass2.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClass2.errors.txt @@ -1,11 +1,10 @@ -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(13,13): error TS1108: A 'return' statement can only be used within a function body. 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 (5 errors) ==== +==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts (4 errors) ==== class Foo { x: string; y() { } @@ -23,8 +22,6 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending !!! error TS2411: Property 'a' of type '{ toString: () => {}; }' is not assignable to string index type 'Object'. return 1; ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. - ~~~~~~ !!! error TS1131: Property or signature expected. }; ~ diff --git a/tests/baselines/reference/libMembers.errors.txt b/tests/baselines/reference/libMembers.errors.txt index a6af67821b..73f5c945f7 100644 --- a/tests/baselines/reference/libMembers.errors.txt +++ b/tests/baselines/reference/libMembers.errors.txt @@ -1,4 +1,4 @@ -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(9,11): 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(12,15): error TS2339: Property 'prototype' does not exist on type 'C'. @@ -15,7 +15,7 @@ tests/cases/compiler/libMembers.ts(12,15): error TS2339: Property 'prototype' do export class C { } var a=new C[]; - ~~ + ~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. a.length; a.push(new C()); diff --git a/tests/baselines/reference/missingArgument1.errors.txt b/tests/baselines/reference/missingArgument1.errors.txt new file mode 100644 index 0000000000..02911e3c9b --- /dev/null +++ b/tests/baselines/reference/missingArgument1.errors.txt @@ -0,0 +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,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 TS2304: Cannot find name 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/newOperator.errors.txt b/tests/baselines/reference/newOperator.errors.txt index 2d3fd00544..47f0a68b68 100644 --- a/tests/baselines/reference/newOperator.errors.txt +++ b/tests/baselines/reference/newOperator.errors.txt @@ -1,6 +1,6 @@ -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(45,23): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/newOperator.ts(18,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/newOperator.ts(20,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/newOperator.ts(45,16): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. 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. @@ -38,14 +38,16 @@ 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'. var t4 = new + ~~~ string ~~~~~~ + ~~~~~~ !!! error TS2304: Cannot find name 'string'. [ ~ @@ -78,7 +80,7 @@ tests/cases/compiler/newOperator.ts(31,10): error TS2351: Cannot use 'new' with class S { public get xs(): M.T[] { return new M.T[]; - ~~ + ~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. } } diff --git a/tests/baselines/reference/objectLiteralErrors.errors.txt b/tests/baselines/reference/objectLiteralErrors.errors.txt index 8a1774c452..d27823a30a 100644 --- a/tests/baselines/reference/objectLiteralErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralErrors.errors.txt @@ -1,5 +1,22 @@ 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 TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. +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'. @@ -79,7 +96,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,12) tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,51): error TS2380: 'get' and 'set' accessor must have the same type. -==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts (79 errors) ==== +==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts (96 errors) ==== // Multiple properties with the same name var e1 = { a: 0, a: 0 }; @@ -177,71 +194,99 @@ 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 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 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 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 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 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 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 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 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 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 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 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 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 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'. ~~~ @@ -254,16 +299,22 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,51) ~~~ !!! 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 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 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'. ~ diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt index 3c5f4e97d8..33672c3d54 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt @@ -7,18 +7,17 @@ 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,6): error TS1005: ',' expected. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(16,6): error TS1005: ',' expected. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(17,6): error TS1005: '=' expected. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(18,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(15,6): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(16,6): error TS1005: ':' expected. +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(5,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(15,5): error TS2300: Duplicate identifier 'a'. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(15,7): error TS2304: Cannot find name 'b'. 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 (18 errors) ==== +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts (17 errors) ==== // errors var y = { "stringLiteral", @@ -55,22 +54,20 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr var x = { a.b, ~ -!!! error TS1005: ',' expected. +!!! error TS1005: ':' expected. ~ !!! error TS2300: Duplicate identifier 'a'. - ~ -!!! error TS2304: Cannot find name 'b'. a["ss"], ~ -!!! error TS1005: ',' expected. +!!! error TS1005: ':' expected. ~ !!! error TS2300: Duplicate identifier 'a'. a[1], ~ -!!! error TS1005: '=' expected. +!!! error TS1005: ':' expected. + ~ +!!! error TS2300: Duplicate identifier 'a'. }; - ~ -!!! error TS1128: Declaration or statement expected. var v = { class }; // error ~ diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt index f5fd8ed53f..15bac99436 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorWithModule.ts(10,10): error TS1005: ',' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorWithModule.ts(10,10): error TS1005: ':' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorWithModule.ts(14,3): error TS2339: Property 'y' does not exist on type 'typeof m'. @@ -14,7 +14,7 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr export var y = { m.x // error ~ -!!! error TS1005: ',' expected. +!!! error TS1005: ':' expected. }; } diff --git a/tests/baselines/reference/objectTypeWithOptionalProperty1.errors.txt b/tests/baselines/reference/objectTypeWithOptionalProperty1.errors.txt new file mode 100644 index 0000000000..7e17563873 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithOptionalProperty1.errors.txt @@ -0,0 +1,9 @@ +tests/cases/compiler/objectTypeWithOptionalProperty1.ts(2,10): error TS1160: An object member cannot be declared optional. + + +==== tests/cases/compiler/objectTypeWithOptionalProperty1.ts (1 errors) ==== + var b = { + x?: 1 // error + ~ +!!! error TS1160: An object member cannot be declared optional. + } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt b/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt index e73e8adc93..d33a5e35b6 100644 --- a/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt +++ b/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts(12,6): error TS1112: A class member cannot be declared optional. tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts(20,6): error TS1112: A class member cannot be declared optional. -tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts(24,6): error TS1160: A object member cannot be declared optional. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts(24,6): error TS1160: An object member cannot be declared optional. ==== tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts (3 errors) ==== @@ -32,6 +32,6 @@ tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWith var b = { x?: 1 // error - -!!! error TS1160: A object member cannot be declared optional. + ~ +!!! error TS1160: An object member cannot be declared optional. } \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt index 0d4cd775c5..70530d409b 100644 --- a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt +++ b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt @@ -1,13 +1,10 @@ tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(1,37): error TS1005: ';' expected. -tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(1,42): error TS1108: A 'return' statement can only be used within a function body. 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 (3 errors) ==== +==== tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts (2 errors) ==== var f: (x: 'hi') => number = ('hi') => { return 1; }; ~~ !!! error TS1005: ';' expected. - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. ~~~~~~~~~~~~~~~~~~~ !!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. \ No newline at end of file diff --git a/tests/baselines/reference/parser512097.errors.txt b/tests/baselines/reference/parser512097.errors.txt index 181060db95..3963d969c3 100644 --- a/tests/baselines/reference/parser512097.errors.txt +++ b/tests/baselines/reference/parser512097.errors.txt @@ -1,16 +1,13 @@ -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512097.ts(1,14): error TS1005: ',' expected. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512097.ts(1,14): error TS1005: ':' expected. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512097.ts(1,16): error TS1128: Declaration or statement expected. -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512097.ts(1,12): error TS2304: Cannot find name 'aa'. -==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512097.ts (3 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512097.ts (2 errors) ==== var tt = { aa; } // After this point, no useful parsing occurs in the entire file ~ -!!! error TS1005: ',' expected. +!!! error TS1005: ':' expected. ~ !!! error TS1128: Declaration or statement expected. - ~~ -!!! error TS2304: Cannot find name 'aa'. if (true) { } \ No newline at end of file diff --git a/tests/baselines/reference/parser645086_1.errors.txt b/tests/baselines/reference/parser645086_1.errors.txt index d326fa2397..f6b76cf26b 100644 --- a/tests/baselines/reference/parser645086_1.errors.txt +++ b/tests/baselines/reference/parser645086_1.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,13): error TS1005: ',' expected. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,14): error TS1134: Variable declaration expected. -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,15): error TS1161: Unterminated regular expression literal. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,15): error TS1162: Unterminated regular expression literal. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts (3 errors) ==== @@ -10,4 +10,4 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,1 ~ !!! error TS1134: Variable declaration expected. -!!! error TS1161: Unterminated regular expression literal. \ No newline at end of file +!!! error TS1162: Unterminated regular expression literal. \ No newline at end of file diff --git a/tests/baselines/reference/parser645086_2.errors.txt b/tests/baselines/reference/parser645086_2.errors.txt index 2d40b3c8f7..558ff5964e 100644 --- a/tests/baselines/reference/parser645086_2.errors.txt +++ b/tests/baselines/reference/parser645086_2.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,14): error TS1005: ',' expected. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,15): error TS1134: Variable declaration expected. -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,16): error TS1161: Unterminated regular expression literal. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,16): error TS1162: Unterminated regular expression literal. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts (3 errors) ==== @@ -10,4 +10,4 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,1 ~ !!! error TS1134: Variable declaration expected. -!!! error TS1161: Unterminated regular expression literal. \ No newline at end of file +!!! error TS1162: Unterminated regular expression literal. \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecovery_ArgumentList6.errors.txt b/tests/baselines/reference/parserErrorRecovery_ArgumentList6.errors.txt index 799c67593e..cf6f7b1093 100644 --- a/tests/baselines/reference/parserErrorRecovery_ArgumentList6.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_ArgumentList6.errors.txt @@ -1,12 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList6.ts(1,5): error TS1135: Argument expression expected. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList6.ts(1,6): error TS1005: ')' expected. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList6.ts(1,1): error TS2304: Cannot find name 'Foo'. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList6.ts (3 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList6.ts (2 errors) ==== Foo(, - ~ -!!! error TS1135: Argument expression expected. !!! error TS1005: ')' expected. ~~~ diff --git a/tests/baselines/reference/parserErrorRecovery_ArgumentList7.errors.txt b/tests/baselines/reference/parserErrorRecovery_ArgumentList7.errors.txt index 95f4febf44..67602cb11a 100644 --- a/tests/baselines/reference/parserErrorRecovery_ArgumentList7.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_ArgumentList7.errors.txt @@ -1,13 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList7.ts(1,7): error TS1135: Argument expression expected. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList7.ts(1,8): error TS1005: ')' expected. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList7.ts(1,1): error TS2304: Cannot find name 'Foo'. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList7.ts(1,5): error TS2304: Cannot find name 'a'. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList7.ts (4 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList7.ts (3 errors) ==== Foo(a,, - ~ -!!! error TS1135: Argument expression expected. !!! error TS1005: ')' expected. ~~~ diff --git a/tests/baselines/reference/parserErrorRecovery_ModuleElement1.errors.txt b/tests/baselines/reference/parserErrorRecovery_ModuleElement1.errors.txt index ad23c21ec1..4b8be3e17a 100644 --- a/tests/baselines/reference/parserErrorRecovery_ModuleElement1.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_ModuleElement1.errors.txt @@ -1,19 +1,13 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ModuleElements/parserErrorRecovery_ModuleElement1.ts(1,1): error TS1108: A 'return' statement can only be used within a function body. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ModuleElements/parserErrorRecovery_ModuleElement1.ts(2,1): error TS1128: Declaration or statement expected. -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ModuleElements/parserErrorRecovery_ModuleElement1.ts(3,1): error TS1108: A 'return' statement can only be used within a function body. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ModuleElements/parserErrorRecovery_ModuleElement1.ts(4,1): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ModuleElements/parserErrorRecovery_ModuleElement1.ts (4 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ModuleElements/parserErrorRecovery_ModuleElement1.ts (2 errors) ==== return foo; - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. } ~ !!! error TS1128: Declaration or statement expected. return bar; - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. } ~ !!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecovery_ObjectLiteral2.errors.txt b/tests/baselines/reference/parserErrorRecovery_ObjectLiteral2.errors.txt index 1c526f0c9e..55667d42de 100644 --- a/tests/baselines/reference/parserErrorRecovery_ObjectLiteral2.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_ObjectLiteral2.errors.txt @@ -1,14 +1,11 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ObjectLiterals/parserErrorRecovery_ObjectLiteral2.ts(2,1): error TS1005: ',' expected. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ObjectLiterals/parserErrorRecovery_ObjectLiteral2.ts(2,1): error TS1005: ':' expected. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ObjectLiterals/parserErrorRecovery_ObjectLiteral2.ts(2,7): error TS1005: ':' expected. -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ObjectLiterals/parserErrorRecovery_ObjectLiteral2.ts(1,11): error TS2304: Cannot find name 'a'. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ObjectLiterals/parserErrorRecovery_ObjectLiteral2.ts (3 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ObjectLiterals/parserErrorRecovery_ObjectLiteral2.ts (2 errors) ==== var v = { a - ~ -!!! error TS2304: Cannot find name 'a'. return; ~~~~~~ -!!! error TS1005: ',' expected. +!!! error TS1005: ':' expected. ~ !!! error TS1005: ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecovery_VariableList1.errors.txt b/tests/baselines/reference/parserErrorRecovery_VariableList1.errors.txt index a42ffcdd47..b69cab688f 100644 --- a/tests/baselines/reference/parserErrorRecovery_VariableList1.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_VariableList1.errors.txt @@ -1,8 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/VariableLists/parserErrorRecovery_VariableList1.ts(1,6): error TS1009: Trailing comma not allowed. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/VariableLists/parserErrorRecovery_VariableList1.ts(2,1): error TS1108: A 'return' statement can only be used within a function body. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/VariableLists/parserErrorRecovery_VariableList1.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/VariableLists/parserErrorRecovery_VariableList1.ts (2 errors) ==== var a, + ~ +!!! error TS1009: Trailing comma not allowed. return; ~~~~~~ !!! error TS1108: A 'return' statement can only be used within a function body. \ No newline at end of file diff --git a/tests/baselines/reference/parserExportAssignment5.errors.txt b/tests/baselines/reference/parserExportAssignment5.errors.txt index b463034f62..16c4188bc0 100644 --- a/tests/baselines/reference/parserExportAssignment5.errors.txt +++ b/tests/baselines/reference/parserExportAssignment5.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignm ==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment5.ts (2 errors) ==== module M { export = A; - ~~~~~~~~~~~ + ~~~~~~ !!! error TS1063: An export assignment cannot be used in an internal module. ~~~~~~~~~~~ !!! error TS2304: Cannot find name 'A'. diff --git a/tests/baselines/reference/parserIndexMemberDeclaration10.errors.txt b/tests/baselines/reference/parserIndexMemberDeclaration10.errors.txt index dc4da35ebc..d448aaa3f2 100644 --- a/tests/baselines/reference/parserIndexMemberDeclaration10.errors.txt +++ b/tests/baselines/reference/parserIndexMemberDeclaration10.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration10.ts(2,4): error TS1145: Modifiers not permitted on index signature members. +tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration10.ts(2,11): error TS1030: 'static' modifier already seen. ==== tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration10.ts (1 errors) ==== class C { static static [x: string]: string; - ~~~~~~~~~~~~~ -!!! error TS1145: Modifiers not permitted on index signature members. + ~~~~~~ +!!! error TS1030: 'static' modifier already seen. } \ No newline at end of file diff --git a/tests/baselines/reference/parserIndexMemberDeclaration9.errors.txt b/tests/baselines/reference/parserIndexMemberDeclaration9.errors.txt index 00ae01b12d..493a789449 100644 --- a/tests/baselines/reference/parserIndexMemberDeclaration9.errors.txt +++ b/tests/baselines/reference/parserIndexMemberDeclaration9.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration9.ts(2,4): error TS1145: Modifiers not permitted on index signature members. +tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration9.ts(2,4): error TS1031: 'export' modifier cannot appear on a class element. ==== tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration9.ts (1 errors) ==== class C { export [x: string]: string; ~~~~~~ -!!! error TS1145: Modifiers not permitted on index signature members. +!!! error TS1031: 'export' modifier cannot appear on a class element. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMissingToken2.errors.txt b/tests/baselines/reference/parserMissingToken2.errors.txt index 31012c0865..8ac1769233 100644 --- a/tests/baselines/reference/parserMissingToken2.errors.txt +++ b/tests/baselines/reference/parserMissingToken2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/parser/ecmascript5/MissingTokens/parserMissingToken2.ts(1,2): error TS1161: Unterminated regular expression literal. +tests/cases/conformance/parser/ecmascript5/MissingTokens/parserMissingToken2.ts(1,2): error TS1162: Unterminated regular expression literal. ==== tests/cases/conformance/parser/ecmascript5/MissingTokens/parserMissingToken2.ts (1 errors) ==== / b; -!!! error TS1161: Unterminated regular expression literal. \ No newline at end of file +!!! error TS1162: Unterminated regular expression literal. \ No newline at end of file diff --git a/tests/baselines/reference/parserObjectCreationArrayLiteral1.errors.txt b/tests/baselines/reference/parserObjectCreationArrayLiteral1.errors.txt index 04be3a6d04..f0ca8d45b7 100644 --- a/tests/baselines/reference/parserObjectCreationArrayLiteral1.errors.txt +++ b/tests/baselines/reference/parserObjectCreationArrayLiteral1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral1.ts(1,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral1.ts(1,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral1.ts(1,5): error TS2304: Cannot find name 'Foo'. ==== tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral1.ts (2 errors) ==== new Foo[]; - ~~ + ~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~ !!! error TS2304: Cannot find name 'Foo'. \ No newline at end of file diff --git a/tests/baselines/reference/parserObjectCreationArrayLiteral3.errors.txt b/tests/baselines/reference/parserObjectCreationArrayLiteral3.errors.txt index 89f861cfcd..3187d985cc 100644 --- a/tests/baselines/reference/parserObjectCreationArrayLiteral3.errors.txt +++ b/tests/baselines/reference/parserObjectCreationArrayLiteral3.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral3.ts(1,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral3.ts(1,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral3.ts(1,5): error TS2304: Cannot find name 'Foo'. ==== tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral3.ts (2 errors) ==== new Foo[](); - ~~ + ~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~ !!! error TS2304: Cannot find name 'Foo'. \ No newline at end of file diff --git a/tests/baselines/reference/parserRealSource10.errors.txt b/tests/baselines/reference/parserRealSource10.errors.txt index aabafd751e..4184d9ac23 100644 --- a/tests/baselines/reference/parserRealSource10.errors.txt +++ b/tests/baselines/reference/parserRealSource10.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. -tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(127,42): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(128,42): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(129,47): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(130,42): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(449,40): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(127,29): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(128,32): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(129,37): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(130,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(449,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(128,36): error TS2304: Cannot find name 'string'. tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(129,41): error TS2304: Cannot find name 'number'. tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(130,35): error TS2304: Cannot find name 'boolean'. @@ -472,20 +472,20 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(356,53): error } export var tokenTable = new TokenInfo[]; - ~~ + ~~~~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. export var nodeTypeTable = new string[]; - ~~ + ~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~ !!! error TS2304: Cannot find name 'string'. export var nodeTypeToTokTable = new number[]; - ~~ + ~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~ !!! error TS2304: Cannot find name 'number'. export var noRegexTable = new boolean[]; - ~~ + ~~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~~ !!! error TS2304: Cannot find name 'boolean'. @@ -1474,7 +1474,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(356,53): error // TODO: new with length TokenID.LimFixed export var staticTokens = new Token[]; - ~~ + ~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. export function initializeStaticTokens() { for (var i = 0; i <= TokenID.LimFixed; i++) { diff --git a/tests/baselines/reference/parserRealSource11.errors.txt b/tests/baselines/reference/parserRealSource11.errors.txt index 68fe64a63f..c76206b821 100644 --- a/tests/baselines/reference/parserRealSource11.errors.txt +++ b/tests/baselines/reference/parserRealSource11.errors.txt @@ -1,7 +1,8 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. -tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(193,40): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1009,45): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1024,47): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(193,33): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(867,29): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1009,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1024,33): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(13,22): error TS2304: Cannot find name 'Type'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(14,24): error TS2304: Cannot find name 'ASTFlags'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(17,38): error TS2304: Cannot find name 'CompilerDiagnostics'. @@ -514,7 +515,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,30): error tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error TS2304: Cannot find name 'TokenID'. -==== tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts (514 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts (515 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -792,7 +793,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error ~~~~~~~~~~~ !!! error TS2304: Cannot find name 'SymbolScope'. public members: AST[] = new AST[]; - ~~ + ~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. constructor () { @@ -1814,6 +1815,8 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error } public getAliasName(aliasAST?: AST = this.alias) : string { + ~~~~~~~~ +!!! error TS1015: Parameter cannot have question mark and initializer. if (aliasAST.nodeType == NodeType.Name) { ~~~~~~~~ !!! error TS2304: Cannot find name 'NodeType'. @@ -2026,7 +2029,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error !!! error TS2304: Cannot find name 'Symbol'. if (this.envids == null) { this.envids = new Identifier[]; - ~~ + ~~~~~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. } this.envids[this.envids.length] = id; @@ -2045,7 +2048,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error !!! error TS2304: Cannot find name 'Symbol'. if (this.jumpRefs == null) { this.jumpRefs = new Identifier[]; - ~~ + ~~~~~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. } var id = new Identifier(sym.name); diff --git a/tests/baselines/reference/parserRealSource4.errors.txt b/tests/baselines/reference/parserRealSource4.errors.txt index e0ae0d2221..5974d62df4 100644 --- a/tests/baselines/reference/parserRealSource4.errors.txt +++ b/tests/baselines/reference/parserRealSource4.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. -tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(195,37): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(195,24): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ==== tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts (2 errors) ==== @@ -200,7 +200,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(195,37): error T export class HashTable { public itemCount: number = 0; public table = new HashEntry[]; - ~~ + ~~~~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. constructor (public size: number, public hashFn: (key) =>number, diff --git a/tests/baselines/reference/parserRealSource7.errors.txt b/tests/baselines/reference/parserRealSource7.errors.txt index 7fddac2c46..773dd49942 100644 --- a/tests/baselines/reference/parserRealSource7.errors.txt +++ b/tests/baselines/reference/parserRealSource7.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. -tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(16,45): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(16,33): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(12,38): error TS2304: Cannot find name 'ASTList'. tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(12,62): error TS2304: Cannot find name 'TypeLink'. tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(16,37): error TS2304: Cannot find name 'TypeLink'. @@ -326,7 +326,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(828,13): error T var len = bases.members.length; if (baseTypeLinks == null) { baseTypeLinks = new TypeLink[]; - ~~ + ~~~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~~~ !!! error TS2304: Cannot find name 'TypeLink'. diff --git a/tests/baselines/reference/parserRealSource9.errors.txt b/tests/baselines/reference/parserRealSource9.errors.txt index 1880a72f18..0dc0de6c12 100644 --- a/tests/baselines/reference/parserRealSource9.errors.txt +++ b/tests/baselines/reference/parserRealSource9.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. -tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(12,39): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(12,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(8,38): error TS2304: Cannot find name 'TypeChecker'. tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(9,48): error TS2304: Cannot find name 'TypeLink'. tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(9,67): error TS2304: Cannot find name 'SymbolScope'. @@ -56,7 +56,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(200,48): error T !!! error TS2304: Cannot find name 'Type'. if (typeLinks) { extendsList = new Type[]; - ~~ + ~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~ !!! error TS2304: Cannot find name 'Type'. diff --git a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.errors.txt b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.errors.txt index 7ea76fc24d..cbe05bd173 100644 --- a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.errors.txt +++ b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,6): error TS1161: Unterminated regular expression literal. +tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,6): error TS1162: Unterminated regular expression literal. tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,17): error TS1005: ')' expected. tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,1): error TS2304: Cannot find name 'foo'. @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpre ==== tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts (3 errors) ==== foo(/notregexp); -!!! error TS1161: Unterminated regular expression literal. +!!! error TS1162: Unterminated regular expression literal. !!! error TS1005: ')' expected. ~~~ diff --git a/tests/baselines/reference/privacyGloImportParseErrors.errors.txt b/tests/baselines/reference/privacyGloImportParseErrors.errors.txt index 4b7cbfa744..a2f2843e4b 100644 --- a/tests/baselines/reference/privacyGloImportParseErrors.errors.txt +++ b/tests/baselines/reference/privacyGloImportParseErrors.errors.txt @@ -75,7 +75,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambie var m1_im2_private_v4_private = m1_im2_private.f1(); import m1_im3_private = require("m1_M3_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. ~~~~~~~~~~~~~~ !!! error TS2307: Cannot find external module 'm1_M3_public'. @@ -147,7 +147,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambie module m5 { import m5_errorImport = require("glo_M2_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. import m5_nonerrorImport = glo_M1_public; } @@ -181,7 +181,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambie module m4 { var a = 10; import m2 = require("use_glo_M1_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. } diff --git a/tests/baselines/reference/privacyImportParseErrors.errors.txt b/tests/baselines/reference/privacyImportParseErrors.errors.txt index 81f0d3fd27..7ba28a2514 100644 --- a/tests/baselines/reference/privacyImportParseErrors.errors.txt +++ b/tests/baselines/reference/privacyImportParseErrors.errors.txt @@ -102,7 +102,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient var m1_im2_private_v4_private = m1_im2_private.f1(); import m1_im3_private = require("m1_M3_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. ~~~~~~~~~~~~~~ !!! error TS2307: Cannot find external module 'm1_M3_public'. @@ -196,7 +196,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient var m1_im2_private_v4_private = m1_im2_private.f1(); import m1_im3_private = require("m2_M3_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. ~~~~~~~~~~~~~~ !!! error TS2307: Cannot find external module 'm2_M3_public'. @@ -356,7 +356,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient module m5 { import m5_errorImport = require("glo_M2_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. import m5_nonerrorImport = glo_M1_public; } @@ -395,7 +395,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient module m5 { import m5_errorImport = require("glo_M4_private"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. import m5_nonerrorImport = glo_M3_private; } @@ -455,7 +455,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient module m4 { var a = 10; import m2 = require("use_glo_M1_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. } @@ -466,7 +466,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient module m4 { var a = 10; import m2 = require("use_glo_M1_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. } diff --git a/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt b/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt index 29925d2255..59cbb44a3c 100644 --- a/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt +++ b/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt @@ -4,7 +4,7 @@ internal2.ts(2,2): error TS1147: Import declarations in an internal module canno ==== internal2.ts (1 errors) ==== module outer { import g = require("external2") - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. export var a = g.square(5); export var b = "foo"; diff --git a/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt b/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt index 29925d2255..59cbb44a3c 100644 --- a/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt +++ b/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt @@ -4,7 +4,7 @@ internal2.ts(2,2): error TS1147: Import declarations in an internal module canno ==== internal2.ts (1 errors) ==== module outer { import g = require("external2") - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. export var a = g.square(5); export var b = "foo"; diff --git a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt index b2bc48b454..43f02e4fb9 100644 --- a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt +++ b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt @@ -4,7 +4,7 @@ test1.ts(2,2): error TS1147: Import declarations in an internal module cannot re ==== test1.ts (1 errors) ==== export module myModule { import foo = require("test2"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. //console.log(foo.$); } diff --git a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt index b2bc48b454..43f02e4fb9 100644 --- a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt +++ b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt @@ -4,7 +4,7 @@ test1.ts(2,2): error TS1147: Import declarations in an internal module cannot re ==== test1.ts (1 errors) ==== export module myModule { import foo = require("test2"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. //console.log(foo.$); } diff --git a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt index d40bca7397..35c81a722d 100644 --- a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt +++ b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt @@ -5,7 +5,7 @@ test1.ts(3,2): error TS1147: Import declarations in an internal module cannot re module myModule { import foo = require("test2"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. //console.log(foo.$); diff --git a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt index d40bca7397..35c81a722d 100644 --- a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt +++ b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt @@ -5,7 +5,7 @@ test1.ts(3,2): error TS1147: Import declarations in an internal module cannot re module myModule { import foo = require("test2"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. //console.log(foo.$); diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt index cb53bb4783..09f7aed73f 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt @@ -4,7 +4,7 @@ testGlo.ts(2,5): error TS1147: Import declarations in an internal module cannot ==== testGlo.ts (1 errors) ==== module m2 { export import mExported = require("mExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. export var c1 = new mExported.me.class1; export function f1() { diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt index cb53bb4783..09f7aed73f 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt @@ -4,7 +4,7 @@ testGlo.ts(2,5): error TS1147: Import declarations in an internal module cannot ==== testGlo.ts (1 errors) ==== module m2 { export import mExported = require("mExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. export var c1 = new mExported.me.class1; export function f1() { diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt index 6be6fe0f92..ad44386dcd 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt @@ -7,7 +7,7 @@ test.ts(5,5): error TS1147: Import declarations in an internal module cannot ref module m2 { export import mExported = require("mExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. export var c1 = new mExported.me.class1; export function f1() { diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt index 6be6fe0f92..ad44386dcd 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt @@ -7,7 +7,7 @@ test.ts(5,5): error TS1147: Import declarations in an internal module cannot ref module m2 { export import mExported = require("mExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. export var c1 = new mExported.me.class1; export function f1() { diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt index 24ce0e94be..0d281b950f 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt @@ -4,7 +4,7 @@ test.ts(2,5): error TS1147: Import declarations in an internal module cannot ref ==== test.ts (1 errors) ==== export module m2 { export import mExported = require("mExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. module Internal_M1 { diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt index 24ce0e94be..0d281b950f 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt @@ -4,7 +4,7 @@ test.ts(2,5): error TS1147: Import declarations in an internal module cannot ref ==== test.ts (1 errors) ==== export module m2 { export import mExported = require("mExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. module Internal_M1 { diff --git a/tests/baselines/reference/propertyWrappedInTry.errors.txt b/tests/baselines/reference/propertyWrappedInTry.errors.txt index 36608ca7d8..0809067b33 100644 --- a/tests/baselines/reference/propertyWrappedInTry.errors.txt +++ b/tests/baselines/reference/propertyWrappedInTry.errors.txt @@ -2,14 +2,13 @@ tests/cases/compiler/propertyWrappedInTry.ts(3,5): error TS1068: Unexpected toke tests/cases/compiler/propertyWrappedInTry.ts(5,9): error TS1129: Statement expected. tests/cases/compiler/propertyWrappedInTry.ts(11,5): error TS1128: Declaration or statement expected. tests/cases/compiler/propertyWrappedInTry.ts(11,18): error TS1005: ';' expected. -tests/cases/compiler/propertyWrappedInTry.ts(13,9): error TS1108: A 'return' statement can only be used within a function body. tests/cases/compiler/propertyWrappedInTry.ts(17,1): error TS1128: Declaration or statement expected. tests/cases/compiler/propertyWrappedInTry.ts(5,16): error TS2304: Cannot find name 'bar'. tests/cases/compiler/propertyWrappedInTry.ts(5,22): error TS2304: Cannot find name 'someInitThatMightFail'. tests/cases/compiler/propertyWrappedInTry.ts(11,12): error TS2304: Cannot find name 'baz'. -==== tests/cases/compiler/propertyWrappedInTry.ts (9 errors) ==== +==== tests/cases/compiler/propertyWrappedInTry.ts (8 errors) ==== class Foo { try { @@ -37,8 +36,6 @@ tests/cases/compiler/propertyWrappedInTry.ts(11,12): error TS2304: Cannot find n !!! error TS2304: Cannot find name 'baz'. return this.bar; // doesn't get rewritten to Foo.bar. - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. } diff --git a/tests/baselines/reference/scannerNumericLiteral3.errors.txt b/tests/baselines/reference/scannerNumericLiteral3.errors.txt index 4bfbbd3b42..894eb391f6 100644 --- a/tests/baselines/reference/scannerNumericLiteral3.errors.txt +++ b/tests/baselines/reference/scannerNumericLiteral3.errors.txt @@ -1,10 +1,7 @@ -tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral3.ts(1,1): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral3.ts(1,3): error TS1005: ';' expected. -==== tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral3.ts (2 errors) ==== +==== tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral3.ts (1 errors) ==== 01.0 - ~~ -!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. ~~ !!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/scannerNumericLiteral9.errors.txt b/tests/baselines/reference/scannerNumericLiteral9.errors.txt index 3bcf3a34d8..7f53ca111d 100644 --- a/tests/baselines/reference/scannerNumericLiteral9.errors.txt +++ b/tests/baselines/reference/scannerNumericLiteral9.errors.txt @@ -1,10 +1,7 @@ -tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral9.ts(1,1): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral9.ts(1,3): error TS1005: ';' expected. -==== tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral9.ts (2 errors) ==== +==== tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral9.ts (1 errors) ==== 009 - ~~ -!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. ~ !!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/staticAsIdentifier.errors.txt b/tests/baselines/reference/staticAsIdentifier.errors.txt new file mode 100644 index 0000000000..52108a5a22 --- /dev/null +++ b/tests/baselines/reference/staticAsIdentifier.errors.txt @@ -0,0 +1,10 @@ +tests/cases/compiler/staticAsIdentifier.ts(2,12): error TS1030: 'static' modifier already seen. + + +==== tests/cases/compiler/staticAsIdentifier.ts (1 errors) ==== + class C { + static static + ~~~~~~ +!!! error TS1030: 'static' modifier already seen. + [x: string]: string; + } \ No newline at end of file diff --git a/tests/baselines/reference/staticIndexers.errors.txt b/tests/baselines/reference/staticIndexers.errors.txt index 708c505841..29c46d0ce8 100644 --- a/tests/baselines/reference/staticIndexers.errors.txt +++ b/tests/baselines/reference/staticIndexers.errors.txt @@ -1,9 +1,10 @@ tests/cases/conformance/classes/indexMemberDeclarations/staticIndexers.ts(4,5): error TS1145: Modifiers not permitted on index signature members. tests/cases/conformance/classes/indexMemberDeclarations/staticIndexers.ts(8,5): error TS1145: Modifiers not permitted on index signature members. tests/cases/conformance/classes/indexMemberDeclarations/staticIndexers.ts(12,5): error TS1145: Modifiers not permitted on index signature members. +tests/cases/conformance/classes/indexMemberDeclarations/staticIndexers.ts(12,25): error TS2302: Static members cannot reference class type parameters. -==== tests/cases/conformance/classes/indexMemberDeclarations/staticIndexers.ts (3 errors) ==== +==== tests/cases/conformance/classes/indexMemberDeclarations/staticIndexers.ts (4 errors) ==== // static indexers not allowed class C { @@ -22,4 +23,6 @@ tests/cases/conformance/classes/indexMemberDeclarations/staticIndexers.ts(12,5): static [x: string]: T; ~~~~~~ !!! error TS1145: Modifiers not permitted on index signature members. + ~ +!!! error TS2302: Static members cannot reference class type parameters. } \ No newline at end of file diff --git a/tests/baselines/reference/switchStatementsWithMultipleDefaults.errors.txt b/tests/baselines/reference/switchStatementsWithMultipleDefaults.errors.txt index cd892f5faa..9c46389e90 100644 --- a/tests/baselines/reference/switchStatementsWithMultipleDefaults.errors.txt +++ b/tests/baselines/reference/switchStatementsWithMultipleDefaults.errors.txt @@ -1,7 +1,9 @@ +tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(9,5): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. +tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(10,5): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(28,22): error TS1108: A 'return' statement can only be used within a function body. -==== tests/cases/compiler/switchStatementsWithMultipleDefaults.ts (1 errors) ==== +==== tests/cases/compiler/switchStatementsWithMultipleDefaults.ts (3 errors) ==== var x = 10; @@ -11,7 +13,11 @@ tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(28,22): error TS110 default: // No issues. break; default: // Error; second 'default' clause. + ~~~~~~~~ +!!! error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. default: // Error; third 'default' clause. + ~~~~~~~~ +!!! error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. case 3: x *= x; } diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt index c4a34fccd9..ac184e9489 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt @@ -1,31 +1,31 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(5,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(9,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(13,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(16,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(20,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(23,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(27,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(28,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(29,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(33,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(34,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(35,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(39,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(40,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(41,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(45,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(46,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(47,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(51,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(52,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(53,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(57,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(58,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(64,11): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(77,11): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(81,11): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(86,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(90,11): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(5,10): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(9,17): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(13,16): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(16,16): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(20,16): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(23,16): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(27,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(28,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(29,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(33,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(34,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(35,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(39,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(40,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(41,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(45,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(46,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(47,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(51,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(52,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(53,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(57,23): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(58,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(64,25): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(77,25): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(81,25): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(86,23): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(90,25): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(64,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(77,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. @@ -38,104 +38,104 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference // Generic tag with one parameter function noParams(n: T) { } noParams ``; - ~~~~~~~~~~~ + ~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic tag with parameter which does not use type parameter function noGenericParams(n: string[]) { } noGenericParams ``; - ~~~~~~~~~~~~~~~~~~ + ~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic tag with multiple type parameters and only one used in parameter type annotation function someGenerics1a(n: T, m: number) { } someGenerics1a `${3}`; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. function someGenerics1b(n: string[], m: U) { } someGenerics1b `${3}`; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic tag with argument of function type whose parameter is of type parameter type function someGenerics2a(strs: string[], n: (x: T) => void) { } someGenerics2a `${(n: string) => n}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. function someGenerics2b(strs: string[], n: (x: T, y: U) => void) { } someGenerics2b `${ (n: string, x: number) => n }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter function someGenerics3(strs: string[], producer: () => T) { } someGenerics3 `${() => ''}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics3 `${() => undefined}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics3 `${() => 3}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type function someGenerics4(strs: string[], n: T, f: (x: U) => void) { } someGenerics4 `${4}${ () => null }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics4 `${''}${ () => 3 }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics4 `${ null }${ null }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type function someGenerics5(strs: string[], n: T, f: (x: U) => void) { } someGenerics5 `${ 4 } ${ () => null }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics5 `${ '' }${ () => 3 }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics5 `${null}${null}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic tag with multiple arguments of function types that each have parameters of the same generic type function someGenerics6(strs: string[], a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { } someGenerics6 `${ n => n }${ n => n}${ n => n}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics6 `${ n => n }${ n => n}${ n => n}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic tag with multiple arguments of function types that each have parameters of different generic type function someGenerics7(strs: string[], a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { } someGenerics7 `${ n => n }${ n => n }${ n => n }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics7 `${ n => n }${ n => n }${ n => n }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic tag with argument of generic function type function someGenerics8(strs: string[], n: T): T { return n; } var x = someGenerics8 `${ someGenerics7 }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. x `${null}${null}${null}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic tag with multiple parameters of generic type passed arguments with no best common type @@ -143,7 +143,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference return null; } var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. @@ -161,7 +161,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference } var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. @@ -170,20 +170,20 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference // Generic tag with multiple parameters of generic type passed arguments with a single best common type var a9d = someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var a9d: { x: number; }; // Generic tag with multiple parameters of generic type where one argument is of type 'any' var anyVar: any; var a = someGenerics9 `${ 7 }${ anyVar }${ 4 }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var a: any; // Generic tag with multiple parameters of generic type where one argument is [] and the other is not 'any' var arr = someGenerics9 `${ [] }${ null }${ undefined }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var arr: any[]; diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt index 7dedca9eb3..6676a6d8a8 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt @@ -1,12 +1,12 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(12,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(14,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(16,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(18,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(20,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(22,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(28,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(12,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(14,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(16,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(18,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(20,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(22,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(28,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(14,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(18,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(22,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. @@ -28,49 +28,49 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped var f: I; f `abc` - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. f `abc`.member - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`.member; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. f `abc`["member"]; - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`["member"]; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. f `abc`[0].member `abc${1}def${2}ghi`; - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. diff --git a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.errors.txt index f6300855a1..17c0b330db 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts(13,21): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts(13,23): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts (1 errors) ==== @@ -15,7 +15,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMember var f: I; var x = new new new f `abc${ 0 }def`.member("hello")(42) === true; - ~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt index d49ec4b716..bb5b56578d 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(16,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(17,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(18,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(20,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(16,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(17,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(18,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(20,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(14,9): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. @@ -31,24 +31,24 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio !!! error TS2346: Supplied parameters do not match any signature of call target. var u = foo ``; // number - ~~~~~~ + ~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var v = foo `${1}`; // string - ~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var w = foo `${1}${2}`; // boolean - ~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var x = foo `${1}${true}`; // boolean (with error) - ~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~ !!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. var y = foo `${1}${"2"}`; // {} - ~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var z = foo `${1}${2}${3}`; // any (with error) - ~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.errors.txt index fcde15afc2..3bf4af3977 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts(8,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts(17,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts(8,14): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts(17,14): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts (2 errors) ==== @@ -11,7 +11,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio } var a = foo1 `${1}`; // string - ~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var b = foo1([], 1); // number @@ -22,6 +22,6 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio } var c = foo2 `${1}`; // number - ~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var d = foo2([], 1); // number \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt index dd943e518f..3ffe3d5820 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt @@ -1,25 +1,25 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(7,17): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(10,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(16,16): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(17,16): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(23,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(26,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(34,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(35,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(36,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(40,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(41,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(42,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(45,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(54,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(55,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(56,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(57,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(60,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(64,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(70,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(71,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(7,21): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(10,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(16,20): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(17,20): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(23,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(26,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(34,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(35,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(36,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(40,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(41,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(42,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(45,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(54,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(55,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(56,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(57,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(60,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(64,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(70,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(71,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(10,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(19,4): error TS2339: Property 'foo' does not exist on type 'Date'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(45,1): error TS2346: Supplied parameters do not match any signature of call target. @@ -36,12 +36,12 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio function fn1() { return null; } var s: string = fn1 `${ undefined }`; - ~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // No candidate overloads found fn1 `${ {} }`; // Error - ~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~ !!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. @@ -51,10 +51,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio function fn2() { return undefined; } var d1: Date = fn2 `${ 0 }${ undefined }`; // contextually typed - ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var d2 = fn2 `${ 0 }${ undefined }`; // any - ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. d1.foo(); // error @@ -64,12 +64,12 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // Generic and non-generic overload where generic overload is the only candidate fn2 `${ 0 }${ '' }`; // OK - ~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic and non-generic overload where non-generic overload is the only candidate fn2 `${ '' }${ 0 }`; // OK - ~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic overloads with differing arity @@ -79,30 +79,30 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio function fn3() { return null; } var s = fn3 `${ 3 }`; - ~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var s = fn3 `${'' }${ 3 }${ '' }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var n = fn3 `${ 5 }${ 5 }${ 5 }`; - ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var n: number; // Generic overloads with differing arity tagging with arguments matching each overload type parameter count var s = fn3 `${ 4 }` - ~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var s = fn3 `${ '' }${ '' }${ '' }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var n = fn3 `${ '' }${ '' }${ 3 }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic overloads with differing arity tagging with argument count that doesn't match any overload fn3 ``; // Error - ~~~~~~ + ~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. @@ -115,31 +115,31 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // Generic overloads with constraints tagged with types that satisfy the constraints fn4 `${ '' }${ 3 }`; - ~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. fn4 `${ 3 }${ '' }`; - ~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. fn4 `${ 3 }${ undefined }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. fn4 `${ '' }${ null }`; - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic overloads with constraints called with type arguments that do not satisfy the constraints fn4 `${ null }${ null }`; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4 `${ true }${ null }`; - ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~ !!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; - ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~ !!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. @@ -149,12 +149,12 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio function fn5(strs: TemplateStringsArray, f: (n: number) => void): number; function fn5() { return undefined; } fn5 `${ (n) => n.toFixed() }`; // will error; 'n' should have type 'string'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~~ !!! error TS2339: Property 'toFixed' does not exist on type 'string'. fn5 `${ (n) => n.substr(0) }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt index 8a334a5611..a50339adf1 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt @@ -1,56 +1,56 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(3,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(5,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(7,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(9,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(11,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(13,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(15,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(17,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(19,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(21,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(3,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(5,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(7,7): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(9,7): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(11,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(13,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(15,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(17,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(19,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(21,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts (10 errors) ==== var f: any; f `abc` - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f.g.h `abc` - ~~~~~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f.g.h `abc${1}def${2}ghi`; - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`.member - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`.member; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`["member"]; - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`["member"]; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f.thisIsNotATag(`abc`); diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.errors.txt index 41f3492317..02de690a22 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(12,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(14,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(16,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(18,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(20,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(22,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(24,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(26,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(12,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(14,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(16,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(18,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(20,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(22,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(24,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(26,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts (8 errors) ==== @@ -21,35 +21,35 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(26,1 var f: I; f `abc` - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`.member - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`.member; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`["member"]; - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`["member"]; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`[0].member `abc${1}def${2}ghi`; - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f.thisIsNotATag(`abc`); diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.errors.txt index a64f5379e4..97e424c01a 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.errors.txt +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts(6,15): error TS1160: Unterminated template literal. +tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts(6,15): error TS1161: Unterminated template literal. ==== tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts (1 errors) ==== @@ -9,4 +9,4 @@ tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts(6,1 // Incomplete call, not enough parameters. f `123qdawdrqw -!!! error TS1160: Unterminated template literal. \ No newline at end of file +!!! error TS1161: Unterminated template literal. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.errors.txt index fab10f8a88..cce51b90ef 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.errors.txt +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts(6,4): error TS1160: Unterminated template literal. +tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts(6,4): error TS1161: Unterminated template literal. ==== tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts (1 errors) ==== @@ -9,4 +9,4 @@ tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts(6,4 // Incomplete call, not enough parameters, at EOF. f ` -!!! error TS1160: Unterminated template literal. \ No newline at end of file +!!! error TS1161: Unterminated template literal. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt b/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt index 3bf910f369..675a987192 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,9): error TS1003: Identifier expected. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,15): error TS1005: ';' expected. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,26): error TS1158: Invalid template literal; expected '}' -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(5,1): error TS1160: Unterminated template literal. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(5,1): error TS1161: Unterminated template literal. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,11): error TS2304: Cannot find name 'gen'. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,20): error TS2304: Cannot find name 'yield'. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,30): error TS2304: Cannot find name 'def'. @@ -26,4 +26,4 @@ tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts( } -!!! error TS1160: Unterminated template literal. \ No newline at end of file +!!! error TS1161: Unterminated template literal. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt index 4e62197e03..ff81519d36 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,9): error TS1003: Identifier expected. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,17): error TS1005: ';' expected. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,26): error TS1158: Invalid template literal; expected '}' -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(5,1): error TS1160: Unterminated template literal. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(5,1): error TS1161: Unterminated template literal. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,11): error TS2304: Cannot find name 'gen'. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,20): error TS2304: Cannot find name 'yield'. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,30): error TS2304: Cannot find name 'def'. @@ -26,4 +26,4 @@ tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6. } -!!! error TS1160: Unterminated template literal. \ No newline at end of file +!!! error TS1161: Unterminated template literal. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.errors.txt b/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.errors.txt index a5e05d986c..572ddfbd68 100644 --- a/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.errors.txt +++ b/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts(10,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts(10,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. lib.d.ts(502,11): error TS2300: Duplicate identifier 'TemplateStringsArray'. tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts(2,7): error TS2300: Duplicate identifier 'TemplateStringsArray'. tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts(8,3): error TS2345: Argument of type '{ [x: number]: undefined; }' is not assignable to parameter of type 'TemplateStringsArray'. @@ -21,5 +21,5 @@ tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts(8,3): error TS2 !!! error TS2345: Property 'raw' is missing in type '{ [x: number]: undefined; }'. f `abcdef${ 1234 }${ 5678 }ghijkl`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringsArrayTypeNotDefinedES5Mode.errors.txt b/tests/baselines/reference/templateStringsArrayTypeNotDefinedES5Mode.errors.txt index 6b2d29139e..56793bf95a 100644 --- a/tests/baselines/reference/templateStringsArrayTypeNotDefinedES5Mode.errors.txt +++ b/tests/baselines/reference/templateStringsArrayTypeNotDefinedES5Mode.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/templateStringsArrayTypeNotDefinedES5Mode.ts(7,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/templateStringsArrayTypeNotDefinedES5Mode.ts(7,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/compiler/templateStringsArrayTypeNotDefinedES5Mode.ts(5,3): error TS2345: Argument of type '{ [x: number]: undefined; }' is not assignable to parameter of type 'TemplateStringsArray'. Property 'raw' is missing in type '{ [x: number]: undefined; }'. @@ -14,5 +14,5 @@ tests/cases/compiler/templateStringsArrayTypeNotDefinedES5Mode.ts(5,3): error TS !!! error TS2345: Property 'raw' is missing in type '{ [x: number]: undefined; }'. f `abcdef${ 1234 }${ 5678 }ghijkl`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterConstraints1.errors.txt b/tests/baselines/reference/typeParameterConstraints1.errors.txt index e081f3c6ce..d2e1f505c8 100644 --- a/tests/baselines/reference/typeParameterConstraints1.errors.txt +++ b/tests/baselines/reference/typeParameterConstraints1.errors.txt @@ -23,7 +23,7 @@ tests/cases/compiler/typeParameterConstraints1.ts(12,26): error TS2304: Cannot f ~ !!! error TS1110: Type expected. function foo10 (test: T) { } - ~~~ + ~ !!! error TS1110: Type expected. function foo11 (test: T) { } ~~~~ diff --git a/tests/baselines/reference/unterminatedRegexAtEndOfSource1.errors.txt b/tests/baselines/reference/unterminatedRegexAtEndOfSource1.errors.txt index fa8959e90b..271a1a3074 100644 --- a/tests/baselines/reference/unterminatedRegexAtEndOfSource1.errors.txt +++ b/tests/baselines/reference/unterminatedRegexAtEndOfSource1.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/unterminatedRegexAtEndOfSource1.ts(1,10): error TS1161: Unterminated regular expression literal. +tests/cases/compiler/unterminatedRegexAtEndOfSource1.ts(1,10): error TS1162: Unterminated regular expression literal. ==== tests/cases/compiler/unterminatedRegexAtEndOfSource1.ts (1 errors) ==== var a = / -!!! error TS1161: Unterminated regular expression literal. \ No newline at end of file +!!! error TS1162: Unterminated regular expression literal. \ No newline at end of file diff --git a/tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts b/tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts index 02e40fd364..c329544098 100644 --- a/tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts +++ b/tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts @@ -1,2 +1,3 @@ -var x; +// @module: commonjs +var x; export declare export = x; \ No newline at end of file diff --git a/tests/cases/compiler/exportAssignmentWithDeclareModifier.ts b/tests/cases/compiler/exportAssignmentWithDeclareModifier.ts index e38f7fa8d3..0cd0625e12 100644 --- a/tests/cases/compiler/exportAssignmentWithDeclareModifier.ts +++ b/tests/cases/compiler/exportAssignmentWithDeclareModifier.ts @@ -1,2 +1,3 @@ -var x; +// @module: commonjs +var x; declare export = x; \ No newline at end of file diff --git a/tests/cases/compiler/exportAssignmentWithExportModifier.ts b/tests/cases/compiler/exportAssignmentWithExportModifier.ts index c6b543caee..9d940eb278 100644 --- a/tests/cases/compiler/exportAssignmentWithExportModifier.ts +++ b/tests/cases/compiler/exportAssignmentWithExportModifier.ts @@ -1,2 +1,3 @@ -var x; +// @module: commonjs +var x; export export = x; \ No newline at end of file diff --git a/tests/cases/compiler/missingArgument1.ts b/tests/cases/compiler/missingArgument1.ts new file mode 100644 index 0000000000..27408bc2cd --- /dev/null +++ b/tests/cases/compiler/missingArgument1.ts @@ -0,0 +1 @@ +foo(a,,b); \ No newline at end of file diff --git a/tests/cases/compiler/objectTypeWithOptionalProperty1.ts b/tests/cases/compiler/objectTypeWithOptionalProperty1.ts new file mode 100644 index 0000000000..69f6e1f51e --- /dev/null +++ b/tests/cases/compiler/objectTypeWithOptionalProperty1.ts @@ -0,0 +1,3 @@ + var b = { + x?: 1 // error + } \ No newline at end of file diff --git a/tests/cases/compiler/staticAsIdentifier.ts b/tests/cases/compiler/staticAsIdentifier.ts new file mode 100644 index 0000000000..3cccca3bf8 --- /dev/null +++ b/tests/cases/compiler/staticAsIdentifier.ts @@ -0,0 +1,4 @@ +class C { + static static + [x: string]: string; +} \ No newline at end of file diff --git a/tests/cases/fourslash/formattingNestedScopes.ts b/tests/cases/fourslash/formattingNestedScopes.ts new file mode 100644 index 0000000000..269a67dcaa --- /dev/null +++ b/tests/cases/fourslash/formattingNestedScopes.ts @@ -0,0 +1,27 @@ +/// + +/////*1*/ module My.App { +/////*2*/export var appModule = angular.module("app", [ +/////*3*/ ]).config([() => { +/////*4*/ configureStates +/////*5*/($stateProvider); +/////*6*/}]).run(My.App.setup); +/////*7*/ } + + +format.document() + +goTo.marker("1"); +verify.currentLineContentIs("module My.App {"); +goTo.marker("2"); +verify.currentLineContentIs(" export var appModule = angular.module(\"app\", ["); +goTo.marker("3"); +verify.currentLineContentIs(" ]).config([() => {"); +goTo.marker("4"); +verify.currentLineContentIs(" configureStates"); +goTo.marker("5"); +verify.currentLineContentIs(" ($stateProvider);"); +goTo.marker("6"); +verify.currentLineContentIs(" }]).run(My.App.setup);"); +goTo.marker("7"); +verify.currentLineContentIs("}"); \ No newline at end of file diff --git a/tests/cases/fourslash/getImplementors1.ts b/tests/cases/fourslash/getImplementors1.ts deleted file mode 100644 index c67e246002..0000000000 --- a/tests/cases/fourslash/getImplementors1.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// - -////class C { -//// /**/p; -////} - -goTo.marker(); -verify.implementorsCountIs(0); \ No newline at end of file diff --git a/tests/cases/fourslash/getImplementorsForFunction.ts b/tests/cases/fourslash/getImplementorsForFunction.ts deleted file mode 100644 index d2df60dc14..0000000000 --- a/tests/cases/fourslash/getImplementorsForFunction.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -////function fo/**/o() { -////} - -goTo.marker(); -verify.implementorsCountIs(0); diff --git a/tests/cases/fourslash/quickInfoForRequire.ts b/tests/cases/fourslash/quickInfoForRequire.ts new file mode 100644 index 0000000000..91d59cb431 --- /dev/null +++ b/tests/cases/fourslash/quickInfoForRequire.ts @@ -0,0 +1,11 @@ +/// + +//@Filename: AA/BB.ts +////export class a{} + +//@Filename: quickInfoForRequire_input.ts +////import a = require("AA/B/*1*/B"); + +goTo.marker('1'); +verify.quickInfoIs('module a'); +verify.referencesCountIs(0); \ No newline at end of file diff --git a/tests/cases/fourslash/smartIndentInCallExpressions.ts b/tests/cases/fourslash/smartIndentInCallExpressions.ts new file mode 100644 index 0000000000..1e28932678 --- /dev/null +++ b/tests/cases/fourslash/smartIndentInCallExpressions.ts @@ -0,0 +1,12 @@ +/// + +////module My.App { +//// export var appModule = angular.module("app", [ +//// ]).config([() => { +//// configureStates/*1*/($stateProvider); +//// }]).run(My.App.setup); +////} + +goTo.marker("1") +edit.insert("\n"); +verify.indentationIs(12); // 4 (module block) + 4 (function block) + 4 (call expression) \ No newline at end of file diff --git a/tests/cases/fourslash_old/callSignatureHelp.ts b/tests/cases/fourslash_old/callSignatureHelp.ts deleted file mode 100644 index 4e813dd17c..0000000000 --- a/tests/cases/fourslash_old/callSignatureHelp.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// - -////interface C { -//// (): number; -////} -////var c: C; -////c(/**/ - -goTo.marker(); -verify.currentSignatureHelpIs('c(): number'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/classExtendsInterfaceSigHelp1.ts b/tests/cases/fourslash_old/classExtendsInterfaceSigHelp1.ts deleted file mode 100644 index ebdccef485..0000000000 --- a/tests/cases/fourslash_old/classExtendsInterfaceSigHelp1.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// - -////class C { -//// public foo(x: string); -//// public foo(x: number); -//// public foo(x: any) { return x; } -////} - -////interface I extends C { -//// other(x: any): any; -////} - -////var i: I; -////i.foo(/**/ - -goTo.marker(); -verify.signatureHelpCountIs(2); -verify.currentParameterSpanIs('x: string'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/completionListInObjectLiteralThatIsParameterOfFunctionCall.ts b/tests/cases/fourslash_old/completionListInObjectLiteralThatIsParameterOfFunctionCall.ts deleted file mode 100644 index bb04cd2ce6..0000000000 --- a/tests/cases/fourslash_old/completionListInObjectLiteralThatIsParameterOfFunctionCall.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// - -////class C { x: string; } -////class D { x: string; y: string; } -////function foo(t: T, t2: U) { return null; } -////var r3 = foo(new C(), { x: '', z/*1*/ - -goTo.marker('1') -verify.not.completionListContains('z'); -verify.not.completionListContains('x'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/functionOverloadCount.ts b/tests/cases/fourslash_old/functionOverloadCount.ts deleted file mode 100644 index 00856dcb24..0000000000 --- a/tests/cases/fourslash_old/functionOverloadCount.ts +++ /dev/null @@ -1,15 +0,0 @@ -/// - -////class C1 { -//// public attr(): string; -//// public attr(i: number): string; -//// public attr(i: number, x: boolean): string; -//// public attr(i?: any, x?: any) { -//// return "hi"; -//// } -////} -////var i = new C1; -////i.attr(/*1*/ - -goTo.marker('1'); -verify.signatureHelpCountIs(3); \ No newline at end of file diff --git a/tests/cases/fourslash_old/genericFunctionSignatureHelp1.ts b/tests/cases/fourslash_old/genericFunctionSignatureHelp1.ts deleted file mode 100644 index fc1e45d7e6..0000000000 --- a/tests/cases/fourslash_old/genericFunctionSignatureHelp1.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -////function f(a: T): T { return null; } -////f(/**/ - -goTo.marker(); -verify.currentSignatureHelpIs('f(a: T): T'); diff --git a/tests/cases/fourslash_old/genericFunctionSignatureHelp2.ts b/tests/cases/fourslash_old/genericFunctionSignatureHelp2.ts deleted file mode 100644 index 7751167758..0000000000 --- a/tests/cases/fourslash_old/genericFunctionSignatureHelp2.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -////var f = (a: T) => a; -////f(/**/ - -goTo.marker(); -verify.currentSignatureHelpIs('f(a: T): T'); diff --git a/tests/cases/fourslash_old/genericFunctionSignatureHelp3.ts b/tests/cases/fourslash_old/genericFunctionSignatureHelp3.ts deleted file mode 100644 index 5f3adc6025..0000000000 --- a/tests/cases/fourslash_old/genericFunctionSignatureHelp3.ts +++ /dev/null @@ -1,39 +0,0 @@ -/// - -////function foo1(x: number, callback: (y1: T) => number) { } -////function foo2(x: number, callback: (y2: T) => number) { } -////function foo3(x: number, callback: (y3: T) => number) { } -////function foo4(x: number, callback: (y4: T) => number) { } -////function foo5(x: number, callback: (y5: T) => number) { } -////function foo6(x: number, callback: (y6: T) => number) { } -////function foo7(x: number, callback: (y7: T) => number) { } -//// IDE shows the results on the right of each line, fourslash says different -////foo1(/*1*/ // signature help shows y as T -////foo2(1,/*2*/ // signature help shows y as {} -////foo3(1, (/*3*/ // signature help shows y as T -////foo4(1,/*4*/ // signature help shows y as string -////foo5(1, (/*5*/ // signature help shows y as T -////foo6(1, (/*7*/ // signature help shows y as T - -goTo.marker('1'); -verify.currentSignatureHelpIs('foo1(x: number, callback: (y1: T) => number): void'); - -goTo.marker('2'); -verify.currentSignatureHelpIs('foo2(x: number, callback: (y2: {}) => number): void'); - -goTo.marker('3'); -verify.currentSignatureHelpIs('foo3(x: number, callback: (y3: T) => number): void'); - -goTo.marker('4'); -verify.currentSignatureHelpIs('foo4(x: number, callback: (y4: string) => number): void'); - -goTo.marker('5'); -verify.currentSignatureHelpIs('foo5(x: number, callback: (y5: T) => number): void'); - -goTo.marker('6'); -verify.currentSignatureHelpIs('foo6(x: number, callback: (y6: {}) => number): void'); -edit.insert('string>(null,null);'); // need to make this line parse so we can get reasonable LS answers to later tests - -goTo.marker('7'); -verify.currentSignatureHelpIs('foo7(x: number, callback: (y7: T) => number): void'); diff --git a/tests/cases/fourslash_old/genericFunctionSignatureHelp3MultiFile.ts b/tests/cases/fourslash_old/genericFunctionSignatureHelp3MultiFile.ts deleted file mode 100644 index dbb0a9fe83..0000000000 --- a/tests/cases/fourslash_old/genericFunctionSignatureHelp3MultiFile.ts +++ /dev/null @@ -1,46 +0,0 @@ -/// - -// @Filename: genericFunctionSignatureHelp_0.ts -////function foo1(x: number, callback: (y1: T) => number) { } -// @Filename: genericFunctionSignatureHelp_1.ts -////function foo2(x: number, callback: (y2: T) => number) { } -// @Filename: genericFunctionSignatureHelp_2.ts -////function foo3(x: number, callback: (y3: T) => number) { } -// @Filename: genericFunctionSignatureHelp_3.ts -////function foo4(x: number, callback: (y4: T) => number) { } -// @Filename: genericFunctionSignatureHelp_4.ts -////function foo5(x: number, callback: (y5: T) => number) { } -// @Filename: genericFunctionSignatureHelp_5.ts -////function foo6(x: number, callback: (y6: T) => number) { } -// @Filename: genericFunctionSignatureHelp_6.ts -////function foo7(x: number, callback: (y7: T) => number) { } -// @Filename: genericFunctionSignatureHelp_7.ts -////foo1(/*1*/ // signature help shows y as T -////foo2(1,/*2*/ // signature help shows y as {} -////foo3(1, (/*3*/ // signature help shows y as T -////foo4(1,/*4*/ // signature help shows y as string -////foo5(1, (/*5*/ // signature help shows y as T -////foo6(1, (/*7*/ // signature help shows y as T - -goTo.marker('1'); -verify.currentSignatureHelpIs('foo1(x: number, callback: (y1: T) => number): void'); - -goTo.marker('2'); -verify.currentSignatureHelpIs('foo2(x: number, callback: (y2: {}) => number): void'); - -goTo.marker('3'); -verify.currentSignatureHelpIs('foo3(x: number, callback: (y3: T) => number): void'); - -goTo.marker('4'); -verify.currentSignatureHelpIs('foo4(x: number, callback: (y4: string) => number): void'); - -goTo.marker('5'); -verify.currentSignatureHelpIs('foo5(x: number, callback: (y5: T) => number): void'); - -goTo.marker('6'); -verify.currentSignatureHelpIs('foo6(x: number, callback: (y6: {}) => number): void'); -edit.insert('string>(null,null);'); // need to make this line parse so we can get reasonable LS answers to later tests - -goTo.marker('7'); -verify.currentSignatureHelpIs('foo7(x: number, callback: (y7: T) => number): void'); diff --git a/tests/cases/fourslash_old/getOutliningSpans.ts b/tests/cases/fourslash_old/getOutliningSpans.ts deleted file mode 100644 index 56a4aa7120..0000000000 --- a/tests/cases/fourslash_old/getOutliningSpans.ts +++ /dev/null @@ -1,97 +0,0 @@ -/// - -////// interface -////interface IFoo[| { -//// getDist(): number; -////}|] -//// -////// class members -////class Foo[| { -//// constructor()[| { -//// }|] -//// -//// public foo(): number[| { -//// return 0; -//// }|] -//// -//// public get X()[| { -//// return 1; -//// }|] -//// -//// public set X(v: number)[| { -//// }|] -//// -//// public member = function f()[| { -//// -//// }|] -////}|] -//// -////// modules -////module m1[| { -//// module m2[| { }|] -//// module m3[| { -//// function foo()[| { -//// -//// }|] -//// -//// interface IFoo2[| { -//// -//// }|] -//// -//// class foo2 implements IFoo2[| { -//// -//// }|] -//// }|] -////}|] -//// -////// function declaration -////function foo(): number[| { -//// return 0; -////}|] -//// -////// function expressions -////(function f()[| { -//// -////}|]) -//// -////// trivia handeling -////class ClassFooWithTrivia[| /* some comments */ -//// /* more trivia */ { -//// -//// -//// /*some trailing trivia */ -////}|] /* even more */ -//// -//////outline with deep nesting -////module m1[|{ -//// module m2[| { -//// module m3[| { -//// module m4[| { -//// module m5[| { -//// module m6[| { -//// module m7[| { -//// module m8[| { -//// module m9[| { -//// module m10[| { -//// module m11 { -//// module m12 { -//// export interface IFoo { -//// } -//// } -//// } -//// }|] -//// }|] -//// }|] -//// }|] -//// }|] -//// }|] -//// }|] -//// }|] -//// }|] -////}|] -//// -//////outline after a deeply nested node -////class AfterNestedNodes[| { -////}|] - -verify.outliningSpansInCurrentFile(test.ranges()); diff --git a/tests/cases/fourslash_old/incrementalEditInvocationExpressionAboveInterfaceDeclaration.ts b/tests/cases/fourslash_old/incrementalEditInvocationExpressionAboveInterfaceDeclaration.ts deleted file mode 100644 index 8a06efbaa4..0000000000 --- a/tests/cases/fourslash_old/incrementalEditInvocationExpressionAboveInterfaceDeclaration.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////declare function alert(message?: any): void; -/////*1*/ -////interface Foo { -//// setISO8601(dString): Date; -////} - -diagnostics.setEditValidation(IncrementalEditValidation.None); - -// Do resolve without typeCheck -goTo.marker('1'); -edit.insert("alert("); -verify.currentSignatureHelpIs("alert(message?: any): void"); - -// TypeCheck -verify.errorExistsAfterMarker('1'); diff --git a/tests/cases/fourslash_old/paramHelpOnCommaInString.ts b/tests/cases/fourslash_old/paramHelpOnCommaInString.ts deleted file mode 100644 index 0027178158..0000000000 --- a/tests/cases/fourslash_old/paramHelpOnCommaInString.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// - -////function blah(foo: string, bar: number) { -////} -////blah('hola/*1*/,/*2*/') - -// making sure the comma in a string literal doesn't trigger param help on the second function param -goTo.marker('1'); -verify.currentParameterHelpArgumentNameIs('foo'); -goTo.marker('2'); -verify.currentParameterHelpArgumentNameIs('foo'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/parameterInfoOnParameterType.ts b/tests/cases/fourslash_old/parameterInfoOnParameterType.ts deleted file mode 100644 index d28e675e24..0000000000 --- a/tests/cases/fourslash_old/parameterInfoOnParameterType.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// - -////function foo(a: string) { }; -////var b = "test"; -////foo("test"/*1*/); -////foo(b/*2*/); - -goTo.marker("1"); -verify.currentParameterHelpArgumentNameIs("a"); -goTo.marker("2"); -verify.currentParameterHelpArgumentNameIs("a"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/restArgSignatureHelp.ts b/tests/cases/fourslash_old/restArgSignatureHelp.ts deleted file mode 100644 index baa8702a5f..0000000000 --- a/tests/cases/fourslash_old/restArgSignatureHelp.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -////function f(...x: any[]) { } -////f(/**/); - -goTo.marker(); -verify.currentParameterHelpArgumentNameIs('x'); diff --git a/tests/cases/fourslash_old/signatureHelpAnonymousFunction.ts b/tests/cases/fourslash_old/signatureHelpAnonymousFunction.ts deleted file mode 100644 index cc723c713d..0000000000 --- a/tests/cases/fourslash_old/signatureHelpAnonymousFunction.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////var anonymousFunctionTest = function(n: number, s: string): (a: number, b: string) => string { -//// return null; -////} -////anonymousFunctionTest(5, "")(/*anonymousFunction1*/1, /*anonymousFunction2*/""); - -goTo.marker('anonymousFunction1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs('(a: number, b: string): string'); -verify.currentParameterHelpArgumentNameIs("a"); -verify.currentParameterSpanIs("a: number"); - -goTo.marker('anonymousFunction2'); -verify.currentParameterHelpArgumentNameIs("b"); -verify.currentParameterSpanIs("b: string"); diff --git a/tests/cases/fourslash_old/signatureHelpAtEOF.ts b/tests/cases/fourslash_old/signatureHelpAtEOF.ts deleted file mode 100644 index 64c4aaeeb2..0000000000 --- a/tests/cases/fourslash_old/signatureHelpAtEOF.ts +++ /dev/null @@ -1,15 +0,0 @@ -/// - -////function Foo(arg1: string, arg2: string) { -////} -//// -////Foo(/**/ - -goTo.marker(); -verify.signatureHelpPresent(); -verify.signatureHelpCountIs(1); - -verify.currentSignatureHelpIs("Foo(arg1: string, arg2: string): void"); -verify.currentSignatureParamterCountIs(2); -verify.currentParameterHelpArgumentNameIs("arg1"); -verify.currentParameterSpanIs("arg1: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpBeforeSemicolon1.ts b/tests/cases/fourslash_old/signatureHelpBeforeSemicolon1.ts deleted file mode 100644 index 2b0b07056b..0000000000 --- a/tests/cases/fourslash_old/signatureHelpBeforeSemicolon1.ts +++ /dev/null @@ -1,15 +0,0 @@ -/// - -////function Foo(arg1: string, arg2: string) { -////} -//// -////Foo(/**/; - -goTo.marker(); -verify.signatureHelpPresent(); -verify.signatureHelpCountIs(1); - -verify.currentSignatureHelpIs("Foo(arg1: string, arg2: string): void"); -verify.currentSignatureParamterCountIs(2); -verify.currentParameterHelpArgumentNameIs("arg1"); -verify.currentParameterSpanIs("arg1: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpCallExpression.ts b/tests/cases/fourslash_old/signatureHelpCallExpression.ts deleted file mode 100644 index 50d89aaae4..0000000000 --- a/tests/cases/fourslash_old/signatureHelpCallExpression.ts +++ /dev/null @@ -1,16 +0,0 @@ -/// - -////function fnTest(str: string, num: number) { } -////fnTest(/*1*/'', /*2*/5); - -goTo.marker('1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs('fnTest(str: string, num: number): void'); - -verify.currentParameterHelpArgumentNameIs('str'); -verify.currentParameterSpanIs("str: string"); - -goTo.marker('2'); -verify.currentParameterHelpArgumentNameIs('num'); -verify.currentParameterSpanIs("num: number"); diff --git a/tests/cases/fourslash_old/signatureHelpConstructExpression.ts b/tests/cases/fourslash_old/signatureHelpConstructExpression.ts deleted file mode 100644 index a88cb3fce6..0000000000 --- a/tests/cases/fourslash_old/signatureHelpConstructExpression.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////class sampleCls { constructor(str: string, num: number) { } } -////var x = new sampleCls(/*1*/"", /*2*/5); - -goTo.marker('1'); -verify.signatureHelpCountIs(1); - -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs('sampleCls(str: string, num: number): sampleCls'); - -verify.currentParameterHelpArgumentNameIs('str'); -verify.currentParameterSpanIs("str: string"); - -goTo.marker('2'); -verify.currentParameterHelpArgumentNameIs('num'); -verify.currentParameterSpanIs("num: number"); diff --git a/tests/cases/fourslash_old/signatureHelpConstructorInheritance.ts b/tests/cases/fourslash_old/signatureHelpConstructorInheritance.ts deleted file mode 100644 index b066eab3fd..0000000000 --- a/tests/cases/fourslash_old/signatureHelpConstructorInheritance.ts +++ /dev/null @@ -1,22 +0,0 @@ -/// - -////class base { -//// constructor(s: string); -//// constructor(n: number); -//// constructor(a: any) { } -////} -////class B1 extends base { } -////class B2 extends B1 { } -////class B3 extends B2 { -//// constructor() { -//// super(/*indirectSuperCall*/3); -//// } -////} - - -goTo.marker('indirectSuperCall'); -verify.signatureHelpCountIs(2); -verify.currentSignatureParamterCountIs(1); -verify.currentSignatureHelpIs('B2(n: number): B2'); -verify.currentParameterHelpArgumentNameIs("n"); -verify.currentParameterSpanIs("n: number"); diff --git a/tests/cases/fourslash_old/signatureHelpConstructorOverload.ts b/tests/cases/fourslash_old/signatureHelpConstructorOverload.ts deleted file mode 100644 index ce276e09d8..0000000000 --- a/tests/cases/fourslash_old/signatureHelpConstructorOverload.ts +++ /dev/null @@ -1,16 +0,0 @@ -/// - -////class clsOverload { constructor(); constructor(test: string); constructor(test?: string) { } } -////var x = new clsOverload(/*1*/); -////var y = new clsOverload(/*2*/''); - -goTo.marker('1'); -verify.signatureHelpCountIs(2); -verify.currentSignatureParamterCountIs(0); -verify.currentSignatureHelpIs('clsOverload(): clsOverload'); - -goTo.marker('2'); -verify.currentSignatureParamterCountIs(1); -verify.currentSignatureHelpIs('clsOverload(test: string): clsOverload'); -verify.currentParameterHelpArgumentNameIs('test'); -verify.currentParameterSpanIs("test: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpForSuperCalls1.ts b/tests/cases/fourslash_old/signatureHelpForSuperCalls1.ts deleted file mode 100644 index 58e083ea2e..0000000000 --- a/tests/cases/fourslash_old/signatureHelpForSuperCalls1.ts +++ /dev/null @@ -1,28 +0,0 @@ -/// - -////class A { } -////class B extends A { } -////class C extends B { -//// constructor() { -//// super(/*1*/ // sig help here? -//// } -////} -////class A2 { } -////class B2 extends A2 { -//// constructor(x:number) {} -//// } -////class C2 extends B2 { -//// constructor() { -//// super(/*2*/ // sig help here? -//// } -////} - -// this line triggers a semantic/syntactic error check, remove line when 788570 is fixed -edit.insert(''); - -goTo.marker('1'); -verify.signatureHelpPresent(); -verify.currentSignatureHelpIs('B(): B'); - -goTo.marker('2'); -verify.currentSignatureHelpIs('B2(x: number): B2'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpFunctionOverload.ts b/tests/cases/fourslash_old/signatureHelpFunctionOverload.ts deleted file mode 100644 index 2c1cdb5129..0000000000 --- a/tests/cases/fourslash_old/signatureHelpFunctionOverload.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// - -////function functionOverload(); -////function functionOverload(test: string); -////function functionOverload(test?: string) { } -////functionOverload(/*functionOverload1*/); -////functionOverload(""/*functionOverload2*/); - -goTo.marker('functionOverload1'); -verify.signatureHelpCountIs(2); -verify.currentSignatureParamterCountIs(0); -verify.currentSignatureHelpIs('functionOverload(): any'); - -goTo.marker('functionOverload2'); -verify.currentSignatureParamterCountIs(1); -verify.currentSignatureHelpIs('functionOverload(test: string): any'); -verify.currentParameterHelpArgumentNameIs("test"); -verify.currentParameterSpanIs("test: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpFunctionParameter.ts b/tests/cases/fourslash_old/signatureHelpFunctionParameter.ts deleted file mode 100644 index cb2264f2c4..0000000000 --- a/tests/cases/fourslash_old/signatureHelpFunctionParameter.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////function parameterFunction(callback: (a: number, b: string) => void) { -//// callback(/*parameterFunction1*/5, /*parameterFunction2*/""); -////} - -goTo.marker('parameterFunction1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs('callback(a: number, b: string): void'); -verify.currentParameterHelpArgumentNameIs("a"); -verify.currentParameterSpanIs("a: number"); - -goTo.marker('parameterFunction2'); -verify.currentSignatureHelpIs('callback(a: number, b: string): void'); -verify.currentParameterHelpArgumentNameIs("b"); -verify.currentParameterSpanIs("b: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpImplicitConstructor.ts b/tests/cases/fourslash_old/signatureHelpImplicitConstructor.ts deleted file mode 100644 index 9e42d25dbe..0000000000 --- a/tests/cases/fourslash_old/signatureHelpImplicitConstructor.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// - -////class ImplicitConstructor { -////} -////var implicitConstructor = new ImplicitConstructor(/**/); - -goTo.marker(); -verify.signatureHelpCountIs(1); -verify.currentSignatureHelpIs("ImplicitConstructor(): ImplicitConstructor"); -verify.currentSignatureParamterCountIs(0); diff --git a/tests/cases/fourslash_old/signatureHelpInCallback.ts b/tests/cases/fourslash_old/signatureHelpInCallback.ts deleted file mode 100644 index dd4856b48e..0000000000 --- a/tests/cases/fourslash_old/signatureHelpInCallback.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// - -////declare function forEach(f: () => void); -////forEach(/*1*/() => { -//// /*2*/ -////}); - -goTo.marker('1'); -verify.signatureHelpPresent(); -goTo.marker('2'); -verify.not.signatureHelpPresent(); diff --git a/tests/cases/fourslash_old/signatureHelpInCompleteGenericsCall.ts b/tests/cases/fourslash_old/signatureHelpInCompleteGenericsCall.ts deleted file mode 100644 index 12036cd6db..0000000000 --- a/tests/cases/fourslash_old/signatureHelpInCompleteGenericsCall.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// - -////function foo(x: number, callback: (x: T) => number) { -////} -////foo(/*1*/ - -goTo.marker('1'); -verify.currentSignatureHelpIs("foo(x: number, callback: (x: T) => number): void"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles.ts b/tests/cases/fourslash_old/signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles.ts deleted file mode 100644 index 2339af0252..0000000000 --- a/tests/cases/fourslash_old/signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// - -// @Filename: signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles_file0.ts -////declare function fn(x: string, y: number); - -// @Filename: signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles_file1.ts -////declare function fn(x: string); - -// @Filename: signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles_file2.ts -////fn(/*1*/ - -diagnostics.setEditValidation(IncrementalEditValidation.None); -goTo.marker('1'); -verify.signatureHelpCountIs(2); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpInIncompleteInvocationExpression.ts b/tests/cases/fourslash_old/signatureHelpInIncompleteInvocationExpression.ts deleted file mode 100644 index 2e097b2a76..0000000000 --- a/tests/cases/fourslash_old/signatureHelpInIncompleteInvocationExpression.ts +++ /dev/null @@ -1,19 +0,0 @@ -/// - -/////** -//// * Returns the substring at the specified location within a String object. -//// * @param start The zero-based index integer indicating the beginning of the substring. -//// * @param end Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. -//// * If end is omitted, the characters from start through the end of the original string are returned. -//// */ -////function foo(start: number, end?: number) { -//// return ""; -////} -//// -////foo(/*1*/ -goTo.marker('1'); -verify.currentParameterHelpArgumentDocCommentIs("The zero-based index integer indicating the beginning of the substring."); -edit.insert("10,"); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); -edit.insert(" "); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); diff --git a/tests/cases/fourslash_old/signatureHelpInParenthetical.ts b/tests/cases/fourslash_old/signatureHelpInParenthetical.ts deleted file mode 100644 index 0628d904fd..0000000000 --- a/tests/cases/fourslash_old/signatureHelpInParenthetical.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// - -//// class base { constructor (public n: number, public y: string) { } } -//// (new base(/**/ - -goTo.marker(); -verify.currentParameterHelpArgumentNameIs('n'); -edit.insert('0, '); -verify.currentParameterHelpArgumentNameIs('y'); diff --git a/tests/cases/fourslash_old/signatureHelpIncompleteCalls.ts b/tests/cases/fourslash_old/signatureHelpIncompleteCalls.ts deleted file mode 100644 index e73217b1d8..0000000000 --- a/tests/cases/fourslash_old/signatureHelpIncompleteCalls.ts +++ /dev/null @@ -1,31 +0,0 @@ -/// - -////module IncompleteCalls { -//// class Foo { -//// public f1() { } -//// public f2(n: number): number { return 0; } -//// public f3(n: number, s: string) : string { return ""; } -//// } -//// var x = new Foo(); -//// x.f1(); -//// x.f2(5); -//// x.f3(5, ""); -//// x.f1(/*incompleteCalls1*/ -//// x.f2(5,/*incompleteCalls2*/ -//// x.f3(5,/*incompleteCalls3*/ -////} - -goTo.marker('incompleteCalls1'); -verify.currentSignatureHelpIs("f1(): void"); -verify.currentSignatureParamterCountIs(0); - -goTo.marker('incompleteCalls2'); -verify.currentSignatureParamterCountIs(1); -verify.currentSignatureHelpIs("f2(n: number): number"); -goTo.marker('incompleteCalls3'); -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs("f3(n: number, s: string): string"); - -verify.currentParameterHelpArgumentNameIs("s"); -verify.currentParameterSpanIs("s: string"); - diff --git a/tests/cases/fourslash_old/signatureHelpNoArguments.ts b/tests/cases/fourslash_old/signatureHelpNoArguments.ts deleted file mode 100644 index 16a1896a74..0000000000 --- a/tests/cases/fourslash_old/signatureHelpNoArguments.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// - - -////function foo(n: number): string { -////} -//// -////foo(/**/ - -goTo.marker(); -verify.currentSignatureHelpIs("foo(n: number): string"); -verify.currentParameterHelpArgumentNameIs("n"); -verify.currentParameterSpanIs("n: number"); diff --git a/tests/cases/fourslash_old/signatureHelpObjectLiteral.ts b/tests/cases/fourslash_old/signatureHelpObjectLiteral.ts deleted file mode 100644 index cbc5df697b..0000000000 --- a/tests/cases/fourslash_old/signatureHelpObjectLiteral.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////var objectLiteral = { n: 5, s: "", f: (a: number, b: string) => "" }; -////objectLiteral.f(/*objectLiteral1*/4, /*objectLiteral2*/""); - -goTo.marker('objectLiteral1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs('f(a: number, b: string): string'); - -verify.currentParameterHelpArgumentNameIs("a"); -verify.currentParameterSpanIs("a: number"); - -goTo.marker('objectLiteral2'); -verify.currentSignatureHelpIs('f(a: number, b: string): string'); -verify.currentParameterHelpArgumentNameIs("b"); -verify.currentParameterSpanIs("b: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpOnOverloadOnConst.ts b/tests/cases/fourslash_old/signatureHelpOnOverloadOnConst.ts deleted file mode 100644 index 8edd0617d7..0000000000 --- a/tests/cases/fourslash_old/signatureHelpOnOverloadOnConst.ts +++ /dev/null @@ -1,26 +0,0 @@ -/// - -////function x1(x: 'hi'); -////function x1(y: 'bye'); -////function x1(z: string); -////function x1(a: any) { -////} -//// -////x1(''/*1*/); -////x1('hi'/*2*/); -////x1('bye'/*3*/); - -goTo.marker('1'); -verify.signatureHelpCountIs(3); -verify.currentParameterHelpArgumentNameIs("z"); -verify.currentParameterSpanIs("z: string"); - -goTo.marker('2'); -verify.signatureHelpCountIs(3); -verify.currentParameterHelpArgumentNameIs("x"); -verify.currentParameterSpanIs("x: 'hi'"); - -goTo.marker('3'); -verify.signatureHelpCountIs(3); -verify.currentParameterHelpArgumentNameIs("y"); -verify.currentParameterSpanIs("y: 'bye'"); diff --git a/tests/cases/fourslash_old/signatureHelpOnOverloads.ts b/tests/cases/fourslash_old/signatureHelpOnOverloads.ts deleted file mode 100644 index 9712c9dc30..0000000000 --- a/tests/cases/fourslash_old/signatureHelpOnOverloads.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// - -////declare function fn(x: string); -////declare function fn(x: string, y: number); -////fn(/*1*/ - -goTo.marker('1'); -verify.signatureHelpCountIs(2); -verify.currentSignatureHelpIs("fn(x: string): any"); -verify.currentParameterHelpArgumentNameIs("x"); -verify.currentParameterSpanIs("x: string"); - -edit.insert("'',"); - -verify.signatureHelpCountIs(2); -verify.currentSignatureHelpIs("fn(x: string, y: number): any"); -verify.currentParameterHelpArgumentNameIs("y"); -verify.currentParameterSpanIs("y: number"); diff --git a/tests/cases/fourslash_old/signatureHelpOnSuperWhenMembersAreNotResolved.ts b/tests/cases/fourslash_old/signatureHelpOnSuperWhenMembersAreNotResolved.ts deleted file mode 100644 index 5613ca71a7..0000000000 --- a/tests/cases/fourslash_old/signatureHelpOnSuperWhenMembersAreNotResolved.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// - -////class A { } -////class B extends A { constructor(public x: string) { } } -////class C extends B { -//// constructor() { -//// /*1*/ -//// } -////} - -diagnostics.setEditValidation(IncrementalEditValidation.None); -goTo.marker("1"); -edit.insert("super("); -verify.currentSignatureHelpIs("B(x: string): B"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpSimpleConstructorCall.ts b/tests/cases/fourslash_old/signatureHelpSimpleConstructorCall.ts deleted file mode 100644 index 81af0422f9..0000000000 --- a/tests/cases/fourslash_old/signatureHelpSimpleConstructorCall.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////class ConstructorCall { -//// constructor(str: string, num: number) { -//// } -////} -////var x = new ConstructorCall(/*constructorCall1*/1,/*constructorCall2*/2); - -goTo.marker('constructorCall1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureHelpIs("ConstructorCall(str: string, num: number): ConstructorCall"); -verify.currentParameterHelpArgumentNameIs("str"); -verify.currentParameterSpanIs("str: string"); -goTo.marker('constructorCall2'); -verify.currentSignatureHelpIs("ConstructorCall(str: string, num: number): ConstructorCall"); -verify.currentParameterHelpArgumentNameIs("num"); -verify.currentParameterSpanIs("num: number"); diff --git a/tests/cases/fourslash_old/signatureHelpSimpleFunctionCall.ts b/tests/cases/fourslash_old/signatureHelpSimpleFunctionCall.ts deleted file mode 100644 index 6e5817ad90..0000000000 --- a/tests/cases/fourslash_old/signatureHelpSimpleFunctionCall.ts +++ /dev/null @@ -1,19 +0,0 @@ -/// - -////// Simple function test -////function functionCall(str: string, num: number) { -////} -////functionCall(/*functionCall1*/); -////functionCall("", /*functionCall2*/1); - - -goTo.marker('functionCall1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureHelpIs("functionCall(str: string, num: number): void"); -verify.currentParameterHelpArgumentNameIs("str"); -verify.currentParameterSpanIs("str: string"); -goTo.marker('functionCall2'); -verify.currentSignatureHelpIs("functionCall(str: string, num: number): void"); -verify.currentParameterHelpArgumentNameIs("num"); -verify.currentParameterSpanIs("num: number"); - diff --git a/tests/cases/fourslash_old/signatureHelpSimpleSuperCall.ts b/tests/cases/fourslash_old/signatureHelpSimpleSuperCall.ts deleted file mode 100644 index ff8913a6b0..0000000000 --- a/tests/cases/fourslash_old/signatureHelpSimpleSuperCall.ts +++ /dev/null @@ -1,20 +0,0 @@ -/// - -////class SuperCallBase { -//// constructor(b: boolean) { -//// } -////} -////class SuperCall extends SuperCallBase { -//// constructor() { -//// super(/*superCall*/); -//// } -////} - -// this line triggers a semantic/syntactic error check, remove line when 788570 is fixed -edit.insert(''); - -goTo.marker('superCall'); -verify.signatureHelpCountIs(1); -verify.currentSignatureHelpIs("SuperCallBase(b: boolean): SuperCallBase"); -verify.currentParameterHelpArgumentNameIs("b"); -verify.currentParameterSpanIs("b: boolean"); diff --git a/tests/cases/fourslash_old/signatureHelpSuperConstructorOverload.ts b/tests/cases/fourslash_old/signatureHelpSuperConstructorOverload.ts deleted file mode 100644 index 1be8c3202a..0000000000 --- a/tests/cases/fourslash_old/signatureHelpSuperConstructorOverload.ts +++ /dev/null @@ -1,28 +0,0 @@ -/// - -////class SuperOverloadlBase { -//// constructor(); -//// constructor(test: string); -//// constructor(test?: string) { -//// } -////} -////class SuperOverLoad1 extends SuperOverloadlBase { -//// constructor() { -//// super(/*superOverload1*/); -//// } -////} -////class SuperOverLoad2 extends SuperOverloadlBase { -//// constructor() { -//// super(""/*superOverload2*/); -//// } -////} - -goTo.marker('superOverload1'); -verify.signatureHelpCountIs(2); -verify.currentSignatureHelpIs("SuperOverloadlBase(): SuperOverloadlBase"); -verify.currentSignatureParamterCountIs(0); -goTo.marker('superOverload2'); -verify.currentSignatureParamterCountIs(1); -verify.currentSignatureHelpIs("SuperOverloadlBase(test: string): SuperOverloadlBase"); -verify.currentParameterHelpArgumentNameIs("test"); -verify.currentParameterSpanIs("test: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpWhenEditingCallExpression.ts b/tests/cases/fourslash_old/signatureHelpWhenEditingCallExpression.ts deleted file mode 100644 index 61e51d0a4e..0000000000 --- a/tests/cases/fourslash_old/signatureHelpWhenEditingCallExpression.ts +++ /dev/null @@ -1,30 +0,0 @@ -/// - -/////** -//// * Returns the substring at the specified location within a String object. -//// * @param start The zero-based index integer indicating the beginning of the substring. -//// * @param end Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. -//// * If end is omitted, the characters from start through the end of the original string are returned. -//// */ -////function foo(start: number, end?: number) { -//// return ""; -////} -//// -////fo/*1*/ -goTo.marker('1'); -verify.not.signatureHelpPresent(); -edit.insert("o"); -verify.not.signatureHelpPresent(); -edit.insert("("); -verify.currentParameterHelpArgumentDocCommentIs("The zero-based index integer indicating the beginning of the substring."); -edit.insert("10,"); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); -edit.insert(" "); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); -edit.insert(", "); -edit.backspace(3); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); -edit.insert("12"); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); -edit.insert(")"); -verify.not.signatureHelpPresent(); diff --git a/tests/cases/fourslash_old/staticGenericOverloads1.ts b/tests/cases/fourslash_old/staticGenericOverloads1.ts deleted file mode 100644 index 141d88eed4..0000000000 --- a/tests/cases/fourslash_old/staticGenericOverloads1.ts +++ /dev/null @@ -1,22 +0,0 @@ -/// - -////class A { -//// static B(v: A): A; -//// static B(v: S): A; -//// static B(v: any): A { -//// return null; -//// } -////} - -////var a = new A(); -////A.B(/**/ - -goTo.marker(); -verify.signatureHelpCountIs(2); -edit.insert('a'); -verify.signatureHelpCountIs(2); -verify.currentSignatureHelpIs('B(v: A): A') -edit.insert('); A.B('); -verify.currentSignatureHelpIs('B(v: A): A'); -edit.insert('a'); -verify.currentSignatureHelpIs('B(v: A): A') diff --git a/tests/cases/fourslash_old/todoComments1.ts b/tests/cases/fourslash_old/todoComments1.ts deleted file mode 100644 index 900b4694c6..0000000000 --- a/tests/cases/fourslash_old/todoComments1.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// // [|TODO|] -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments10.ts b/tests/cases/fourslash_old/todoComments10.ts deleted file mode 100644 index 26ee7a4014..0000000000 --- a/tests/cases/fourslash_old/todoComments10.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|todo 1|] -//// [|hack 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments11.ts b/tests/cases/fourslash_old/todoComments11.ts deleted file mode 100644 index 976368315d..0000000000 --- a/tests/cases/fourslash_old/todoComments11.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|TODO(jason) 1|] -//// [|HACK 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO(jason)", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments12.ts b/tests/cases/fourslash_old/todoComments12.ts deleted file mode 100644 index d9cd3dea4d..0000000000 --- a/tests/cases/fourslash_old/todoComments12.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|TODO(jason) 1|] -//// [|HACK 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["HACK", "TODO(jason)"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments13.ts b/tests/cases/fourslash_old/todoComments13.ts deleted file mode 100644 index 93147b30e4..0000000000 --- a/tests/cases/fourslash_old/todoComments13.ts +++ /dev/null @@ -1,4 +0,0 @@ -//// TODO - -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments14.ts b/tests/cases/fourslash_old/todoComments14.ts deleted file mode 100644 index 46f8f48fe3..0000000000 --- a/tests/cases/fourslash_old/todoComments14.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// BAR // [|TODO|] -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments15.ts b/tests/cases/fourslash_old/todoComments15.ts deleted file mode 100644 index 22cee54d0f..0000000000 --- a/tests/cases/fourslash_old/todoComments15.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// "// HACK 1"; -debugger; -verify.todoCommentsInCurrentFile(["TODO(jason)", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments16.ts b/tests/cases/fourslash_old/todoComments16.ts deleted file mode 100644 index bbdeac0c5e..0000000000 --- a/tests/cases/fourslash_old/todoComments16.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// //// [|HACK 1|] -debugger; -verify.todoCommentsInCurrentFile(["TODO(jason)", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments17.ts b/tests/cases/fourslash_old/todoComments17.ts deleted file mode 100644 index 5231694160..0000000000 --- a/tests/cases/fourslash_old/todoComments17.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// /**** [|HACK 1 |]*/ a -debugger; -verify.todoCommentsInCurrentFile(["TODO(jason)", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments2.ts b/tests/cases/fourslash_old/todoComments2.ts deleted file mode 100644 index b58b0fda7a..0000000000 --- a/tests/cases/fourslash_old/todoComments2.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// // not TODO -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments3.ts b/tests/cases/fourslash_old/todoComments3.ts deleted file mode 100644 index 62eb02642e..0000000000 --- a/tests/cases/fourslash_old/todoComments3.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// // [|TODO with stuff|] -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments4.ts b/tests/cases/fourslash_old/todoComments4.ts deleted file mode 100644 index c9ec94785f..0000000000 --- a/tests/cases/fourslash_old/todoComments4.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// // TODOnomatch -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments5.ts b/tests/cases/fourslash_old/todoComments5.ts deleted file mode 100644 index 157ac162a8..0000000000 --- a/tests/cases/fourslash_old/todoComments5.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|TODO 1|] -//// [|TODO 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments6.ts b/tests/cases/fourslash_old/todoComments6.ts deleted file mode 100644 index 0d2692511c..0000000000 --- a/tests/cases/fourslash_old/todoComments6.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// * [|TODO 1|] -//// * [|TODO 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments7.ts b/tests/cases/fourslash_old/todoComments7.ts deleted file mode 100644 index ffb5bcf660..0000000000 --- a/tests/cases/fourslash_old/todoComments7.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|TODO 1|] -//// [|HACK 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments8.ts b/tests/cases/fourslash_old/todoComments8.ts deleted file mode 100644 index 5d53b7b57c..0000000000 --- a/tests/cases/fourslash_old/todoComments8.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|HACK 1|] -//// [|TODO 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments9.ts b/tests/cases/fourslash_old/todoComments9.ts deleted file mode 100644 index 36cba71cec..0000000000 --- a/tests/cases/fourslash_old/todoComments9.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|TODO HACK|] -//// [|HACK TODO|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO", "HACK"]); \ No newline at end of file