mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Merge branch 'master' into getReferences
Conflicts: tests/baselines/reference/aliasUsageInGenericFunction.types tests/baselines/reference/aliasUsageInObjectLiteral.types tests/baselines/reference/aliasUsageInOrExpression.types tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types
This commit is contained in:
commit
dc0560ae59
1
Jakefile
1
Jakefile
@ -43,7 +43,6 @@ var compilerSources = [
|
||||
|
||||
var servicesSources = [
|
||||
"core.ts",
|
||||
"sys.ts",
|
||||
"types.ts",
|
||||
"scanner.ts",
|
||||
"parser.ts",
|
||||
|
||||
13134
bin/services.js
13134
bin/services.js
File diff suppressed because one or more lines are too long
169
bin/tsc.js
169
bin/tsc.js
@ -125,7 +125,7 @@ var ts;
|
||||
Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1 /* Error */, key: "Import declarations in an internal module cannot reference an external module." },
|
||||
Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." },
|
||||
Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: 1 /* Error */, key: "Filename '{0}' differs from already included filename '{1}' only in casing" },
|
||||
new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 2068, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead." },
|
||||
new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead." },
|
||||
Duplicate_identifier_0: { code: 2300, category: 1 /* Error */, key: "Duplicate identifier '{0}'." },
|
||||
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1 /* 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: 1 /* Error */, key: "Static members cannot reference class type parameters." },
|
||||
@ -402,7 +402,8 @@ var ts;
|
||||
Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1 /* Error */, key: "Index signature of object type implicitly has an 'any' type." },
|
||||
Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1 /* Error */, key: "Object literal's property '{0}' implicitly has an '{1}' type." },
|
||||
Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1 /* Error */, key: "Rest parameter '{0}' implicitly has an 'any[]' type." },
|
||||
Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1 /* Error */, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }
|
||||
Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1 /* Error */, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." },
|
||||
You_cannot_rename_this_element: { code: 8000, category: 1 /* Error */, key: "You cannot rename this element." }
|
||||
};
|
||||
})(ts || (ts = {}));
|
||||
var ts;
|
||||
@ -1938,9 +1939,9 @@ var ts;
|
||||
if (ts.localizedDiagnosticMessages) {
|
||||
message = ts.localizedDiagnosticMessages[message];
|
||||
}
|
||||
Debug.assert(message, "Diagnostic message does not exist in locale map.");
|
||||
return message;
|
||||
}
|
||||
ts.getLocaleSpecificMessage = getLocaleSpecificMessage;
|
||||
function createFileDiagnostic(file, start, length, message) {
|
||||
var text = getLocaleSpecificMessage(message.key);
|
||||
if (arguments.length > 4) {
|
||||
@ -2206,10 +2207,6 @@ var ts;
|
||||
return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension;
|
||||
}
|
||||
ts.fileExtensionIs = fileExtensionIs;
|
||||
function getCanonicalFileName(fileName) {
|
||||
return sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase();
|
||||
}
|
||||
ts.getCanonicalFileName = getCanonicalFileName;
|
||||
function Symbol(flags, name) {
|
||||
this.flags = flags;
|
||||
this.name = name;
|
||||
@ -2247,7 +2244,7 @@ var ts;
|
||||
(function (Debug) {
|
||||
var currentAssertionLevel = 0 /* None */;
|
||||
function shouldAssert(level) {
|
||||
return this.currentAssertionLevel >= level;
|
||||
return currentAssertionLevel >= level;
|
||||
}
|
||||
Debug.shouldAssert = shouldAssert;
|
||||
function assert(expression, message, verboseDebugInfo) {
|
||||
@ -2590,6 +2587,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
ts.getJsDocComments = getJsDocComments;
|
||||
ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*<reference\s+path\s*=\s*)('|")(.+?)\2.*?\/>/;
|
||||
function forEachChild(node, cbNode, cbNodes) {
|
||||
function child(node) {
|
||||
if (node)
|
||||
@ -2823,7 +2821,6 @@ var ts;
|
||||
ControlBlockContext[ControlBlockContext["CrossingFunctionBoundary"] = 2] = "CrossingFunctionBoundary";
|
||||
})(ControlBlockContext || (ControlBlockContext = {}));
|
||||
function createSourceFile(filename, sourceText, languageVersion, version, isOpen) {
|
||||
if (version === void 0) { version = 0; }
|
||||
if (isOpen === void 0) { isOpen = false; }
|
||||
var file;
|
||||
var scanner;
|
||||
@ -4331,8 +4328,6 @@ var ts;
|
||||
function parseBreakOrContinueStatement(kind) {
|
||||
var node = createNode(kind);
|
||||
var errorCountBeforeStatement = file.syntacticErrors.length;
|
||||
var keywordStart = scanner.getTokenPos();
|
||||
var keywordLength = scanner.getTextPos() - keywordStart;
|
||||
parseExpected(kind === 153 /* BreakStatement */ ? 56 /* BreakKeyword */ : 61 /* ContinueKeyword */);
|
||||
if (!canParseSemicolon())
|
||||
node.label = parseIdentifier();
|
||||
@ -5254,8 +5249,7 @@ var ts;
|
||||
file.hasNoDefaultLib = true;
|
||||
}
|
||||
else {
|
||||
var fullReferenceRegEx = /^(\/\/\/\s*<reference\s+path\s*=\s*)('|")(.+?)\2.*?\/>/;
|
||||
var matchResult = fullReferenceRegEx.exec(comment);
|
||||
var matchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment);
|
||||
if (!matchResult) {
|
||||
var start = range.pos;
|
||||
var length = range.end - start;
|
||||
@ -6027,7 +6021,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
else {
|
||||
writer.writeLiteral(sys.newLine);
|
||||
writer.writeLiteral(newLine);
|
||||
}
|
||||
}
|
||||
function calculateIndent(pos, end) {
|
||||
@ -6056,9 +6050,13 @@ var ts;
|
||||
} : emitLeadingDeclarationComments;
|
||||
var emitTrailingComments = compilerOptions.removeComments ? function (node) {
|
||||
} : emitTrailingDeclarationComments;
|
||||
var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) {
|
||||
} : emitLeadingCommentsOfLocalPosition;
|
||||
var detachedCommentsInfo;
|
||||
var emitDetachedComments = compilerOptions.removeComments ? function (node) {
|
||||
} : emitDetachedCommentsAtPosition;
|
||||
var emitPinnedOrTripleSlashComments = compilerOptions.removeComments ? function (node) {
|
||||
} : emitPinnedOrTripleSlashCommentsOfNode;
|
||||
var writeComment = writeCommentRange;
|
||||
var emit = emitNode;
|
||||
var emitStart = function (node) {
|
||||
@ -6854,8 +6852,9 @@ var ts;
|
||||
emitTrailingComments(node);
|
||||
}
|
||||
function emitFunctionDeclaration(node) {
|
||||
if (!node.body)
|
||||
return;
|
||||
if (!node.body) {
|
||||
return emitPinnedOrTripleSlashComments(node);
|
||||
}
|
||||
if (node.kind !== 116 /* Method */) {
|
||||
emitLeadingComments(node);
|
||||
}
|
||||
@ -6923,12 +6922,14 @@ var ts;
|
||||
write(";");
|
||||
emitTrailingComments(node.body);
|
||||
}
|
||||
decreaseIndent();
|
||||
writeLine();
|
||||
if (node.body.kind === 168 /* FunctionBlock */) {
|
||||
emitLeadingCommentsOfPosition(node.body.statements.end);
|
||||
decreaseIndent();
|
||||
emitToken(6 /* CloseBraceToken */, node.body.statements.end);
|
||||
}
|
||||
else {
|
||||
decreaseIndent();
|
||||
emitStart(node.body);
|
||||
write("}");
|
||||
emitEnd(node.body);
|
||||
@ -7012,8 +7013,9 @@ var ts;
|
||||
function emitMemberFunctions(node) {
|
||||
ts.forEach(node.members, function (member) {
|
||||
if (member.kind === 116 /* Method */) {
|
||||
if (!member.body)
|
||||
return;
|
||||
if (!member.body) {
|
||||
return emitPinnedOrTripleSlashComments(member);
|
||||
}
|
||||
writeLine();
|
||||
emitLeadingComments(member);
|
||||
emitStart(member);
|
||||
@ -7134,6 +7136,11 @@ var ts;
|
||||
}
|
||||
emitTrailingComments(node);
|
||||
function emitConstructorOfClass() {
|
||||
ts.forEach(node.members, function (member) {
|
||||
if (member.kind === 117 /* Constructor */ && !member.body) {
|
||||
emitPinnedOrTripleSlashComments(member);
|
||||
}
|
||||
});
|
||||
var ctor = getFirstConstructorWithBody(node);
|
||||
if (ctor) {
|
||||
emitLeadingComments(ctor);
|
||||
@ -7176,8 +7183,11 @@ var ts;
|
||||
statements = statements.slice(1);
|
||||
emitLines(statements);
|
||||
}
|
||||
decreaseIndent();
|
||||
writeLine();
|
||||
if (ctor) {
|
||||
emitLeadingCommentsOfPosition(ctor.body.statements.end);
|
||||
}
|
||||
decreaseIndent();
|
||||
emitToken(6 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end);
|
||||
scopeEmitEnd();
|
||||
emitEnd(ctor || node);
|
||||
@ -7186,6 +7196,9 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function emitInterfaceDeclaration(node) {
|
||||
emitPinnedOrTripleSlashComments(node);
|
||||
}
|
||||
function emitEnumDeclaration(node) {
|
||||
emitLeadingComments(node);
|
||||
if (!(node.flags & 1 /* Export */)) {
|
||||
@ -7258,8 +7271,9 @@ var ts;
|
||||
}
|
||||
}
|
||||
function emitModuleDeclaration(node) {
|
||||
if (!ts.isInstantiated(node))
|
||||
return;
|
||||
if (!ts.isInstantiated(node)) {
|
||||
return emitPinnedOrTripleSlashComments(node);
|
||||
}
|
||||
emitLeadingComments(node);
|
||||
if (!(node.flags & 1 /* Export */)) {
|
||||
emitStart(node);
|
||||
@ -7438,6 +7452,7 @@ var ts;
|
||||
}
|
||||
function emitSourceFile(node) {
|
||||
currentSourceFile = node;
|
||||
writeLine();
|
||||
emitDetachedComments(node);
|
||||
var startIndex = emitDirectivePrologues(node.statements, false);
|
||||
if (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8 /* EmitExtends */) {
|
||||
@ -7471,8 +7486,12 @@ var ts;
|
||||
}
|
||||
}
|
||||
function emitNode(node) {
|
||||
if (!node || node.flags & 2 /* Ambient */)
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
if (node.flags & 2 /* Ambient */) {
|
||||
return emitPinnedOrTripleSlashComments(node);
|
||||
}
|
||||
switch (node.kind) {
|
||||
case 55 /* Identifier */:
|
||||
return emitIdentifier(node);
|
||||
@ -7576,6 +7595,8 @@ var ts;
|
||||
return emitVariableDeclaration(node);
|
||||
case 169 /* ClassDeclaration */:
|
||||
return emitClassDeclaration(node);
|
||||
case 170 /* InterfaceDeclaration */:
|
||||
return emitInterfaceDeclaration(node);
|
||||
case 171 /* EnumDeclaration */:
|
||||
return emitEnumDeclaration(node);
|
||||
case 172 /* ModuleDeclaration */:
|
||||
@ -7586,31 +7607,53 @@ var ts;
|
||||
return emitSourceFile(node);
|
||||
}
|
||||
}
|
||||
function emitLeadingDeclarationComments(node) {
|
||||
function hasDetachedComments(pos) {
|
||||
return detachedCommentsInfo !== undefined && detachedCommentsInfo[detachedCommentsInfo.length - 1].nodePos === pos;
|
||||
}
|
||||
function getLeadingCommentsWithoutDetachedComments() {
|
||||
var leadingComments = ts.getLeadingComments(currentSourceFile.text, detachedCommentsInfo[detachedCommentsInfo.length - 1].detachedCommentEndPos);
|
||||
if (detachedCommentsInfo.length - 1) {
|
||||
detachedCommentsInfo.pop();
|
||||
}
|
||||
else {
|
||||
detachedCommentsInfo = undefined;
|
||||
}
|
||||
return leadingComments;
|
||||
}
|
||||
function getLeadingCommentsToEmit(node) {
|
||||
if (node.parent.kind === 177 /* SourceFile */ || node.pos !== node.parent.pos) {
|
||||
var leadingComments;
|
||||
if (detachedCommentsInfo === undefined || detachedCommentsInfo[detachedCommentsInfo.length - 1].nodePos !== node.pos) {
|
||||
leadingComments = ts.getLeadingCommentsOfNode(node, currentSourceFile);
|
||||
if (hasDetachedComments(node.pos)) {
|
||||
leadingComments = getLeadingCommentsWithoutDetachedComments();
|
||||
}
|
||||
else {
|
||||
leadingComments = ts.getLeadingComments(currentSourceFile.text, detachedCommentsInfo[detachedCommentsInfo.length - 1].detachedCommentEndPos);
|
||||
if (detachedCommentsInfo.length - 1) {
|
||||
detachedCommentsInfo.pop();
|
||||
}
|
||||
else {
|
||||
detachedCommentsInfo = undefined;
|
||||
}
|
||||
leadingComments = ts.getLeadingCommentsOfNode(node, currentSourceFile);
|
||||
}
|
||||
emitNewLineBeforeLeadingComments(node, leadingComments, writer);
|
||||
emitComments(leadingComments, true, writer, writeComment);
|
||||
return leadingComments;
|
||||
}
|
||||
}
|
||||
function emitLeadingDeclarationComments(node) {
|
||||
var leadingComments = getLeadingCommentsToEmit(node);
|
||||
emitNewLineBeforeLeadingComments(node, leadingComments, writer);
|
||||
emitComments(leadingComments, true, writer, writeComment);
|
||||
}
|
||||
function emitTrailingDeclarationComments(node) {
|
||||
if (node.parent.kind === 177 /* SourceFile */ || node.end !== node.parent.end) {
|
||||
var trailingComments = ts.getTrailingComments(currentSourceFile.text, node.end);
|
||||
emitComments(trailingComments, false, writer, writeComment);
|
||||
}
|
||||
}
|
||||
function emitLeadingCommentsOfLocalPosition(pos) {
|
||||
var leadingComments;
|
||||
if (hasDetachedComments(pos)) {
|
||||
leadingComments = getLeadingCommentsWithoutDetachedComments();
|
||||
}
|
||||
else {
|
||||
leadingComments = ts.getLeadingComments(currentSourceFile.text, pos);
|
||||
}
|
||||
emitNewLineBeforeLeadingComments({ pos: pos, end: pos }, leadingComments, writer);
|
||||
emitComments(leadingComments, true, writer, writeComment);
|
||||
}
|
||||
function emitDetachedCommentsAtPosition(node) {
|
||||
var leadingComments = ts.getLeadingComments(currentSourceFile.text, node.pos);
|
||||
if (leadingComments) {
|
||||
@ -7627,7 +7670,7 @@ var ts;
|
||||
detachedComments.push(comment);
|
||||
lastComment = comment;
|
||||
});
|
||||
if (detachedComments && detachedComments.length) {
|
||||
if (detachedComments.length) {
|
||||
var lastCommentLine = getLineOfLocalPosition(detachedComments[detachedComments.length - 1].end);
|
||||
var astLine = getLineOfLocalPosition(ts.skipTrivia(currentSourceFile.text, node.pos));
|
||||
if (astLine >= lastCommentLine + 2) {
|
||||
@ -7644,6 +7687,19 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function emitPinnedOrTripleSlashCommentsOfNode(node) {
|
||||
var pinnedComments = ts.filter(getLeadingCommentsToEmit(node), isPinnedOrTripleSlashComment);
|
||||
function isPinnedOrTripleSlashComment(comment) {
|
||||
if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */) {
|
||||
return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33 /* exclamation */;
|
||||
}
|
||||
else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 /* slash */ && comment.pos + 2 < comment.end && currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 /* slash */ && currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
emitNewLineBeforeLeadingComments(node, pinnedComments, writer);
|
||||
emitComments(pinnedComments, true, writer, writeComment);
|
||||
}
|
||||
if (compilerOptions.sourceMap) {
|
||||
initializeEmitterWithSourceMaps();
|
||||
}
|
||||
@ -9078,7 +9134,7 @@ var ts;
|
||||
}
|
||||
return symbol.name;
|
||||
}
|
||||
if (enclosingDeclaration && !(symbol.flags & ts.SymbolFlags.PropertyOrAccessor & ts.SymbolFlags.Signature & 4096 /* Constructor */ & 2048 /* Method */ & 262144 /* TypeParameter */)) {
|
||||
if (enclosingDeclaration && !(symbol.flags & (ts.SymbolFlags.PropertyOrAccessor | ts.SymbolFlags.Signature | 4096 /* Constructor */ | 2048 /* Method */ | 262144 /* TypeParameter */))) {
|
||||
var symbolName;
|
||||
while (symbol) {
|
||||
var isFirstName = !symbolName;
|
||||
@ -9561,7 +9617,7 @@ var ts;
|
||||
function getTypeOfFuncClassEnumModule(symbol) {
|
||||
var links = getSymbolLinks(symbol);
|
||||
if (!links.type) {
|
||||
var type = links.type = createObjectType(8192 /* Anonymous */, symbol);
|
||||
links.type = createObjectType(8192 /* Anonymous */, symbol);
|
||||
}
|
||||
return links.type;
|
||||
}
|
||||
@ -10234,11 +10290,11 @@ var ts;
|
||||
}
|
||||
var type = getDeclaredTypeOfSymbol(symbol);
|
||||
if (!(type.flags & ts.TypeFlags.ObjectType)) {
|
||||
error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, name);
|
||||
error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name);
|
||||
return emptyObjectType;
|
||||
}
|
||||
if ((type.typeParameters ? type.typeParameters.length : 0) !== arity) {
|
||||
error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, name, arity);
|
||||
error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbol.name, arity);
|
||||
return emptyObjectType;
|
||||
}
|
||||
return type;
|
||||
@ -11370,7 +11426,8 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function checkSuperExpression(node, isCallExpression) {
|
||||
function checkSuperExpression(node) {
|
||||
var isCallExpression = node.parent.kind === 132 /* CallExpression */ && node.parent.func === node;
|
||||
var enclosingClass = getAncestor(node, 169 /* ClassDeclaration */);
|
||||
var baseClass;
|
||||
if (enclosingClass && enclosingClass.baseType) {
|
||||
@ -11872,7 +11929,7 @@ var ts;
|
||||
}
|
||||
function resolveCallExpression(node) {
|
||||
if (node.func.kind === 81 /* SuperKeyword */) {
|
||||
var superType = checkSuperExpression(node.func, true);
|
||||
var superType = checkSuperExpression(node.func);
|
||||
if (superType !== unknownType) {
|
||||
return resolveCall(node, getSignaturesOfType(superType, 1 /* Construct */));
|
||||
}
|
||||
@ -12345,7 +12402,7 @@ var ts;
|
||||
case 83 /* ThisKeyword */:
|
||||
return checkThisExpression(node);
|
||||
case 81 /* SuperKeyword */:
|
||||
return checkSuperExpression(node, false);
|
||||
return checkSuperExpression(node);
|
||||
case 79 /* NullKeyword */:
|
||||
return nullType;
|
||||
case 85 /* TrueKeyword */:
|
||||
@ -13786,6 +13843,7 @@ var ts;
|
||||
case 114 /* Parameter */:
|
||||
case 115 /* Property */:
|
||||
case 176 /* EnumMember */:
|
||||
case 129 /* PropertyAssignment */:
|
||||
return parent.initializer === node;
|
||||
case 146 /* ExpressionStatement */:
|
||||
case 147 /* IfStatement */:
|
||||
@ -13888,6 +13946,9 @@ var ts;
|
||||
if (entityName.parent.kind === 175 /* ExportAssignment */) {
|
||||
return resolveEntityName(entityName.parent.parent, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace | 4194304 /* Import */);
|
||||
}
|
||||
if (isInRightSideOfImportOrExportAssignment(entityName)) {
|
||||
return getSymbolOfPartOfRightHandSideOfImport(entityName);
|
||||
}
|
||||
if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
|
||||
entityName = entityName.parent;
|
||||
}
|
||||
@ -13976,8 +14037,7 @@ var ts;
|
||||
return getTypeOfSymbol(symbol);
|
||||
}
|
||||
if (isInRightSideOfImportOrExportAssignment(node)) {
|
||||
var symbol;
|
||||
symbol = node.parent.kind === 175 /* ExportAssignment */ ? getSymbolInfo(node) : getSymbolOfPartOfRightHandSideOfImport(node);
|
||||
var symbol = getSymbolInfo(node);
|
||||
var declaredType = getDeclaredTypeOfSymbol(symbol);
|
||||
return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol);
|
||||
}
|
||||
@ -14113,7 +14173,8 @@ var ts;
|
||||
function isImplementationOfOverload(node) {
|
||||
if (node.body) {
|
||||
var symbol = getSymbolOfNode(node);
|
||||
return getSignaturesOfSymbol(symbol).length > 1;
|
||||
var signaturesOfSymbol = getSignaturesOfSymbol(symbol);
|
||||
return signaturesOfSymbol.length > 1 || (signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -14465,13 +14526,14 @@ var ts;
|
||||
return diagnostic.messageText;
|
||||
}
|
||||
function reportDiagnostic(diagnostic) {
|
||||
var output = "";
|
||||
if (diagnostic.file) {
|
||||
var loc = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start);
|
||||
sys.write(diagnostic.file.filename + "(" + loc.line + "," + loc.character + "): " + diagnostic.messageText + sys.newLine);
|
||||
}
|
||||
else {
|
||||
sys.write(diagnostic.messageText + sys.newLine);
|
||||
output += diagnostic.file.filename + "(" + loc.line + "," + loc.character + "): ";
|
||||
}
|
||||
var category = ts.DiagnosticCategory[diagnostic.category].toLowerCase();
|
||||
output += category + " TS" + diagnostic.code + ": " + diagnostic.messageText + sys.newLine;
|
||||
sys.write(output);
|
||||
}
|
||||
function reportDiagnostics(diagnostics) {
|
||||
for (var i = 0; i < diagnostics.length; i++) {
|
||||
@ -14502,6 +14564,9 @@ var ts;
|
||||
function createCompilerHost(options) {
|
||||
var currentDirectory;
|
||||
var existingDirectories = {};
|
||||
function getCanonicalFileName(fileName) {
|
||||
return sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase();
|
||||
}
|
||||
function getSourceFile(filename, languageVersion, onError) {
|
||||
try {
|
||||
var text = sys.readFile(filename, options.charset);
|
||||
@ -14512,7 +14577,7 @@ var ts;
|
||||
}
|
||||
text = "";
|
||||
}
|
||||
return text !== undefined ? ts.createSourceFile(filename, text, languageVersion) : undefined;
|
||||
return text !== undefined ? ts.createSourceFile(filename, text, languageVersion, "0") : undefined;
|
||||
}
|
||||
function writeFile(fileName, data, writeByteOrderMark, onError) {
|
||||
function directoryExists(directoryPath) {
|
||||
@ -14547,7 +14612,7 @@ var ts;
|
||||
writeFile: writeFile,
|
||||
getCurrentDirectory: function () { return currentDirectory || (currentDirectory = sys.getCurrentDirectory()); },
|
||||
useCaseSensitiveFileNames: function () { return sys.useCaseSensitiveFileNames; },
|
||||
getCanonicalFileName: ts.getCanonicalFileName,
|
||||
getCanonicalFileName: getCanonicalFileName,
|
||||
getNewLine: function () { return sys.newLine; }
|
||||
};
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -908,7 +908,7 @@ module ts {
|
||||
// Get qualified name
|
||||
if (enclosingDeclaration &&
|
||||
// Properties/methods/Signatures/Constructors/TypeParameters do not need qualification
|
||||
!(symbol.flags & SymbolFlags.PropertyOrAccessor & SymbolFlags.Signature & SymbolFlags.Constructor & SymbolFlags.Method & SymbolFlags.TypeParameter)) {
|
||||
!(symbol.flags & (SymbolFlags.PropertyOrAccessor | SymbolFlags.Signature | SymbolFlags.Constructor | SymbolFlags.Method | SymbolFlags.TypeParameter))) {
|
||||
var symbolName: string;
|
||||
while (symbol) {
|
||||
var isFirstName = !symbolName;
|
||||
@ -2238,13 +2238,12 @@ module ts {
|
||||
return emptyObjectType;
|
||||
}
|
||||
var type = getDeclaredTypeOfSymbol(symbol);
|
||||
var name = symbol.name;
|
||||
if (!(type.flags & TypeFlags.ObjectType)) {
|
||||
error(getTypeDeclaration(symbol), Diagnostics.Global_type_0_must_be_a_class_or_interface_type, name);
|
||||
error(getTypeDeclaration(symbol), Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name);
|
||||
return emptyObjectType;
|
||||
}
|
||||
if (((<InterfaceType>type).typeParameters ? (<InterfaceType>type).typeParameters.length : 0) !== arity) {
|
||||
error(getTypeDeclaration(symbol), Diagnostics.Global_type_0_must_have_1_type_parameter_s, name, arity);
|
||||
error(getTypeDeclaration(symbol), Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbol.name, arity);
|
||||
return emptyObjectType;
|
||||
}
|
||||
return <ObjectType>type;
|
||||
@ -3548,7 +3547,8 @@ module ts {
|
||||
return false;
|
||||
}
|
||||
|
||||
function checkSuperExpression(node: Node, isCallExpression: boolean): Type {
|
||||
function checkSuperExpression(node: Node): Type {
|
||||
var isCallExpression = node.parent.kind === SyntaxKind.CallExpression && (<CallExpression>node.parent).func === node;
|
||||
var enclosingClass = <ClassDeclaration>getAncestor(node, SyntaxKind.ClassDeclaration);
|
||||
var baseClass: Type;
|
||||
if (enclosingClass && enclosingClass.baseType) {
|
||||
@ -4183,7 +4183,7 @@ module ts {
|
||||
|
||||
function resolveCallExpression(node: CallExpression): Signature {
|
||||
if (node.func.kind === SyntaxKind.SuperKeyword) {
|
||||
var superType = checkSuperExpression(node.func, true);
|
||||
var superType = checkSuperExpression(node.func);
|
||||
if (superType !== unknownType) {
|
||||
return resolveCall(node, getSignaturesOfType(superType, SignatureKind.Construct));
|
||||
}
|
||||
@ -4831,7 +4831,7 @@ module ts {
|
||||
case SyntaxKind.ThisKeyword:
|
||||
return checkThisExpression(node);
|
||||
case SyntaxKind.SuperKeyword:
|
||||
return checkSuperExpression(node, false);
|
||||
return checkSuperExpression(node);
|
||||
case SyntaxKind.NullKeyword:
|
||||
return nullType;
|
||||
case SyntaxKind.TrueKeyword:
|
||||
@ -6775,6 +6775,11 @@ module ts {
|
||||
/*all meanings*/ SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Import);
|
||||
}
|
||||
|
||||
if (isInRightSideOfImportOrExportAssignment(entityName)) {
|
||||
// Since we already checked for ExportAssignment, this really could only be an Import
|
||||
return getSymbolOfPartOfRightHandSideOfImport(entityName);
|
||||
}
|
||||
|
||||
if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
|
||||
entityName = entityName.parent;
|
||||
}
|
||||
@ -6895,11 +6900,7 @@ module ts {
|
||||
}
|
||||
|
||||
if (isInRightSideOfImportOrExportAssignment(node)) {
|
||||
var symbol: Symbol;
|
||||
symbol = node.parent.kind === SyntaxKind.ExportAssignment
|
||||
? getSymbolInfo(node)
|
||||
: getSymbolOfPartOfRightHandSideOfImport(node);
|
||||
|
||||
var symbol = getSymbolInfo(node);
|
||||
var declaredType = getDeclaredTypeOfSymbol(symbol);
|
||||
return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol);
|
||||
}
|
||||
@ -7073,7 +7074,20 @@ module ts {
|
||||
function isImplementationOfOverload(node: FunctionDeclaration) {
|
||||
if (node.body) {
|
||||
var symbol = getSymbolOfNode(node);
|
||||
return getSignaturesOfSymbol(symbol).length > 1;
|
||||
var signaturesOfSymbol = getSignaturesOfSymbol(symbol);
|
||||
// If this function body corresponds to function with multiple signature, it is implementation of overload
|
||||
// eg: function foo(a: string): string;
|
||||
// function foo(a: number): number;
|
||||
// function foo(a: any) { // This is implementation of the overloads
|
||||
// return a;
|
||||
// }
|
||||
return signaturesOfSymbol.length > 1 ||
|
||||
// If there is single signature for the symbol, it is overload if that signature isnt coming from the node
|
||||
// eg: function foo(a: string): string;
|
||||
// function foo(a: any) { // This is implementation of the overloads
|
||||
// return a;
|
||||
// }
|
||||
(signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -509,12 +509,6 @@ module ts {
|
||||
return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension;
|
||||
}
|
||||
|
||||
export function getCanonicalFileName(fileName: string): string {
|
||||
// if underlying system can distinguish between two files whose names differs only in cases then file name already in canonical form.
|
||||
// otherwise use toLowerCase as a canonical form.
|
||||
return sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase();
|
||||
}
|
||||
|
||||
export interface ObjectAllocator {
|
||||
getNodeConstructor(kind: SyntaxKind): new () => Node;
|
||||
getSymbolConstructor(): new (flags: SymbolFlags, name: string) => Symbol;
|
||||
|
||||
@ -290,7 +290,7 @@ module ts {
|
||||
}
|
||||
else {
|
||||
// Empty string - make sure we write empty line
|
||||
writer.writeLiteral(sys.newLine);
|
||||
writer.writeLiteral(newLine);
|
||||
}
|
||||
}
|
||||
|
||||
@ -336,6 +336,9 @@ module ts {
|
||||
/** Emit detached comments of the node */
|
||||
var emitDetachedComments = compilerOptions.removeComments ? (node: TextRange) => { } : emitDetachedCommentsAtPosition;
|
||||
|
||||
/** Emits /// or pinned which is comment starting with /*! comments */
|
||||
var emitPinnedOrTripleSlashComments = compilerOptions.removeComments ? (node: Node) => { } : emitPinnedOrTripleSlashCommentsOfNode;
|
||||
|
||||
var writeComment = writeCommentRange;
|
||||
|
||||
/** Emit a node */
|
||||
@ -1318,7 +1321,10 @@ module ts {
|
||||
}
|
||||
|
||||
function emitFunctionDeclaration(node: FunctionDeclaration) {
|
||||
if (!node.body) return;
|
||||
if (!node.body) {
|
||||
return emitPinnedOrTripleSlashComments(node);
|
||||
}
|
||||
|
||||
if (node.kind !== SyntaxKind.Method) {
|
||||
// Methods will emit the comments as part of emitting method declaration
|
||||
emitLeadingComments(node);
|
||||
@ -1488,7 +1494,10 @@ module ts {
|
||||
function emitMemberFunctions(node: ClassDeclaration) {
|
||||
forEach(node.members, member => {
|
||||
if (member.kind === SyntaxKind.Method) {
|
||||
if (!(<MethodDeclaration>member).body) return;
|
||||
if (!(<MethodDeclaration>member).body) {
|
||||
return emitPinnedOrTripleSlashComments(member);
|
||||
}
|
||||
|
||||
writeLine();
|
||||
emitLeadingComments(member);
|
||||
emitStart(member);
|
||||
@ -1611,6 +1620,13 @@ module ts {
|
||||
emitTrailingComments(node);
|
||||
|
||||
function emitConstructorOfClass() {
|
||||
// Emit the constructor overload pinned comments
|
||||
forEach(node.members, member => {
|
||||
if (member.kind === SyntaxKind.Constructor && !(<ConstructorDeclaration>member).body) {
|
||||
emitPinnedOrTripleSlashComments(member);
|
||||
}
|
||||
});
|
||||
|
||||
var ctor = getFirstConstructorWithBody(node);
|
||||
if (ctor) {
|
||||
emitLeadingComments(ctor);
|
||||
@ -1666,6 +1682,10 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function emitInterfaceDeclaration(node: InterfaceDeclaration) {
|
||||
emitPinnedOrTripleSlashComments(node);
|
||||
}
|
||||
|
||||
function emitEnumDeclaration(node: EnumDeclaration) {
|
||||
emitLeadingComments(node);
|
||||
if (!(node.flags & NodeFlags.Export)) {
|
||||
@ -1741,7 +1761,10 @@ module ts {
|
||||
}
|
||||
|
||||
function emitModuleDeclaration(node: ModuleDeclaration) {
|
||||
if (!isInstantiated(node)) return;
|
||||
if (!isInstantiated(node)) {
|
||||
return emitPinnedOrTripleSlashComments(node);
|
||||
}
|
||||
|
||||
emitLeadingComments(node);
|
||||
if (!(node.flags & NodeFlags.Export)) {
|
||||
emitStart(node);
|
||||
@ -1969,7 +1992,14 @@ module ts {
|
||||
}
|
||||
|
||||
function emitNode(node: Node) {
|
||||
if (!node || node.flags & NodeFlags.Ambient) return;
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.flags & NodeFlags.Ambient) {
|
||||
return emitPinnedOrTripleSlashComments(node);
|
||||
}
|
||||
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.Identifier:
|
||||
return emitIdentifier(<Identifier>node);
|
||||
@ -2073,6 +2103,8 @@ module ts {
|
||||
return emitVariableDeclaration(<VariableDeclaration>node);
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
return emitClassDeclaration(<ClassDeclaration>node);
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
return emitInterfaceDeclaration(<InterfaceDeclaration>node);
|
||||
case SyntaxKind.EnumDeclaration:
|
||||
return emitEnumDeclaration(<EnumDeclaration>node);
|
||||
case SyntaxKind.ModuleDeclaration:
|
||||
@ -2101,7 +2133,7 @@ module ts {
|
||||
return leadingComments;
|
||||
}
|
||||
|
||||
function emitLeadingDeclarationComments(node: Node) {
|
||||
function getLeadingCommentsToEmit(node: Node) {
|
||||
// Emit the leading comments only if the parent's pos doesnt match because parent should take care of emitting these comments
|
||||
if (node.parent.kind === SyntaxKind.SourceFile || node.pos !== node.parent.pos) {
|
||||
var leadingComments: Comment[];
|
||||
@ -2113,12 +2145,17 @@ module ts {
|
||||
// get the leading comments from the node
|
||||
leadingComments = getLeadingCommentsOfNode(node, currentSourceFile);
|
||||
}
|
||||
emitNewLineBeforeLeadingComments(node, leadingComments, writer);
|
||||
// Leading comments are emitted at /*leading comment1 */space/*leading comment*/space
|
||||
emitComments(leadingComments, /*trailingSeparator*/ true, writer, writeComment);
|
||||
return leadingComments;
|
||||
}
|
||||
}
|
||||
|
||||
function emitLeadingDeclarationComments(node: Node) {
|
||||
var leadingComments = getLeadingCommentsToEmit(node);
|
||||
emitNewLineBeforeLeadingComments(node, leadingComments, writer);
|
||||
// Leading comments are emitted at /*leading comment1 */space/*leading comment*/space
|
||||
emitComments(leadingComments, /*trailingSeparator*/ true, writer, writeComment);
|
||||
}
|
||||
|
||||
function emitTrailingDeclarationComments(node: Node) {
|
||||
// Emit the trailing comments only if the parent's end doesnt match
|
||||
if (node.parent.kind === SyntaxKind.SourceFile || node.end !== node.parent.end) {
|
||||
@ -2166,7 +2203,7 @@ module ts {
|
||||
lastComment = comment;
|
||||
});
|
||||
|
||||
if (detachedComments && detachedComments.length) {
|
||||
if (detachedComments.length) {
|
||||
// All comments look like they could have been part of the copyright header. Make
|
||||
// sure there is at least one blank line between it and the node. If not, it's not
|
||||
// a copyright header.
|
||||
@ -2188,6 +2225,28 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function emitPinnedOrTripleSlashCommentsOfNode(node: Node) {
|
||||
var pinnedComments = ts.filter(getLeadingCommentsToEmit(node), isPinnedOrTripleSlashComment);
|
||||
|
||||
function isPinnedOrTripleSlashComment(comment: Comment) {
|
||||
if (currentSourceFile.text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk) {
|
||||
return currentSourceFile.text.charCodeAt(comment.pos + 2) === CharacterCodes.exclamation;
|
||||
}
|
||||
// Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text
|
||||
// so that we dont end up computing comment string and doing match for all // comments
|
||||
else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === CharacterCodes.slash &&
|
||||
comment.pos + 2 < comment.end &&
|
||||
currentSourceFile.text.charCodeAt(comment.pos + 2) === CharacterCodes.slash &&
|
||||
currentSourceFile.text.substring(comment.pos, comment.end).match(fullTripleSlashReferencePathRegEx)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
emitNewLineBeforeLeadingComments(node, pinnedComments, writer);
|
||||
// Leading comments are emitted at /*leading comment1 */space/*leading comment*/space
|
||||
emitComments(pinnedComments, /*trailingSeparator*/ true, writer, writeComment);
|
||||
}
|
||||
|
||||
if (compilerOptions.sourceMap) {
|
||||
initializeEmitterWithSourceMaps();
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
/// <reference path="sys.ts"/>
|
||||
/// <reference path="types.ts"/>
|
||||
/// <reference path="core.ts"/>
|
||||
/// <reference path="scanner.ts"/>
|
||||
@ -165,6 +164,8 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
export var fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*<reference\s+path\s*=\s*)('|")(.+?)\2.*?\/>/
|
||||
|
||||
// Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes
|
||||
// stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise,
|
||||
// embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns
|
||||
@ -3555,8 +3556,7 @@ module ts {
|
||||
file.hasNoDefaultLib = true;
|
||||
}
|
||||
else {
|
||||
var fullReferenceRegEx = /^(\/\/\/\s*<reference\s+path\s*=\s*)('|")(.+?)\2.*?\/>/;
|
||||
var matchResult = fullReferenceRegEx.exec(comment);
|
||||
var matchResult = fullTripleSlashReferencePathRegEx.exec(comment);
|
||||
if (!matchResult) {
|
||||
var start = range.pos;
|
||||
var length = range.end - start;
|
||||
|
||||
@ -137,6 +137,12 @@ module ts {
|
||||
var currentDirectory: string;
|
||||
var existingDirectories: Map<boolean> = {};
|
||||
|
||||
function getCanonicalFileName(fileName: string): string {
|
||||
// if underlying system can distinguish between two files whose names differs only in cases then file name already in canonical form.
|
||||
// otherwise use toLowerCase as a canonical form.
|
||||
return sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase();
|
||||
}
|
||||
|
||||
function getSourceFile(filename: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile {
|
||||
try {
|
||||
var text = sys.readFile(filename, options.charset);
|
||||
@ -323,6 +329,7 @@ module ts {
|
||||
function compile(commandLine: ParsedCommandLine, compilerHost: CompilerHost) {
|
||||
var parseStart = new Date().getTime();
|
||||
var program = createProgram(commandLine.filenames, commandLine.options, compilerHost);
|
||||
|
||||
var bindStart = new Date().getTime();
|
||||
var errors = program.getDiagnostics();
|
||||
if (errors.length) {
|
||||
|
||||
@ -41,16 +41,16 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
describe('compiler tests for ' + fileName, () => {
|
||||
// Mocha holds onto the closure environment of the describe callback even after the test is done.
|
||||
// Everything declared here should be cleared out in the "after" callback.
|
||||
var justName = fileName.replace(/^.*[\\\/]/, ''); // strips the fileName from the path.
|
||||
var content = Harness.IO.readFile(fileName);
|
||||
var testCaseContent = Harness.TestCaseParser.makeUnitsFromTest(content, fileName);
|
||||
var justName: string;
|
||||
var content: string;
|
||||
var testCaseContent: { settings: Harness.TestCaseParser.CompilerSetting[]; testUnitData: Harness.TestCaseParser.TestUnitData[]; }
|
||||
|
||||
var units = testCaseContent.testUnitData;
|
||||
var tcSettings = testCaseContent.settings;
|
||||
var createNewInstance = false;
|
||||
var units: Harness.TestCaseParser.TestUnitData[];
|
||||
var tcSettings: Harness.TestCaseParser.CompilerSetting[];
|
||||
var createNewInstance: boolean;
|
||||
|
||||
var lastUnit = units[units.length - 1];
|
||||
var rootDir = lastUnit.originalFilePath.indexOf('conformance') === -1 ? 'tests/cases/compiler/' : lastUnit.originalFilePath.substring(0, lastUnit.originalFilePath.lastIndexOf('/')) + '/';
|
||||
var lastUnit: Harness.TestCaseParser.TestUnitData;
|
||||
var rootDir: string;
|
||||
|
||||
var result: Harness.Compiler.CompilerResult;
|
||||
var checker: ts.TypeChecker;
|
||||
@ -68,6 +68,14 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
var createNewInstance = false;
|
||||
|
||||
before(() => {
|
||||
justName = fileName.replace(/^.*[\\\/]/, ''); // strips the fileName from the path.
|
||||
content = Harness.IO.readFile(fileName);
|
||||
testCaseContent = Harness.TestCaseParser.makeUnitsFromTest(content, fileName);
|
||||
units = testCaseContent.testUnitData;
|
||||
tcSettings = testCaseContent.settings;
|
||||
createNewInstance = false;
|
||||
lastUnit = units[units.length - 1];
|
||||
rootDir = lastUnit.originalFilePath.indexOf('conformance') === -1 ? 'tests/cases/compiler/' : lastUnit.originalFilePath.substring(0, lastUnit.originalFilePath.lastIndexOf('/')) + '/';
|
||||
harnessCompiler = Harness.Compiler.getCompiler();
|
||||
// We need to assemble the list of input files for the compiler and other related files on the 'filesystem' (ie in a multi-file test)
|
||||
// If the last file in a test uses require or a triple slash reference we'll assume all other files will be brought in via references,
|
||||
@ -307,7 +315,7 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
allFiles.forEach(file => {
|
||||
var codeLines = file.content.split('\n');
|
||||
walker.getTypes(file.unitName).forEach(result => {
|
||||
var formattedLine = result.identifierName + " : " + result.type;
|
||||
var formattedLine = result.sourceText.replace(/\r?\n/g, "") + " : " + result.type;
|
||||
if (!typeMap[file.unitName]) {
|
||||
typeMap[file.unitName] = {};
|
||||
}
|
||||
|
||||
@ -1923,9 +1923,9 @@ module FourSlash {
|
||||
fourslashSourceFile = fourslashSourceFile || ts.createSourceFile(tsFn, Harness.IO.readFile(tsFn), ts.ScriptTarget.ES5, /*version*/ "0", /*isOpen*/ false);
|
||||
|
||||
var files: { [filename: string]: ts.SourceFile; } = {};
|
||||
files[ts.getCanonicalFileName(fourslashFilename)] = fourslashSourceFile;
|
||||
files[ts.getCanonicalFileName(fileName)] = ts.createSourceFile(fileName, content, ts.ScriptTarget.ES5, /*version*/ "0", /*isOpen*/ false);
|
||||
files[ts.getCanonicalFileName(Harness.Compiler.defaultLibFileName)] = Harness.Compiler.defaultLibSourceFile;
|
||||
files[Harness.Compiler.getCanonicalFileName(fourslashFilename)] = fourslashSourceFile;
|
||||
files[Harness.Compiler.getCanonicalFileName(fileName)] = ts.createSourceFile(fileName, content, ts.ScriptTarget.ES5, /*version*/ "0", /*isOpen*/ false);
|
||||
files[Harness.Compiler.getCanonicalFileName(Harness.Compiler.defaultLibFileName)] = Harness.Compiler.defaultLibSourceFile;
|
||||
|
||||
var host = Harness.Compiler.createCompilerHost(files, (fn, contents) => result = contents);
|
||||
var program = ts.createProgram([fourslashFilename, fileName], { out: "fourslashTestOutput.js" }, host);
|
||||
|
||||
@ -534,13 +534,17 @@ module Harness {
|
||||
export var defaultLibFileName = 'lib.d.ts';
|
||||
export var defaultLibSourceFile = ts.createSourceFile(defaultLibFileName, IO.readFile(libFolder + 'lib.core.d.ts'), /*languageVersion*/ ts.ScriptTarget.ES5, /*version:*/ "0");
|
||||
|
||||
export function getCanonicalFileName(fileName: string): string {
|
||||
return sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase();
|
||||
}
|
||||
|
||||
export function createCompilerHost(filemap: { [filename: string]: ts.SourceFile; }, writeFile: (fn: string, contents: string, writeByteOrderMark:boolean) => void): ts.CompilerHost {
|
||||
return {
|
||||
getCurrentDirectory: sys.getCurrentDirectory,
|
||||
getCancellationToken: (): any => undefined,
|
||||
getSourceFile: (fn, languageVersion) => {
|
||||
if (Object.prototype.hasOwnProperty.call(filemap, ts.getCanonicalFileName(fn))) {
|
||||
return filemap[ts.getCanonicalFileName(fn)];
|
||||
if (Object.prototype.hasOwnProperty.call(filemap, getCanonicalFileName(fn))) {
|
||||
return filemap[getCanonicalFileName(fn)];
|
||||
} else {
|
||||
var lib = defaultLibFileName;
|
||||
if (fn === defaultLibFileName) {
|
||||
@ -552,7 +556,7 @@ module Harness {
|
||||
},
|
||||
getDefaultLibFilename: () => defaultLibFileName,
|
||||
writeFile: writeFile,
|
||||
getCanonicalFileName: ts.getCanonicalFileName,
|
||||
getCanonicalFileName: getCanonicalFileName,
|
||||
useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames,
|
||||
getNewLine: ()=> sys.newLine
|
||||
};
|
||||
@ -729,7 +733,7 @@ module Harness {
|
||||
var filemap: { [name: string]: ts.SourceFile; } = {};
|
||||
var register = (file: { unitName: string; content: string; }) => {
|
||||
var filename = Path.switchToForwardSlashes(file.unitName);
|
||||
filemap[ts.getCanonicalFileName(filename)] = ts.createSourceFile(filename, file.content, options.target, /*version:*/ "0");
|
||||
filemap[getCanonicalFileName(filename)] = ts.createSourceFile(filename, file.content, options.target, /*version:*/ "0");
|
||||
};
|
||||
inputFiles.forEach(register);
|
||||
otherFiles.forEach(register);
|
||||
|
||||
@ -187,7 +187,7 @@ class ProjectRunner extends RunnerBase {
|
||||
getDefaultLibFilename: () => "lib.d.ts",
|
||||
writeFile: writeFile,
|
||||
getCurrentDirectory: getCurrentDirectory,
|
||||
getCanonicalFileName: ts.getCanonicalFileName,
|
||||
getCanonicalFileName: Harness.Compiler.getCanonicalFileName,
|
||||
useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames,
|
||||
getNewLine: () => sys.newLine
|
||||
};
|
||||
|
||||
@ -2,7 +2,7 @@ interface TypeWriterResult {
|
||||
line: number;
|
||||
column: number;
|
||||
syntaxKind: string;
|
||||
identifierName: string;
|
||||
sourceText: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ class TypeWriterWalker {
|
||||
// TODO: Ideally we should log all expressions, but to compare to the
|
||||
// old typeWriter baselines, suppress tokens
|
||||
case ts.SyntaxKind.ThisKeyword:
|
||||
case ts.SyntaxKind.RegularExpressionLiteral:
|
||||
case ts.SyntaxKind.SuperKeyword:
|
||||
case ts.SyntaxKind.ArrayLiteral:
|
||||
case ts.SyntaxKind.ObjectLiteral:
|
||||
case ts.SyntaxKind.PropertyAccess:
|
||||
@ -77,7 +77,6 @@ class TypeWriterWalker {
|
||||
var actualPos = ts.skipTrivia(this.currentSourceFile.text, node.pos);
|
||||
var lineAndCharacter = this.currentSourceFile.getLineAndCharacterFromPosition(actualPos);
|
||||
var sourceText = ts.getSourceTextOfNodeFromSourceText(this.currentSourceFile.text, node);
|
||||
var isUnknownType = (<ts.IntrinsicType>type).intrinsicName === "unknown";
|
||||
|
||||
// If we got an unknown type, we temporarily want to fall back to just pretending the name
|
||||
// (source text) of the node is the type. This is to align with the old typeWriter to make
|
||||
@ -86,8 +85,8 @@ class TypeWriterWalker {
|
||||
line: lineAndCharacter.line - 1,
|
||||
column: lineAndCharacter.character,
|
||||
syntaxKind: ts.SyntaxKind[node.kind],
|
||||
identifierName: sourceText,
|
||||
type: isUnknownType ? sourceText : this.checker.typeToString(type)
|
||||
sourceText: sourceText,
|
||||
type: this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.None)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -120,7 +120,7 @@ module TypeScript {
|
||||
// TODO: We need to expose an extensibility point on our hosts to have them tell us what
|
||||
// they want the newline string to be. That way we can get the correct result regardless
|
||||
// of which host we use
|
||||
return sys.newLine ? sys.newLine : "\r\n";
|
||||
return "\r\n";
|
||||
}
|
||||
|
||||
function getLargestIndex(diagnostic: string): number {
|
||||
|
||||
@ -45,15 +45,15 @@ var p: { x: number; y: number; }
|
||||
var p = A.Point.Origin;
|
||||
>p : { x: number; y: number; }
|
||||
>A.Point.Origin : { x: number; y: number; }
|
||||
>A.Point : typeof Point
|
||||
>A.Point : typeof A.Point
|
||||
>A : typeof A
|
||||
>Point : typeof Point
|
||||
>Point : typeof A.Point
|
||||
>Origin : { x: number; y: number; }
|
||||
|
||||
var p = new A.Point(0, 0); // unexpected error here, bug 840000
|
||||
>p : { x: number; y: number; }
|
||||
>new A.Point(0, 0) : Point
|
||||
>A.Point : typeof Point
|
||||
>new A.Point(0, 0) : A.Point
|
||||
>A.Point : typeof A.Point
|
||||
>A : typeof A
|
||||
>Point : typeof Point
|
||||
>Point : typeof A.Point
|
||||
|
||||
|
||||
@ -39,15 +39,15 @@ var p: { x: number; y: number; }
|
||||
var p = A.Point.Origin;
|
||||
>p : { x: number; y: number; }
|
||||
>A.Point.Origin : { x: number; y: number; }
|
||||
>A.Point : typeof Point
|
||||
>A.Point : typeof A.Point
|
||||
>A : typeof A
|
||||
>Point : typeof Point
|
||||
>Point : typeof A.Point
|
||||
>Origin : { x: number; y: number; }
|
||||
|
||||
var p = new A.Point(0, 0); // unexpected error here, bug 840000
|
||||
>p : { x: number; y: number; }
|
||||
>new A.Point(0, 0) : Point
|
||||
>A.Point : typeof Point
|
||||
>new A.Point(0, 0) : A.Point
|
||||
>A.Point : typeof A.Point
|
||||
>A : typeof A
|
||||
>Point : typeof Point
|
||||
>Point : typeof A.Point
|
||||
|
||||
|
||||
6
tests/baselines/reference/ArrowFunction1.errors.txt
Normal file
6
tests/baselines/reference/ArrowFunction1.errors.txt
Normal file
@ -0,0 +1,6 @@
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction1.ts (1 errors) ====
|
||||
var v = (a: ) => {
|
||||
~
|
||||
!!! Type expected.
|
||||
|
||||
};
|
||||
8
tests/baselines/reference/ArrowFunction2.errors.txt
Normal file
8
tests/baselines/reference/ArrowFunction2.errors.txt
Normal file
@ -0,0 +1,8 @@
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction2.ts (2 errors) ====
|
||||
var v = (a: b,) => {
|
||||
~
|
||||
!!! Trailing comma not allowed.
|
||||
~
|
||||
!!! Cannot find name 'b'.
|
||||
|
||||
};
|
||||
10
tests/baselines/reference/ArrowFunction3.errors.txt
Normal file
10
tests/baselines/reference/ArrowFunction3.errors.txt
Normal file
@ -0,0 +1,10 @@
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts (3 errors) ====
|
||||
var v = (a): => {
|
||||
~
|
||||
!!! ',' expected.
|
||||
~~
|
||||
!!! ';' expected.
|
||||
~
|
||||
!!! Cannot find name 'a'.
|
||||
|
||||
};
|
||||
8
tests/baselines/reference/ArrowFunction4.js
Normal file
8
tests/baselines/reference/ArrowFunction4.js
Normal file
@ -0,0 +1,8 @@
|
||||
//// [ArrowFunction4.ts]
|
||||
var v = (a, b) => {
|
||||
|
||||
};
|
||||
|
||||
//// [ArrowFunction4.js]
|
||||
var v = function (a, b) {
|
||||
};
|
||||
8
tests/baselines/reference/ArrowFunction4.types
Normal file
8
tests/baselines/reference/ArrowFunction4.types
Normal file
@ -0,0 +1,8 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction4.ts ===
|
||||
var v = (a, b) => {
|
||||
>v : (a: any, b: any) => void
|
||||
>(a, b) => { } : (a: any, b: any) => void
|
||||
>a : any
|
||||
>b : any
|
||||
|
||||
};
|
||||
@ -36,8 +36,8 @@ var y: { x: number; y: number };
|
||||
|
||||
var y = new enumdule.Point(0, 0);
|
||||
>y : { x: number; y: number; }
|
||||
>new enumdule.Point(0, 0) : Point
|
||||
>enumdule.Point : typeof Point
|
||||
>new enumdule.Point(0, 0) : enumdule.Point
|
||||
>enumdule.Point : typeof enumdule.Point
|
||||
>enumdule : typeof enumdule
|
||||
>Point : typeof Point
|
||||
>Point : typeof enumdule.Point
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts ===
|
||||
module A {
|
||||
>A : A
|
||||
>A : unknown
|
||||
|
||||
interface Point {
|
||||
>Point : Point
|
||||
|
||||
@ -47,8 +47,8 @@ var cl: { x: number; y: number; }
|
||||
var cl = B.Point.Origin;
|
||||
>cl : { x: number; y: number; }
|
||||
>B.Point.Origin : { x: number; y: number; }
|
||||
>B.Point : typeof Point
|
||||
>B.Point : typeof B.Point
|
||||
>B : typeof B
|
||||
>Point : typeof Point
|
||||
>Point : typeof B.Point
|
||||
>Origin : { x: number; y: number; }
|
||||
|
||||
|
||||
@ -36,8 +36,8 @@ var y: { x: number; y: number };
|
||||
|
||||
var y = new enumdule.Point(0, 0);
|
||||
>y : { x: number; y: number; }
|
||||
>new enumdule.Point(0, 0) : Point
|
||||
>enumdule.Point : typeof Point
|
||||
>new enumdule.Point(0, 0) : enumdule.Point
|
||||
>enumdule.Point : typeof enumdule.Point
|
||||
>enumdule : typeof enumdule
|
||||
>Point : typeof Point
|
||||
>Point : typeof enumdule.Point
|
||||
|
||||
|
||||
@ -20,20 +20,20 @@ module A {
|
||||
>Point : Point
|
||||
|
||||
fromCarthesian(p: A.Point) {
|
||||
>fromCarthesian : (p: Point) => { x: number; y: number; }
|
||||
>p : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>fromCarthesian : (p: A.Point) => { x: number; y: number; }
|
||||
>p : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
|
||||
return { x: p.x, y: p.y };
|
||||
>{ x: p.x, y: p.y } : { x: number; y: number; }
|
||||
>x : number
|
||||
>p.x : number
|
||||
>p : Point
|
||||
>p : A.Point
|
||||
>x : number
|
||||
>y : number
|
||||
>p.y : number
|
||||
>p : Point
|
||||
>p : A.Point
|
||||
>y : number
|
||||
}
|
||||
}
|
||||
@ -47,8 +47,8 @@ var p: { x: number; y: number; };
|
||||
|
||||
var p: A.Point;
|
||||
>p : { x: number; y: number; }
|
||||
>A : A
|
||||
>Point : Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
|
||||
module X.Y.Z {
|
||||
>X : typeof X
|
||||
@ -89,9 +89,9 @@ var l: { length: number; }
|
||||
|
||||
var l: X.Y.Z.Line;
|
||||
>l : { length: number; }
|
||||
>X : X
|
||||
>Y : Y
|
||||
>Z : Z
|
||||
>Line : Line
|
||||
>X : unknown
|
||||
>Y : unknown
|
||||
>Z : unknown
|
||||
>Line : X.Y.Z.Line
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts ===
|
||||
module A {
|
||||
>A : A
|
||||
>A : unknown
|
||||
|
||||
export interface Point {
|
||||
>Point : Point
|
||||
@ -18,7 +18,7 @@ module A {
|
||||
}
|
||||
|
||||
module A {
|
||||
>A : A
|
||||
>A : unknown
|
||||
|
||||
interface Point {
|
||||
>Point : Point
|
||||
@ -31,73 +31,73 @@ module A {
|
||||
|
||||
// ensure merges as expected
|
||||
var p: { x: number; y: number; toCarth(): A.Point; };
|
||||
>p : { x: number; y: number; toCarth(): Point; }
|
||||
>p : { x: number; y: number; toCarth(): A.Point; }
|
||||
>x : number
|
||||
>y : number
|
||||
>toCarth : () => Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>toCarth : () => A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
|
||||
var p: A.Point;
|
||||
>p : { x: number; y: number; toCarth(): Point; }
|
||||
>A : A
|
||||
>Point : Point
|
||||
>p : { x: number; y: number; toCarth(): A.Point; }
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
|
||||
module X.Y.Z {
|
||||
>X : X
|
||||
>Y : Y
|
||||
>Z : Z
|
||||
>X : unknown
|
||||
>Y : unknown
|
||||
>Z : unknown
|
||||
|
||||
export interface Line {
|
||||
>Line : Line
|
||||
|
||||
new (start: A.Point, end: A.Point);
|
||||
>start : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>end : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>start : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>end : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
}
|
||||
}
|
||||
|
||||
module X {
|
||||
>X : X
|
||||
>X : unknown
|
||||
|
||||
export module Y.Z {
|
||||
>Y : Y
|
||||
>Z : Z
|
||||
>Y : unknown
|
||||
>Z : unknown
|
||||
|
||||
interface Line {
|
||||
>Line : Line
|
||||
|
||||
start: A.Point;
|
||||
>start : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>start : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
|
||||
end: A.Point;
|
||||
>end : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>end : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ensure merges as expected
|
||||
var l: { new (s: A.Point, e: A.Point); }
|
||||
>l : new (s: Point, e: Point) => any
|
||||
>s : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>e : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>l : new (s: A.Point, e: A.Point) => any
|
||||
>s : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>e : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
|
||||
var l: X.Y.Z.Line;
|
||||
>l : new (s: Point, e: Point) => any
|
||||
>X : X
|
||||
>Y : Y
|
||||
>Z : Z
|
||||
>Line : Line
|
||||
>l : new (s: A.Point, e: A.Point) => any
|
||||
>X : unknown
|
||||
>Y : unknown
|
||||
>Z : unknown
|
||||
>Line : X.Y.Z.Line
|
||||
|
||||
|
||||
@ -75,48 +75,48 @@ var o: { x: number; y: number };
|
||||
|
||||
var o: A.Point;
|
||||
>o : { x: number; y: number; }
|
||||
>A : A
|
||||
>Point : Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
|
||||
var o = A.Origin;
|
||||
>o : { x: number; y: number; }
|
||||
>A.Origin : Point
|
||||
>A.Origin : A.Point
|
||||
>A : typeof A
|
||||
>Origin : Point
|
||||
>Origin : A.Point
|
||||
|
||||
var o = A.Utils.mirror(o);
|
||||
>o : { x: number; y: number; }
|
||||
>A.Utils.mirror(o) : { x: number; y: number; }
|
||||
>A.Utils.mirror : <T extends Point>(p: T) => { x: number; y: number; }
|
||||
>A.Utils : typeof Utils
|
||||
>A.Utils.mirror : <T extends A.Point>(p: T) => { x: number; y: number; }
|
||||
>A.Utils : typeof A.Utils
|
||||
>A : typeof A
|
||||
>Utils : typeof Utils
|
||||
>mirror : <T extends Point>(p: T) => { x: number; y: number; }
|
||||
>Utils : typeof A.Utils
|
||||
>mirror : <T extends A.Point>(p: T) => { x: number; y: number; }
|
||||
>o : { x: number; y: number; }
|
||||
|
||||
var p: { tl: A.Point; br: A.Point };
|
||||
>p : { tl: Point; br: Point; }
|
||||
>tl : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>br : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>p : { tl: A.Point; br: A.Point; }
|
||||
>tl : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>br : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
|
||||
var p: A.Utils.Plane;
|
||||
>p : { tl: Point; br: Point; }
|
||||
>A : A
|
||||
>Utils : Utils
|
||||
>Plane : Plane
|
||||
>p : { tl: A.Point; br: A.Point; }
|
||||
>A : unknown
|
||||
>Utils : unknown
|
||||
>Plane : A.Utils.Plane
|
||||
|
||||
var p = new A.Utils.Plane(o, { x: 1, y: 1 });
|
||||
>p : { tl: Point; br: Point; }
|
||||
>new A.Utils.Plane(o, { x: 1, y: 1 }) : Plane
|
||||
>A.Utils.Plane : typeof Plane
|
||||
>A.Utils : typeof Utils
|
||||
>p : { tl: A.Point; br: A.Point; }
|
||||
>new A.Utils.Plane(o, { x: 1, y: 1 }) : A.Utils.Plane
|
||||
>A.Utils.Plane : typeof A.Utils.Plane
|
||||
>A.Utils : typeof A.Utils
|
||||
>A : typeof A
|
||||
>Utils : typeof Utils
|
||||
>Plane : typeof Plane
|
||||
>Utils : typeof A.Utils
|
||||
>Plane : typeof A.Utils.Plane
|
||||
>o : { x: number; y: number; }
|
||||
>{ x: 1, y: 1 } : { x: number; y: number; }
|
||||
>x : number
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts ===
|
||||
module A {
|
||||
>A : A
|
||||
>A : unknown
|
||||
|
||||
export interface Point {
|
||||
>Point : Point
|
||||
@ -18,7 +18,7 @@ module A {
|
||||
}
|
||||
|
||||
module A {
|
||||
>A : A
|
||||
>A : unknown
|
||||
|
||||
export interface Point {
|
||||
>Point : Point
|
||||
@ -31,82 +31,82 @@ module A {
|
||||
|
||||
// ensure merges as expected
|
||||
var p: { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; };
|
||||
>p : { x: number; y: number; toCarth(): Point; fromCarth(): Point; }
|
||||
>p : { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }
|
||||
>x : number
|
||||
>y : number
|
||||
>toCarth : () => Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>fromCarth : () => Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>toCarth : () => A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>fromCarth : () => A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
|
||||
var p: A.Point;
|
||||
>p : { x: number; y: number; toCarth(): Point; fromCarth(): Point; }
|
||||
>A : A
|
||||
>Point : Point
|
||||
>p : { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
|
||||
module X.Y.Z {
|
||||
>X : X
|
||||
>Y : Y
|
||||
>Z : Z
|
||||
>X : unknown
|
||||
>Y : unknown
|
||||
>Z : unknown
|
||||
|
||||
export interface Line {
|
||||
>Line : Line
|
||||
|
||||
new (start: A.Point, end: A.Point);
|
||||
>start : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>end : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>start : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>end : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
}
|
||||
}
|
||||
|
||||
module X {
|
||||
>X : X
|
||||
>X : unknown
|
||||
|
||||
export module Y.Z {
|
||||
>Y : Y
|
||||
>Z : Z
|
||||
>Y : unknown
|
||||
>Z : unknown
|
||||
|
||||
export interface Line {
|
||||
>Line : Line
|
||||
|
||||
start: A.Point;
|
||||
>start : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>start : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
|
||||
end: A.Point;
|
||||
>end : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>end : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ensure merges as expected
|
||||
var l: { start: A.Point; end: A.Point; new (s: A.Point, e: A.Point); }
|
||||
>l : { new (s: Point, e: Point): any; start: Point; end: Point; }
|
||||
>start : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>end : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>s : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>e : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>l : { new (s: A.Point, e: A.Point): any; start: A.Point; end: A.Point; }
|
||||
>start : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>end : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>s : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>e : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
|
||||
var l: X.Y.Z.Line;
|
||||
>l : { new (s: Point, e: Point): any; start: Point; end: Point; }
|
||||
>X : X
|
||||
>Y : Y
|
||||
>Z : Z
|
||||
>Line : Line
|
||||
>l : { new (s: A.Point, e: A.Point): any; start: A.Point; end: A.Point; }
|
||||
>X : unknown
|
||||
>Y : unknown
|
||||
>Z : unknown
|
||||
>Line : X.Y.Z.Line
|
||||
|
||||
|
||||
@ -25,9 +25,9 @@ var x: number;
|
||||
var x = A.B.x;
|
||||
>x : number
|
||||
>A.B.x : number
|
||||
>A.B : typeof B
|
||||
>A.B : typeof A.B
|
||||
>A : typeof A
|
||||
>B : typeof B
|
||||
>B : typeof A.B
|
||||
>x : number
|
||||
|
||||
module X.Y.Z {
|
||||
@ -69,8 +69,8 @@ var l: { length: number };
|
||||
|
||||
var l: X.Y.Z.Line;
|
||||
>l : { length: number; }
|
||||
>X : X
|
||||
>Y : Y
|
||||
>Z : Z
|
||||
>Line : Line
|
||||
>X : unknown
|
||||
>Y : unknown
|
||||
>Z : unknown
|
||||
>Line : X.Y.Z.Line
|
||||
|
||||
|
||||
@ -49,10 +49,10 @@ module otherRoot {
|
||||
|
||||
// have to be fully qualified since in different root
|
||||
export var Origin: Root.A.Point = { x: 0, y: 0 };
|
||||
>Origin : Point
|
||||
>Root : Root
|
||||
>A : A
|
||||
>Point : Point
|
||||
>Origin : Root.A.Point
|
||||
>Root : unknown
|
||||
>A : unknown
|
||||
>Point : Root.A.Point
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
@ -64,14 +64,14 @@ module otherRoot {
|
||||
>Plane : Plane
|
||||
|
||||
constructor(public tl: Root.A.Point, public br: Root.A.Point) { }
|
||||
>tl : Point
|
||||
>Root : Root
|
||||
>A : A
|
||||
>Point : Point
|
||||
>br : Point
|
||||
>Root : Root
|
||||
>A : A
|
||||
>Point : Point
|
||||
>tl : Root.A.Point
|
||||
>Root : unknown
|
||||
>A : unknown
|
||||
>Point : Root.A.Point
|
||||
>br : Root.A.Point
|
||||
>Root : unknown
|
||||
>A : unknown
|
||||
>Point : Root.A.Point
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,48 +72,48 @@ var o: { x: number; y: number };
|
||||
|
||||
var o: A.Point;
|
||||
>o : { x: number; y: number; }
|
||||
>A : A
|
||||
>Point : Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
|
||||
var o = A.Origin;
|
||||
>o : { x: number; y: number; }
|
||||
>A.Origin : Point
|
||||
>A.Origin : A.Point
|
||||
>A : typeof A
|
||||
>Origin : Point
|
||||
>Origin : A.Point
|
||||
|
||||
var o = A.Utils.mirror(o);
|
||||
>o : { x: number; y: number; }
|
||||
>A.Utils.mirror(o) : { x: number; y: number; }
|
||||
>A.Utils.mirror : <T extends Point>(p: T) => { x: number; y: number; }
|
||||
>A.Utils : typeof Utils
|
||||
>A.Utils.mirror : <T extends A.Point>(p: T) => { x: number; y: number; }
|
||||
>A.Utils : typeof A.Utils
|
||||
>A : typeof A
|
||||
>Utils : typeof Utils
|
||||
>mirror : <T extends Point>(p: T) => { x: number; y: number; }
|
||||
>Utils : typeof A.Utils
|
||||
>mirror : <T extends A.Point>(p: T) => { x: number; y: number; }
|
||||
>o : { x: number; y: number; }
|
||||
|
||||
var p: { tl: A.Point; br: A.Point };
|
||||
>p : { tl: Point; br: Point; }
|
||||
>tl : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>br : Point
|
||||
>A : A
|
||||
>Point : Point
|
||||
>p : { tl: A.Point; br: A.Point; }
|
||||
>tl : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>br : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
|
||||
var p: A.Utils.Plane;
|
||||
>p : { tl: Point; br: Point; }
|
||||
>A : A
|
||||
>Utils : Utils
|
||||
>Plane : Plane
|
||||
>p : { tl: A.Point; br: A.Point; }
|
||||
>A : unknown
|
||||
>Utils : unknown
|
||||
>Plane : A.Utils.Plane
|
||||
|
||||
var p = new A.Utils.Plane(o, { x: 1, y: 1 });
|
||||
>p : { tl: Point; br: Point; }
|
||||
>new A.Utils.Plane(o, { x: 1, y: 1 }) : Plane
|
||||
>A.Utils.Plane : typeof Plane
|
||||
>A.Utils : typeof Utils
|
||||
>p : { tl: A.Point; br: A.Point; }
|
||||
>new A.Utils.Plane(o, { x: 1, y: 1 }) : A.Utils.Plane
|
||||
>A.Utils.Plane : typeof A.Utils.Plane
|
||||
>A.Utils : typeof A.Utils
|
||||
>A : typeof A
|
||||
>Utils : typeof Utils
|
||||
>Plane : typeof Plane
|
||||
>Utils : typeof A.Utils
|
||||
>Plane : typeof A.Utils.Plane
|
||||
>o : { x: number; y: number; }
|
||||
>{ x: 1, y: 1 } : { x: number; y: number; }
|
||||
>x : number
|
||||
|
||||
12
tests/baselines/reference/TypeArgumentList1.errors.txt
Normal file
12
tests/baselines/reference/TypeArgumentList1.errors.txt
Normal file
@ -0,0 +1,12 @@
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/TypeArgumentLists/TypeArgumentList1.ts (5 errors) ====
|
||||
Foo<A,B,\ C>(4, 5, 6);
|
||||
|
||||
!!! Invalid character.
|
||||
~~~
|
||||
!!! Cannot find name 'Foo'.
|
||||
~
|
||||
!!! Cannot find name 'A'.
|
||||
~
|
||||
!!! Cannot find name 'B'.
|
||||
~
|
||||
!!! Cannot find name 'C'.
|
||||
@ -3,15 +3,15 @@ module M {
|
||||
>M : typeof M
|
||||
|
||||
export module N {
|
||||
>N : N
|
||||
>N : unknown
|
||||
}
|
||||
export import X = N;
|
||||
>X : X
|
||||
>N : N
|
||||
>X : unknown
|
||||
>N : unknown
|
||||
}
|
||||
|
||||
import r = M.X;
|
||||
>r : r
|
||||
>r : unknown
|
||||
>M : typeof M
|
||||
>X : X
|
||||
>X : unknown
|
||||
|
||||
|
||||
@ -32,6 +32,7 @@ class ColoredPoint extends Point {
|
||||
|
||||
super(x, y);
|
||||
>super(x, y) : void
|
||||
>super : typeof Point
|
||||
>x : number
|
||||
>y : number
|
||||
}
|
||||
@ -43,6 +44,7 @@ class ColoredPoint extends Point {
|
||||
>super.toString() + " color=" : string
|
||||
>super.toString() : string
|
||||
>super.toString : () => string
|
||||
>super : Point
|
||||
>toString : () => string
|
||||
>this.color : string
|
||||
>this : ColoredPoint
|
||||
|
||||
@ -21,9 +21,7 @@ class D {
|
||||
|
||||
var x = {
|
||||
>x : { a: number; }
|
||||
>{
|
||||
get a() { return 1 }
|
||||
} : { a: number; }
|
||||
>{ get a() { return 1 }} : { a: number; }
|
||||
|
||||
get a() { return 1 }
|
||||
>a : number
|
||||
@ -31,9 +29,7 @@ var x = {
|
||||
|
||||
var y = {
|
||||
>y : { b: any; }
|
||||
>{
|
||||
set b(v) { }
|
||||
} : { b: any; }
|
||||
>{ set b(v) { }} : { b: any; }
|
||||
|
||||
set b(v) { }
|
||||
>b : any
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
=== tests/cases/compiler/aliasUsage1_main.ts ===
|
||||
import Backbone = require("aliasUsage1_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsage1_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
import moduleA = require("aliasUsage1_moduleA");
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsage1_moduleA"
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
interface IHasVisualizationModel {
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
|
||||
VisualizationModel: typeof Backbone.Model;
|
||||
>VisualizationModel : typeof Model
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsage1_backbone"
|
||||
>Model : typeof Model
|
||||
>VisualizationModel : typeof Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : typeof Backbone.Model
|
||||
}
|
||||
class C2 {
|
||||
>C2 : C2
|
||||
@ -33,9 +33,9 @@ class C2 {
|
||||
>x : IHasVisualizationModel
|
||||
|
||||
x = moduleA;
|
||||
>x = moduleA : typeof "tests/cases/compiler/aliasUsage1_moduleA"
|
||||
>x = moduleA : typeof moduleA
|
||||
>x : IHasVisualizationModel
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsage1_moduleA"
|
||||
>moduleA : typeof moduleA
|
||||
}
|
||||
}
|
||||
=== tests/cases/compiler/aliasUsage1_backbone.ts ===
|
||||
@ -48,12 +48,12 @@ export class Model {
|
||||
|
||||
=== tests/cases/compiler/aliasUsage1_moduleA.ts ===
|
||||
import Backbone = require("aliasUsage1_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsage1_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone : Backbone
|
||||
>Model : Model
|
||||
>Backbone : unknown
|
||||
>Model : Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@ -1,30 +1,30 @@
|
||||
=== tests/cases/compiler/aliasUsageInArray_main.ts ===
|
||||
import Backbone = require("aliasUsageInArray_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInArray_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
import moduleA = require("aliasUsageInArray_moduleA");
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInArray_moduleA"
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
interface IHasVisualizationModel {
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
|
||||
VisualizationModel: typeof Backbone.Model;
|
||||
>VisualizationModel : typeof Model
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInArray_backbone"
|
||||
>Model : typeof Model
|
||||
>VisualizationModel : typeof Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : typeof Backbone.Model
|
||||
}
|
||||
|
||||
var xs: IHasVisualizationModel[] = [moduleA];
|
||||
>xs : IHasVisualizationModel[]
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
>[moduleA] : IHasVisualizationModel[]
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInArray_moduleA"
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
var xs2: typeof moduleA[] = [moduleA];
|
||||
>xs2 : typeof "tests/cases/compiler/aliasUsageInArray_moduleA"[]
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInArray_moduleA"
|
||||
>[moduleA] : typeof "tests/cases/compiler/aliasUsageInArray_moduleA"[]
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInArray_moduleA"
|
||||
>xs2 : typeof moduleA[]
|
||||
>moduleA : typeof moduleA
|
||||
>[moduleA] : typeof moduleA[]
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
=== tests/cases/compiler/aliasUsageInArray_backbone.ts ===
|
||||
export class Model {
|
||||
@ -36,12 +36,12 @@ export class Model {
|
||||
|
||||
=== tests/cases/compiler/aliasUsageInArray_moduleA.ts ===
|
||||
import Backbone = require("aliasUsageInArray_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInArray_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone : Backbone
|
||||
>Model : Model
|
||||
>Backbone : unknown
|
||||
>Model : Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
=== tests/cases/compiler/aliasUsageInFunctionExpression_main.ts ===
|
||||
import Backbone = require("aliasUsageInFunctionExpression_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInFunctionExpression_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
import moduleA = require("aliasUsageInFunctionExpression_moduleA");
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInFunctionExpression_moduleA"
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
interface IHasVisualizationModel {
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
|
||||
VisualizationModel: typeof Backbone.Model;
|
||||
>VisualizationModel : typeof Model
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInFunctionExpression_backbone"
|
||||
>Model : typeof Model
|
||||
>VisualizationModel : typeof Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : typeof Backbone.Model
|
||||
}
|
||||
var f = (x: IHasVisualizationModel) => x;
|
||||
>f : (x: IHasVisualizationModel) => IHasVisualizationModel
|
||||
@ -21,11 +21,11 @@ var f = (x: IHasVisualizationModel) => x;
|
||||
>x : IHasVisualizationModel
|
||||
|
||||
f = (x) => moduleA;
|
||||
>f = (x) => moduleA : (x: IHasVisualizationModel) => typeof "tests/cases/compiler/aliasUsageInFunctionExpression_moduleA"
|
||||
>f = (x) => moduleA : (x: IHasVisualizationModel) => typeof moduleA
|
||||
>f : (x: IHasVisualizationModel) => IHasVisualizationModel
|
||||
>(x) => moduleA : (x: IHasVisualizationModel) => typeof "tests/cases/compiler/aliasUsageInFunctionExpression_moduleA"
|
||||
>(x) => moduleA : (x: IHasVisualizationModel) => typeof moduleA
|
||||
>x : IHasVisualizationModel
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInFunctionExpression_moduleA"
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
=== tests/cases/compiler/aliasUsageInFunctionExpression_backbone.ts ===
|
||||
export class Model {
|
||||
@ -37,12 +37,12 @@ export class Model {
|
||||
|
||||
=== tests/cases/compiler/aliasUsageInFunctionExpression_moduleA.ts ===
|
||||
import Backbone = require("aliasUsageInFunctionExpression_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInFunctionExpression_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone : Backbone
|
||||
>Model : Model
|
||||
>Backbone : unknown
|
||||
>Model : Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
=== tests/cases/compiler/aliasUsageInGenericFunction_main.ts ===
|
||||
import Backbone = require("aliasUsageInGenericFunction_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInGenericFunction_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
import moduleA = require("aliasUsageInGenericFunction_moduleA");
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInGenericFunction_moduleA"
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
interface IHasVisualizationModel {
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
|
||||
VisualizationModel: typeof Backbone.Model;
|
||||
>VisualizationModel : typeof Model
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInGenericFunction_backbone"
|
||||
>Model : typeof Model
|
||||
>VisualizationModel : typeof Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : typeof Backbone.Model
|
||||
}
|
||||
function foo<T extends { a: IHasVisualizationModel }>(x: T) {
|
||||
>foo : <T extends { a: IHasVisualizationModel; }>(x: T) => T
|
||||
@ -25,12 +25,12 @@ function foo<T extends { a: IHasVisualizationModel }>(x: T) {
|
||||
>x : T
|
||||
}
|
||||
var r = foo({ a: moduleA });
|
||||
>r : { a: typeof "tests/cases/compiler/aliasUsageInGenericFunction_moduleA"; }
|
||||
>foo({ a: moduleA }) : { a: typeof "tests/cases/compiler/aliasUsageInGenericFunction_moduleA"; }
|
||||
>r : { a: typeof moduleA; }
|
||||
>foo({ a: moduleA }) : { a: typeof moduleA; }
|
||||
>foo : <T extends { a: IHasVisualizationModel; }>(x: T) => T
|
||||
>{ a: moduleA } : { a: typeof "tests/cases/compiler/aliasUsageInGenericFunction_moduleA"; }
|
||||
>a : typeof "tests/cases/compiler/aliasUsageInGenericFunction_moduleA"
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInGenericFunction_moduleA"
|
||||
>{ a: moduleA } : { a: typeof moduleA; }
|
||||
>a : typeof moduleA
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
var r2 = foo({ a: <IHasVisualizationModel>null });
|
||||
>r2 : { a: IHasVisualizationModel; }
|
||||
@ -51,12 +51,12 @@ export class Model {
|
||||
|
||||
=== tests/cases/compiler/aliasUsageInGenericFunction_moduleA.ts ===
|
||||
import Backbone = require("aliasUsageInGenericFunction_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInGenericFunction_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone : Backbone
|
||||
>Model : Model
|
||||
>Backbone : unknown
|
||||
>Model : Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
=== tests/cases/compiler/aliasUsageInIndexerOfClass_main.ts ===
|
||||
import Backbone = require("aliasUsageInIndexerOfClass_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInIndexerOfClass_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
import moduleA = require("aliasUsageInIndexerOfClass_moduleA");
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInIndexerOfClass_moduleA"
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
interface IHasVisualizationModel {
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
|
||||
VisualizationModel: typeof Backbone.Model;
|
||||
>VisualizationModel : typeof Model
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInIndexerOfClass_backbone"
|
||||
>Model : typeof Model
|
||||
>VisualizationModel : typeof Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : typeof Backbone.Model
|
||||
}
|
||||
class N {
|
||||
>N : N
|
||||
@ -21,15 +21,15 @@ class N {
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
|
||||
x = moduleA;
|
||||
>x : typeof "tests/cases/compiler/aliasUsageInIndexerOfClass_moduleA"
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInIndexerOfClass_moduleA"
|
||||
>x : typeof moduleA
|
||||
>moduleA : typeof moduleA
|
||||
}
|
||||
class N2 {
|
||||
>N2 : N2
|
||||
|
||||
[idx: string]: typeof moduleA
|
||||
>idx : string
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInIndexerOfClass_moduleA"
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
x: IHasVisualizationModel;
|
||||
>x : IHasVisualizationModel
|
||||
@ -45,12 +45,12 @@ export class Model {
|
||||
|
||||
=== tests/cases/compiler/aliasUsageInIndexerOfClass_moduleA.ts ===
|
||||
import Backbone = require("aliasUsageInIndexerOfClass_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInIndexerOfClass_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone : Backbone
|
||||
>Model : Model
|
||||
>Backbone : unknown
|
||||
>Model : Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@ -1,44 +1,44 @@
|
||||
=== tests/cases/compiler/aliasUsageInObjectLiteral_main.ts ===
|
||||
import Backbone = require("aliasUsageInObjectLiteral_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInObjectLiteral_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
import moduleA = require("aliasUsageInObjectLiteral_moduleA");
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInObjectLiteral_moduleA"
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
interface IHasVisualizationModel {
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
|
||||
VisualizationModel: typeof Backbone.Model;
|
||||
>VisualizationModel : typeof Model
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInObjectLiteral_backbone"
|
||||
>Model : typeof Model
|
||||
>VisualizationModel : typeof Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : typeof Backbone.Model
|
||||
}
|
||||
var a: { x: typeof moduleA } = { x: moduleA };
|
||||
>a : { x: typeof "tests/cases/compiler/aliasUsageInObjectLiteral_moduleA"; }
|
||||
>x : typeof "tests/cases/compiler/aliasUsageInObjectLiteral_moduleA"
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInObjectLiteral_moduleA"
|
||||
>{ x: moduleA } : { x: typeof "tests/cases/compiler/aliasUsageInObjectLiteral_moduleA"; }
|
||||
>x : typeof "tests/cases/compiler/aliasUsageInObjectLiteral_moduleA"
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInObjectLiteral_moduleA"
|
||||
>a : { x: typeof moduleA; }
|
||||
>x : typeof moduleA
|
||||
>moduleA : typeof moduleA
|
||||
>{ x: moduleA } : { x: typeof moduleA; }
|
||||
>x : typeof moduleA
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
var b: { x: IHasVisualizationModel } = { x: moduleA };
|
||||
>b : { x: IHasVisualizationModel; }
|
||||
>x : IHasVisualizationModel
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
>{ x: moduleA } : { x: typeof "tests/cases/compiler/aliasUsageInObjectLiteral_moduleA"; }
|
||||
>x : typeof "tests/cases/compiler/aliasUsageInObjectLiteral_moduleA"
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInObjectLiteral_moduleA"
|
||||
>{ x: moduleA } : { x: typeof moduleA; }
|
||||
>x : typeof moduleA
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
var c: { y: { z: IHasVisualizationModel } } = { y: { z: moduleA } };
|
||||
>c : { y: { z: IHasVisualizationModel; }; }
|
||||
>y : { z: IHasVisualizationModel; }
|
||||
>z : IHasVisualizationModel
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
>{ y: { z: moduleA } } : { y: { z: typeof "tests/cases/compiler/aliasUsageInObjectLiteral_moduleA"; }; }
|
||||
>y : { z: typeof "tests/cases/compiler/aliasUsageInObjectLiteral_moduleA"; }
|
||||
>{ z: moduleA } : { z: typeof "tests/cases/compiler/aliasUsageInObjectLiteral_moduleA"; }
|
||||
>z : typeof "tests/cases/compiler/aliasUsageInObjectLiteral_moduleA"
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInObjectLiteral_moduleA"
|
||||
>{ y: { z: moduleA } } : { y: { z: typeof moduleA; }; }
|
||||
>y : { z: typeof moduleA; }
|
||||
>{ z: moduleA } : { z: typeof moduleA; }
|
||||
>z : typeof moduleA
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
=== tests/cases/compiler/aliasUsageInObjectLiteral_backbone.ts ===
|
||||
export class Model {
|
||||
@ -50,12 +50,12 @@ export class Model {
|
||||
|
||||
=== tests/cases/compiler/aliasUsageInObjectLiteral_moduleA.ts ===
|
||||
import Backbone = require("aliasUsageInObjectLiteral_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInObjectLiteral_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone : Backbone
|
||||
>Model : Model
|
||||
>Backbone : unknown
|
||||
>Model : Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
=== tests/cases/compiler/aliasUsageInOrExpression_main.ts ===
|
||||
import Backbone = require("aliasUsageInOrExpression_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInOrExpression_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
import moduleA = require("aliasUsageInOrExpression_moduleA");
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInOrExpression_moduleA"
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
interface IHasVisualizationModel {
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
|
||||
VisualizationModel: typeof Backbone.Model;
|
||||
>VisualizationModel : typeof Model
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInOrExpression_backbone"
|
||||
>Model : typeof Model
|
||||
>VisualizationModel : typeof Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : typeof Backbone.Model
|
||||
}
|
||||
var i: IHasVisualizationModel;
|
||||
>i : IHasVisualizationModel
|
||||
@ -21,20 +21,20 @@ var d1 = i || moduleA;
|
||||
>d1 : IHasVisualizationModel
|
||||
>i || moduleA : IHasVisualizationModel
|
||||
>i : IHasVisualizationModel
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInOrExpression_moduleA"
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
var d2: IHasVisualizationModel = i || moduleA;
|
||||
>d2 : IHasVisualizationModel
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
>i || moduleA : IHasVisualizationModel
|
||||
>i : IHasVisualizationModel
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInOrExpression_moduleA"
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
var d2: IHasVisualizationModel = moduleA || i;
|
||||
>d2 : IHasVisualizationModel
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
>moduleA || i : IHasVisualizationModel
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInOrExpression_moduleA"
|
||||
>moduleA : typeof moduleA
|
||||
>i : IHasVisualizationModel
|
||||
|
||||
var e: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null || { x: moduleA };
|
||||
@ -45,9 +45,9 @@ var e: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null || {
|
||||
><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; }
|
||||
>x : IHasVisualizationModel
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
>{ x: moduleA } : { x: typeof "tests/cases/compiler/aliasUsageInOrExpression_moduleA"; }
|
||||
>x : typeof "tests/cases/compiler/aliasUsageInOrExpression_moduleA"
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInOrExpression_moduleA"
|
||||
>{ x: moduleA } : { x: typeof moduleA; }
|
||||
>x : typeof moduleA
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x: moduleA } : null;
|
||||
>f : { x: IHasVisualizationModel; }
|
||||
@ -57,9 +57,9 @@ var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x
|
||||
><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; }
|
||||
>x : IHasVisualizationModel
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
>{ x: moduleA } : { x: typeof "tests/cases/compiler/aliasUsageInOrExpression_moduleA"; }
|
||||
>x : typeof "tests/cases/compiler/aliasUsageInOrExpression_moduleA"
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInOrExpression_moduleA"
|
||||
>{ x: moduleA } : { x: typeof moduleA; }
|
||||
>x : typeof moduleA
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
=== tests/cases/compiler/aliasUsageInOrExpression_backbone.ts ===
|
||||
export class Model {
|
||||
@ -71,12 +71,12 @@ export class Model {
|
||||
|
||||
=== tests/cases/compiler/aliasUsageInOrExpression_moduleA.ts ===
|
||||
import Backbone = require("aliasUsageInOrExpression_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInOrExpression_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone : Backbone
|
||||
>Model : Model
|
||||
>Backbone : unknown
|
||||
>Model : Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
=== tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_main.ts ===
|
||||
import Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
import moduleA = require("aliasUsageInTypeArgumentOfExtendsClause_moduleA");
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_moduleA"
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
interface IHasVisualizationModel {
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
|
||||
VisualizationModel: typeof Backbone.Model;
|
||||
>VisualizationModel : typeof Model
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_backbone"
|
||||
>Model : typeof Model
|
||||
>VisualizationModel : typeof Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : typeof Backbone.Model
|
||||
}
|
||||
class C<T extends IHasVisualizationModel> {
|
||||
>C : C<T>
|
||||
@ -28,8 +28,8 @@ class D extends C<IHasVisualizationModel> {
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
|
||||
x = moduleA;
|
||||
>x : typeof "tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_moduleA"
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_moduleA"
|
||||
>x : typeof moduleA
|
||||
>moduleA : typeof moduleA
|
||||
}
|
||||
=== tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_backbone.ts ===
|
||||
export class Model {
|
||||
@ -41,12 +41,12 @@ export class Model {
|
||||
|
||||
=== tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_moduleA.ts ===
|
||||
import Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone : Backbone
|
||||
>Model : Model
|
||||
>Backbone : unknown
|
||||
>Model : Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@ -1,25 +1,25 @@
|
||||
=== tests/cases/compiler/aliasUsageInVarAssignment_main.ts ===
|
||||
import Backbone = require("aliasUsageInVarAssignment_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInVarAssignment_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
import moduleA = require("aliasUsageInVarAssignment_moduleA");
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInVarAssignment_moduleA"
|
||||
>moduleA : typeof moduleA
|
||||
|
||||
interface IHasVisualizationModel {
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
|
||||
VisualizationModel: typeof Backbone.Model;
|
||||
>VisualizationModel : typeof Model
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInVarAssignment_backbone"
|
||||
>Model : typeof Model
|
||||
>VisualizationModel : typeof Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : typeof Backbone.Model
|
||||
}
|
||||
var i: IHasVisualizationModel;
|
||||
>i : IHasVisualizationModel
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
|
||||
var m: typeof moduleA = i;
|
||||
>m : typeof "tests/cases/compiler/aliasUsageInVarAssignment_moduleA"
|
||||
>moduleA : typeof "tests/cases/compiler/aliasUsageInVarAssignment_moduleA"
|
||||
>m : typeof moduleA
|
||||
>moduleA : typeof moduleA
|
||||
>i : IHasVisualizationModel
|
||||
|
||||
=== tests/cases/compiler/aliasUsageInVarAssignment_backbone.ts ===
|
||||
@ -32,12 +32,12 @@ export class Model {
|
||||
|
||||
=== tests/cases/compiler/aliasUsageInVarAssignment_moduleA.ts ===
|
||||
import Backbone = require("aliasUsageInVarAssignment_backbone");
|
||||
>Backbone : typeof "tests/cases/compiler/aliasUsageInVarAssignment_backbone"
|
||||
>Backbone : typeof Backbone
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone : Backbone
|
||||
>Model : Model
|
||||
>Backbone : unknown
|
||||
>Model : Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@ -2,25 +2,22 @@
|
||||
///<reference path='aliasUsedAsNameValue_0.ts' />
|
||||
///<reference path='aliasUsedAsNameValue_1.ts' />
|
||||
import mod = require("aliasUsedAsNameValue_0");
|
||||
>mod : typeof "tests/cases/compiler/aliasUsedAsNameValue_0"
|
||||
>mod : typeof mod
|
||||
|
||||
import b = require("aliasUsedAsNameValue_1");
|
||||
>b : typeof "tests/cases/compiler/aliasUsedAsNameValue_1"
|
||||
>b : typeof b
|
||||
|
||||
export var a = function () {
|
||||
>a : () => void
|
||||
>function () {
|
||||
//var x = mod.id; // TODO needed hack that mod is loaded
|
||||
b.b(mod);
|
||||
} : () => void
|
||||
>function () { //var x = mod.id; // TODO needed hack that mod is loaded b.b(mod);} : () => void
|
||||
|
||||
//var x = mod.id; // TODO needed hack that mod is loaded
|
||||
b.b(mod);
|
||||
>b.b(mod) : any
|
||||
>b.b : (a: any) => any
|
||||
>b : typeof "tests/cases/compiler/aliasUsedAsNameValue_1"
|
||||
>b : typeof b
|
||||
>b : (a: any) => any
|
||||
>mod : typeof "tests/cases/compiler/aliasUsedAsNameValue_0"
|
||||
>mod : typeof mod
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/aliasUsedAsNameValue_0.ts ===
|
||||
|
||||
@ -1,33 +1,33 @@
|
||||
=== tests/cases/compiler/ambientExternalModuleWithInternalImportDeclaration_1.ts ===
|
||||
///<reference path='ambientExternalModuleWithInternalImportDeclaration_0.ts'/>
|
||||
import A = require('M');
|
||||
>A : typeof C
|
||||
>A : typeof A
|
||||
|
||||
var c = new A();
|
||||
>c : C
|
||||
>new A() : C
|
||||
>A : typeof C
|
||||
>c : A
|
||||
>new A() : A
|
||||
>A : typeof A
|
||||
|
||||
=== tests/cases/compiler/ambientExternalModuleWithInternalImportDeclaration_0.ts ===
|
||||
declare module 'M' {
|
||||
module C {
|
||||
>C : typeof C
|
||||
>C : typeof X
|
||||
|
||||
export var f: number;
|
||||
>f : number
|
||||
}
|
||||
class C {
|
||||
>C : C
|
||||
>C : X
|
||||
|
||||
foo(): void;
|
||||
>foo : () => void
|
||||
}
|
||||
import X = C;
|
||||
>X : typeof C
|
||||
>C : C
|
||||
>X : typeof X
|
||||
>C : X
|
||||
|
||||
export = X;
|
||||
>X : C
|
||||
>X : X
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
=== tests/cases/compiler/ambientExternalModuleWithoutInternalImportDeclaration_1.ts ===
|
||||
///<reference path='ambientExternalModuleWithoutInternalImportDeclaration_0.ts'/>
|
||||
import A = require('M');
|
||||
>A : typeof C
|
||||
>A : typeof A
|
||||
|
||||
var c = new A();
|
||||
>c : C
|
||||
>new A() : C
|
||||
>A : typeof C
|
||||
>c : A
|
||||
>new A() : A
|
||||
>A : typeof A
|
||||
|
||||
=== tests/cases/compiler/ambientExternalModuleWithoutInternalImportDeclaration_0.ts ===
|
||||
declare module 'M' {
|
||||
|
||||
@ -24,11 +24,11 @@ Foo.b;
|
||||
>b : number
|
||||
|
||||
var c = new Foo.C();
|
||||
>c : C
|
||||
>new Foo.C() : C
|
||||
>Foo.C : typeof C
|
||||
>c : Foo.C
|
||||
>new Foo.C() : Foo.C
|
||||
>Foo.C : typeof Foo.C
|
||||
>Foo : typeof Foo
|
||||
>C : typeof C
|
||||
>C : typeof Foo.C
|
||||
|
||||
declare module Foo2 {
|
||||
>Foo2 : typeof Foo2
|
||||
@ -55,9 +55,9 @@ Foo2.b;
|
||||
>b : number
|
||||
|
||||
var c2 = new Foo2.C();
|
||||
>c2 : C
|
||||
>new Foo2.C() : C
|
||||
>Foo2.C : typeof C
|
||||
>c2 : Foo2.C
|
||||
>new Foo2.C() : Foo2.C
|
||||
>Foo2.C : typeof Foo2.C
|
||||
>Foo2 : typeof Foo2
|
||||
>C : typeof C
|
||||
>C : typeof Foo2.C
|
||||
|
||||
|
||||
@ -7,8 +7,8 @@ declare module Foo.Bar { export var foo; };
|
||||
Foo.Bar.foo = 5;
|
||||
>Foo.Bar.foo = 5 : number
|
||||
>Foo.Bar.foo : any
|
||||
>Foo.Bar : typeof Bar
|
||||
>Foo.Bar : typeof Foo.Bar
|
||||
>Foo : typeof Foo
|
||||
>Bar : typeof Bar
|
||||
>Bar : typeof Foo.Bar
|
||||
>foo : any
|
||||
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
=== tests/cases/conformance/externalModules/foo_1.ts ===
|
||||
import foo = require("./foo_0");
|
||||
>foo : typeof "tests/cases/conformance/externalModules/foo_0"
|
||||
>foo : typeof foo
|
||||
|
||||
if(foo.E1.A === 0){
|
||||
>foo.E1.A === 0 : boolean
|
||||
>foo.E1.A : E1
|
||||
>foo.E1 : typeof E1
|
||||
>foo : typeof "tests/cases/conformance/externalModules/foo_0"
|
||||
>E1 : typeof E1
|
||||
>A : E1
|
||||
>foo.E1.A : foo.E1
|
||||
>foo.E1 : typeof foo.E1
|
||||
>foo : typeof foo
|
||||
>E1 : typeof foo.E1
|
||||
>A : foo.E1
|
||||
|
||||
// Should cause runtime import - interesting optimization possibility, as gets inlined to 0.
|
||||
}
|
||||
|
||||
@ -1,43 +1,43 @@
|
||||
=== tests/cases/conformance/externalModules/foo_1.ts ===
|
||||
import foo = require("./foo_0");
|
||||
>foo : typeof "tests/cases/conformance/externalModules/foo_0"
|
||||
>foo : typeof foo
|
||||
|
||||
// None of the below should cause a runtime dependency on foo_0
|
||||
import f = foo.M1;
|
||||
>f : f
|
||||
>foo : typeof "tests/cases/conformance/externalModules/foo_0"
|
||||
>M1 : M1
|
||||
>f : unknown
|
||||
>foo : typeof foo
|
||||
>M1 : unknown
|
||||
|
||||
var i: f.I2;
|
||||
>i : I2
|
||||
>f : f
|
||||
>I2 : I2
|
||||
>i : f.I2
|
||||
>f : unknown
|
||||
>I2 : f.I2
|
||||
|
||||
var x: foo.C1 = <{m1: number}>{};
|
||||
>x : C1
|
||||
>foo : foo
|
||||
>C1 : C1
|
||||
>x : foo.C1
|
||||
>foo : unknown
|
||||
>C1 : foo.C1
|
||||
><{m1: number}>{} : { m1: number; }
|
||||
>m1 : number
|
||||
>{} : {}
|
||||
|
||||
var y: typeof foo.C1.s1 = false;
|
||||
>y : boolean
|
||||
>foo : typeof "tests/cases/conformance/externalModules/foo_0"
|
||||
>C1 : typeof C1
|
||||
>foo : typeof foo
|
||||
>C1 : typeof foo.C1
|
||||
>s1 : boolean
|
||||
|
||||
var z: foo.M1.I2;
|
||||
>z : I2
|
||||
>foo : foo
|
||||
>M1 : M1
|
||||
>I2 : I2
|
||||
>z : f.I2
|
||||
>foo : unknown
|
||||
>M1 : unknown
|
||||
>I2 : f.I2
|
||||
|
||||
var e: number = <foo.E1>0;
|
||||
>e : number
|
||||
><foo.E1>0 : E1
|
||||
>foo : foo
|
||||
>E1 : E1
|
||||
><foo.E1>0 : foo.E1
|
||||
>foo : unknown
|
||||
>E1 : foo.E1
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo_0.ts ===
|
||||
export class C1 {
|
||||
@ -61,7 +61,7 @@ export interface I1 {
|
||||
}
|
||||
|
||||
export module M1 {
|
||||
>M1 : M1
|
||||
>M1 : unknown
|
||||
|
||||
export interface I2 {
|
||||
>I2 : I2
|
||||
|
||||
@ -20,16 +20,16 @@ module M {
|
||||
}
|
||||
|
||||
var c=new M.C();
|
||||
>c : C
|
||||
>new M.C() : C
|
||||
>M.C : typeof C
|
||||
>c : M.C
|
||||
>new M.C() : M.C
|
||||
>M.C : typeof M.C
|
||||
>M : typeof M
|
||||
>C : typeof C
|
||||
>C : typeof M.C
|
||||
|
||||
c.m(function(n) { return "hello: "+n; },18);
|
||||
>c.m(function(n) { return "hello: "+n; },18) : string
|
||||
>c.m : (fn: (n: number) => string, n2: number) => string
|
||||
>c : C
|
||||
>c : M.C
|
||||
>m : (fn: (n: number) => string, n2: number) => string
|
||||
>function(n) { return "hello: "+n; } : (n: number) => string
|
||||
>n : number
|
||||
|
||||
@ -3,19 +3,11 @@ var paired: any[];
|
||||
>paired : any[]
|
||||
|
||||
paired.reduce(function (a1, a2) {
|
||||
>paired.reduce(function (a1, a2) {
|
||||
|
||||
return a1.concat({});
|
||||
|
||||
} , []) : any
|
||||
>paired.reduce(function (a1, a2) { return a1.concat({});} , []) : any
|
||||
>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; }
|
||||
>paired : any[]
|
||||
>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; }
|
||||
>function (a1, a2) {
|
||||
|
||||
return a1.concat({});
|
||||
|
||||
} : (a1: any, a2: any) => any
|
||||
>function (a1, a2) { return a1.concat({});} : (a1: any, a2: any) => any
|
||||
>a1 : any
|
||||
>a2 : any
|
||||
|
||||
@ -30,17 +22,11 @@ paired.reduce(function (a1, a2) {
|
||||
>[] : undefined[]
|
||||
|
||||
paired.reduce((b1, b2) => {
|
||||
>paired.reduce((b1, b2) => {
|
||||
|
||||
return b1.concat({});
|
||||
} , []) : any
|
||||
>paired.reduce((b1, b2) => { return b1.concat({});} , []) : any
|
||||
>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; }
|
||||
>paired : any[]
|
||||
>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; }
|
||||
>(b1, b2) => {
|
||||
|
||||
return b1.concat({});
|
||||
} : (b1: any, b2: any) => any
|
||||
>(b1, b2) => { return b1.concat({});} : (b1: any, b2: any) => any
|
||||
>b1 : any
|
||||
>b2 : any
|
||||
|
||||
|
||||
@ -8,9 +8,7 @@ class A {
|
||||
>selectedValue : any
|
||||
|
||||
return {
|
||||
>{
|
||||
selectedValue: arguments.length
|
||||
} : { selectedValue: number; }
|
||||
>{ selectedValue: arguments.length } : { selectedValue: number; }
|
||||
|
||||
selectedValue: arguments.length
|
||||
>selectedValue : number
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
=== tests/cases/compiler/arrayConcatMap.ts ===
|
||||
var x = [].concat([{ a: 1 }], [{ a: 2 }])
|
||||
>x : any[]
|
||||
>[].concat([{ a: 1 }], [{ a: 2 }])
|
||||
.map(b => b.a) : any[]
|
||||
>[].concat([{ a: 1 }], [{ a: 2 }])
|
||||
.map : <U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]
|
||||
>[].concat([{ a: 1 }], [{ a: 2 }]) .map(b => b.a) : any[]
|
||||
>[].concat([{ a: 1 }], [{ a: 2 }]) .map : <U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]
|
||||
>[].concat([{ a: 1 }], [{ a: 2 }]) : any[]
|
||||
>[].concat : { <U extends any[]>(...items: U[]): any[]; (...items: any[]): any[]; }
|
||||
>[] : undefined[]
|
||||
|
||||
@ -25,10 +25,7 @@ class ActionB extends Action {
|
||||
var x1: Action[] = [
|
||||
>x1 : Action[]
|
||||
>Action : Action
|
||||
>[
|
||||
{ id: 2, trueness: false },
|
||||
{ id: 3, name: "three" }
|
||||
] : Action[]
|
||||
>[ { id: 2, trueness: false }, { id: 3, name: "three" }] : Action[]
|
||||
|
||||
{ id: 2, trueness: false },
|
||||
>{ id: 2, trueness: false } : { id: number; trueness: boolean; }
|
||||
@ -45,10 +42,7 @@ var x1: Action[] = [
|
||||
var x2: Action[] = [
|
||||
>x2 : Action[]
|
||||
>Action : Action
|
||||
>[
|
||||
new ActionA(),
|
||||
new ActionB()
|
||||
] : Action[]
|
||||
>[ new ActionA(), new ActionB()] : Action[]
|
||||
|
||||
new ActionA(),
|
||||
>new ActionA() : ActionA
|
||||
@ -63,11 +57,7 @@ var x2: Action[] = [
|
||||
var x3: Action[] = [
|
||||
>x3 : Action[]
|
||||
>Action : Action
|
||||
>[
|
||||
new Action(),
|
||||
new ActionA(),
|
||||
new ActionB()
|
||||
] : Action[]
|
||||
>[ new Action(), new ActionA(), new ActionB()] : Action[]
|
||||
|
||||
new Action(),
|
||||
>new Action() : Action
|
||||
@ -88,10 +78,7 @@ var z1: { id: number }[] =
|
||||
>id : number
|
||||
|
||||
[
|
||||
>[
|
||||
{ id: 2, trueness: false },
|
||||
{ id: 3, name: "three" }
|
||||
] : { id: number; }[]
|
||||
>[ { id: 2, trueness: false }, { id: 3, name: "three" } ] : { id: number; }[]
|
||||
|
||||
{ id: 2, trueness: false },
|
||||
>{ id: 2, trueness: false } : { id: number; trueness: boolean; }
|
||||
@ -110,10 +97,7 @@ var z2: { id: number }[] =
|
||||
>id : number
|
||||
|
||||
[
|
||||
>[
|
||||
new ActionA(),
|
||||
new ActionB()
|
||||
] : { id: number; }[]
|
||||
>[ new ActionA(), new ActionB() ] : { id: number; }[]
|
||||
|
||||
new ActionA(),
|
||||
>new ActionA() : ActionA
|
||||
@ -130,11 +114,7 @@ var z3: { id: number }[] =
|
||||
>id : number
|
||||
|
||||
[
|
||||
>[
|
||||
new Action(),
|
||||
new ActionA(),
|
||||
new ActionB()
|
||||
] : { id: number; }[]
|
||||
>[ new Action(), new ActionA(), new ActionB() ] : { id: number; }[]
|
||||
|
||||
new Action(),
|
||||
>new Action() : Action
|
||||
|
||||
@ -62,11 +62,11 @@ declare module Data {
|
||||
|
||||
//removeIndices: WinJS.Promise<IListItem<T>[]>;
|
||||
removeIndices(indices: number[], options?: any): WinJS.Promise<IListItem<T>[]>;
|
||||
>removeIndices : (indices: number[], options?: any) => Promise<IListItem<T>[]>
|
||||
>removeIndices : (indices: number[], options?: any) => WinJS.Promise<IListItem<T>[]>
|
||||
>indices : number[]
|
||||
>options : any
|
||||
>WinJS : WinJS
|
||||
>Promise : Promise<T>
|
||||
>WinJS : unknown
|
||||
>Promise : WinJS.Promise<T>
|
||||
>IListItem : IListItem<T>
|
||||
>T : T
|
||||
}
|
||||
@ -78,11 +78,11 @@ declare module Data {
|
||||
|
||||
//removeIndices: WinJS.Promise<IListItem<T>[]>;
|
||||
public removeIndices(indices: number[], options?: any): WinJS.Promise<IListItem<T>[]>;
|
||||
>removeIndices : (indices: number[], options?: any) => Promise<IListItem<T>[]>
|
||||
>removeIndices : (indices: number[], options?: any) => WinJS.Promise<IListItem<T>[]>
|
||||
>indices : number[]
|
||||
>options : any
|
||||
>WinJS : WinJS
|
||||
>Promise : Promise<T>
|
||||
>WinJS : unknown
|
||||
>Promise : WinJS.Promise<T>
|
||||
>IListItem : IListItem<T>
|
||||
>T : T
|
||||
}
|
||||
|
||||
@ -36,50 +36,17 @@ class parser {
|
||||
>m : () => void
|
||||
|
||||
this.options = this.options.sort(function(a, b) {
|
||||
>this.options = this.options.sort(function(a, b) {
|
||||
var aName = a.name.toLowerCase();
|
||||
var bName = b.name.toLowerCase();
|
||||
|
||||
if (aName > bName) {
|
||||
return 1;
|
||||
} else if (aName < bName) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}) : IOptions[]
|
||||
>this.options = this.options.sort(function(a, b) { var aName = a.name.toLowerCase(); var bName = b.name.toLowerCase(); if (aName > bName) { return 1; } else if (aName < bName) { return -1; } else { return 0; } }) : IOptions[]
|
||||
>this.options : IOptions[]
|
||||
>this : parser
|
||||
>options : IOptions[]
|
||||
>this.options.sort(function(a, b) {
|
||||
var aName = a.name.toLowerCase();
|
||||
var bName = b.name.toLowerCase();
|
||||
|
||||
if (aName > bName) {
|
||||
return 1;
|
||||
} else if (aName < bName) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}) : IOptions[]
|
||||
>this.options.sort(function(a, b) { var aName = a.name.toLowerCase(); var bName = b.name.toLowerCase(); if (aName > bName) { return 1; } else if (aName < bName) { return -1; } else { return 0; } }) : IOptions[]
|
||||
>this.options.sort : (compareFn?: (a: IOptions, b: IOptions) => number) => IOptions[]
|
||||
>this.options : IOptions[]
|
||||
>this : parser
|
||||
>options : IOptions[]
|
||||
>sort : (compareFn?: (a: IOptions, b: IOptions) => number) => IOptions[]
|
||||
>function(a, b) {
|
||||
var aName = a.name.toLowerCase();
|
||||
var bName = b.name.toLowerCase();
|
||||
|
||||
if (aName > bName) {
|
||||
return 1;
|
||||
} else if (aName < bName) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} : (a: IOptions, b: IOptions) => number
|
||||
>function(a, b) { var aName = a.name.toLowerCase(); var bName = b.name.toLowerCase(); if (aName > bName) { return 1; } else if (aName < bName) { return -1; } else { return 0; } } : (a: IOptions, b: IOptions) => number
|
||||
>a : IOptions
|
||||
>b : IOptions
|
||||
|
||||
|
||||
@ -182,12 +182,7 @@ function outerFn() {
|
||||
// Arrow function used in nested function in arrow function
|
||||
var f = (n: string) => {
|
||||
>f : (n: string) => () => string
|
||||
>(n: string) => {
|
||||
function fn(x: number) {
|
||||
return () => n + x;
|
||||
}
|
||||
return fn(4);
|
||||
} : (n: string) => () => string
|
||||
>(n: string) => { function fn(x: number) { return () => n + x; } return fn(4);} : (n: string) => () => string
|
||||
>n : string
|
||||
|
||||
function fn(x: number) {
|
||||
@ -220,12 +215,7 @@ function someOuterFn() {
|
||||
|
||||
var arr = (n: string) => {
|
||||
>arr : (n: string) => () => () => number
|
||||
>(n: string) => {
|
||||
function innerFn() {
|
||||
return () => n.length;
|
||||
}
|
||||
return innerFn;
|
||||
} : (n: string) => () => () => number
|
||||
>(n: string) => { function innerFn() { return () => n.length; } return innerFn; } : (n: string) => () => () => number
|
||||
>n : string
|
||||
|
||||
function innerFn() {
|
||||
|
||||
@ -9,30 +9,16 @@ var z =
|
||||
>z : number
|
||||
|
||||
x
|
||||
>x
|
||||
|
||||
+
|
||||
|
||||
+
|
||||
|
||||
+
|
||||
|
||||
y : number
|
||||
>x+++y : number
|
||||
>x : number
|
||||
|
||||
+
|
||||
|
||||
+
|
||||
>+
|
||||
|
||||
+
|
||||
|
||||
y : number
|
||||
>++y : number
|
||||
|
||||
+
|
||||
>+
|
||||
|
||||
y : number
|
||||
>+y : number
|
||||
|
||||
y
|
||||
>y : number
|
||||
@ -48,30 +34,16 @@ var c =
|
||||
>c : number
|
||||
|
||||
x
|
||||
>x
|
||||
|
||||
-
|
||||
|
||||
-
|
||||
|
||||
-
|
||||
|
||||
y : number
|
||||
>x---y : number
|
||||
>x : number
|
||||
|
||||
-
|
||||
|
||||
-
|
||||
>-
|
||||
|
||||
-
|
||||
|
||||
y : number
|
||||
>--y : number
|
||||
|
||||
-
|
||||
>-
|
||||
|
||||
y : number
|
||||
>-y : number
|
||||
|
||||
y
|
||||
>y : number
|
||||
|
||||
@ -6,11 +6,7 @@ class Foo {
|
||||
|
||||
defaults = {
|
||||
>defaults : { done: boolean; }
|
||||
>{
|
||||
|
||||
done: false
|
||||
|
||||
} : { done: boolean; }
|
||||
>{ done: false } : { done: boolean; }
|
||||
|
||||
done: false
|
||||
>done : boolean
|
||||
|
||||
@ -9,15 +9,13 @@ declare class Point {
|
||||
}
|
||||
|
||||
Point.prototype.add = function(dx, dy) {
|
||||
>Point.prototype.add = function(dx, dy) {
|
||||
} : (dx: number, dy: number) => void
|
||||
>Point.prototype.add = function(dx, dy) {} : (dx: number, dy: number) => void
|
||||
>Point.prototype.add : (dx: number, dy: number) => void
|
||||
>Point.prototype : Point
|
||||
>Point : typeof Point
|
||||
>prototype : Point
|
||||
>add : (dx: number, dy: number) => void
|
||||
>function(dx, dy) {
|
||||
} : (dx: number, dy: number) => void
|
||||
>function(dx, dy) {} : (dx: number, dy: number) => void
|
||||
>dx : number
|
||||
>dy : number
|
||||
|
||||
|
||||
170
tests/baselines/reference/assignmentCompatWithObjectMembers.js
Normal file
170
tests/baselines/reference/assignmentCompatWithObjectMembers.js
Normal file
@ -0,0 +1,170 @@
|
||||
//// [assignmentCompatWithObjectMembers.ts]
|
||||
// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M
|
||||
// no errors expected
|
||||
|
||||
module SimpleTypes {
|
||||
class S { foo: string; }
|
||||
class T { foo: string; }
|
||||
var s: S;
|
||||
var t: T;
|
||||
|
||||
interface S2 { foo: string; }
|
||||
interface T2 { foo: string; }
|
||||
var s2: S2;
|
||||
var t2: T2;
|
||||
|
||||
var a: { foo: string; }
|
||||
var b: { foo: string; }
|
||||
|
||||
var a2 = { foo: '' };
|
||||
var b2 = { foo: '' };
|
||||
|
||||
s = t;
|
||||
t = s;
|
||||
s = s2;
|
||||
s = a2;
|
||||
|
||||
s2 = t2;
|
||||
t2 = s2;
|
||||
s2 = t;
|
||||
s2 = b;
|
||||
s2 = a2;
|
||||
|
||||
a = b;
|
||||
b = a;
|
||||
a = s;
|
||||
a = s2;
|
||||
a = a2;
|
||||
|
||||
a2 = b2;
|
||||
b2 = a2;
|
||||
a2 = b;
|
||||
a2 = t2;
|
||||
a2 = t;
|
||||
}
|
||||
|
||||
module ObjectTypes {
|
||||
class S { foo: S; }
|
||||
class T { foo: T; }
|
||||
var s: S;
|
||||
var t: T;
|
||||
|
||||
interface S2 { foo: S2; }
|
||||
interface T2 { foo: T2; }
|
||||
var s2: S2;
|
||||
var t2: T2;
|
||||
|
||||
var a: { foo: typeof a; }
|
||||
var b: { foo: typeof b; }
|
||||
|
||||
var a2 = { foo: a2 };
|
||||
var b2 = { foo: b2 };
|
||||
|
||||
s = t;
|
||||
t = s;
|
||||
s = s2;
|
||||
s = a2;
|
||||
|
||||
s2 = t2;
|
||||
t2 = s2;
|
||||
s2 = t;
|
||||
s2 = b;
|
||||
s2 = a2;
|
||||
|
||||
a = b;
|
||||
b = a;
|
||||
a = s;
|
||||
a = s2;
|
||||
a = a2;
|
||||
|
||||
a2 = b2;
|
||||
b2 = a2;
|
||||
a2 = b;
|
||||
a2 = t2;
|
||||
a2 = t;
|
||||
|
||||
}
|
||||
|
||||
//// [assignmentCompatWithObjectMembers.js]
|
||||
// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M
|
||||
// no errors expected
|
||||
var SimpleTypes;
|
||||
(function (SimpleTypes) {
|
||||
var S = (function () {
|
||||
function S() {
|
||||
}
|
||||
return S;
|
||||
})();
|
||||
var T = (function () {
|
||||
function T() {
|
||||
}
|
||||
return T;
|
||||
})();
|
||||
var s;
|
||||
var t;
|
||||
var s2;
|
||||
var t2;
|
||||
var a;
|
||||
var b;
|
||||
var a2 = { foo: '' };
|
||||
var b2 = { foo: '' };
|
||||
s = t;
|
||||
t = s;
|
||||
s = s2;
|
||||
s = a2;
|
||||
s2 = t2;
|
||||
t2 = s2;
|
||||
s2 = t;
|
||||
s2 = b;
|
||||
s2 = a2;
|
||||
a = b;
|
||||
b = a;
|
||||
a = s;
|
||||
a = s2;
|
||||
a = a2;
|
||||
a2 = b2;
|
||||
b2 = a2;
|
||||
a2 = b;
|
||||
a2 = t2;
|
||||
a2 = t;
|
||||
})(SimpleTypes || (SimpleTypes = {}));
|
||||
var ObjectTypes;
|
||||
(function (ObjectTypes) {
|
||||
var S = (function () {
|
||||
function S() {
|
||||
}
|
||||
return S;
|
||||
})();
|
||||
var T = (function () {
|
||||
function T() {
|
||||
}
|
||||
return T;
|
||||
})();
|
||||
var s;
|
||||
var t;
|
||||
var s2;
|
||||
var t2;
|
||||
var a;
|
||||
var b;
|
||||
var a2 = { foo: a2 };
|
||||
var b2 = { foo: b2 };
|
||||
s = t;
|
||||
t = s;
|
||||
s = s2;
|
||||
s = a2;
|
||||
s2 = t2;
|
||||
t2 = s2;
|
||||
s2 = t;
|
||||
s2 = b;
|
||||
s2 = a2;
|
||||
a = b;
|
||||
b = a;
|
||||
a = s;
|
||||
a = s2;
|
||||
a = a2;
|
||||
a2 = b2;
|
||||
b2 = a2;
|
||||
a2 = b;
|
||||
a2 = t2;
|
||||
a2 = t;
|
||||
})(ObjectTypes || (ObjectTypes = {}));
|
||||
@ -0,0 +1,310 @@
|
||||
=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers.ts ===
|
||||
// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M
|
||||
// no errors expected
|
||||
|
||||
module SimpleTypes {
|
||||
>SimpleTypes : typeof SimpleTypes
|
||||
|
||||
class S { foo: string; }
|
||||
>S : S
|
||||
>foo : string
|
||||
|
||||
class T { foo: string; }
|
||||
>T : T
|
||||
>foo : string
|
||||
|
||||
var s: S;
|
||||
>s : S
|
||||
>S : S
|
||||
|
||||
var t: T;
|
||||
>t : T
|
||||
>T : T
|
||||
|
||||
interface S2 { foo: string; }
|
||||
>S2 : S2
|
||||
>foo : string
|
||||
|
||||
interface T2 { foo: string; }
|
||||
>T2 : T2
|
||||
>foo : string
|
||||
|
||||
var s2: S2;
|
||||
>s2 : S2
|
||||
>S2 : S2
|
||||
|
||||
var t2: T2;
|
||||
>t2 : T2
|
||||
>T2 : T2
|
||||
|
||||
var a: { foo: string; }
|
||||
>a : { foo: string; }
|
||||
>foo : string
|
||||
|
||||
var b: { foo: string; }
|
||||
>b : { foo: string; }
|
||||
>foo : string
|
||||
|
||||
var a2 = { foo: '' };
|
||||
>a2 : { foo: string; }
|
||||
>{ foo: '' } : { foo: string; }
|
||||
>foo : string
|
||||
|
||||
var b2 = { foo: '' };
|
||||
>b2 : { foo: string; }
|
||||
>{ foo: '' } : { foo: string; }
|
||||
>foo : string
|
||||
|
||||
s = t;
|
||||
>s = t : T
|
||||
>s : S
|
||||
>t : T
|
||||
|
||||
t = s;
|
||||
>t = s : S
|
||||
>t : T
|
||||
>s : S
|
||||
|
||||
s = s2;
|
||||
>s = s2 : S2
|
||||
>s : S
|
||||
>s2 : S2
|
||||
|
||||
s = a2;
|
||||
>s = a2 : { foo: string; }
|
||||
>s : S
|
||||
>a2 : { foo: string; }
|
||||
|
||||
s2 = t2;
|
||||
>s2 = t2 : T2
|
||||
>s2 : S2
|
||||
>t2 : T2
|
||||
|
||||
t2 = s2;
|
||||
>t2 = s2 : S2
|
||||
>t2 : T2
|
||||
>s2 : S2
|
||||
|
||||
s2 = t;
|
||||
>s2 = t : T
|
||||
>s2 : S2
|
||||
>t : T
|
||||
|
||||
s2 = b;
|
||||
>s2 = b : { foo: string; }
|
||||
>s2 : S2
|
||||
>b : { foo: string; }
|
||||
|
||||
s2 = a2;
|
||||
>s2 = a2 : { foo: string; }
|
||||
>s2 : S2
|
||||
>a2 : { foo: string; }
|
||||
|
||||
a = b;
|
||||
>a = b : { foo: string; }
|
||||
>a : { foo: string; }
|
||||
>b : { foo: string; }
|
||||
|
||||
b = a;
|
||||
>b = a : { foo: string; }
|
||||
>b : { foo: string; }
|
||||
>a : { foo: string; }
|
||||
|
||||
a = s;
|
||||
>a = s : S
|
||||
>a : { foo: string; }
|
||||
>s : S
|
||||
|
||||
a = s2;
|
||||
>a = s2 : S2
|
||||
>a : { foo: string; }
|
||||
>s2 : S2
|
||||
|
||||
a = a2;
|
||||
>a = a2 : { foo: string; }
|
||||
>a : { foo: string; }
|
||||
>a2 : { foo: string; }
|
||||
|
||||
a2 = b2;
|
||||
>a2 = b2 : { foo: string; }
|
||||
>a2 : { foo: string; }
|
||||
>b2 : { foo: string; }
|
||||
|
||||
b2 = a2;
|
||||
>b2 = a2 : { foo: string; }
|
||||
>b2 : { foo: string; }
|
||||
>a2 : { foo: string; }
|
||||
|
||||
a2 = b;
|
||||
>a2 = b : { foo: string; }
|
||||
>a2 : { foo: string; }
|
||||
>b : { foo: string; }
|
||||
|
||||
a2 = t2;
|
||||
>a2 = t2 : T2
|
||||
>a2 : { foo: string; }
|
||||
>t2 : T2
|
||||
|
||||
a2 = t;
|
||||
>a2 = t : T
|
||||
>a2 : { foo: string; }
|
||||
>t : T
|
||||
}
|
||||
|
||||
module ObjectTypes {
|
||||
>ObjectTypes : typeof ObjectTypes
|
||||
|
||||
class S { foo: S; }
|
||||
>S : S
|
||||
>foo : S
|
||||
>S : S
|
||||
|
||||
class T { foo: T; }
|
||||
>T : T
|
||||
>foo : T
|
||||
>T : T
|
||||
|
||||
var s: S;
|
||||
>s : S
|
||||
>S : S
|
||||
|
||||
var t: T;
|
||||
>t : T
|
||||
>T : T
|
||||
|
||||
interface S2 { foo: S2; }
|
||||
>S2 : S2
|
||||
>foo : S2
|
||||
>S2 : S2
|
||||
|
||||
interface T2 { foo: T2; }
|
||||
>T2 : T2
|
||||
>foo : T2
|
||||
>T2 : T2
|
||||
|
||||
var s2: S2;
|
||||
>s2 : S2
|
||||
>S2 : S2
|
||||
|
||||
var t2: T2;
|
||||
>t2 : T2
|
||||
>T2 : T2
|
||||
|
||||
var a: { foo: typeof a; }
|
||||
>a : { foo: any; }
|
||||
>foo : { foo: any; }
|
||||
>a : { foo: any; }
|
||||
|
||||
var b: { foo: typeof b; }
|
||||
>b : { foo: any; }
|
||||
>foo : { foo: any; }
|
||||
>b : { foo: any; }
|
||||
|
||||
var a2 = { foo: a2 };
|
||||
>a2 : any
|
||||
>{ foo: a2 } : { foo: any; }
|
||||
>foo : any
|
||||
>a2 : any
|
||||
|
||||
var b2 = { foo: b2 };
|
||||
>b2 : any
|
||||
>{ foo: b2 } : { foo: any; }
|
||||
>foo : any
|
||||
>b2 : any
|
||||
|
||||
s = t;
|
||||
>s = t : T
|
||||
>s : S
|
||||
>t : T
|
||||
|
||||
t = s;
|
||||
>t = s : S
|
||||
>t : T
|
||||
>s : S
|
||||
|
||||
s = s2;
|
||||
>s = s2 : S2
|
||||
>s : S
|
||||
>s2 : S2
|
||||
|
||||
s = a2;
|
||||
>s = a2 : any
|
||||
>s : S
|
||||
>a2 : any
|
||||
|
||||
s2 = t2;
|
||||
>s2 = t2 : T2
|
||||
>s2 : S2
|
||||
>t2 : T2
|
||||
|
||||
t2 = s2;
|
||||
>t2 = s2 : S2
|
||||
>t2 : T2
|
||||
>s2 : S2
|
||||
|
||||
s2 = t;
|
||||
>s2 = t : T
|
||||
>s2 : S2
|
||||
>t : T
|
||||
|
||||
s2 = b;
|
||||
>s2 = b : { foo: any; }
|
||||
>s2 : S2
|
||||
>b : { foo: any; }
|
||||
|
||||
s2 = a2;
|
||||
>s2 = a2 : any
|
||||
>s2 : S2
|
||||
>a2 : any
|
||||
|
||||
a = b;
|
||||
>a = b : { foo: any; }
|
||||
>a : { foo: any; }
|
||||
>b : { foo: any; }
|
||||
|
||||
b = a;
|
||||
>b = a : { foo: any; }
|
||||
>b : { foo: any; }
|
||||
>a : { foo: any; }
|
||||
|
||||
a = s;
|
||||
>a = s : S
|
||||
>a : { foo: any; }
|
||||
>s : S
|
||||
|
||||
a = s2;
|
||||
>a = s2 : S2
|
||||
>a : { foo: any; }
|
||||
>s2 : S2
|
||||
|
||||
a = a2;
|
||||
>a = a2 : any
|
||||
>a : { foo: any; }
|
||||
>a2 : any
|
||||
|
||||
a2 = b2;
|
||||
>a2 = b2 : any
|
||||
>a2 : any
|
||||
>b2 : any
|
||||
|
||||
b2 = a2;
|
||||
>b2 = a2 : any
|
||||
>b2 : any
|
||||
>a2 : any
|
||||
|
||||
a2 = b;
|
||||
>a2 = b : { foo: any; }
|
||||
>a2 : any
|
||||
>b : { foo: any; }
|
||||
|
||||
a2 = t2;
|
||||
>a2 = t2 : T2
|
||||
>a2 : any
|
||||
>t2 : T2
|
||||
|
||||
a2 = t;
|
||||
>a2 = t : T
|
||||
>a2 : any
|
||||
>t : T
|
||||
|
||||
}
|
||||
@ -31,11 +31,11 @@ module __test2__ {
|
||||
>aa : {}
|
||||
}
|
||||
__test2__.__val__aa = __test1__.__val__obj4
|
||||
>__test2__.__val__aa = __test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__aa = __test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__aa : {}
|
||||
>__test2__ : typeof __test2__
|
||||
>__val__aa : {}
|
||||
>__test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test1__ : typeof __test1__
|
||||
>__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
|
||||
|
||||
@ -30,11 +30,11 @@ module __test2__ {
|
||||
>aa : {}
|
||||
}
|
||||
__test2__.__val__aa = __test1__.__val__obj4
|
||||
>__test2__.__val__aa = __test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__aa = __test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__aa : {}
|
||||
>__test2__ : typeof __test2__
|
||||
>__val__aa : {}
|
||||
>__test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test1__ : typeof __test1__
|
||||
>__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
|
||||
|
||||
@ -32,11 +32,11 @@ module __test2__ {
|
||||
>obj : { one: number; }
|
||||
}
|
||||
__test2__.__val__obj = __test1__.__val__obj4
|
||||
>__test2__.__val__obj = __test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__obj = __test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__obj : { one: number; }
|
||||
>__test2__ : typeof __test2__
|
||||
>__val__obj : { one: number; }
|
||||
>__test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test1__ : typeof __test1__
|
||||
>__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
|
||||
|
||||
@ -31,11 +31,11 @@ module __test2__ {
|
||||
>aa : { one: number; }
|
||||
}
|
||||
__test2__.__val__aa = __test1__.__val__obj4
|
||||
>__test2__.__val__aa = __test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__aa = __test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__aa : { one: number; }
|
||||
>__test2__ : typeof __test2__
|
||||
>__val__aa : { one: number; }
|
||||
>__test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test1__ : typeof __test1__
|
||||
>__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
|
||||
|
||||
@ -37,11 +37,11 @@ module __test2__ {
|
||||
>obj1 : interfaceOne<number>
|
||||
}
|
||||
__test2__.__val__obj1 = __test1__.__val__obj4
|
||||
>__test2__.__val__obj1 = __test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__obj1 : interfaceOne<number>
|
||||
>__test2__.__val__obj1 = __test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__obj1 : __test2__.interfaceOne<number>
|
||||
>__test2__ : typeof __test2__
|
||||
>__val__obj1 : interfaceOne<number>
|
||||
>__test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__val__obj1 : __test2__.interfaceOne<number>
|
||||
>__test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test1__ : typeof __test1__
|
||||
>__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
|
||||
|
||||
@ -36,11 +36,11 @@ module __test2__ {
|
||||
>obj3 : interfaceWithOptional<number>
|
||||
}
|
||||
__test2__.__val__obj3 = __test1__.__val__obj4
|
||||
>__test2__.__val__obj3 = __test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__obj3 : interfaceWithOptional<number>
|
||||
>__test2__.__val__obj3 = __test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__obj3 : __test2__.interfaceWithOptional<number>
|
||||
>__test2__ : typeof __test2__
|
||||
>__val__obj3 : interfaceWithOptional<number>
|
||||
>__test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__val__obj3 : __test2__.interfaceWithOptional<number>
|
||||
>__test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test1__ : typeof __test1__
|
||||
>__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
|
||||
|
||||
@ -40,11 +40,11 @@ module __test2__ {
|
||||
>obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
}
|
||||
__test2__.__val__obj4 = __test1__.__val__obj4
|
||||
>__test2__.__val__obj4 = __test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__obj4 = __test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__obj4 : __test2__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__ : typeof __test2__
|
||||
>__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__val__obj4 : __test2__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test1__ : typeof __test1__
|
||||
>__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
|
||||
|
||||
@ -36,11 +36,11 @@ module __test2__ {
|
||||
>x1 : classWithPublic<number>
|
||||
}
|
||||
__test2__.__val__x1 = __test1__.__val__obj4
|
||||
>__test2__.__val__x1 = __test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__x1 : classWithPublic<number>
|
||||
>__test2__.__val__x1 = __test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__x1 : __test2__.classWithPublic<number>
|
||||
>__test2__ : typeof __test2__
|
||||
>__val__x1 : classWithPublic<number>
|
||||
>__test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__val__x1 : __test2__.classWithPublic<number>
|
||||
>__test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test1__ : typeof __test1__
|
||||
>__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
|
||||
|
||||
@ -36,11 +36,11 @@ module __test2__ {
|
||||
>x3 : classWithOptional<number>
|
||||
}
|
||||
__test2__.__val__x3 = __test1__.__val__obj4
|
||||
>__test2__.__val__x3 = __test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__x3 : classWithOptional<number>
|
||||
>__test2__.__val__x3 = __test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__x3 : __test2__.classWithOptional<number>
|
||||
>__test2__ : typeof __test2__
|
||||
>__val__x3 : classWithOptional<number>
|
||||
>__test1__.__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__val__x3 : __test2__.classWithOptional<number>
|
||||
>__test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test1__ : typeof __test1__
|
||||
>__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
|
||||
|
||||
@ -12,26 +12,14 @@ class Greeter {
|
||||
|
||||
constructor() {
|
||||
foo(() => {
|
||||
>foo(() => {
|
||||
bar(() => {
|
||||
var x = this;
|
||||
});
|
||||
}) : any
|
||||
>foo(() => { bar(() => { var x = this; }); }) : any
|
||||
>foo : (a: any) => any
|
||||
>() => {
|
||||
bar(() => {
|
||||
var x = this;
|
||||
});
|
||||
} : () => void
|
||||
>() => { bar(() => { var x = this; }); } : () => void
|
||||
|
||||
bar(() => {
|
||||
>bar(() => {
|
||||
var x = this;
|
||||
}) : any
|
||||
>bar(() => { var x = this; }) : any
|
||||
>bar : (a: any) => any
|
||||
>() => {
|
||||
var x = this;
|
||||
} : () => void
|
||||
>() => { var x = this; } : () => void
|
||||
|
||||
var x = this;
|
||||
>x : Greeter
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
//// [breakInIterationOrSwitchStatement1.ts]
|
||||
while (true) {
|
||||
break;
|
||||
}
|
||||
|
||||
//// [breakInIterationOrSwitchStatement1.js]
|
||||
while (true) {
|
||||
break;
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
=== tests/cases/compiler/breakInIterationOrSwitchStatement1.ts ===
|
||||
while (true) {
|
||||
No type information for this code. break;
|
||||
No type information for this code.}
|
||||
No type information for this code.
|
||||
@ -0,0 +1,10 @@
|
||||
//// [breakInIterationOrSwitchStatement2.ts]
|
||||
do {
|
||||
break;
|
||||
}
|
||||
while (true);
|
||||
|
||||
//// [breakInIterationOrSwitchStatement2.js]
|
||||
do {
|
||||
break;
|
||||
} while (true);
|
||||
@ -0,0 +1,6 @@
|
||||
=== tests/cases/compiler/breakInIterationOrSwitchStatement2.ts ===
|
||||
do {
|
||||
No type information for this code. break;
|
||||
No type information for this code.}
|
||||
No type information for this code.while (true);
|
||||
No type information for this code.
|
||||
@ -0,0 +1,9 @@
|
||||
//// [breakInIterationOrSwitchStatement3.ts]
|
||||
for (;;) {
|
||||
break;
|
||||
}
|
||||
|
||||
//// [breakInIterationOrSwitchStatement3.js]
|
||||
for (;;) {
|
||||
break;
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
=== tests/cases/compiler/breakInIterationOrSwitchStatement3.ts ===
|
||||
for (;;) {
|
||||
No type information for this code. break;
|
||||
No type information for this code.}
|
||||
No type information for this code.
|
||||
@ -0,0 +1,6 @@
|
||||
==== tests/cases/compiler/breakInIterationOrSwitchStatement4.ts (1 errors) ====
|
||||
for (var i in something) {
|
||||
~~~~~~~~~
|
||||
!!! Cannot find name 'something'.
|
||||
break;
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
//// [breakInIterationOrSwitchStatement4.ts]
|
||||
for (var i in something) {
|
||||
break;
|
||||
}
|
||||
|
||||
//// [breakInIterationOrSwitchStatement4.js]
|
||||
for (var i in something) {
|
||||
break;
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
==== tests/cases/compiler/breakNotInIterationOrSwitchStatement1.ts (1 errors) ====
|
||||
break;
|
||||
~~~~~~
|
||||
!!! A 'break' statement can only be used within an enclosing iteration or switch statement.
|
||||
@ -0,0 +1,8 @@
|
||||
==== tests/cases/compiler/breakNotInIterationOrSwitchStatement2.ts (1 errors) ====
|
||||
while (true) {
|
||||
function f() {
|
||||
break;
|
||||
~~~~~~
|
||||
!!! Jump target cannot cross function boundary.
|
||||
}
|
||||
}
|
||||
6
tests/baselines/reference/breakTarget1.js
Normal file
6
tests/baselines/reference/breakTarget1.js
Normal file
@ -0,0 +1,6 @@
|
||||
//// [breakTarget1.ts]
|
||||
target:
|
||||
break target;
|
||||
|
||||
//// [breakTarget1.js]
|
||||
target: break target;
|
||||
4
tests/baselines/reference/breakTarget1.types
Normal file
4
tests/baselines/reference/breakTarget1.types
Normal file
@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/breakTarget1.ts ===
|
||||
target:
|
||||
No type information for this code. break target;
|
||||
No type information for this code.
|
||||
10
tests/baselines/reference/breakTarget2.js
Normal file
10
tests/baselines/reference/breakTarget2.js
Normal file
@ -0,0 +1,10 @@
|
||||
//// [breakTarget2.ts]
|
||||
target:
|
||||
while (true) {
|
||||
break target;
|
||||
}
|
||||
|
||||
//// [breakTarget2.js]
|
||||
target: while (true) {
|
||||
break target;
|
||||
}
|
||||
6
tests/baselines/reference/breakTarget2.types
Normal file
6
tests/baselines/reference/breakTarget2.types
Normal file
@ -0,0 +1,6 @@
|
||||
=== tests/cases/compiler/breakTarget2.ts ===
|
||||
target:
|
||||
No type information for this code.while (true) {
|
||||
No type information for this code. break target;
|
||||
No type information for this code.}
|
||||
No type information for this code.
|
||||
11
tests/baselines/reference/breakTarget3.js
Normal file
11
tests/baselines/reference/breakTarget3.js
Normal file
@ -0,0 +1,11 @@
|
||||
//// [breakTarget3.ts]
|
||||
target1:
|
||||
target2:
|
||||
while (true) {
|
||||
break target1;
|
||||
}
|
||||
|
||||
//// [breakTarget3.js]
|
||||
target1: target2: while (true) {
|
||||
break target1;
|
||||
}
|
||||
7
tests/baselines/reference/breakTarget3.types
Normal file
7
tests/baselines/reference/breakTarget3.types
Normal file
@ -0,0 +1,7 @@
|
||||
=== tests/cases/compiler/breakTarget3.ts ===
|
||||
target1:
|
||||
No type information for this code.target2:
|
||||
No type information for this code.while (true) {
|
||||
No type information for this code. break target1;
|
||||
No type information for this code.}
|
||||
No type information for this code.
|
||||
11
tests/baselines/reference/breakTarget4.js
Normal file
11
tests/baselines/reference/breakTarget4.js
Normal file
@ -0,0 +1,11 @@
|
||||
//// [breakTarget4.ts]
|
||||
target1:
|
||||
target2:
|
||||
while (true) {
|
||||
break target2;
|
||||
}
|
||||
|
||||
//// [breakTarget4.js]
|
||||
target1: target2: while (true) {
|
||||
break target2;
|
||||
}
|
||||
7
tests/baselines/reference/breakTarget4.types
Normal file
7
tests/baselines/reference/breakTarget4.types
Normal file
@ -0,0 +1,7 @@
|
||||
=== tests/cases/compiler/breakTarget4.ts ===
|
||||
target1:
|
||||
No type information for this code.target2:
|
||||
No type information for this code.while (true) {
|
||||
No type information for this code. break target2;
|
||||
No type information for this code.}
|
||||
No type information for this code.
|
||||
11
tests/baselines/reference/breakTarget5.errors.txt
Normal file
11
tests/baselines/reference/breakTarget5.errors.txt
Normal file
@ -0,0 +1,11 @@
|
||||
==== tests/cases/compiler/breakTarget5.ts (1 errors) ====
|
||||
target:
|
||||
while (true) {
|
||||
function f() {
|
||||
while (true) {
|
||||
break target;
|
||||
~~~~~~~~~~~~~
|
||||
!!! Jump target cannot cross function boundary.
|
||||
}
|
||||
}
|
||||
}
|
||||
6
tests/baselines/reference/breakTarget6.errors.txt
Normal file
6
tests/baselines/reference/breakTarget6.errors.txt
Normal file
@ -0,0 +1,6 @@
|
||||
==== tests/cases/compiler/breakTarget6.ts (1 errors) ====
|
||||
while (true) {
|
||||
break target;
|
||||
~~~~~~~~~~~~~
|
||||
!!! A 'break' statement can only jump to a label of an enclosing statement.
|
||||
}
|
||||
@ -134,11 +134,7 @@ a.foo(1);
|
||||
|
||||
var b = {
|
||||
>b : { foo: (x?: number) => void; a: (x: number, y?: number) => void; b: (x?: number) => void; }
|
||||
>{
|
||||
foo(x?: number) { },
|
||||
a: function foo(x: number, y?: number) { },
|
||||
b: (x?: number) => { }
|
||||
} : { foo: (x?: number) => void; a: (x: number, y?: number) => void; b: (x?: number) => void; }
|
||||
>{ foo(x?: number) { }, a: function foo(x: number, y?: number) { }, b: (x?: number) => { }} : { foo: (x?: number) => void; a: (x: number, y?: number) => void; b: (x?: number) => void; }
|
||||
|
||||
foo(x?: number) { },
|
||||
>foo : (x?: number) => void
|
||||
|
||||
@ -12,6 +12,7 @@ class B extends A {
|
||||
|
||||
constructor() { super({ test: () => this.someMethod()}); }
|
||||
>super({ test: () => this.someMethod()}) : void
|
||||
>super : typeof A
|
||||
>{ test: () => this.someMethod()} : { test: () => void; }
|
||||
>test : () => void
|
||||
>() => this.someMethod() : () => void
|
||||
|
||||
@ -26,7 +26,6 @@ declare var a;
|
||||
(<any>/regexp/g);
|
||||
>(<any>/regexp/g) : any
|
||||
><any>/regexp/g : any
|
||||
>/regexp/g : RegExp
|
||||
|
||||
(<any>false);
|
||||
>(<any>false) : any
|
||||
|
||||
@ -63,31 +63,10 @@ declare class Point
|
||||
|
||||
var p_cast = <Point> ({
|
||||
>p_cast : Point
|
||||
><Point> ({
|
||||
x: 0,
|
||||
y: 0,
|
||||
add: function(dx, dy) {
|
||||
return new Point(this.x + dx, this.y + dy);
|
||||
},
|
||||
mult: function(p) { return p; }
|
||||
}) : Point
|
||||
><Point> ({ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; }}) : Point
|
||||
>Point : Point
|
||||
>({
|
||||
x: 0,
|
||||
y: 0,
|
||||
add: function(dx, dy) {
|
||||
return new Point(this.x + dx, this.y + dy);
|
||||
},
|
||||
mult: function(p) { return p; }
|
||||
}) : { x: number; y: number; add: (dx: any, dy: any) => Point; mult: (p: any) => any; }
|
||||
>{
|
||||
x: 0,
|
||||
y: 0,
|
||||
add: function(dx, dy) {
|
||||
return new Point(this.x + dx, this.y + dy);
|
||||
},
|
||||
mult: function(p) { return p; }
|
||||
} : { x: number; y: number; add: (dx: any, dy: any) => Point; mult: (p: any) => any; }
|
||||
>({ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; }}) : { x: number; y: number; add: (dx: any, dy: any) => Point; mult: (p: any) => any; }
|
||||
>{ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; }} : { x: number; y: number; add: (dx: any, dy: any) => Point; mult: (p: any) => any; }
|
||||
|
||||
x: 0,
|
||||
>x : number
|
||||
@ -97,9 +76,7 @@ var p_cast = <Point> ({
|
||||
|
||||
add: function(dx, dy) {
|
||||
>add : (dx: any, dy: any) => Point
|
||||
>function(dx, dy) {
|
||||
return new Point(this.x + dx, this.y + dy);
|
||||
} : (dx: any, dy: any) => Point
|
||||
>function(dx, dy) { return new Point(this.x + dx, this.y + dy); } : (dx: any, dy: any) => Point
|
||||
>dx : any
|
||||
>dy : any
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user