This commit is contained in:
Vladimir Matveev 2014-11-19 19:59:07 -08:00
commit a6bb527278
173 changed files with 1177 additions and 1872 deletions

View file

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

View file

@ -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 () {

View file

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

View file

@ -153,9 +153,9 @@ module ts {
parseStrings(commandLine);
return {
options: options,
filenames: filenames,
errors: errors
options,
filenames,
errors
};
function parseStrings(args: string[]) {

View file

@ -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
};
}

View file

@ -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." },

View file

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

View file

@ -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: (<Declaration>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>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>node.name,
typeName: undefined
};
@ -3286,7 +3286,7 @@ module ts {
}
return {
diagnosticMessage: diagnosticMessage,
diagnosticMessage,
errorNode: <Node>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
};
}

View file

@ -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 {
// <T extends "">
//
// 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 = <SignatureDeclaration>createNode(SyntaxKind.IndexSignature);
function parseIndexSignatureMember(modifiers: ModifiersArray, pos?: number): SignatureDeclaration {
var node = <SignatureDeclaration>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 = <TupleTypeNode>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 = <Identifier>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 = <Identifier>createMissingNode();
}
}
propertyAccess.left = expr;
propertyAccess.right = id;
propertyAccess.right = id || parseIdentifierName();
expr = finishNode(propertyAccess);
continue;
}
if (parseOptional(SyntaxKind.OpenBracketToken)) {
var indexedAccess = <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 = <PropertyDeclaration>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 {
(<PropertyDeclaration>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 = <ShortHandPropertyDeclaration>createNode(SyntaxKind.ShorthandPropertyAssignment, nodePos);
node.name = propertyName;
}
@ -2480,6 +2458,8 @@ module ts {
parseExpected(SyntaxKind.ColonToken);
(<PropertyDeclaration>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 = <ReturnStatement>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 = <MethodDeclaration>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 = <PropertyDeclaration>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 = <Block>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 = <ModuleDeclaration>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 = <ExportAssignment>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(<FunctionExpression>node);
case SyntaxKind.BinaryExpression: return visitBinaryExpression(<BinaryExpression>node);
case SyntaxKind.BreakStatement: return visitBreakOrContinueStatement(<BreakOrContinueStatement>node);
case SyntaxKind.CallExpression: return visitCallExpression(<CallExpression>node);
case SyntaxKind.CallSignature: return visitCallSignature(<SignatureDeclaration>node);
case SyntaxKind.CatchBlock: return visitCatchBlock(<CatchBlock>node);
case SyntaxKind.ClassDeclaration: return visitClassDeclaration(<ClassDeclaration>node);
case SyntaxKind.Constructor: return visitConstructor(<ConstructorDeclaration>node);
case SyntaxKind.ConstructorType: return visitConstructorType(<SignatureDeclaration>node);
case SyntaxKind.ConstructSignature: return visitConstructSignature(<SignatureDeclaration>node);
case SyntaxKind.ContinueStatement: return visitBreakOrContinueStatement(<BreakOrContinueStatement>node);
case SyntaxKind.EnumDeclaration: return visitEnumDeclaration(<EnumDeclaration>node);
case SyntaxKind.ForInStatement: return visitForInStatement(<ForInStatement>node);
case SyntaxKind.ForStatement: return visitForStatement(<ForStatement>node);
case SyntaxKind.FunctionDeclaration: return visitFunctionDeclaration(<FunctionLikeDeclaration>node);
case SyntaxKind.FunctionExpression: return visitFunctionExpression(<FunctionExpression>node);
case SyntaxKind.FunctionType: return visitFunctionType(<SignatureDeclaration>node);
case SyntaxKind.GetAccessor: return visitGetAccessor(<MethodDeclaration>node);
case SyntaxKind.IndexSignature: return visitIndexSignature(<SignatureDeclaration>node);
case SyntaxKind.InterfaceDeclaration: return visitInterfaceDeclaration(<InterfaceDeclaration>node);
case SyntaxKind.LabeledStatement: return visitLabeledStatement(<LabeledStatement>node);
case SyntaxKind.Method: return visitMethod(<MethodDeclaration>node);
case SyntaxKind.ModuleDeclaration: return visitModuleDeclaration(<ModuleDeclaration>node);
case SyntaxKind.NewExpression: return visitNewExpression(<NewExpression>node);
case SyntaxKind.ObjectLiteral: return visitObjectLiteral(<ObjectLiteral>node);
case SyntaxKind.Parameter: return visitParameter(<ParameterDeclaration>node);
case SyntaxKind.PostfixOperator: return visitPostfixOperator(<UnaryExpression>node);
case SyntaxKind.PrefixOperator: return visitPrefixOperator(<UnaryExpression>node);
case SyntaxKind.SetAccessor: return visitSetAccessor(<MethodDeclaration>node);
case SyntaxKind.SwitchStatement: return visitSwitchStatement(<SwitchStatement>node);
case SyntaxKind.TaggedTemplateExpression: return visitTaggedTemplateExpression(<TaggedTemplateExpression>node);
case SyntaxKind.TupleType: return visitTupleType(<TupleTypeNode>node);
case SyntaxKind.TypeReference: return visitTypeReference(<TypeReferenceNode>node);
case SyntaxKind.VariableDeclaration: return visitVariableDeclaration(<VariableDeclaration>node);
case SyntaxKind.VariableStatement: return visitVariableStatement(<VariableStatement>node);
case SyntaxKind.WithStatement: return visitWithStatement(<WithStatement>node);
case SyntaxKind.ArrowFunction: return visitArrowFunction(<FunctionExpression>node);
case SyntaxKind.BinaryExpression: return visitBinaryExpression(<BinaryExpression>node);
case SyntaxKind.BreakStatement: return visitBreakOrContinueStatement(<BreakOrContinueStatement>node);
case SyntaxKind.CallExpression: return visitCallExpression(<CallExpression>node);
case SyntaxKind.CallSignature: return visitCallSignature(<SignatureDeclaration>node);
case SyntaxKind.CatchBlock: return visitCatchBlock(<CatchBlock>node);
case SyntaxKind.ClassDeclaration: return visitClassDeclaration(<ClassDeclaration>node);
case SyntaxKind.Constructor: return visitConstructor(<ConstructorDeclaration>node);
case SyntaxKind.ConstructorType: return visitConstructorType(<SignatureDeclaration>node);
case SyntaxKind.ConstructSignature: return visitConstructSignature(<SignatureDeclaration>node);
case SyntaxKind.ContinueStatement: return visitBreakOrContinueStatement(<BreakOrContinueStatement>node);
case SyntaxKind.EnumDeclaration: return visitEnumDeclaration(<EnumDeclaration>node);
case SyntaxKind.ExportAssignment: return visitExportAssignment(<ExportAssignment>node);
case SyntaxKind.ForInStatement: return visitForInStatement(<ForInStatement>node);
case SyntaxKind.ForStatement: return visitForStatement(<ForStatement>node);
case SyntaxKind.FunctionDeclaration: return visitFunctionDeclaration(<FunctionLikeDeclaration>node);
case SyntaxKind.FunctionExpression: return visitFunctionExpression(<FunctionExpression>node);
case SyntaxKind.FunctionType: return visitFunctionType(<SignatureDeclaration>node);
case SyntaxKind.GetAccessor: return visitGetAccessor(<MethodDeclaration>node);
case SyntaxKind.IndexedAccess: return visitIndexedAccess(<IndexedAccess>node);
case SyntaxKind.IndexSignature: return visitIndexSignature(<SignatureDeclaration>node);
case SyntaxKind.InterfaceDeclaration: return visitInterfaceDeclaration(<InterfaceDeclaration>node);
case SyntaxKind.LabeledStatement: return visitLabeledStatement(<LabeledStatement>node);
case SyntaxKind.Method: return visitMethod(<MethodDeclaration>node);
case SyntaxKind.ModuleDeclaration: return visitModuleDeclaration(<ModuleDeclaration>node);
case SyntaxKind.NewExpression: return visitNewExpression(<NewExpression>node);
case SyntaxKind.ObjectLiteral: return visitObjectLiteral(<ObjectLiteral>node);
case SyntaxKind.NumericLiteral: return visitNumericLiteral(<LiteralExpression>node);
case SyntaxKind.Parameter: return visitParameter(<ParameterDeclaration>node);
case SyntaxKind.PostfixOperator: return visitPostfixOperator(<UnaryExpression>node);
case SyntaxKind.PrefixOperator: return visitPrefixOperator(<UnaryExpression>node);
case SyntaxKind.Property: return visitProperty(<PropertyDeclaration>node);
case SyntaxKind.PropertyAssignment: return visitPropertyAssignment(<PropertyDeclaration>node);
case SyntaxKind.ReturnStatement: return visitReturnStatement(<ReturnStatement>node);
case SyntaxKind.SetAccessor: return visitSetAccessor(<MethodDeclaration>node);
case SyntaxKind.ShorthandPropertyAssignment: return visitShorthandPropertyAssignment(<ShortHandPropertyDeclaration>node);
case SyntaxKind.SwitchStatement: return visitSwitchStatement(<SwitchStatement>node);
case SyntaxKind.TaggedTemplateExpression: return visitTaggedTemplateExpression(<TaggedTemplateExpression>node);
case SyntaxKind.TupleType: return visitTupleType(<TupleTypeNode>node);
case SyntaxKind.TypeParameter: return visitTypeParameter(<TypeParameterDeclaration>node);
case SyntaxKind.TypeReference: return visitTypeReference(<TypeReferenceNode>node);
case SyntaxKind.VariableDeclaration: return visitVariableDeclaration(<VariableDeclaration>node);
case SyntaxKind.VariableStatement: return visitVariableStatement(<VariableStatement>node);
case SyntaxKind.WithStatement: return visitWithStatement(<WithStatement>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<Expression>) {
return checkForTrailingComma(arguments) ||
checkForOmittedArgument(arguments);
}
function checkTypeArguments(typeArguments: NodeArray<TypeNode>) {
return checkForTrailingComma(typeArguments) ||
checkForAtLeastOneTypeArgument(typeArguments) ||
checkForMissingTypeArgument(typeArguments);
}
function checkForOmittedArgument(arguments: NodeArray<Expression>) {
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<TypeNode>) {
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<TypeNode>) {
@ -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<VariableDeclaration>) {
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 &&
(<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((<Block>node.body).statements, s => {
if (s.kind === SyntaxKind.ExportAssignment) {
var statements = (<Block>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 && (<ImportDeclaration>s).externalModuleName) {
return grammarErrorOnNode(s, Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module);
else if (statement.kind === SyntaxKind.ImportDeclaration && (<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 = <Declaration>prop;
var name = <Identifier>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);
}
}
}

View file

@ -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,
};
}
}

View file

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

View file

@ -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() {

View file

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

View file

@ -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<string>(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
};
}

View file

@ -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) {

View file

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

View file

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

View file

@ -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) {

View file

@ -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
};

View file

@ -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 ? (<Identifier>container.name).text : "",
containerKind: container.name ? getNodeKind(container) : ""
containerName: container && container.name ? (<Identifier>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() {

View file

@ -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
/**

View file

@ -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
};
}

View file

@ -222,7 +222,8 @@ module ts.formatting {
if (node.parent) {
switch (node.parent.kind) {
case SyntaxKind.TypeReference:
if ((<TypeReferenceNode>node.parent).typeArguments) {
if ((<TypeReferenceNode>node.parent).typeArguments &&
rangeContainsStartEnd((<TypeReferenceNode>node.parent).typeArguments, node.getStart(sourceFile), node.getEnd())) {
return (<TypeReferenceNode>node.parent).typeArguments;
}
break;
@ -236,21 +237,28 @@ module ts.formatting {
case SyntaxKind.Method:
case SyntaxKind.CallSignature:
case SyntaxKind.ConstructSignature:
if ((<SignatureDeclaration>node.parent).typeParameters && node.end < (<SignatureDeclaration>node.parent).typeParameters.end) {
var start = node.getStart(sourceFile);
if ((<SignatureDeclaration>node.parent).typeParameters &&
rangeContainsStartEnd((<SignatureDeclaration>node.parent).typeParameters, start, node.getEnd())) {
return (<SignatureDeclaration>node.parent).typeParameters;
}
return (<SignatureDeclaration>node.parent).parameters;
if (rangeContainsStartEnd((<SignatureDeclaration>node.parent).parameters, start, node.getEnd())) {
return (<SignatureDeclaration>node.parent).parameters;
}
break;
case SyntaxKind.NewExpression:
case SyntaxKind.CallExpression:
if ((<CallExpression>node.parent).typeArguments && node.end < (<CallExpression>node.parent).typeArguments.end) {
var start = node.getStart(sourceFile);
if ((<CallExpression>node.parent).typeArguments &&
rangeContainsStartEnd((<CallExpression>node.parent).typeArguments, start, node.getEnd())) {
return (<CallExpression>node.parent).typeArguments;
}
return (<CallExpression>node.parent).arguments;
if (rangeContainsStartEnd((<CallExpression>node.parent).arguments, start, node.getEnd())) {
return (<CallExpression>node.parent).arguments;
}
break;
}
}
return undefined;
}

View file

@ -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
};
}

View file

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

View file

@ -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<T>()' instead.
tests/cases/compiler/badArraySyntax.ts(7,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/badArraySyntax.ts(8,20): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/badArraySyntax.ts(9,20): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/badArraySyntax.ts(10,29): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/badArraySyntax.ts(10,40): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/badArraySyntax.ts(6,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/badArraySyntax.ts(7,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/badArraySyntax.ts(8,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/badArraySyntax.ts(9,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/badArraySyntax.ts(10,17): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' 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<T>()' instead.
var a3 = new Z[]();
~~
~~~~~~~
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
var a4: Z[] = new Z[];
~~
~~~~~~~
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
var a5: Z[] = new Z[]();
~~
~~~~~~~
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
var a6: Z[][] = new Z [ ] [ ];
~~~~~~~~
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.

View file

@ -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<T>()' instead.
tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,9): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' 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<T>()' instead.
~~~~~~
!!! error TS2339: Property 'ClassA' does not exist on type 'typeof M'.

View file

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

View file

@ -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<T>()' instead.
tests/cases/compiler/createArray.ts(6,6): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/createArray.ts(7,19): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/createArray.ts(8,18): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/createArray.ts(1,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/createArray.ts(6,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/createArray.ts(7,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/createArray.ts(8,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' 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<T>()' 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<T>()' instead.
var ba=new boolean[];
~~
~~~~~~~~~~~~~
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' 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<T>()' instead.
~~~~~~
!!! error TS2304: Cannot find name 'string'.

View file

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

View file

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

View file

@ -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.
~~~~~~
!!! error TS1120: An export assignment cannot have modifiers.

View file

@ -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.
!!! error TS1120: An export assignment cannot have modifiers.

View file

@ -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.
!!! error TS1120: An export assignment cannot have modifiers.

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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<T>()' instead.
tests/cases/compiler/libMembers.ts(9,11): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' 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<T>()' instead.
a.length;
a.push(new C());

View file

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

View file

@ -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<T>()' instead.
tests/cases/compiler/newOperator.ts(22,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/newOperator.ts(45,23): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/newOperator.ts(18,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/newOperator.ts(20,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/newOperator.ts(45,16): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' 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<T>()' 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<T>()' instead.
}
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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) {
}

View file

@ -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.
!!! error TS1162: Unterminated regular expression literal.

View file

@ -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.
!!! error TS1162: Unterminated regular expression literal.

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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.
!!! error TS1162: Unterminated regular expression literal.

View file

@ -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<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral1.ts(1,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' 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<T>()' instead.
~~~
!!! error TS2304: Cannot find name 'Foo'.

View file

@ -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<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral3.ts(1,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' 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<T>()' instead.
~~~
!!! error TS2304: Cannot find name 'Foo'.

View file

@ -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<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(128,42): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(129,47): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(130,42): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(449,40): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(127,29): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(128,32): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(129,37): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(130,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(449,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' 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<T>()' instead.
export var nodeTypeTable = new string[];
~~
~~~~~~~~~~~~
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' 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<T>()' 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<T>()' 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<T>()' instead.
export function initializeStaticTokens() {
for (var i = 0; i <= TokenID.LimFixed; i++) {

View file

@ -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<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1009,45): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1024,47): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(193,33): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' 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<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1024,33): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' 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<T>()' 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<T>()' 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<T>()' instead.
}
var id = new Identifier(sym.name);

View file

@ -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<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(195,24): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' 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<T>()' instead.
constructor (public size: number, public hashFn: (key) =>number,

View file

@ -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<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(16,33): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' 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<T>()' instead.
~~~~~~~~
!!! error TS2304: Cannot find name 'TypeLink'.

View file

@ -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<T>()' instead.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(12,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' 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<T>()' instead.
~~~~
!!! error TS2304: Cannot find name 'Type'.

View file

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

View file

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

View file

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

View file

@ -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";

View file

@ -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";

View file

@ -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.$);
}

View file

@ -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.$);
}

View file

@ -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.$);

View file

@ -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.$);

View file

@ -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() {

View file

@ -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() {

View file

@ -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() {

View file

@ -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() {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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;
}

View file

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

View file

@ -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;
}

View file

@ -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<T>(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<T>(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<T, U>(n: T, m: number) { }
someGenerics1a `${3}`;
~~~~~~~~~~~~~~~~~~~~~
~~~
!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher.
function someGenerics1b<T, U>(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<T>(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<T, U>(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<T>(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<T, U>(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<U, T>(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<A>(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<A, B, C>(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<T>(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[];

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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.
!!! error TS1161: Unterminated template literal.

View file

@ -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.
!!! error TS1161: Unterminated template literal.

View file

@ -1,7 +1,7 @@
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,9): error TS1003: Identifier expected.
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,15): error TS1005: ';' expected.
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,26): error 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.
!!! error TS1161: Unterminated template literal.

View file

@ -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.
!!! error TS1161: Unterminated template literal.

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