From 417cea9cc0923ca15772082d5a799f05c510ce87 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 22 Oct 2014 17:33:16 -0700 Subject: [PATCH 01/28] move completion list position detection to the new tree --- src/services/services.ts | 324 +++++++++--------- src/services/utilities.ts | 7 +- .../completionListAfterNumericLiteral.ts | 4 +- .../completionListAfterNumericLiteral1.ts | 2 +- .../fourslash/completionListInComments2.ts | 7 + .../fourslash/completionListInComments3.ts | 26 ++ .../completionListPrivateMembers3.ts | 31 ++ ...entifiers-should-not-show-in-completion.ts | 1 + 8 files changed, 241 insertions(+), 161 deletions(-) create mode 100644 tests/cases/fourslash/completionListInComments2.ts create mode 100644 tests/cases/fourslash/completionListInComments3.ts create mode 100644 tests/cases/fourslash/completionListPrivateMembers3.ts diff --git a/src/services/services.ts b/src/services/services.ts index b0c69aa99fe..66d59a5f0a3 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -38,6 +38,7 @@ module ts { getFullWidth(): number; getLeadingTriviaWidth(sourceFile?: SourceFile): number; getFullText(sourceFile?: SourceFile): string; + getText(sourceFile?: SourceFile): string; getFirstToken(sourceFile?: SourceFile): Node; getLastToken(sourceFile?: SourceFile): Node; } @@ -130,6 +131,10 @@ module ts { return (sourceFile || this.getSourceFile()).text.substring(this.pos, this.end); } + public getText(sourceFile?: SourceFile): string { + return (sourceFile || this.getSourceFile()).text.substring(this.getStart(), this.getEnd()); + } + private addSyntheticNodes(nodes: Node[], pos: number, end: number): number { scanner.setTextPos(pos); while (pos < end) { @@ -1921,15 +1926,15 @@ module ts { } function isCallExpressionTarget(node: Node): boolean { - if (node.parent.kind === SyntaxKind.PropertyAccess && (node.parent).right === node) + if (node && node.parent && node.parent.kind === SyntaxKind.PropertyAccess && (node.parent).right === node) node = node.parent; - return node.parent.kind === SyntaxKind.CallExpression && (node.parent).func === node; + return node && node.parent && node.parent.kind === SyntaxKind.CallExpression && (node.parent).func === node; } function isNewExpressionTarget(node: Node): boolean { - if (node.parent.kind === SyntaxKind.PropertyAccess && (node.parent).right === node) + if (node && node.parent && node.parent.kind === SyntaxKind.PropertyAccess && (node.parent).right === node) node = node.parent; - return node.parent.kind === SyntaxKind.NewExpression && (node.parent).func === node; + return node && node.parent && node.parent.kind === SyntaxKind.NewExpression && (node.parent).func === node; } function isNameOfFunctionDeclaration(node: Node): boolean { @@ -1968,6 +1973,39 @@ module ts { (node.parent.kind === SyntaxKind.ImportDeclaration && (node.parent).externalModuleName === node)); } + /** Returns true if the position is within a comment */ + function isInsideComment(sourceFile: SourceFile, position: number): boolean { + var token = getTokenAtPosition(sourceFile, position); + + // The position has to be: 1. in the leading trivia (before tokek.getStart()), and 2. within a comment + return position <= token.getStart() && + (isInsideCommentRange(getTrailingCommentRanges(sourceFile.text, token.getFullStart())) || + isInsideCommentRange(getLeadingCommentRanges(sourceFile.text, token.getFullStart()))); + + function isInsideCommentRange(comments: CommentRange[]): boolean { + return forEach(comments, comment => { + // either we are 1. completely inside the comment, or 2. at the end of + if (comment.pos < position && position < comment.end) { + return true; + } + else if (position === comment.end) { + var text = sourceFile.text; + var width = comment.end - comment.pos; + // is single line comment or just /* + if (width <=2 || text.charCodeAt(comment.pos + 1) === CharacterCodes.slash) { + return true; + } + else { + // is unterminated multiline comment + return text.charCodeAt(comment.end - 1) !== CharacterCodes.slash && + text.charCodeAt(comment.end - 2) !== CharacterCodes.asterisk; + } + } + return false; + }); + } + } + enum SemanticMeaning { None = 0x0, Value = 0x1, @@ -2281,40 +2319,58 @@ module ts { }); } - function isCompletionListBlocker(sourceUnit: TypeScript.SourceUnitSyntax, position: number): boolean { + function isCompletionListBlocker(sourceFile: SourceFile, position: number): boolean { // We shouldn't be getting a position that is outside the file because // isEntirelyInsideComment can't handle when the position is out of bounds, // callers should be fixed, however we should be resilient to bad inputs // so we return true (this position is a blocker for getting completions) - if (position < 0 || position > TypeScript.fullWidth(sourceUnit)) { + if (position < 0 || position > sourceFile.end) { return true; } // This method uses Fidelity completely. Some information can be reached using the AST, but not everything. - return TypeScript.Syntax.isEntirelyInsideComment(sourceUnit, position) || - TypeScript.Syntax.isEntirelyInStringOrRegularExpressionLiteral(sourceUnit, position) || - isIdentifierDefinitionLocation(sourceUnit, position) || - isRightOfIllegalDot(sourceUnit, position); + return isInsideComment(sourceFile, position) || + isEntirelyInStringOrRegularExpressionLiteral(sourceFile, position) || + isIdentifierDefinitionLocation(sourceFile, position) || + isRightOfIllegalDot(sourceFile, position); } - function getContainingObjectLiteralApplicableForCompletion(sourceUnit: TypeScript.SourceUnitSyntax, position: number): TypeScript.ISyntaxElement { + function isEntirelyInStringOrRegularExpressionLiteral(sourceFile: SourceFile, position: number): boolean { + var token = getTouchingPropertyName(sourceFile, position); + + // || token.kind === SyntaxKind.RegularExpressionLiteral + if (token.kind === SyntaxKind.StringLiteral) { + // The position has to be either: 1. entirely within the token text, or + // 2. at the end position, and the string literal is not terminated + var start = token.getStart(); + var end = token.getEnd(); + if (start < position && position < end) { + return true; + } + else if (position === end) { + var width = end - start; + return width <= 1 || sourceFile.text.charCodeAt(start) !== sourceFile.text.charCodeAt(end - 1); + } + } + else if (token.kind === SyntaxKind.RegularExpressionLiteral) { + return token.getStart() < position && position < token.getEnd(); + } + return false; + } + + function getContainingObjectLiteralApplicableForCompletion(sourceFile: SourceFile, position: number): ObjectLiteral { // The locations in an object literal expression that are applicable for completion are property name definition locations. - var previousToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); + var previousToken = getNonIdentifierCompleteTokenOnLeft(sourceFile, position); if (previousToken) { var parent = previousToken.parent; - switch (previousToken.kind()) { - case TypeScript.SyntaxKind.OpenBraceToken: // var x = { | - case TypeScript.SyntaxKind.CommaToken: // var x = { a: 0, | - if (parent && parent.kind() === TypeScript.SyntaxKind.SeparatedList) { - parent = parent.parent; + switch (previousToken.kind) { + case SyntaxKind.OpenBraceToken: // var x = { | + case SyntaxKind.CommaToken: // var x = { a: 0, | + if (parent && parent.kind === SyntaxKind.ObjectLiteral) { + return parent; } - - if (parent && parent.kind() === TypeScript.SyntaxKind.ObjectLiteralExpression) { - return parent; - } - break; } } @@ -2322,47 +2378,67 @@ module ts { return undefined; } - function isIdentifierDefinitionLocation(sourceUnit: TypeScript.SourceUnitSyntax, position: number): boolean { - var positionedToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); + function isFunction(kind: SyntaxKind): boolean { + switch (kind) { + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.Method: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.CallSignature: + case SyntaxKind.ConstructSignature: + case SyntaxKind.IndexSignature: + return true; + } + return false; + } - if (positionedToken) { - var containingNodeKind = TypeScript.Syntax.containingNode(positionedToken) && TypeScript.Syntax.containingNode(positionedToken).kind(); - switch (positionedToken.kind()) { - case TypeScript.SyntaxKind.CommaToken: - return containingNodeKind === TypeScript.SyntaxKind.ParameterList || - containingNodeKind === TypeScript.SyntaxKind.VariableDeclaration || - containingNodeKind === TypeScript.SyntaxKind.EnumDeclaration; // enum { foo, | + function isIdentifierDefinitionLocation(sourceFile: SourceFile, position: number): boolean { + var previousToken = getNonIdentifierCompleteTokenOnLeft(sourceFile, position); + if (previousToken) { + var containingNodeKind = previousToken.parent.kind; + switch (previousToken.kind) { + case SyntaxKind.CommaToken: + return containingNodeKind === SyntaxKind.VariableDeclaration || + containingNodeKind === SyntaxKind.VariableStatement || + containingNodeKind === SyntaxKind.EnumDeclaration || // enum { foo, | + isFunction(containingNodeKind); - case TypeScript.SyntaxKind.OpenParenToken: - return containingNodeKind === TypeScript.SyntaxKind.ParameterList || - containingNodeKind === TypeScript.SyntaxKind.CatchClause; + case SyntaxKind.OpenParenToken: + return containingNodeKind === SyntaxKind.CatchBlock || + isFunction(containingNodeKind); - case TypeScript.SyntaxKind.OpenBraceToken: - return containingNodeKind === TypeScript.SyntaxKind.EnumDeclaration; // enum { | + case SyntaxKind.OpenBraceToken: + return containingNodeKind === SyntaxKind.EnumDeclaration; // enum { | + // containingNodeKind === SyntaxKind.InterfaceDeclaration; - case TypeScript.SyntaxKind.PublicKeyword: - case TypeScript.SyntaxKind.PrivateKeyword: - case TypeScript.SyntaxKind.StaticKeyword: - case TypeScript.SyntaxKind.DotDotDotToken: - return containingNodeKind === TypeScript.SyntaxKind.Parameter; + case SyntaxKind.PublicKeyword: + case SyntaxKind.PrivateKeyword: + case SyntaxKind.StaticKeyword: + case SyntaxKind.DotDotDotToken: + return containingNodeKind === SyntaxKind.Parameter; - case TypeScript.SyntaxKind.ClassKeyword: - case TypeScript.SyntaxKind.ModuleKeyword: - case TypeScript.SyntaxKind.EnumKeyword: - case TypeScript.SyntaxKind.InterfaceKeyword: - case TypeScript.SyntaxKind.FunctionKeyword: - case TypeScript.SyntaxKind.VarKeyword: - case TypeScript.SyntaxKind.GetKeyword: - case TypeScript.SyntaxKind.SetKeyword: + case SyntaxKind.ClassKeyword: + case SyntaxKind.ModuleKeyword: + case SyntaxKind.EnumKeyword: + case SyntaxKind.InterfaceKeyword: + case SyntaxKind.FunctionKeyword: + case SyntaxKind.VarKeyword: + case SyntaxKind.GetKeyword: + case SyntaxKind.SetKeyword: return true; } // Previous token may have been a keyword that was converted to an identifier. - switch (positionedToken.text()) { + switch (previousToken.getText()) { case "class": case "interface": case "enum": case "module": + case "function": + case "var": return true; } } @@ -2370,44 +2446,28 @@ module ts { return false; } - function getNonIdentifierCompleteTokenOnLeft(sourceUnit: TypeScript.SourceUnitSyntax, position: number): TypeScript.ISyntaxToken { - var positionedToken = TypeScript.Syntax.findCompleteTokenOnLeft(sourceUnit, position, /*includeSkippedTokens*/true); + function getNonIdentifierCompleteTokenOnLeft(sourceFile: SourceFile, position: number): Node { + var previousToken = findTokenOnLeftOfPosition(sourceFile, position); - if (positionedToken && position === TypeScript.end(positionedToken) && positionedToken.kind() == TypeScript.SyntaxKind.EndOfFileToken) { - // EndOfFile token is not interesting, get the one before it - positionedToken = TypeScript. previousToken(positionedToken, /*includeSkippedTokens*/true); - } - - if (positionedToken && position === TypeScript.end(positionedToken) && positionedToken.kind() === TypeScript.SyntaxKind.IdentifierName) { + if (previousToken && position <= previousToken.end && previousToken.kind === SyntaxKind.Identifier) { // The caret is at the end of an identifier, the decision to provide completion depends on the previous token - positionedToken = TypeScript.previousToken(positionedToken, /*includeSkippedTokens*/true); + previousToken = findPrecedingToken(previousToken.pos, sourceFile); } - return positionedToken; + return previousToken; } - function isRightOfIllegalDot(sourceUnit: TypeScript.SourceUnitSyntax, position: number): boolean { - var positionedToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); + function isRightOfIllegalDot(sourceFile: SourceFile, position: number): boolean { + var previousToken = getNonIdentifierCompleteTokenOnLeft(sourceFile, position); - if (positionedToken) { - switch (positionedToken.kind()) { - case TypeScript.SyntaxKind.DotToken: - var leftOfDotPositionedToken = TypeScript.previousToken(positionedToken, /*includeSkippedTokens*/true); - return leftOfDotPositionedToken && leftOfDotPositionedToken.kind() === TypeScript.SyntaxKind.NumericLiteral; - - case TypeScript.SyntaxKind.NumericLiteral: - var text = positionedToken.text(); - return text.charAt(text.length - 1) === "."; - } + if (previousToken && previousToken.kind === SyntaxKind.NumericLiteral) { + var text = previousToken.getFullText(); + return text.charAt(text.length - 1) === "."; } return false; } - function isPunctuation(kind: SyntaxKind) { - return (SyntaxKind.FirstPunctuation <= kind && kind <= SyntaxKind.LastPunctuation); - } - function filterContextualMembersList(contextualMemberSymbols: Symbol[], existingMembers: Declaration[]): Symbol[] { if (!existingMembers || existingMembers.length === 0) { return contextualMemberSymbols; @@ -2445,65 +2505,28 @@ module ts { var sourceFile = getSourceFile(filename); var sourceUnit = sourceFile.getSourceUnit(); - if (isCompletionListBlocker(sourceFile.getSyntaxTree().sourceUnit(), position)) { + if (isCompletionListBlocker(sourceFile, position)) { host.log("Returning an empty list because completion was blocked."); return null; } - var node = TypeScript.ASTHelpers.getAstAtPosition(sourceUnit, position, /*useTrailingTriviaAsLimChar*/ true, /*forceInclusive*/ true); - - if (node && node.kind() === TypeScript.SyntaxKind.IdentifierName && - TypeScript.start(node) === TypeScript.end(node)) { - // Ignore missing name nodes - node = node.parent; - } - - var isRightOfDot = false; - if (node && - node.kind() === TypeScript.SyntaxKind.MemberAccessExpression && - TypeScript.end((node).expression) < position) { - + var node: Node; + var isRightOfDot: boolean; + var token = getNonIdentifierCompleteTokenOnLeft(sourceFile, position); + if (token && token.kind === SyntaxKind.DotToken && + (token.parent.kind === SyntaxKind.PropertyAccess || token.parent.kind === SyntaxKind.QualifiedName)) { + node = (token.parent).left; isRightOfDot = true; - node = (node).expression; - } - else if (node && - node.kind() === TypeScript.SyntaxKind.QualifiedName && - TypeScript.end((node).left) < position) { - - isRightOfDot = true; - node = (node).left; - } - else if (node && node.parent && - node.kind() === TypeScript.SyntaxKind.IdentifierName && - node.parent.kind() === TypeScript.SyntaxKind.MemberAccessExpression && - (node.parent).name === node) { - - isRightOfDot = true; - node = (node.parent).expression; - } - else if (node && node.parent && - node.kind() === TypeScript.SyntaxKind.IdentifierName && - node.parent.kind() === TypeScript.SyntaxKind.QualifiedName && - (node.parent).right === node) { - - isRightOfDot = true; - node = (node.parent).left; - } - - // TODO: this is a hack for now, we need a proper walking mechanism to verify that we have the correct node - var precedingToken = findTokenOnLeftOfPosition(sourceFile, TypeScript.end(node)); - var mappedNode: Node; - if (!precedingToken) { - mappedNode = sourceFile; - } - else if (isPunctuation(precedingToken.kind)) { - mappedNode = precedingToken.parent; } else { - mappedNode = precedingToken; - } + node = !token ? sourceFile : token.parent; + isRightOfDot = false; - Debug.assert(mappedNode, "Could not map a Fidelity node to an AST node"); + // we are at the end of a container node, we do not want to be inside it, as that would affect our completion results + // e.g. function f(a) {}| <- 'a' should not be visible here + if (token && token.kind === SyntaxKind.CloseBraceToken && position === token.end) { + } + } // Get the completions activeCompletionSession = { @@ -2511,7 +2534,7 @@ module ts { position: position, entries: [], symbols: {}, - location: mappedNode, + location: node, typeChecker: typeInfoResolver }; @@ -2520,8 +2543,8 @@ module ts { var symbols: Symbol[] = []; isMemberCompletion = true; - if (mappedNode.kind === SyntaxKind.Identifier || mappedNode.kind === SyntaxKind.QualifiedName || mappedNode.kind === SyntaxKind.PropertyAccess) { - var symbol = typeInfoResolver.getSymbolInfo(mappedNode); + if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccess) { + var symbol = typeInfoResolver.getSymbolInfo(node); // This is an alias, follow what it aliases if (symbol && symbol.flags & SymbolFlags.Import) { @@ -2531,19 +2554,19 @@ module ts { if (symbol && symbol.flags & SymbolFlags.HasExports) { // Extract module or enum members forEachValue(symbol.exports, symbol => { - if (typeInfoResolver.isValidPropertyAccess((mappedNode.parent), symbol.name)) { + if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { symbols.push(symbol); } }); } } - var type = typeInfoResolver.getTypeOfNode(mappedNode); + var type = typeInfoResolver.getTypeOfNode(node); var apparentType = type && typeInfoResolver.getApparentType(type); if (apparentType) { // Filter private properties forEach(apparentType.getApparentProperties(), symbol => { - if (typeInfoResolver.isValidPropertyAccess((mappedNode.parent), symbol.name)) { + if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { symbols.push(symbol); } }); @@ -2552,17 +2575,13 @@ module ts { getCompletionEntriesFromSymbols(symbols, activeCompletionSession); } else { - var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(sourceFile.getSyntaxTree().sourceUnit(), position); + var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(sourceFile, position); // Object literal expression, look up possible property names from contextual type if (containingObjectLiteral) { - var objectLiteral = (mappedNode.kind === SyntaxKind.ObjectLiteral ? mappedNode : getAncestor(mappedNode, SyntaxKind.ObjectLiteral)); - - Debug.assert(objectLiteral); - isMemberCompletion = true; - var contextualType = typeInfoResolver.getContextualType(objectLiteral); + var contextualType = typeInfoResolver.getContextualType(containingObjectLiteral); if (!contextualType) { return undefined; } @@ -2570,7 +2589,7 @@ module ts { var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType); if (contextualTypeMembers && contextualTypeMembers.length > 0) { // Add filtered items to the completion list - var filteredMembers = filterContextualMembersList(contextualTypeMembers, objectLiteral.properties); + var filteredMembers = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession); } } @@ -2579,7 +2598,7 @@ module ts { isMemberCompletion = false; /// TODO filter meaning based on the current context var symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Import; - var symbols = typeInfoResolver.getSymbolsInScope(mappedNode, symbolMeanings); + var symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings); getCompletionEntriesFromSymbols(symbols, activeCompletionSession); } @@ -2767,14 +2786,19 @@ module ts { var type = typeResolver.getTypeOfSymbol(symbol); if (type) { - if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { - // try get the call/construct signature from the type if it matches - var callExpression: CallExpression; + // try get the call/construct signature from the type if it matches + var callExpression: CallExpression; + if (location.kind === SyntaxKind.CallExpression || location.kind === SyntaxKind.NewExpression) { + callExpression = location; + } + else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { if (location.parent.kind === SyntaxKind.PropertyAccess && (location.parent).right === location) { location = location.parent; } callExpression = location.parent; + } + if (callExpression) { var candidateSignatures: Signature[] = []; signature = typeResolver.getResolvedSignature(callExpression, candidateSignatures); if (!signature && candidateSignatures.length) { @@ -5016,17 +5040,7 @@ module ts { // OK, we have found a match in the file. This is only an acceptable match if // it is contained within a comment. - var token = getTokenAtPosition(sourceFile, matchPosition); - - if (token.getStart() <= matchPosition && matchPosition < token.getEnd()) { - // match was within the token itself. Not in the comment. Keep searching - // descriptor. - continue; - } - - // Looks to be within the trivia. See if we can find the comment containing it. - if (!getContainingComment(getTrailingCommentRanges(fileContents, token.getFullStart()), matchPosition) && - !getContainingComment(getLeadingCommentRanges(fileContents, token.getFullStart()), matchPosition)) { + if (!isInsideComment(sourceFile, matchPosition)) { continue; } diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 4ceb20fdcee..825c194bc73 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -95,11 +95,12 @@ module ts { var child = current.getChildAt(i); var start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile); if (start <= position) { - if (position < child.getEnd()) { + var end = child.getEnd(); + if (position < end || (position === end && child.kind === SyntaxKind.EndOfFileToken)) { current = child; continue outer; } - else if (includeItemAtEndPosition && child.getEnd() === position) { + else if (includeItemAtEndPosition && end === position) { var previousToken = findPrecedingToken(position, sourceFile, child); if (previousToken && includeItemAtEndPosition(previousToken)) { return previousToken; @@ -180,7 +181,7 @@ module ts { for (var i = 0, len = children.length; i < len; ++i) { var child = children[i]; if (nodeHasTokens(child)) { - if (position < child.end) { + if (position <= child.end) { if (child.getStart(sourceFile) >= position) { // actual start of the node is past the position - previous token should be at the end of previous child var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i); diff --git a/tests/cases/fourslash/completionListAfterNumericLiteral.ts b/tests/cases/fourslash/completionListAfterNumericLiteral.ts index a8ea0335f70..549c048a635 100644 --- a/tests/cases/fourslash/completionListAfterNumericLiteral.ts +++ b/tests/cases/fourslash/completionListAfterNumericLiteral.ts @@ -25,10 +25,10 @@ goTo.marker("dotOnNumberExrpressions1"); verify.completionListIsEmpty(); goTo.marker("dotOnNumberExrpressions2"); -verify.completionListIsEmpty(); +verify.completionListContains("toExponential"); goTo.marker("dotOnNumberExrpressions3"); -verify.completionListIsEmpty(); +verify.completionListContains("toExponential"); goTo.marker("dotOnNumberExrpressions4"); verify.completionListIsEmpty(); diff --git a/tests/cases/fourslash/completionListAfterNumericLiteral1.ts b/tests/cases/fourslash/completionListAfterNumericLiteral1.ts index b2604531316..cf8b5d41e98 100644 --- a/tests/cases/fourslash/completionListAfterNumericLiteral1.ts +++ b/tests/cases/fourslash/completionListAfterNumericLiteral1.ts @@ -3,4 +3,4 @@ ////5../**/ goTo.marker(); -verify.completionListIsEmpty(); \ No newline at end of file +verify.completionListContains("toFixed"); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListInComments2.ts b/tests/cases/fourslash/completionListInComments2.ts new file mode 100644 index 00000000000..d9855306fcf --- /dev/null +++ b/tests/cases/fourslash/completionListInComments2.ts @@ -0,0 +1,7 @@ +/// + +//// // */{| "name" : "1" |} + +goTo.marker("1"); +// Completion list should not be available within comments +verify.completionListIsEmpty(); diff --git a/tests/cases/fourslash/completionListInComments3.ts b/tests/cases/fourslash/completionListInComments3.ts new file mode 100644 index 00000000000..3f57929c1f4 --- /dev/null +++ b/tests/cases/fourslash/completionListInComments3.ts @@ -0,0 +1,26 @@ +/// + +//// /*{| "name": "1" |} + +//// /* {| "name": "2" |} + +//// /* *{| "name": "3" |} + +//// /* */{| "name": "4" |} + +//// {| "name": "5" |}/* */ + +goTo.marker("1"); +verify.completionListIsEmpty(); + +goTo.marker("2"); +verify.completionListIsEmpty(); + +goTo.marker("3"); +verify.completionListIsEmpty(); + +goTo.marker("4"); +verify.not.completionListIsEmpty(); + +//goTo.marker("5"); +//verify.not.completionListIsEmpty(); diff --git a/tests/cases/fourslash/completionListPrivateMembers3.ts b/tests/cases/fourslash/completionListPrivateMembers3.ts new file mode 100644 index 00000000000..69f7456d7b5 --- /dev/null +++ b/tests/cases/fourslash/completionListPrivateMembers3.ts @@ -0,0 +1,31 @@ +/// + +////class Other { +//// public p; +//// protected p2 +//// private p3; +////} +//// +////class Self { +//// private other: Other; +//// +//// method() { +//// this.other./*1*/; +//// +//// this.other.p/*2*/; +//// +//// this.other.p/*3*/.toString(); +//// } +////} + +goTo.marker("1"); +verify.memberListContains("p"); +verify.memberListCount(1); + +goTo.marker("2"); +verify.memberListContains("p"); +verify.memberListCount(1); + +goTo.marker("2"); +verify.memberListContains("p"); +verify.memberListCount(1); diff --git a/tests/cases/fourslash/completion_enum-members-with-invalid-identifiers-should-not-show-in-completion.ts b/tests/cases/fourslash/completion_enum-members-with-invalid-identifiers-should-not-show-in-completion.ts index e49dd0dea5d..d01856a54fb 100644 --- a/tests/cases/fourslash/completion_enum-members-with-invalid-identifiers-should-not-show-in-completion.ts +++ b/tests/cases/fourslash/completion_enum-members-with-invalid-identifiers-should-not-show-in-completion.ts @@ -10,6 +10,7 @@ //// //// e./**/ +goTo.marker(); verify.not.completionListContains('1'); verify.not.completionListContains('"1"'); verify.not.completionListContains('2'); From 68db15d960cc9de180305e28e8c3ff495cc7bffc Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 22 Oct 2014 17:34:00 -0700 Subject: [PATCH 02/28] Split completionListAtIdentifierDefinitionLocation into multiple tests to ease debugging --- ...stAtIdentifierDefinitionLocations_catch.ts | 13 +++++++ ...AtIdentifierDefinitionLocations_classes.ts | 12 +++++++ ...entifierDefinitionLocations_enumMembers.ts | 11 ++++++ ...ntifierDefinitionLocations_enumMembers2.ts | 9 +++++ ...stAtIdentifierDefinitionLocations_enums.ts | 14 ++++++++ ...IdentifierDefinitionLocations_functions.ts | 13 +++++++ ...dentifierDefinitionLocations_interfaces.ts | 13 +++++++ ...AtIdentifierDefinitionLocations_modules.ts | 13 +++++++ ...entifierDefinitionLocations_parameters.ts} | 35 ++++++++----------- ...fierDefinitionLocations_varDeclarations.ts | 18 ++++++++++ 10 files changed, 130 insertions(+), 21 deletions(-) create mode 100644 tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_catch.ts create mode 100644 tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_classes.ts create mode 100644 tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enumMembers.ts create mode 100644 tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enumMembers2.ts create mode 100644 tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enums.ts create mode 100644 tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_functions.ts create mode 100644 tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaces.ts create mode 100644 tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_modules.ts rename tests/cases/fourslash/{completionListAtIdentifierDefinitionLocations.ts => completionListAtIdentifierDefinitionLocations_parameters.ts} (54%) create mode 100644 tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_varDeclarations.ts diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_catch.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_catch.ts new file mode 100644 index 00000000000..bdf13c1d97f --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_catch.ts @@ -0,0 +1,13 @@ +/// + +////var aa = 1; + +//// try {} catch(/*catchVariable1*/ + +//// try {} catch(a/*catchVariable2*/ + + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_classes.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_classes.ts new file mode 100644 index 00000000000..60a108cf1e6 --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_classes.ts @@ -0,0 +1,12 @@ +/// + +////var aa = 1; + +////class /*className1*/ + +////class a/*className2*/ + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enumMembers.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enumMembers.ts new file mode 100644 index 00000000000..6c0472be546 --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enumMembers.ts @@ -0,0 +1,11 @@ +/// + +////var aa = 1; + +////enum a { /*enumValueName1*/ + + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enumMembers2.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enumMembers2.ts new file mode 100644 index 00000000000..ee2f3e71032 --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enumMembers2.ts @@ -0,0 +1,9 @@ +/// + +////var aa = 1; +////enum a { foo, /*enumValueName3*/ + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enums.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enums.ts new file mode 100644 index 00000000000..183f8a22c63 --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enums.ts @@ -0,0 +1,14 @@ +/// + +////var aa = 1; + +////enum /*enumName1*/ + +////enum a/*enumName2*/ + +////var x = 0; enum /*enumName4*/ + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_functions.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_functions.ts new file mode 100644 index 00000000000..24231174727 --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_functions.ts @@ -0,0 +1,13 @@ +/// + +////var aa = 1; + +////function /*functionName1*/ + +////function a/*functionName2*/ + + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaces.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaces.ts new file mode 100644 index 00000000000..ec2732fe2fe --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaces.ts @@ -0,0 +1,13 @@ +/// + +////var aa = 1; + +////interface /*interfaceName1*/ + +////interface a/*interfaceName2*/ + + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_modules.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_modules.ts new file mode 100644 index 00000000000..4ebdf029a89 --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_modules.ts @@ -0,0 +1,13 @@ +/// + +////var aa = 1; + +////module /*moduleName1*/ + +////module a/*moduleName2*/ + + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_parameters.ts similarity index 54% rename from tests/cases/fourslash/completionListAtIdentifierDefinitionLocations.ts rename to tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_parameters.ts index e36d69c82f2..0fd66e9d091 100644 --- a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations.ts +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_parameters.ts @@ -1,40 +1,33 @@ /// ////var aa = 1; -////class /*className1*/ -////class a/*className2*/ -////interface /*interfaceName1*/ -////interface a/*interfaceName2*/ -////module /*moduleName1*/ -////module a/*moduleName2*/ -////enum /*enumName1*/ -////enum a/*enumName2*/ -////// fourslash is saying completion list is not empty on this line but editor disagrees -//////enum a { /*enumValueName1*/ -////enum a { f/*enumValueName2*/ -////enum a { foo, /*enumValueName3*/ -////var x = 0; enum /*enumName4*/ -////function /*functionName1*/ -////function a/*functionName2*/ -////var /*varName1*/ -////var a/*varName2*/ -////var a2,/*varName3*/ -////var a2, a/*varName4*/ + ////function testFunction(/*parameterName1*/ + ////function testFunction(a/*parameterName2*/ + ////function testFunction(a, /*parameterName3*/ + ////function testFunction(a, b/*parameterName4*/ + ////class bar1{ constructor(/*constructorParamter1*/ + ////class bar2{ constructor(a/*constructorParamter2*/ + ////class bar3{ constructor(a, /*constructorParamter3*/ + ////class bar4{ constructor(a, b/*constructorParamter4*/ + ////class bar5{ constructor(public /*constructorParamter5*/ + ////class bar6{ constructor(public a/*constructorParamter6*/ + ////class bar7{ constructor(private a/*constructorParamter7*/ + ////class bar8{ constructor(.../*constructorParamter8*/ + ////class bar9{ constructor(...a/*constructorParamter9*/ -//// try {} catch(/*catchVariable1*/ -//// try {} catch(a/*catchVariable2*/ + test.markers().forEach((m) => { goTo.position(m.position, m.fileName); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_varDeclarations.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_varDeclarations.ts new file mode 100644 index 00000000000..50a112f4625 --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_varDeclarations.ts @@ -0,0 +1,18 @@ +/// + +////var aa = 1; + + +////var /*varName1*/ + +////var a/*varName2*/ + +////var a2,/*varName3*/ + +////var a2, a/*varName4*/ + + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); From 463b2392b7d89eb3f88933d894a87fd8e77494d3 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 22 Oct 2014 17:36:43 -0700 Subject: [PATCH 03/28] remove call to getSourceUnit --- src/services/services.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/services.ts b/src/services/services.ts index 66d59a5f0a3..018f322ac41 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2439,6 +2439,7 @@ module ts { case "module": case "function": case "var": + // TODO: add let and const return true; } } @@ -2503,7 +2504,6 @@ module ts { filename = TypeScript.switchToForwardSlashes(filename); var sourceFile = getSourceFile(filename); - var sourceUnit = sourceFile.getSourceUnit(); if (isCompletionListBlocker(sourceFile, position)) { host.log("Returning an empty list because completion was blocked."); From 3dc6072f583e80ddece8233774c1e0dcf05bd65f Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 23 Oct 2014 09:27:50 -0700 Subject: [PATCH 04/28] Disallow completion in interface declarations --- src/services/services.ts | 10 +++++++--- ...AtIdentifierDefinitionLocations_interfaceMembers.ts | 10 ++++++++++ ...tIdentifierDefinitionLocations_interfaceMembers2.ts | 10 ++++++++++ ...tIdentifierDefinitionLocations_interfaceMembers3.ts | 10 ++++++++++ 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers.ts create mode 100644 tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers2.ts create mode 100644 tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers3.ts diff --git a/src/services/services.ts b/src/services/services.ts index 018f322ac41..82f19d1797c 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2403,7 +2403,7 @@ module ts { case SyntaxKind.CommaToken: return containingNodeKind === SyntaxKind.VariableDeclaration || containingNodeKind === SyntaxKind.VariableStatement || - containingNodeKind === SyntaxKind.EnumDeclaration || // enum { foo, | + containingNodeKind === SyntaxKind.EnumDeclaration || // enum a { foo, | isFunction(containingNodeKind); case SyntaxKind.OpenParenToken: @@ -2411,8 +2411,12 @@ module ts { isFunction(containingNodeKind); case SyntaxKind.OpenBraceToken: - return containingNodeKind === SyntaxKind.EnumDeclaration; // enum { | - // containingNodeKind === SyntaxKind.InterfaceDeclaration; + return containingNodeKind === SyntaxKind.EnumDeclaration || // enum a { | + containingNodeKind === SyntaxKind.InterfaceDeclaration; // interface a { | + + case SyntaxKind.SemicolonToken: + return containingNodeKind === SyntaxKind.Property && + previousToken.parent.parent.kind === SyntaxKind.InterfaceDeclaration; // interface a { f; | case SyntaxKind.PublicKeyword: case SyntaxKind.PrivateKeyword: diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers.ts new file mode 100644 index 00000000000..266b0b78c9c --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers.ts @@ -0,0 +1,10 @@ +/// + +////var aa = 1; + +////interface a { /*interfaceValue1*/ + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers2.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers2.ts new file mode 100644 index 00000000000..82a30325948 --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers2.ts @@ -0,0 +1,10 @@ +/// + +////var aa = 1; + +////interface a { f/*interfaceValue2*/ + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers3.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers3.ts new file mode 100644 index 00000000000..ed640dd3f1a --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers3.ts @@ -0,0 +1,10 @@ +/// + +////var aa = 1; + +////interface a { f; /*interfaceValue3*/ + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); From 161eea13e02c289defefc01fc37499fa7c7140f0 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 23 Oct 2014 09:34:29 -0700 Subject: [PATCH 05/28] Add test for issue#903 --- tests/cases/fourslash/completionListAfterSlash.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/cases/fourslash/completionListAfterSlash.ts diff --git a/tests/cases/fourslash/completionListAfterSlash.ts b/tests/cases/fourslash/completionListAfterSlash.ts new file mode 100644 index 00000000000..f9a0b69afdf --- /dev/null +++ b/tests/cases/fourslash/completionListAfterSlash.ts @@ -0,0 +1,8 @@ +/// + +////var a = 0; +////a/./**/ + +goTo.marker(); +// should not crash +verify.completionListIsEmpty(); From 669044c495d4a7ad58347cd4f73a8b1516fac4c6 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 23 Oct 2014 12:35:04 -0700 Subject: [PATCH 06/28] Fix issue #866, detect the current location correctelly in completion entry details --- src/services/services.ts | 20 +++++++++++++------ .../fourslash/commentsExternalModules.ts | 4 ++-- tests/cases/fourslash/commentsFunction.ts | 2 +- .../fourslash/commentsImportDeclaration.ts | 2 +- tests/cases/fourslash/commentsInheritance.ts | 20 +++++++++---------- tests/cases/fourslash/commentsInterface.ts | 2 +- tests/cases/fourslash/commentsModules.ts | 14 ++++++------- .../externalModuleWithExportAssignment.ts | 4 ++-- 8 files changed, 38 insertions(+), 30 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index 82f19d1797c..77fa907956d 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1265,7 +1265,6 @@ module ts { position: number; // position in the file where the completion was requested entries: CompletionEntry[]; // entries for this completion symbols: Map; // symbols by entry name map - location: Node; // the node where the completion was requested typeChecker: TypeChecker; // the typeChecker used to generate this completion } @@ -2515,8 +2514,10 @@ module ts { } var node: Node; + var location: Node; var isRightOfDot: boolean; var token = getNonIdentifierCompleteTokenOnLeft(sourceFile, position); + if (token && token.kind === SyntaxKind.DotToken && (token.parent.kind === SyntaxKind.PropertyAccess || token.parent.kind === SyntaxKind.QualifiedName)) { node = (token.parent).left; @@ -2538,7 +2539,6 @@ module ts { position: position, entries: [], symbols: {}, - location: node, typeChecker: typeInfoResolver }; @@ -2624,6 +2624,8 @@ module ts { // in the getCompletionsAtPosition earlier filename = TypeScript.switchToForwardSlashes(filename); + var sourceFile = getSourceFile(filename); + var session = activeCompletionSession; // Ensure that the current active completion session is still valid for this request @@ -2640,7 +2642,8 @@ module ts { // which is permissible given that it is backwards compatible; but really we should consider // passing the meaning for the node so that we don't report that a suggestion for a value is an interface. // We COULD also just do what 'getSymbolModifiers' does, which is to use the first declaration. - var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getSourceFile(filename), session.location, session.typeChecker, session.location, SemanticMeaning.All); + var location = getTouchingPropertyName(sourceFile, position); + var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getSourceFile(filename), location, session.typeChecker, location, SemanticMeaning.All); return { name: entryName, kind: displayPartsDocumentationsAndSymbolKind.symbolKind, @@ -2790,15 +2793,20 @@ module ts { var type = typeResolver.getTypeOfSymbol(symbol); if (type) { + if (location.parent && location.parent.kind === SyntaxKind.PropertyAccess) { + var right = (location.parent).right; + // Either the location is on the right of a property access, or on the left and the right is missing + if (right === location || (right && right.kind === SyntaxKind.Missing)){ + location = location.parent; + } + } + // try get the call/construct signature from the type if it matches var callExpression: CallExpression; if (location.kind === SyntaxKind.CallExpression || location.kind === SyntaxKind.NewExpression) { callExpression = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { - if (location.parent.kind === SyntaxKind.PropertyAccess && (location.parent).right === location) { - location = location.parent; - } callExpression = location.parent; } diff --git a/tests/cases/fourslash/commentsExternalModules.ts b/tests/cases/fourslash/commentsExternalModules.ts index 0eed08ca01e..154d87535c6 100644 --- a/tests/cases/fourslash/commentsExternalModules.ts +++ b/tests/cases/fourslash/commentsExternalModules.ts @@ -64,7 +64,7 @@ goTo.marker('7'); verify.quickInfoIs("(var) myvar: m1.m2.c", ""); goTo.marker('8'); -verify.memberListContains("c", "class m1.m2.c", "class comment;"); +verify.memberListContains("c", "(constructor) m1.m2.c(): m1.m2.c", ""); verify.memberListContains("i", "(var) m1.m2.i: m1.m2.c", "i"); goTo.file("commentsExternalModules_file1.ts"); @@ -91,5 +91,5 @@ goTo.marker('14'); verify.quickInfoIs("(var) newVar: extMod.m1.m2.c", ""); goTo.marker('15'); -verify.memberListContains("c", "class extMod.m1.m2.c", "class comment;"); +verify.memberListContains("c", "(constructor) extMod.m1.m2.c(): extMod.m1.m2.c", ""); verify.memberListContains("i", "(var) extMod.m1.m2.i: extMod.m1.m2.c", "i"); diff --git a/tests/cases/fourslash/commentsFunction.ts b/tests/cases/fourslash/commentsFunction.ts index 3a4e4e4dcc2..3af718fc967 100644 --- a/tests/cases/fourslash/commentsFunction.ts +++ b/tests/cases/fourslash/commentsFunction.ts @@ -74,7 +74,7 @@ goTo.marker('12'); verify.quickInfoIs("(var) lambddaNoVarComment: (a: number, b: number) => number", ""); goTo.marker('13'); -verify.completionListContains('lambdaFoo', '(var) lambdaFoo: (a: number, b: number) => number', 'lamdaFoo var comment'); +verify.completionListContains('lambdaFoo', '(var) lambdaFoo: (a: number, b: number) => number', ''); verify.completionListContains('lambddaNoVarComment', '(var) lambddaNoVarComment: (a: number, b: number) => number', ''); goTo.marker('14'); diff --git a/tests/cases/fourslash/commentsImportDeclaration.ts b/tests/cases/fourslash/commentsImportDeclaration.ts index 192cb2763ca..7b34d2fade2 100644 --- a/tests/cases/fourslash/commentsImportDeclaration.ts +++ b/tests/cases/fourslash/commentsImportDeclaration.ts @@ -47,5 +47,5 @@ goTo.marker('9'); verify.quickInfoIs("(var) newVar: extMod.m1.m2.c", ""); goTo.marker('10'); -verify.memberListContains("c", "class extMod.m1.m2.c", "class comment;"); +verify.memberListContains("c", "(constructor) extMod.m1.m2.c(): extMod.m1.m2.c", ""); verify.memberListContains("i", "(var) extMod.m1.m2.i: extMod.m1.m2.c", "i"); diff --git a/tests/cases/fourslash/commentsInheritance.ts b/tests/cases/fourslash/commentsInheritance.ts index eaca1d79ccb..e8c2084d38d 100644 --- a/tests/cases/fourslash/commentsInheritance.ts +++ b/tests/cases/fourslash/commentsInheritance.ts @@ -223,7 +223,7 @@ goTo.marker('1'); verify.memberListContains("i1_p1", "(property) i1.i1_p1: number", "i1_p1"); verify.memberListContains("i1_f1", "(method) i1.i1_f1(): void", "i1_f1"); -verify.memberListContains("i1_l1", "(property) i1.i1_l1: () => void", "i1_l1"); +verify.memberListContains("i1_l1", "(property) i1.i1_l1: () => void", ""); verify.memberListContains("i1_nc_p1", "(property) i1.i1_nc_p1: number", ""); verify.memberListContains("i1_nc_f1", "(method) i1.i1_nc_f1(): void", ""); verify.memberListContains("i1_nc_l1", "(property) i1.i1_nc_l1: () => void", ""); @@ -278,10 +278,10 @@ verify.memberListContains("i1_nc_f1", "(method) c1.i1_nc_f1(): void", ""); verify.memberListContains("i1_nc_l1", "(property) c1.i1_nc_l1: () => void", ""); verify.memberListContains("p1", "(property) c1.p1: number", "c1_p1"); verify.memberListContains("f1", "(method) c1.f1(): void", "c1_f1"); -verify.memberListContains("l1", "(property) c1.l1: () => void", "c1_l1"); +verify.memberListContains("l1", "(property) c1.l1: () => void", ""); verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", "c1_nc_p1"); verify.memberListContains("nc_f1", "(method) c1.nc_f1(): void", "c1_nc_f1"); -verify.memberListContains("nc_l1", "(property) c1.nc_l1: () => void", "c1_nc_l1"); +verify.memberListContains("nc_l1", "(property) c1.nc_l1: () => void", ""); goTo.marker('7'); verify.currentSignatureHelpDocCommentIs(""); goTo.marker('8'); @@ -321,7 +321,7 @@ verify.quickInfoIs("(property) c1.nc_l1: () => void", ""); goTo.marker('11'); verify.memberListContains("i1_p1", "(property) i1.i1_p1: number", "i1_p1"); verify.memberListContains("i1_f1", "(method) i1.i1_f1(): void", "i1_f1"); -verify.memberListContains("i1_l1", "(property) i1.i1_l1: () => void", "i1_l1"); +verify.memberListContains("i1_l1", "(property) i1.i1_l1: () => void", ""); verify.memberListContains("i1_nc_p1", "(property) i1.i1_nc_p1: number", ""); verify.memberListContains("i1_nc_f1", "(method) i1.i1_nc_f1(): void", ""); verify.memberListContains("i1_nc_l1", "(property) i1.i1_nc_l1: () => void", ""); @@ -508,13 +508,13 @@ verify.completionListContains("c4_i", "(var) c4_i: c4", ""); goTo.marker('36'); verify.memberListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1"); verify.memberListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1"); -verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", "i2_l1"); +verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", ""); verify.memberListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", ""); verify.memberListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", ""); verify.memberListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", ""); verify.memberListContains("p1", "(property) i2.p1: number", "i2 p1"); verify.memberListContains("f1", "(method) i2.f1(): void", "i2 f1"); -verify.memberListContains("l1", "(property) i2.l1: () => void", "i2 l1"); +verify.memberListContains("l1", "(property) i2.l1: () => void", ""); verify.memberListContains("nc_p1", "(property) i2.nc_p1: number", ""); verify.memberListContains("nc_f1", "(method) i2.nc_f1(): void", ""); verify.memberListContains("nc_l1", "(property) i2.nc_l1: () => void", ""); @@ -559,13 +559,13 @@ verify.quickInfoIs("(property) i2.nc_l1: () => void", ""); goTo.marker('41'); verify.memberListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1"); verify.memberListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1"); -verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", "i2_l1"); +verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", ""); verify.memberListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", ""); verify.memberListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", ""); verify.memberListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", ""); verify.memberListContains("p1", "(property) i3.p1: number", "i3 p1"); verify.memberListContains("f1", "(method) i3.f1(): void", "i3 f1"); -verify.memberListContains("l1", "(property) i3.l1: () => void", "i3 l1"); +verify.memberListContains("l1", "(property) i3.l1: () => void", ""); verify.memberListContains("nc_p1", "(property) i3.nc_p1: number", ""); verify.memberListContains("nc_f1", "(method) i3.nc_f1(): void", ""); verify.memberListContains("nc_l1", "(property) i3.nc_l1: () => void", ""); @@ -606,13 +606,13 @@ verify.quickInfoIs("(property) i3.nc_l1: () => void", ""); goTo.marker('46'); verify.memberListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1"); verify.memberListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1"); -verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", "i2_l1"); +verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", ""); verify.memberListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", ""); verify.memberListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", ""); verify.memberListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", ""); verify.memberListContains("p1", "(property) i2.p1: number", "i2 p1"); verify.memberListContains("f1", "(method) i2.f1(): void", "i2 f1"); -verify.memberListContains("l1", "(property) i2.l1: () => void", "i2 l1"); +verify.memberListContains("l1", "(property) i2.l1: () => void", ""); verify.memberListContains("nc_p1", "(property) i2.nc_p1: number", ""); verify.memberListContains("nc_f1", "(method) i2.nc_f1(): void", ""); verify.memberListContains("nc_l1", "(property) i2.nc_l1: () => void", ""); diff --git a/tests/cases/fourslash/commentsInterface.ts b/tests/cases/fourslash/commentsInterface.ts index 02856242cee..d4a3d2dd924 100644 --- a/tests/cases/fourslash/commentsInterface.ts +++ b/tests/cases/fourslash/commentsInterface.ts @@ -235,7 +235,7 @@ verify.completionListContains("i3_i", "(var) i3_i: i3", ""); goTo.marker('41'); verify.quickInfoIs("(method) i3.f(a: number): string", "Function i3 f"); verify.memberListContains("f", "(method) i3.f(a: number): string", "Function i3 f"); -verify.memberListContains("l", "(property) i3.l: (b: number) => string", "i3 l"); +verify.memberListContains("l", "(property) i3.l: (b: number) => string", ""); verify.memberListContains("x", "(property) i3.x: number", "Comment i3 x"); verify.memberListContains("nc_f", "(method) i3.nc_f(a: number): string", ""); verify.memberListContains("nc_l", "(property) i3.nc_l: (b: number) => string", ""); diff --git a/tests/cases/fourslash/commentsModules.ts b/tests/cases/fourslash/commentsModules.ts index 06b45afe89e..90257079569 100644 --- a/tests/cases/fourslash/commentsModules.ts +++ b/tests/cases/fourslash/commentsModules.ts @@ -125,7 +125,7 @@ verify.quickInfoIs("(var) myvar: m1.m2.c", ""); goTo.marker('8'); verify.quickInfoIs("(constructor) m1.m2.c(): m1.m2.c", ""); -verify.memberListContains("c", "class m1.m2.c", "class comment;"); +verify.memberListContains("c", "(constructor) m1.m2.c(): m1.m2.c", ""); verify.memberListContains("i", "(var) m1.m2.i: m1.m2.c", "i"); goTo.marker('9'); @@ -138,7 +138,7 @@ verify.quickInfoIs("module m2.m3", "module comment of m2.m3"); goTo.marker('11'); verify.quickInfoIs("(constructor) m2.m3.c(): m2.m3.c", ""); -verify.memberListContains("c", "class m2.m3.c", "Exported class comment"); +verify.memberListContains("c", "(constructor) m2.m3.c(): m2.m3.c", ""); goTo.marker('12'); verify.completionListContains("m3", "module m3", ""); @@ -153,8 +153,8 @@ verify.memberListContains("m5", "module m3.m4.m5"); verify.quickInfoIs("module m3.m4.m5", "module comment of m3.m4.m5"); goTo.marker('15'); -verify.memberListContains("c", "class m3.m4.m5.c", "Exported class comment"); verify.quickInfoIs("(constructor) m3.m4.m5.c(): m3.m4.m5.c", ""); +verify.memberListContains("c", "(constructor) m3.m4.m5.c(): m3.m4.m5.c", ""); goTo.marker('16'); verify.completionListContains("m4", "module m4", ""); @@ -173,7 +173,7 @@ verify.memberListContains("m7", "module m4.m5.m6.m7"); verify.quickInfoIs("module m4.m5.m6.m7", ""); goTo.marker('20'); -verify.memberListContains("c", "class m4.m5.m6.m7.c", "Exported class comment"); +verify.memberListContains("c", "(constructor) m4.m5.m6.m7.c(): m4.m5.m6.m7.c", ""); verify.quickInfoIs("(constructor) m4.m5.m6.m7.c(): m4.m5.m6.m7.c", ""); goTo.marker('21'); @@ -193,7 +193,7 @@ verify.memberListContains("m8", "module m5.m6.m7.m8"); verify.quickInfoIs("module m5.m6.m7.m8", "module m8 comment"); goTo.marker('25'); -verify.memberListContains("c", "class m5.m6.m7.m8.c", "Exported class comment"); +verify.memberListContains("c", "(constructor) m5.m6.m7.m8.c(): m5.m6.m7.m8.c", ""); verify.quickInfoIs("(constructor) m5.m6.m7.m8.c(): m5.m6.m7.m8.c", ""); goTo.marker('26'); @@ -209,7 +209,7 @@ verify.memberListContains("m8", "module m6.m7.m8"); verify.quickInfoIs("module m6.m7.m8", ""); goTo.marker('29'); -verify.memberListContains("c", "class m6.m7.m8.c", "Exported class comment"); +verify.memberListContains("c", "(constructor) m6.m7.m8.c(): m6.m7.m8.c", ""); verify.quickInfoIs("(constructor) m6.m7.m8.c(): m6.m7.m8.c", ""); goTo.marker('30'); @@ -225,7 +225,7 @@ verify.memberListContains("m9", "module m7.m8.m9"); verify.quickInfoIs("module m7.m8.m9", "module m9 comment"); goTo.marker('33'); -verify.memberListContains("c", "class m7.m8.m9.c", "Exported class comment"); +verify.memberListContains("c", "(constructor) m7.m8.m9.c(): m7.m8.m9.c", ""); verify.quickInfoIs("(constructor) m7.m8.m9.c(): m7.m8.m9.c", ""); goTo.marker('34'); diff --git a/tests/cases/fourslash/externalModuleWithExportAssignment.ts b/tests/cases/fourslash/externalModuleWithExportAssignment.ts index 952640f2c6c..1cbaf4f518c 100644 --- a/tests/cases/fourslash/externalModuleWithExportAssignment.ts +++ b/tests/cases/fourslash/externalModuleWithExportAssignment.ts @@ -37,7 +37,7 @@ verify.quickInfoIs("(var) a: {\n (): a1.connectExport;\n test1: a1.connect goTo.marker('3'); verify.quickInfoIs("(property) test1: a1.connectModule(res: any, req: any, next: any) => void", undefined); -verify.completionListContains("test1", "(property) test1: a1.connectModule", undefined); +verify.completionListContains("test1", "(property) test1: a1.connectModule(res: any, req: any, next: any) => void", undefined); verify.completionListContains("test2", "(method) test2(): a1.connectModule", undefined); verify.not.completionListContains("connectModule"); verify.not.completionListContains("connectExport"); @@ -59,7 +59,7 @@ verify.quickInfoIs("(var) r2: a1.connectExport", undefined); goTo.marker('9'); verify.quickInfoIs("(property) test1: a1.connectModule(res: any, req: any, next: any) => void", undefined); -verify.completionListContains("test1", "(property) test1: a1.connectModule", undefined); +verify.completionListContains("test1", "(property) test1: a1.connectModule(res: any, req: any, next: any) => void", undefined); verify.completionListContains("test2", "(method) test2(): a1.connectModule", undefined); verify.completionListContains("connectModule"); verify.completionListContains("connectExport"); From d327873d7b3b9ec248c5d65e9874d89cc4661a46 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 23 Oct 2014 12:52:42 -0700 Subject: [PATCH 07/28] Fix issue #764, select the correct scope node if not left of a dot --- src/services/services.ts | 3 ++- .../fourslash/completionListAfterFunction.ts | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/completionListAfterFunction.ts diff --git a/src/services/services.ts b/src/services/services.ts index 77fa907956d..9b98b1a0eb3 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2529,7 +2529,8 @@ module ts { // we are at the end of a container node, we do not want to be inside it, as that would affect our completion results // e.g. function f(a) {}| <- 'a' should not be visible here - if (token && token.kind === SyntaxKind.CloseBraceToken && position === token.end) { + if (token && position === token.end && (token.kind === SyntaxKind.CloseBraceToken || token.kind === SyntaxKind.SemicolonToken)) { + node = getTokenAtPosition(sourceFile, position); } } diff --git a/tests/cases/fourslash/completionListAfterFunction.ts b/tests/cases/fourslash/completionListAfterFunction.ts new file mode 100644 index 00000000000..140c5e2e363 --- /dev/null +++ b/tests/cases/fourslash/completionListAfterFunction.ts @@ -0,0 +1,25 @@ +/// + +////// Outside the function +////declare function f1(a: number);/*1*/ +//// +////// inside the function +////declare function f2(b: number, b2 = /*2*/ +//// +////// Outside the function +////function f3(c: number) { }/*3*/ +//// +////// inside the function +////function f4(d: number) { /*4*/} + +goTo.marker("1"); +verify.not.completionListContains("a"); + +goTo.marker("2"); +verify.completionListContains("b"); + +goTo.marker("3"); +verify.not.completionListContains("c"); + +goTo.marker("4"); +verify.completionListContains("d"); From 48404452b825551a950c650852a369182a825d3f Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 23 Oct 2014 13:42:56 -0700 Subject: [PATCH 08/28] Cleanup completion list logic: - Do not walk the tree multiple times for the same session, instead pass along the previous token - Use current token if the this is not after a dot to avoid running into scoping issues - Also, add some documentation about different steps --- src/services/services.ts | 120 ++++++++++----------- tests/cases/fourslash/commentsOverloads.ts | 6 +- 2 files changed, 56 insertions(+), 70 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index 36561dd8f85..7ba2b11c48c 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2003,8 +2003,8 @@ module ts { } /** Returns true if the position is within a comment */ - function isInsideComment(sourceFile: SourceFile, position: number): boolean { - var token = getTokenAtPosition(sourceFile, position); + function isInsideComment(token: Node, position: number): boolean { + var sourceFile = token.getSourceFile(); // The position has to be: 1. in the leading trivia (before tokek.getStart()), and 2. within a comment return position <= token.getStart() && @@ -2348,48 +2348,38 @@ module ts { }); } - function isCompletionListBlocker(sourceFile: SourceFile, position: number): boolean { - // We shouldn't be getting a position that is outside the file because - // isEntirelyInsideComment can't handle when the position is out of bounds, - // callers should be fixed, however we should be resilient to bad inputs - // so we return true (this position is a blocker for getting completions) - if (position < 0 || position > sourceFile.end) { - return true; - } - - // This method uses Fidelity completely. Some information can be reached using the AST, but not everything. - return isInsideComment(sourceFile, position) || - isEntirelyInStringOrRegularExpressionLiteral(sourceFile, position) || - isIdentifierDefinitionLocation(sourceFile, position) || - isRightOfIllegalDot(sourceFile, position); + function isCompletionListBlocker(previousToken: Node): boolean { + return isInStringOrRegularExpressionLiteral(previousToken) || + isIdentifierDefinitionLocation(previousToken) || + isRightOfIllegalDot(previousToken); } - function isEntirelyInStringOrRegularExpressionLiteral(sourceFile: SourceFile, position: number): boolean { - var token = getTouchingPropertyName(sourceFile, position); + function isInStringOrRegularExpressionLiteral(previousToken: Node): boolean { + //var token = getTouchingPropertyName(sourceFile, position); // || token.kind === SyntaxKind.RegularExpressionLiteral - if (token.kind === SyntaxKind.StringLiteral) { + if (previousToken.kind === SyntaxKind.StringLiteral) { // The position has to be either: 1. entirely within the token text, or // 2. at the end position, and the string literal is not terminated - var start = token.getStart(); - var end = token.getEnd(); + var start = previousToken.getStart(); + var end = previousToken.getEnd(); if (start < position && position < end) { return true; } else if (position === end) { var width = end - start; - return width <= 1 || sourceFile.text.charCodeAt(start) !== sourceFile.text.charCodeAt(end - 1); + var text = previousToken.getSourceFile().text; + return width <= 1 || text.charCodeAt(start) !== text.charCodeAt(end - 1); } } - else if (token.kind === SyntaxKind.RegularExpressionLiteral) { - return token.getStart() < position && position < token.getEnd(); + else if (previousToken.kind === SyntaxKind.RegularExpressionLiteral) { + return previousToken.getStart() < position && position < previousToken.getEnd(); } return false; } - function getContainingObjectLiteralApplicableForCompletion(sourceFile: SourceFile, position: number): ObjectLiteral { + function getContainingObjectLiteralApplicableForCompletion(previousToken: Node): ObjectLiteral { // The locations in an object literal expression that are applicable for completion are property name definition locations. - var previousToken = getNonIdentifierCompleteTokenOnLeft(sourceFile, position); if (previousToken) { var parent = previousToken.parent; @@ -2424,8 +2414,7 @@ module ts { return false; } - function isIdentifierDefinitionLocation(sourceFile: SourceFile, position: number): boolean { - var previousToken = getNonIdentifierCompleteTokenOnLeft(sourceFile, position); + function isIdentifierDefinitionLocation(previousToken: Node): boolean { if (previousToken) { var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { @@ -2480,20 +2469,7 @@ module ts { return false; } - function getNonIdentifierCompleteTokenOnLeft(sourceFile: SourceFile, position: number): Node { - var previousToken = findTokenOnLeftOfPosition(sourceFile, position); - - if (previousToken && position <= previousToken.end && previousToken.kind === SyntaxKind.Identifier) { - // The caret is at the end of an identifier, the decision to provide completion depends on the previous token - previousToken = findPrecedingToken(previousToken.pos, sourceFile); - } - - return previousToken; - } - - function isRightOfIllegalDot(sourceFile: SourceFile, position: number): boolean { - var previousToken = getNonIdentifierCompleteTokenOnLeft(sourceFile, position); - + function isRightOfIllegalDot(previousToken: Node): boolean { if (previousToken && previousToken.kind === SyntaxKind.NumericLiteral) { var text = previousToken.getFullText(); return text.charAt(text.length - 1) === "."; @@ -2538,33 +2514,45 @@ module ts { var sourceFile = getSourceFile(filename); - if (isCompletionListBlocker(sourceFile, position)) { + var currentToken = getTokenAtPosition(sourceFile, position); + + // Completion not allowed inside comments, bail out if this is the case + if (isInsideComment(currentToken, position)) { host.log("Returning an empty list because completion was blocked."); - return null; + return undefined; } - var node: Node; - var location: Node; - var isRightOfDot: boolean; - var token = getNonIdentifierCompleteTokenOnLeft(sourceFile, position); + // The decision to provide completion depends on the previous token, so find it + // Note: previousToken can be undefined if we are the beginning of the file + var previousToken = findPrecedingToken(position, sourceFile); - if (token && token.kind === SyntaxKind.DotToken && - (token.parent.kind === SyntaxKind.PropertyAccess || token.parent.kind === SyntaxKind.QualifiedName)) { - node = (token.parent).left; + // The caret is at the end of an identifier; this is a partial identifier that we want to complete: e.g. a.toS| + // Skip this partial identifier to the previous token + if (previousToken && position <= previousToken.end && previousToken.kind === SyntaxKind.Identifier) { + previousToken = findPrecedingToken(previousToken.pos, sourceFile); + } + + // Check if this is a valid completion location + if (previousToken && isCompletionListBlocker(previousToken)) { + host.log("Returning an empty list because completion was blocked."); + return undefined; + } + + // Find the node where completion is requested on, in the case of a completion after a dot, it is the member access expression + // other wise, it is a request for all visible symbols in the scope, and the node is the current location + var node: Node; + var isRightOfDot: boolean; + if (previousToken && previousToken.kind === SyntaxKind.DotToken && + (previousToken.parent.kind === SyntaxKind.PropertyAccess || previousToken.parent.kind === SyntaxKind.QualifiedName)) { + node = (previousToken.parent).left; isRightOfDot = true; } else { - node = !token ? sourceFile : token.parent; + node = currentToken; isRightOfDot = false; - - // we are at the end of a container node, we do not want to be inside it, as that would affect our completion results - // e.g. function f(a) {}| <- 'a' should not be visible here - if (token && position === token.end && (token.kind === SyntaxKind.CloseBraceToken || token.kind === SyntaxKind.SemicolonToken)) { - node = getTokenAtPosition(sourceFile, position); - } } - // Get the completions + // Clear the current activeCompletionSession for this session activeCompletionSession = { filename: filename, position: position, @@ -2573,8 +2561,9 @@ module ts { typeChecker: typeInfoResolver }; - // Right of dot member completion list + // Populate the completion list if (isRightOfDot) { + // Right of dot member completion list var symbols: Symbol[] = []; isMemberCompletion = true; @@ -2609,10 +2598,9 @@ module ts { getCompletionEntriesFromSymbols(symbols, activeCompletionSession); } else { - var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(sourceFile, position); - - // Object literal expression, look up possible property names from contextual type + var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(previousToken); if (containingObjectLiteral) { + // Object literal expression, look up possible property names from contextual type isMemberCompletion = true; var contextualType = typeInfoResolver.getContextualType(containingObjectLiteral); @@ -2627,9 +2615,10 @@ module ts { getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession); } } - // Get scope members else { + // Get scope members isMemberCompletion = false; + /// TODO filter meaning based on the current context var symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Import; var symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings); @@ -5150,7 +5139,8 @@ module ts { // OK, we have found a match in the file. This is only an acceptable match if // it is contained within a comment. - if (!isInsideComment(sourceFile, matchPosition)) { + var token = getTokenAtPosition(sourceFile, matchPosition); + if (!isInsideComment(token, matchPosition)) { continue; } diff --git a/tests/cases/fourslash/commentsOverloads.ts b/tests/cases/fourslash/commentsOverloads.ts index 3976fdeae4a..1e85346a17a 100644 --- a/tests/cases/fourslash/commentsOverloads.ts +++ b/tests/cases/fourslash/commentsOverloads.ts @@ -594,11 +594,7 @@ goTo.marker('64q'); verify.quickInfoIs("(constructor) c5(b: string): c5 (+1 overload)", "c5 2"); goTo.marker('65'); -//verify.completionListContains("c", "class c", ""); -// the below check is wrong and it should show it as class but currently we have a bug for adding the parameters of ambient function in the symbol list -// eg declare function foo2(x: number); -// completion list here -verify.completionListContains("c", "(parameter) c: boolean", ""); +verify.completionListContains("c", "class c", ""); verify.completionListContains("c1", "class c1", ""); verify.completionListContains("c2", "class c2", ""); verify.completionListContains("c3", "class c3", ""); From 3c32fcc8df4de513b4e3a387e539fca11c56a6d5 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 23 Oct 2014 13:44:10 -0700 Subject: [PATCH 09/28] Move helpers to the bottom of the function --- src/services/services.ts | 340 +++++++++++++++++++-------------------- 1 file changed, 170 insertions(+), 170 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index 7ba2b11c48c..cf04ba101b6 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2338,176 +2338,6 @@ module ts { } function getCompletionsAtPosition(filename: string, position: number, isMemberCompletion: boolean) { - function getCompletionEntriesFromSymbols(symbols: Symbol[], session: CompletionSession): void { - forEach(symbols, symbol => { - var entry = createCompletionEntry(symbol, session.typeChecker); - if (entry && !lookUp(session.symbols, entry.name)) { - session.entries.push(entry); - session.symbols[entry.name] = symbol; - } - }); - } - - function isCompletionListBlocker(previousToken: Node): boolean { - return isInStringOrRegularExpressionLiteral(previousToken) || - isIdentifierDefinitionLocation(previousToken) || - isRightOfIllegalDot(previousToken); - } - - function isInStringOrRegularExpressionLiteral(previousToken: Node): boolean { - //var token = getTouchingPropertyName(sourceFile, position); - - // || token.kind === SyntaxKind.RegularExpressionLiteral - if (previousToken.kind === SyntaxKind.StringLiteral) { - // The position has to be either: 1. entirely within the token text, or - // 2. at the end position, and the string literal is not terminated - var start = previousToken.getStart(); - var end = previousToken.getEnd(); - if (start < position && position < end) { - return true; - } - else if (position === end) { - var width = end - start; - var text = previousToken.getSourceFile().text; - return width <= 1 || text.charCodeAt(start) !== text.charCodeAt(end - 1); - } - } - else if (previousToken.kind === SyntaxKind.RegularExpressionLiteral) { - return previousToken.getStart() < position && position < previousToken.getEnd(); - } - return false; - } - - function getContainingObjectLiteralApplicableForCompletion(previousToken: Node): ObjectLiteral { - // The locations in an object literal expression that are applicable for completion are property name definition locations. - - if (previousToken) { - var parent = previousToken.parent; - - switch (previousToken.kind) { - case SyntaxKind.OpenBraceToken: // var x = { | - case SyntaxKind.CommaToken: // var x = { a: 0, | - if (parent && parent.kind === SyntaxKind.ObjectLiteral) { - return parent; - } - break; - } - } - - return undefined; - } - - function isFunction(kind: SyntaxKind): boolean { - switch (kind) { - case SyntaxKind.FunctionExpression: - case SyntaxKind.ArrowFunction: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.Method: - case SyntaxKind.Constructor: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.CallSignature: - case SyntaxKind.ConstructSignature: - case SyntaxKind.IndexSignature: - return true; - } - return false; - } - - function isIdentifierDefinitionLocation(previousToken: Node): boolean { - if (previousToken) { - var containingNodeKind = previousToken.parent.kind; - switch (previousToken.kind) { - case SyntaxKind.CommaToken: - return containingNodeKind === SyntaxKind.VariableDeclaration || - containingNodeKind === SyntaxKind.VariableStatement || - containingNodeKind === SyntaxKind.EnumDeclaration || // enum a { foo, | - isFunction(containingNodeKind); - - case SyntaxKind.OpenParenToken: - return containingNodeKind === SyntaxKind.CatchBlock || - isFunction(containingNodeKind); - - case SyntaxKind.OpenBraceToken: - return containingNodeKind === SyntaxKind.EnumDeclaration || // enum a { | - containingNodeKind === SyntaxKind.InterfaceDeclaration; // interface a { | - - case SyntaxKind.SemicolonToken: - return containingNodeKind === SyntaxKind.Property && - previousToken.parent.parent.kind === SyntaxKind.InterfaceDeclaration; // interface a { f; | - - case SyntaxKind.PublicKeyword: - case SyntaxKind.PrivateKeyword: - case SyntaxKind.StaticKeyword: - case SyntaxKind.DotDotDotToken: - return containingNodeKind === SyntaxKind.Parameter; - - case SyntaxKind.ClassKeyword: - case SyntaxKind.ModuleKeyword: - case SyntaxKind.EnumKeyword: - case SyntaxKind.InterfaceKeyword: - case SyntaxKind.FunctionKeyword: - case SyntaxKind.VarKeyword: - case SyntaxKind.GetKeyword: - case SyntaxKind.SetKeyword: - return true; - } - - // Previous token may have been a keyword that was converted to an identifier. - switch (previousToken.getText()) { - case "class": - case "interface": - case "enum": - case "module": - case "function": - case "var": - // TODO: add let and const - return true; - } - } - - return false; - } - - function isRightOfIllegalDot(previousToken: Node): boolean { - if (previousToken && previousToken.kind === SyntaxKind.NumericLiteral) { - var text = previousToken.getFullText(); - return text.charAt(text.length - 1) === "."; - } - - return false; - } - - function filterContextualMembersList(contextualMemberSymbols: Symbol[], existingMembers: Declaration[]): Symbol[] { - if (!existingMembers || existingMembers.length === 0) { - return contextualMemberSymbols; - } - - var existingMemberNames: Map = {}; - forEach(existingMembers, m => { - if (m.kind !== SyntaxKind.PropertyAssignment) { - // Ignore omitted expressions for missing members in the object literal - return; - } - - if (m.getStart() <= position && position <= m.getEnd()) { - // If this is the current item we are editing right now, do not filter it out - return; - } - - existingMemberNames[m.name.text] = true; - }); - - var filteredMembers: Symbol[] = []; - forEach(contextualMemberSymbols, s => { - if (!existingMemberNames[s.name]) { - filteredMembers.push(s); - } - }); - - return filteredMembers; - } - synchronizeHostData(); filename = TypeScript.switchToForwardSlashes(filename); @@ -2636,6 +2466,176 @@ module ts { isMemberCompletion: isMemberCompletion, entries: activeCompletionSession.entries }; + + function getCompletionEntriesFromSymbols(symbols: Symbol[], session: CompletionSession): void { + forEach(symbols, symbol => { + var entry = createCompletionEntry(symbol, session.typeChecker); + if (entry && !lookUp(session.symbols, entry.name)) { + session.entries.push(entry); + session.symbols[entry.name] = symbol; + } + }); + } + + function isCompletionListBlocker(previousToken: Node): boolean { + return isInStringOrRegularExpressionLiteral(previousToken) || + isIdentifierDefinitionLocation(previousToken) || + isRightOfIllegalDot(previousToken); + } + + function isInStringOrRegularExpressionLiteral(previousToken: Node): boolean { + //var token = getTouchingPropertyName(sourceFile, position); + + // || token.kind === SyntaxKind.RegularExpressionLiteral + if (previousToken.kind === SyntaxKind.StringLiteral) { + // The position has to be either: 1. entirely within the token text, or + // 2. at the end position, and the string literal is not terminated + var start = previousToken.getStart(); + var end = previousToken.getEnd(); + if (start < position && position < end) { + return true; + } + else if (position === end) { + var width = end - start; + var text = previousToken.getSourceFile().text; + return width <= 1 || text.charCodeAt(start) !== text.charCodeAt(end - 1); + } + } + else if (previousToken.kind === SyntaxKind.RegularExpressionLiteral) { + return previousToken.getStart() < position && position < previousToken.getEnd(); + } + return false; + } + + function getContainingObjectLiteralApplicableForCompletion(previousToken: Node): ObjectLiteral { + // The locations in an object literal expression that are applicable for completion are property name definition locations. + + if (previousToken) { + var parent = previousToken.parent; + + switch (previousToken.kind) { + case SyntaxKind.OpenBraceToken: // var x = { | + case SyntaxKind.CommaToken: // var x = { a: 0, | + if (parent && parent.kind === SyntaxKind.ObjectLiteral) { + return parent; + } + break; + } + } + + return undefined; + } + + function isFunction(kind: SyntaxKind): boolean { + switch (kind) { + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.Method: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.CallSignature: + case SyntaxKind.ConstructSignature: + case SyntaxKind.IndexSignature: + return true; + } + return false; + } + + function isIdentifierDefinitionLocation(previousToken: Node): boolean { + if (previousToken) { + var containingNodeKind = previousToken.parent.kind; + switch (previousToken.kind) { + case SyntaxKind.CommaToken: + return containingNodeKind === SyntaxKind.VariableDeclaration || + containingNodeKind === SyntaxKind.VariableStatement || + containingNodeKind === SyntaxKind.EnumDeclaration || // enum a { foo, | + isFunction(containingNodeKind); + + case SyntaxKind.OpenParenToken: + return containingNodeKind === SyntaxKind.CatchBlock || + isFunction(containingNodeKind); + + case SyntaxKind.OpenBraceToken: + return containingNodeKind === SyntaxKind.EnumDeclaration || // enum a { | + containingNodeKind === SyntaxKind.InterfaceDeclaration; // interface a { | + + case SyntaxKind.SemicolonToken: + return containingNodeKind === SyntaxKind.Property && + previousToken.parent.parent.kind === SyntaxKind.InterfaceDeclaration; // interface a { f; | + + case SyntaxKind.PublicKeyword: + case SyntaxKind.PrivateKeyword: + case SyntaxKind.StaticKeyword: + case SyntaxKind.DotDotDotToken: + return containingNodeKind === SyntaxKind.Parameter; + + case SyntaxKind.ClassKeyword: + case SyntaxKind.ModuleKeyword: + case SyntaxKind.EnumKeyword: + case SyntaxKind.InterfaceKeyword: + case SyntaxKind.FunctionKeyword: + case SyntaxKind.VarKeyword: + case SyntaxKind.GetKeyword: + case SyntaxKind.SetKeyword: + return true; + } + + // Previous token may have been a keyword that was converted to an identifier. + switch (previousToken.getText()) { + case "class": + case "interface": + case "enum": + case "module": + case "function": + case "var": + // TODO: add let and const + return true; + } + } + + return false; + } + + function isRightOfIllegalDot(previousToken: Node): boolean { + if (previousToken && previousToken.kind === SyntaxKind.NumericLiteral) { + var text = previousToken.getFullText(); + return text.charAt(text.length - 1) === "."; + } + + return false; + } + + function filterContextualMembersList(contextualMemberSymbols: Symbol[], existingMembers: Declaration[]): Symbol[] { + if (!existingMembers || existingMembers.length === 0) { + return contextualMemberSymbols; + } + + var existingMemberNames: Map = {}; + forEach(existingMembers, m => { + if (m.kind !== SyntaxKind.PropertyAssignment) { + // Ignore omitted expressions for missing members in the object literal + return; + } + + if (m.getStart() <= position && position <= m.getEnd()) { + // If this is the current item we are editing right now, do not filter it out + return; + } + + existingMemberNames[m.name.text] = true; + }); + + var filteredMembers: Symbol[] = []; + forEach(contextualMemberSymbols, s => { + if (!existingMemberNames[s.name]) { + filteredMembers.push(s); + } + }); + + return filteredMembers; + } } function getCompletionEntryDetails(filename: string, position: number, entryName: string): CompletionEntryDetails { From b6f4aa9da9052ee77091c5d07a8f87de2b0ebc4c Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 23 Oct 2014 14:08:04 -0700 Subject: [PATCH 10/28] Fix wrong condition for unterminated multi-line comments --- src/services/services.ts | 6 +++--- tests/cases/fourslash/completionListInComments3.ts | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index cf04ba101b6..3584e016227 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2025,9 +2025,9 @@ module ts { return true; } else { - // is unterminated multiline comment - return text.charCodeAt(comment.end - 1) !== CharacterCodes.slash && - text.charCodeAt(comment.end - 2) !== CharacterCodes.asterisk; + // is unterminated multi-line comment + return !(text.charCodeAt(comment.end - 1) === CharacterCodes.slash && + text.charCodeAt(comment.end - 2) === CharacterCodes.asterisk); } } return false; diff --git a/tests/cases/fourslash/completionListInComments3.ts b/tests/cases/fourslash/completionListInComments3.ts index 3f57929c1f4..2f20a969ba1 100644 --- a/tests/cases/fourslash/completionListInComments3.ts +++ b/tests/cases/fourslash/completionListInComments3.ts @@ -10,6 +10,8 @@ //// {| "name": "5" |}/* */ +/////* {| "name": "6" |} + goTo.marker("1"); verify.completionListIsEmpty(); @@ -22,5 +24,8 @@ verify.completionListIsEmpty(); goTo.marker("4"); verify.not.completionListIsEmpty(); -//goTo.marker("5"); -//verify.not.completionListIsEmpty(); +goTo.marker("5"); +verify.not.completionListIsEmpty(); + +goTo.marker("6"); +verify.completionListIsEmpty(); From 8f29661e01b170ec1df491caade466caccbb7fec Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 23 Oct 2014 14:30:43 -0700 Subject: [PATCH 11/28] Implementation of Type Aliases in compiler core --- src/compiler/binder.ts | 3 ++ src/compiler/checker.ts | 30 ++++++++++++++++++ .../diagnosticInformationMap.generated.ts | 1 + src/compiler/diagnosticMessages.json | 4 +++ src/compiler/parser.ts | 23 +++++++++++++- src/compiler/scanner.ts | 1 + src/compiler/types.ts | 31 ++++++++++++------- src/services/services.ts | 19 +++++++++++- 8 files changed, 99 insertions(+), 13 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index c9f9d6bf6e3..d8da47fb566 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -326,6 +326,9 @@ module ts { case SyntaxKind.InterfaceDeclaration: bindDeclaration(node, SymbolFlags.Interface, SymbolFlags.InterfaceExcludes); break; + case SyntaxKind.TypeAliasDeclaration: + bindDeclaration(node, SymbolFlags.TypeAlias, SymbolFlags.TypeAliasExcludes); + break; case SyntaxKind.EnumDeclaration: bindDeclaration(node, SymbolFlags.Enum, SymbolFlags.EnumExcludes); break; diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 229fcf51f17..876742d9edf 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -86,6 +86,7 @@ module ts { emitFiles: invokeEmitter, getParentOfSymbol: getParentOfSymbol, getTypeOfSymbol: getTypeOfSymbol, + getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, getSignaturesOfType: getSignaturesOfType, @@ -188,6 +189,7 @@ module ts { if (flags & SymbolFlags.GetAccessor) result |= SymbolFlags.GetAccessorExcludes; if (flags & SymbolFlags.SetAccessor) result |= SymbolFlags.SetAccessorExcludes; if (flags & SymbolFlags.TypeParameter) result |= SymbolFlags.TypeParameterExcludes; + if (flags & SymbolFlags.TypeAlias) result |= SymbolFlags.TypeAliasExcludes; if (flags & SymbolFlags.Import) result |= SymbolFlags.ImportExcludes; return result; } @@ -1907,6 +1909,24 @@ module ts { return links.declaredType; } + function getDeclaredTypeOfTypeAlias(symbol: Symbol): Type { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + links.declaredType = resolvingType; + var declaration = getDeclarationOfKind(symbol, SyntaxKind.TypeAliasDeclaration); + var type = getTypeFromTypeNode(declaration.type); + if (links.declaredType === resolvingType) { + links.declaredType = type; + } + } + else if (links.declaredType === resolvingType) { + links.declaredType = unknownType; + var declaration = getDeclarationOfKind(symbol, SyntaxKind.TypeAliasDeclaration); + error(declaration.name, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + } + return links.declaredType; + } + function getDeclaredTypeOfEnum(symbol: Symbol): Type { var links = getSymbolLinks(symbol); if (!links.declaredType) { @@ -1946,6 +1966,9 @@ module ts { if (symbol.flags & SymbolFlags.Interface) { return getDeclaredTypeOfInterface(symbol); } + if (symbol.flags & SymbolFlags.TypeAlias) { + return getDeclaredTypeOfTypeAlias(symbol); + } if (symbol.flags & SymbolFlags.Enum) { return getDeclaredTypeOfEnum(symbol); } @@ -7304,6 +7327,10 @@ module ts { } } + function checkTypeAliasDeclaration(node: TypeAliasDeclaration) { + checkSourceElement(node.type); + } + function getConstantValueForExpression(node: Expression): number { var isNegative = false; if (node.kind === SyntaxKind.PrefixOperator) { @@ -7596,6 +7623,8 @@ module ts { return checkClassDeclaration(node); case SyntaxKind.InterfaceDeclaration: return checkInterfaceDeclaration(node); + case SyntaxKind.TypeAliasDeclaration: + return checkTypeAliasDeclaration(node); case SyntaxKind.EnumDeclaration: return checkEnumDeclaration(node); case SyntaxKind.ModuleDeclaration: @@ -7840,6 +7869,7 @@ module ts { case SyntaxKind.TypeParameter: case SyntaxKind.ClassDeclaration: case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: case SyntaxKind.EnumDeclaration: return true; } diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index ac2a79c603d..b1de70a8b58 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -261,6 +261,7 @@ module ts { Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: DiagnosticCategory.Error, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: DiagnosticCategory.Error, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: DiagnosticCategory.Error, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, + Type_alias_0_circularly_references_itself: { code: 2448, category: DiagnosticCategory.Error, key: "Type alias '{0}' circularly references itself." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index d8895d15144..274cc0fd9be 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1036,6 +1036,10 @@ "category": "Error", "code": 2447 }, + "Type alias '{0}' circularly references itself.": { + "category": "Error", + "code": 2448 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index c755205ee3a..1fd1e3c2178 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -333,6 +333,9 @@ module ts { children((node).typeParameters) || children((node).baseTypes) || children((node).members); + case SyntaxKind.TypeAliasDeclaration: + return child((node).name) || + child((node).type); case SyntaxKind.EnumDeclaration: return child((node).name) || children((node).members); @@ -478,6 +481,7 @@ module ts { case SyntaxKind.SetAccessor: case SyntaxKind.ClassDeclaration: case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: case SyntaxKind.EnumDeclaration: case SyntaxKind.ModuleDeclaration: case SyntaxKind.ImportDeclaration: @@ -540,6 +544,7 @@ module ts { return node; case SyntaxKind.EnumDeclaration: case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: case SyntaxKind.ModuleDeclaration: case SyntaxKind.ImportDeclaration: // early exit cases - declarations cannot be nested in classes @@ -3075,6 +3080,7 @@ module ts { case SyntaxKind.ClassKeyword: case SyntaxKind.ModuleKeyword: case SyntaxKind.EnumKeyword: + case SyntaxKind.TypeKeyword: // When followed by an identifier, these do not start a statement but might // instead be following declarations if (isDeclaration()) { @@ -3626,7 +3632,18 @@ module ts { } return finishNode(node); } - + + function parseTypeAliasDeclaration(pos: number, flags: NodeFlags): TypeAliasDeclaration { + var node = createNode(SyntaxKind.TypeAliasDeclaration, pos); + node.flags = flags; + parseExpected(SyntaxKind.TypeKeyword); + node.name = parseIdentifier(); + parseExpected(SyntaxKind.EqualsToken); + node.type = parseType(); + parseSemicolon(); + return finishNode(node); + } + function parseAndCheckEnumDeclaration(pos: number, flags: NodeFlags): EnumDeclaration { function isIntegerLiteral(expression: Expression): boolean { function isInteger(literalExpression: LiteralExpression): boolean { @@ -3786,6 +3803,7 @@ module ts { case SyntaxKind.InterfaceKeyword: case SyntaxKind.EnumKeyword: case SyntaxKind.ImportKeyword: + case SyntaxKind.TypeKeyword: // Not true keywords so ensure an identifier follows return lookAhead(() => nextToken() >= SyntaxKind.Identifier); case SyntaxKind.ModuleKeyword: @@ -3841,6 +3859,9 @@ module ts { case SyntaxKind.InterfaceKeyword: result = parseInterfaceDeclaration(pos, flags); break; + case SyntaxKind.TypeKeyword: + result = parseTypeAliasDeclaration(pos, flags); + break; case SyntaxKind.EnumKeyword: result = parseAndCheckEnumDeclaration(pos, flags); break; diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 81d16b5f487..75b14801ae7 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -80,6 +80,7 @@ module ts { "throw": SyntaxKind.ThrowKeyword, "true": SyntaxKind.TrueKeyword, "try": SyntaxKind.TryKeyword, + "type": SyntaxKind.TypeKeyword, "typeof": SyntaxKind.TypeOfKeyword, "var": SyntaxKind.VarKeyword, "void": SyntaxKind.VoidKeyword, diff --git a/src/compiler/types.ts b/src/compiler/types.ts index ea58b1166c6..0df11239107 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -132,6 +132,7 @@ module ts { NumberKeyword, SetKeyword, StringKeyword, + TypeKeyword, // Parse tree nodes Missing, // Names @@ -202,6 +203,7 @@ module ts { FunctionBlock, ClassDeclaration, InterfaceDeclaration, + TypeAliasDeclaration, EnumDeclaration, ModuleDeclaration, ModuleBlock, @@ -518,6 +520,10 @@ module ts { members: NodeArray; } + export interface TypeAliasDeclaration extends Declaration { + type: TypeNode; + } + export interface EnumMember extends Declaration { initializer?: Expression; } @@ -643,6 +649,7 @@ module ts { emitFiles(targetSourceFile?: SourceFile): EmitResult; getParentOfSymbol(symbol: Symbol): Symbol; getTypeOfSymbol(symbol: Symbol): Type; + getDeclaredTypeOfSymbol(symbol: Symbol): Type; getPropertiesOfType(type: Type): Symbol[]; getPropertyOfType(type: Type, propertyName: string): Symbol; getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; @@ -780,22 +787,23 @@ module ts { ConstructSignature = 0x00010000, // Construct signature IndexSignature = 0x00020000, // Index signature TypeParameter = 0x00040000, // Type parameter + TypeAlias = 0x00080000, // Type alias // Export markers (see comment in declareModuleMember in binder) - ExportValue = 0x00080000, // Exported value marker - ExportType = 0x00100000, // Exported type marker - ExportNamespace = 0x00200000, // Exported namespace marker + ExportValue = 0x00100000, // Exported value marker + ExportType = 0x00200000, // Exported type marker + ExportNamespace = 0x00400000, // Exported namespace marker - Import = 0x00400000, // Import - Instantiated = 0x00800000, // Instantiated symbol - Merged = 0x01000000, // Merged symbol (created during program binding) - Transient = 0x02000000, // Transient symbol (created during type check) - Prototype = 0x04000000, // Prototype property (no source representation) - UnionProperty = 0x08000000, // Property in union type + Import = 0x00800000, // Import + Instantiated = 0x01000000, // Instantiated symbol + Merged = 0x02000000, // Merged symbol (created during program binding) + Transient = 0x04000000, // Transient symbol (created during type check) + Prototype = 0x08000000, // Prototype property (no source representation) + UnionProperty = 0x10000000, // Property in union type Value = Variable | Property | EnumMember | Function | Class | Enum | ValueModule | Method | GetAccessor | SetAccessor, - Type = Class | Interface | Enum | TypeLiteral | ObjectLiteral | TypeParameter, + Type = Class | Interface | Enum | TypeLiteral | ObjectLiteral | TypeParameter | TypeAlias, Namespace = ValueModule | NamespaceModule, Module = ValueModule | NamespaceModule, Accessor = GetAccessor | SetAccessor, @@ -815,11 +823,12 @@ module ts { GetAccessorExcludes = Value & ~SetAccessor, SetAccessorExcludes = Value & ~GetAccessor, TypeParameterExcludes = Type & ~TypeParameter, + TypeAliasExcludes = Type, // Imports collide with all other imports with the same name. ImportExcludes = Import, - ModuleMember = Variable | Function | Class | Interface | Enum | Module | Import, + ModuleMember = Variable | Function | Class | Interface | Enum | Module | TypeAlias | Import, ExportHasLocal = Function | Class | Enum | ValueModule, diff --git a/src/services/services.ts b/src/services/services.ts index 162aa4ae201..3050b99c2d4 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -706,6 +706,7 @@ module ts { case SyntaxKind.ClassDeclaration: case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: case SyntaxKind.EnumDeclaration: case SyntaxKind.ModuleDeclaration: case SyntaxKind.ImportDeclaration: @@ -1186,6 +1187,9 @@ module ts { // interface Y {} static interfaceElement = "interface"; + // type T = ... + static typeElement = "type"; + // enum E static enumElement = "enum"; @@ -2695,6 +2699,7 @@ module ts { if (flags & SymbolFlags.Class) return ScriptElementKind.classElement; if (flags & SymbolFlags.Enum) return ScriptElementKind.enumElement; + if (flags & SymbolFlags.TypeAlias) return ScriptElementKind.typeElement; if (flags & SymbolFlags.Interface) return ScriptElementKind.interfaceElement; if (flags & SymbolFlags.TypeParameter) return ScriptElementKind.typeParameterElement; @@ -2763,6 +2768,7 @@ module ts { case SyntaxKind.ModuleDeclaration: return ScriptElementKind.moduleElement; case SyntaxKind.ClassDeclaration: return ScriptElementKind.classElement; case SyntaxKind.InterfaceDeclaration: return ScriptElementKind.interfaceElement; + case SyntaxKind.TypeAliasDeclaration: return ScriptElementKind.typeElement; case SyntaxKind.EnumDeclaration: return ScriptElementKind.enumElement; case SyntaxKind.VariableDeclaration: return ScriptElementKind.variableElement; case SyntaxKind.FunctionDeclaration: return ScriptElementKind.functionElement; @@ -2777,8 +2783,8 @@ module ts { case SyntaxKind.TypeParameter: return ScriptElementKind.typeParameterElement; case SyntaxKind.EnumMember: return ScriptElementKind.variableElement; case SyntaxKind.Parameter: return (node.flags & NodeFlags.AccessibilityModifier) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - return ScriptElementKind.unknown; } + return ScriptElementKind.unknown; } function getSymbolModifiers(symbol: Symbol): string { @@ -2916,6 +2922,16 @@ module ts { addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } + if (symbolFlags & SymbolFlags.TypeAlias) { + addNewLineIfDisplayPartsExist(); + displayParts.push(keywordPart(SyntaxKind.TypeKeyword)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + displayParts.push(spacePart()); + displayParts.push(punctuationPart(SyntaxKind.EqualsToken)); + displayParts.push(spacePart()); + displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); + } if (symbolFlags & SymbolFlags.Enum) { addNewLineIfDisplayPartsExist(); displayParts.push(keywordPart(SyntaxKind.EnumKeyword)); @@ -4503,6 +4519,7 @@ module ts { case SyntaxKind.TypeParameter: case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: case SyntaxKind.TypeLiteral: return SemanticMeaning.Type; From 7a3761421faf7573c3837e7848a38eb622259d75 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 24 Oct 2014 13:00:23 -0700 Subject: [PATCH 12/28] Use type alias names in aliased recursive type literals --- src/compiler/checker.ts | 24 ++++++++++++++++++++++-- src/compiler/types.ts | 4 ++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 876742d9edf..dd2861d8e46 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -991,6 +991,19 @@ module ts { return result; } + function getTypeAliasForTypeLiteral(type: Type): Symbol { + if (type.symbol && type.symbol.flags & SymbolFlags.TypeLiteral) { + var node = type.symbol.declarations[0].parent; + while (node.kind === SyntaxKind.ParenType) { + node = node.parent; + } + if (node.kind === SyntaxKind.TypeAliasDeclaration) { + return getSymbolOfNode(node); + } + } + return undefined; + } + // This is for caching the result of getSymbolDisplayBuilder. Do not access directly. var _displayBuilder: SymbolDisplayBuilder; function getSymbolDisplayBuilder(): SymbolDisplayBuilder { @@ -1181,8 +1194,15 @@ module ts { writeTypeofSymbol(type); } else if (typeStack && contains(typeStack, type)) { - // Recursive usage, use any - writeKeyword(writer, SyntaxKind.AnyKeyword); + // If type is an anonymous type literal in a type alias declaration, use type alias name + var typeAlias = getTypeAliasForTypeLiteral(type); + if (typeAlias) { + buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, SymbolFlags.Type); + } + else { + // Recursive usage, use any + writeKeyword(writer, SyntaxKind.AnyKeyword); + } } else { if (!typeStack) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 0df11239107..0124b8d2c50 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -224,7 +224,7 @@ module ts { FirstReservedWord = BreakKeyword, LastReservedWord = WithKeyword, FirstKeyword = BreakKeyword, - LastKeyword = StringKeyword, + LastKeyword = TypeKeyword, FirstFutureReservedWord = ImplementsKeyword, LastFutureReservedWord = YieldKeyword, FirstTypeNode = TypeReference, @@ -232,7 +232,7 @@ module ts { FirstPunctuation = OpenBraceToken, LastPunctuation = CaretEqualsToken, FirstToken = EndOfFileToken, - LastToken = StringKeyword, + LastToken = TypeKeyword, FirstTriviaToken = SingleLineCommentTrivia, LastTriviaToken = WhitespaceTrivia } From f3b1e94d6879f6ddb810aee53eb8007f9cc187f2 Mon Sep 17 00:00:00 2001 From: Jed Mao Date: Sat, 25 Oct 2014 01:27:02 -0500 Subject: [PATCH 13/28] Introduce .editorconfig file --- .editorconfig | 16 ++++++++++ package.json | 88 +++++++++++++++++++++++++-------------------------- 2 files changed, 60 insertions(+), 44 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000000..0879f3c6c7d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# http://editorconfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.json] +indent_size = 2 + +[*.yml] +indent_size = 2 diff --git a/package.json b/package.json index 00752302254..535a666a4f9 100644 --- a/package.json +++ b/package.json @@ -1,46 +1,46 @@ { - "name": "typescript", - "author": "Microsoft Corp.", - "homepage": "http://typescriptlang.org/", - "version": "1.3.0", - "licenses": [ - { - "type": "Apache License 2.0", - "url": "https://github.com/Microsoft/TypeScript/blob/master/LICENSE.txt" - } - ], - "description": "TypeScript is a language for application scale JavaScript development", - "keywords": [ - "TypeScript", - "Microsoft", - "compiler", - "language", - "javascript" - ], - "bugs": { - "url" : "https://github.com/Microsoft/TypeScript/issues" - }, - "repository" : { - "type" : "git", - "url" : "https://github.com/Microsoft/TypeScript.git" - }, - "preferGlobal" : true, - "main" : "./bin/tsc.js", - "bin" : { - "tsc" : "./bin/tsc" - }, - "engines" : { - "node" : ">=0.8.0" - }, - "devDependencies": { - "jake" : "latest", - "mocha" : "latest", - "chai" : "latest", - "browserify" : "latest", - "istanbul": "latest", - "codeclimate-test-reporter": "latest" - }, - "scripts": { - "test": "jake generate-code-coverage" - } + "name": "typescript", + "author": "Microsoft Corp.", + "homepage": "http://typescriptlang.org/", + "version": "1.3.0", + "licenses": [ + { + "type": "Apache License 2.0", + "url": "https://github.com/Microsoft/TypeScript/blob/master/LICENSE.txt" + } + ], + "description": "TypeScript is a language for application scale JavaScript development", + "keywords": [ + "TypeScript", + "Microsoft", + "compiler", + "language", + "javascript" + ], + "bugs": { + "url": "https://github.com/Microsoft/TypeScript/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/TypeScript.git" + }, + "preferGlobal": true, + "main": "./bin/tsc.js", + "bin": { + "tsc": "./bin/tsc" + }, + "engines": { + "node": ">=0.8.0" + }, + "devDependencies": { + "browserify": "latest", + "chai": "latest", + "codeclimate-test-reporter": "latest", + "istanbul": "latest", + "jake": "latest", + "mocha": "latest" + }, + "scripts": { + "test": "jake generate-code-coverage" + } } From 218064d8b4a8d1ea4fad00ff339e13318c8ee627 Mon Sep 17 00:00:00 2001 From: Jed Mao Date: Sat, 25 Oct 2014 01:34:08 -0500 Subject: [PATCH 14/28] Introduce .gitattributes file --- .gitattributes | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..e186d4ff06b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,14 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain From 7f9c9b6825770b79692387efc99154d05d6b1066 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 25 Oct 2014 10:48:02 -0700 Subject: [PATCH 15/28] Support for type aliases in .d.ts generation --- src/compiler/checker.ts | 1 + .../diagnosticInformationMap.generated.ts | 3 ++ src/compiler/diagnosticMessages.json | 12 ++++++++ src/compiler/emitter.ts | 28 +++++++++++++++++++ 4 files changed, 44 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 827a9a281d8..d024d03e0ec 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1552,6 +1552,7 @@ module ts { case SyntaxKind.ModuleDeclaration: case SyntaxKind.ClassDeclaration: case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: case SyntaxKind.FunctionDeclaration: case SyntaxKind.EnumDeclaration: case SyntaxKind.ImportDeclaration: diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 01115004483..611aa38c1f3 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -351,6 +351,9 @@ module ts { Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, + Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4079, category: DiagnosticCategory.Error, key: "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2: { code: 4080, category: DiagnosticCategory.Error, key: "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: DiagnosticCategory.Error, key: "Exported type alias '{0}' has or is using private name '{1}'." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: DiagnosticCategory.Error, key: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: DiagnosticCategory.Error, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: DiagnosticCategory.Error, key: "Cannot read file '{0}': {1}" }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 305bb8bd2a3..d11ec004cb7 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1401,6 +1401,18 @@ "category": "Error", "code": 4078 }, + "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4079 + }, + "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4080 + }, + "Exported type alias '{0}' has or is using private name '{1}'.": { + "category": "Error", + "code": 4081 + }, "The current host does not support the '{0}' option.": { diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 1517584e4c8..bc27520d87c 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2566,6 +2566,32 @@ module ts { } } + function emitTypeAliasDeclaration(node: TypeAliasDeclaration) { + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitDeclarationFlags(node); + write("type "); + emitSourceTextOfNode(node.name); + write(" = "); + getSymbolVisibilityDiagnosticMessage = getTypeAliasDeclarationVisibilityError; + resolver.writeTypeAtLocation(node.type, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + write(";"); + writeLine(); + } + function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { + var diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : + Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1; + return { + diagnosticMessage: diagnosticMessage, + errorNode: node, + typeName: node.name + }; + } + } + function emitEnumDeclaration(node: EnumDeclaration) { if (resolver.isDeclarationVisible(node)) { emitJsDocComments(node); @@ -3163,6 +3189,8 @@ module ts { return emitInterfaceDeclaration(node); case SyntaxKind.ClassDeclaration: return emitClassDeclaration(node); + case SyntaxKind.TypeAliasDeclaration: + return emitTypeAliasDeclaration(node); case SyntaxKind.EnumMember: return emitEnumMemberDeclaration(node); case SyntaxKind.EnumDeclaration: From 962c4de875640f0dd0716687f12b0aa59fbbbabb Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 27 Oct 2014 15:30:38 -0700 Subject: [PATCH 16/28] Address code review comments --- src/services/services.ts | 9 ++++----- .../cases/fourslash/completionListAfterFunction2.ts | 13 +++++++++++++ .../cases/fourslash/completionListAfterFunction3.ts | 12 ++++++++++++ 3 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 tests/cases/fourslash/completionListAfterFunction2.ts create mode 100644 tests/cases/fourslash/completionListAfterFunction3.ts diff --git a/src/services/services.ts b/src/services/services.ts index 3584e016227..9270a3115dc 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2021,7 +2021,7 @@ module ts { var text = sourceFile.text; var width = comment.end - comment.pos; // is single line comment or just /* - if (width <=2 || text.charCodeAt(comment.pos + 1) === CharacterCodes.slash) { + if (width <= 2 || text.charCodeAt(comment.pos + 1) === CharacterCodes.slash) { return true; } else { @@ -2484,9 +2484,6 @@ module ts { } function isInStringOrRegularExpressionLiteral(previousToken: Node): boolean { - //var token = getTouchingPropertyName(sourceFile, position); - - // || token.kind === SyntaxKind.RegularExpressionLiteral if (previousToken.kind === SyntaxKind.StringLiteral) { // The position has to be either: 1. entirely within the token text, or // 2. at the end position, and the string literal is not terminated @@ -2498,7 +2495,9 @@ module ts { else if (position === end) { var width = end - start; var text = previousToken.getSourceFile().text; - return width <= 1 || text.charCodeAt(start) !== text.charCodeAt(end - 1); + return width <= 1 || + text.charCodeAt(start) !== text.charCodeAt(end - 1) || + text.charCodeAt(end - 2) === CharacterCodes.backslash; } } else if (previousToken.kind === SyntaxKind.RegularExpressionLiteral) { diff --git a/tests/cases/fourslash/completionListAfterFunction2.ts b/tests/cases/fourslash/completionListAfterFunction2.ts new file mode 100644 index 00000000000..c123e084972 --- /dev/null +++ b/tests/cases/fourslash/completionListAfterFunction2.ts @@ -0,0 +1,13 @@ +/// + +////// Outside the function expression +////declare var f1: (a: number) => void; /*1*/ +//// +////declare var f1: (b: number, b2: /*2*/) => void; + +goTo.marker("1"); +verify.not.completionListContains("a"); + +goTo.marker("2"); +verify.completionListContains("b"); + diff --git a/tests/cases/fourslash/completionListAfterFunction3.ts b/tests/cases/fourslash/completionListAfterFunction3.ts new file mode 100644 index 00000000000..575351ea648 --- /dev/null +++ b/tests/cases/fourslash/completionListAfterFunction3.ts @@ -0,0 +1,12 @@ +/// + +////// Outside the function expression +////var x1 = (a: number) => { }/*1*/; +//// +////var x2 = (b: number) => {/*2*/ }; + +goTo.marker("1"); +verify.not.completionListContains("a"); + +goTo.marker("2"); +verify.completionListContains("b"); From a32521de12344e7b509cdec9b285373ed0bfafa4 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 27 Oct 2014 16:53:21 -0700 Subject: [PATCH 17/28] Making it an error to alias an object type literal --- src/compiler/diagnosticInformationMap.generated.ts | 1 + src/compiler/diagnosticMessages.json | 4 ++++ src/compiler/parser.ts | 7 +++++++ 3 files changed, 12 insertions(+) diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 611aa38c1f3..a04407454fb 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -120,6 +120,7 @@ module ts { const_declarations_must_be_initialized: { code: 1155, category: DiagnosticCategory.Error, key: "'const' declarations must be initialized" }, const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: DiagnosticCategory.Error, key: "'const' declarations can only be declared inside a block." }, let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: DiagnosticCategory.Error, key: "'let' declarations can only be declared inside a block." }, + Aliased_type_cannot_be_an_object_type_literal_Use_an_interface_declaration_instead: { code: 1158, category: DiagnosticCategory.Error, key: "Aliased type cannot be an object type literal. Use an interface declaration instead." }, Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index d11ec004cb7..c2086f6eaa9 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -471,6 +471,10 @@ "category": "Error", "code": 1157 }, + "Aliased type cannot be an object type literal. Use an interface declaration instead.": { + "category": "Error", + "code": 1158 + }, "Duplicate identifier '{0}'.": { "category": "Error", diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index db7aeeead75..1ffdab29752 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3761,6 +3761,13 @@ module ts { parseExpected(SyntaxKind.EqualsToken); node.type = parseType(); parseSemicolon(); + var n = node.type; + while (n.kind === SyntaxKind.ParenType) { + n = (n).type; + } + if (n.kind === SyntaxKind.TypeLiteral && (n.pos !== (n).members.pos || n.end !== (n).members.end)) { + grammarErrorOnNode(node.type, Diagnostics.Aliased_type_cannot_be_an_object_type_literal_Use_an_interface_declaration_instead); + } return finishNode(node); } From 6e77e2e81054c8e1aaa8ed720c2ec2e305f64085 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 28 Oct 2014 00:28:59 -0700 Subject: [PATCH 18/28] Removed colons from diagnostic messages. Also got rid of the 'terminalMessages' concept. --- src/compiler/checker.ts | 76 +++--- .../diagnosticInformationMap.generated.ts | 18 +- src/compiler/diagnosticMessages.json | 40 +-- ...addMoreOverloadsToBaseSignature.errors.txt | 10 +- .../reference/aliasAssignments.errors.txt | 6 +- .../apparentTypeSubtyping.errors.txt | 10 +- .../apparentTypeSupertype.errors.txt | 10 +- ...indsToFunctionScopeArgumentList.errors.txt | 6 +- .../reference/arrayAssignmentTest1.errors.txt | 150 +++++------ .../reference/arrayAssignmentTest2.errors.txt | 72 +++--- .../reference/arrayAssignmentTest4.errors.txt | 12 +- .../reference/arrayAssignmentTest5.errors.txt | 10 +- .../baselines/reference/arrayCast.errors.txt | 10 +- .../reference/arraySigChecking.errors.txt | 20 +- .../reference/arrayTypeOfTypeOf.errors.txt | 6 +- .../reference/assignmentCompat1.errors.txt | 12 +- ...nmentCompatBetweenTupleAndArray.errors.txt | 24 +- .../reference/assignmentCompatBug2.errors.txt | 30 +-- ...CompatFunctionsWithOptionalArgs.errors.txt | 4 +- ...ignmentCompatWithCallSignatures.errors.txt | 80 +++--- ...gnmentCompatWithCallSignatures2.errors.txt | 120 ++++----- ...gnmentCompatWithCallSignatures4.errors.txt | 52 ++-- ...allSignaturesWithRestParameters.errors.txt | 90 +++---- ...tCompatWithConstructSignatures2.errors.txt | 88 +++---- ...tCompatWithConstructSignatures4.errors.txt | 92 +++---- ...ignmentCompatWithNumericIndexer.errors.txt | 76 +++--- ...gnmentCompatWithNumericIndexer2.errors.txt | 76 +++--- ...gnmentCompatWithNumericIndexer3.errors.txt | 38 +-- ...ignmentCompatWithObjectMembers4.errors.txt | 238 +++++++++--------- ...ignmentCompatWithObjectMembers5.errors.txt | 12 +- ...tWithObjectMembersAccessibility.errors.txt | 144 +++++------ ...patWithObjectMembersOptionality.errors.txt | 36 +-- ...atWithObjectMembersOptionality2.errors.txt | 54 ++-- ...ObjectMembersStringNumericNames.errors.txt | 174 ++++++------- .../assignmentCompatWithOverloads.errors.txt | 32 +-- ...signmentCompatWithStringIndexer.errors.txt | 104 ++++---- ...ignmentCompatWithStringIndexer2.errors.txt | 104 ++++---- ...ignmentCompatWithStringIndexer3.errors.txt | 20 +- .../assignmentCompatability10.errors.txt | 6 +- .../assignmentCompatability11.errors.txt | 10 +- .../assignmentCompatability12.errors.txt | 10 +- .../assignmentCompatability13.errors.txt | 6 +- .../assignmentCompatability14.errors.txt | 10 +- .../assignmentCompatability15.errors.txt | 10 +- .../assignmentCompatability16.errors.txt | 14 +- .../assignmentCompatability17.errors.txt | 14 +- .../assignmentCompatability18.errors.txt | 14 +- .../assignmentCompatability19.errors.txt | 14 +- .../assignmentCompatability20.errors.txt | 14 +- .../assignmentCompatability21.errors.txt | 14 +- .../assignmentCompatability22.errors.txt | 14 +- .../assignmentCompatability23.errors.txt | 14 +- .../assignmentCompatability25.errors.txt | 10 +- .../assignmentCompatability26.errors.txt | 10 +- .../assignmentCompatability27.errors.txt | 6 +- .../assignmentCompatability28.errors.txt | 10 +- .../assignmentCompatability29.errors.txt | 14 +- .../assignmentCompatability30.errors.txt | 14 +- .../assignmentCompatability31.errors.txt | 14 +- .../assignmentCompatability32.errors.txt | 14 +- .../assignmentCompatability35.errors.txt | 6 +- .../assignmentCompatability36.errors.txt | 6 +- .../assignmentCompatability39.errors.txt | 6 +- .../assignmentCompatability40.errors.txt | 6 +- .../assignmentCompatability41.errors.txt | 6 +- .../assignmentCompatability42.errors.txt | 6 +- .../assignmentCompatability43.errors.txt | 6 +- ...ember-off-of-function-interface.errors.txt | 24 +- ...ember-off-of-function-interface.errors.txt | 24 +- .../reference/assignmentToObject.errors.txt | 10 +- .../assignmentToObjectAndFunction.errors.txt | 26 +- ...nmentToParenthesizedIdentifiers.errors.txt | 30 +-- ...eAssignmentCompatIndexSignature.errors.txt | 12 +- .../baseTypePrivateMemberClash.errors.txt | 4 +- tests/baselines/reference/bases.errors.txt | 6 +- ...atureAssignabilityInInheritance.errors.txt | 14 +- ...tureAssignabilityInInheritance3.errors.txt | 52 ++-- ...uresThatDifferOnlyByReturnType2.errors.txt | 4 +- .../reference/castingTuple.errors.txt | 54 ++-- .../reference/chainedAssignment1.errors.txt | 12 +- .../reference/chainedAssignment3.errors.txt | 6 +- .../chainedAssignmentChecking.errors.txt | 12 +- ...ceThatExtendsClassWithPrivates1.errors.txt | 6 +- .../classImplementsClass2.errors.txt | 12 +- .../classImplementsClass4.errors.txt | 12 +- .../classImplementsClass5.errors.txt | 18 +- .../classIsSubtypeOfBaseType.errors.txt | 14 +- .../reference/classUpdateTests.errors.txt | 12 +- .../classWithMultipleBaseClasses.errors.txt | 6 +- .../clodulesDerivedClasses.errors.txt | 14 +- ...onAssignmentLHSCannotBeAssigned.errors.txt | 6 +- .../conditionalExpression1.errors.txt | 6 +- ...onalOperatorWithoutIdenticalBCT.errors.txt | 50 ++-- .../conflictingMemberTypesInBases.errors.txt | 4 +- .../reference/constraints0.errors.txt | 6 +- ...atureAssignabilityInInheritance.errors.txt | 14 +- ...tureAssignabilityInInheritance3.errors.txt | 52 ++-- .../contextualTypeWithTuple.errors.txt | 60 ++--- .../reference/contextualTyping.errors.txt | 4 +- .../reference/contextualTyping11.errors.txt | 10 +- .../reference/contextualTyping21.errors.txt | 14 +- .../reference/contextualTyping24.errors.txt | 10 +- .../reference/contextualTyping30.errors.txt | 4 +- .../reference/contextualTyping33.errors.txt | 4 +- .../reference/contextualTyping39.errors.txt | 6 +- .../reference/contextualTyping41.errors.txt | 6 +- .../reference/contextualTyping5.errors.txt | 6 +- ...ontextualTypingOfArrayLiterals1.errors.txt | 18 +- ...lTypingOfConditionalExpression2.errors.txt | 18 +- ...ontextualTypingOfObjectLiterals.errors.txt | 6 +- ...lTypingWithFixedTypeParameters1.errors.txt | 4 +- ...ertyIsRelatableToTargetProperty.errors.txt | 6 +- ...areClassInterfaceImplementation.errors.txt | 6 +- ...defaultBestCommonTypesHaveDecls.errors.txt | 4 +- ...ctionOverridesBaseClassAccessor.errors.txt | 10 +- ...dClassOverridesPrivateFunction1.errors.txt | 6 +- .../derivedClassOverridesPrivates.errors.txt | 12 +- ...ClassOverridesProtectedMembers3.errors.txt | 60 ++--- ...ClassOverridesProtectedMembers4.errors.txt | 6 +- .../derivedClassTransitivity.errors.txt | 18 +- .../derivedClassTransitivity2.errors.txt | 18 +- .../derivedClassTransitivity3.errors.txt | 18 +- .../derivedClassTransitivity4.errors.txt | 18 +- .../reference/derivedClassWithAny.errors.txt | 10 +- ...tanceShadowingProtectedInstance.errors.txt | 6 +- ...InstanceShadowingPublicInstance.errors.txt | 6 +- ...eStaticShadowingProtectedStatic.errors.txt | 6 +- ...vateStaticShadowingPublicStatic.errors.txt | 6 +- .../derivedGenericClassWithAny.errors.txt | 10 +- .../derivedInterfaceCallSignature.errors.txt | 10 +- ...rivedTypeIncompatibleSignatures.errors.txt | 20 +- ...ontShowCompilerGeneratedMembers.errors.txt | 6 +- .../reference/enumAssignability.errors.txt | 42 ++-- .../reference/enumAssignmentCompat.errors.txt | 12 +- .../enumAssignmentCompat2.errors.txt | 12 +- ...orOnContextuallyTypedReturnType.errors.txt | 6 +- ...AnnotationAndInvalidInitializer.errors.txt | 100 ++++---- ...endAndImplementTheSameBaseType2.errors.txt | 14 +- ...erInSignatureWithRestParameters.errors.txt | 4 +- .../reference/functionOverloads40.errors.txt | 8 +- .../reference/functionOverloads41.errors.txt | 4 +- ...ctionSignatureAssignmentCompat1.errors.txt | 10 +- tests/baselines/reference/fuzzy.errors.txt | 22 +- .../genericArrayAssignment1.errors.txt | 6 +- .../genericArrayExtenstions.errors.txt | 6 +- .../reference/genericArrayMethods1.errors.txt | 6 +- ...AssignmentCompatWithInterfaces1.errors.txt | 104 ++++---- ...cCallWithFunctionTypedArguments.errors.txt | 20 +- ...CallWithFunctionTypedArguments2.errors.txt | 8 +- ...CallWithFunctionTypedArguments5.errors.txt | 8 +- ...llWithGenericSignatureArguments.errors.txt | 8 +- ...lWithGenericSignatureArguments2.errors.txt | 4 +- ...lWithGenericSignatureArguments3.errors.txt | 8 +- ...ricCallWithNonSymmetricSubtypes.errors.txt | 8 +- ...enericCallWithObjectLiteralArgs.errors.txt | 4 +- ...CallWithObjectLiteralArguments1.errors.txt | 20 +- .../genericCallWithObjectTypeArgs.errors.txt | 4 +- ...thObjectTypeArgsAndConstraints3.errors.txt | 4 +- ...loadedConstructorTypedArguments.errors.txt | 4 +- .../genericCallWithTupleType.errors.txt | 54 ++-- ...ithFunctionTypedMemberArguments.errors.txt | 16 +- .../genericCloneReturnTypes.errors.txt | 6 +- .../genericCloneReturnTypes2.errors.txt | 6 +- .../reference/genericConstraint2.errors.txt | 6 +- .../genericConstraintSatisfaction1.errors.txt | 4 +- ...cDerivedTypeWithSpecializedBase.errors.txt | 10 +- ...DerivedTypeWithSpecializedBase2.errors.txt | 14 +- .../reference/genericRestArgs.errors.txt | 8 +- .../genericSpecializations3.errors.txt | 54 ++-- .../genericTypeAssertions1.errors.txt | 22 +- .../genericTypeAssertions2.errors.txt | 30 +-- ...cTypeWithNonGenericBaseMisMatch.errors.txt | 52 ++-- .../baselines/reference/generics1.errors.txt | 6 +- .../baselines/reference/generics2.errors.txt | 6 +- .../baselines/reference/generics4.errors.txt | 18 +- .../baselines/reference/generics5.errors.txt | 6 +- .../getAndSetNotIdenticalType2.errors.txt | 6 +- .../getAndSetNotIdenticalType3.errors.txt | 6 +- .../heterogeneousArrayAndOverloads.errors.txt | 4 +- tests/baselines/reference/i3.errors.txt | 6 +- ...implementClausePrecedingExtends.errors.txt | 6 +- ...ementGenericWithMismatchedTypes.errors.txt | 32 +-- ...mplementPublicPropertyAsPrivate.errors.txt | 6 +- ...rfaceExtendingClassWithPrivates.errors.txt | 24 +- ...faceExtendingClassWithPrivates2.errors.txt | 78 +++--- ...aceExtendingClassWithProtecteds.errors.txt | 36 +-- .../incompatibleGenericTypes.errors.txt | 6 +- .../reference/incompatibleTypes.errors.txt | 62 ++--- tests/baselines/reference/indexer2.errors.txt | 18 +- .../baselines/reference/indexer2A.errors.txt | 18 +- .../reference/indexerAssignability.errors.txt | 18 +- ...teExpansionThroughInstantiation.errors.txt | 20 +- ...ePropertiesFromDifferentOrigins.errors.txt | 4 +- ...pertiesWithDifferentOptionality.errors.txt | 4 +- ...opertiesWithDifferentVisibility.errors.txt | 4 +- .../reference/inheritance.errors.txt | 10 +- .../reference/inheritance1.errors.txt | 60 ++--- ...andParentPrivateMemberCollision.errors.txt | 6 +- ...MemberCollisionWithPublicMember.errors.txt | 6 +- ...emberCollisionWithPrivateMember.errors.txt | 6 +- ...eMemberAccessorOverridingMethod.errors.txt | 10 +- ...nceMemberFuncOverridingAccessor.errors.txt | 10 +- ...eStaticAccessorOverridingMethod.errors.txt | 10 +- ...nceStaticFuncOverridingAccessor.errors.txt | 10 +- ...nceStaticFuncOverridingProperty.errors.txt | 10 +- ...itanceStaticMembersIncompatible.errors.txt | 10 +- ...eStaticPropertyOverridingMethod.errors.txt | 10 +- ...nheritedModuleMembersForClodule.errors.txt | 14 +- ...gIndexersFromDifferentBaseTypes.errors.txt | 20 +- ...ceMemberAssignsToClassPrototype.errors.txt | 6 +- .../instanceSubtypeCheck2.errors.txt | 14 +- .../reference/intTypeCheck.errors.txt | 108 ++++---- .../interfaceAssignmentCompat.errors.txt | 12 +- .../interfaceDeclaration1.errors.txt | 10 +- .../interfaceDeclaration3.errors.txt | 30 +-- .../interfaceDeclaration4.errors.txt | 22 +- .../interfaceDeclaration6.errors.txt | 10 +- ...rfaceExtendingClassWithPrivates.errors.txt | 6 +- ...faceExtendingClassWithPrivates2.errors.txt | 16 +- ...aceExtendingClassWithProtecteds.errors.txt | 6 +- ...ceExtendingClassWithProtecteds2.errors.txt | 16 +- ...terfaceExtendsClassWithPrivate1.errors.txt | 18 +- ...terfaceExtendsClassWithPrivate2.errors.txt | 24 +- .../interfaceImplementation1.errors.txt | 12 +- .../interfaceImplementation2.errors.txt | 6 +- .../interfaceImplementation3.errors.txt | 6 +- .../interfaceImplementation4.errors.txt | 6 +- .../interfaceImplementation6.errors.txt | 12 +- .../interfaceImplementation7.errors.txt | 22 +- .../interfaceImplementation8.errors.txt | 18 +- .../reference/interfaceInheritance.errors.txt | 32 +-- .../interfaceMemberValidation.errors.txt | 10 +- ...nterfacePropertiesWithSameName2.errors.txt | 8 +- ...nterfacePropertiesWithSameName3.errors.txt | 8 +- ...interfaceThatHidesBaseProperty2.errors.txt | 18 +- .../interfaceWithMultipleBaseTypes.errors.txt | 86 +++---- ...interfaceWithMultipleBaseTypes2.errors.txt | 18 +- ...PropertyThatIsPrivateInBaseType.errors.txt | 12 +- ...ropertyThatIsPrivateInBaseType2.errors.txt | 12 +- .../invalidBooleanAssignments.errors.txt | 12 +- .../invalidNumberAssignments.errors.txt | 24 +- .../invalidReturnStatements.errors.txt | 12 +- .../invalidStringAssignments.errors.txt | 24 +- .../invalidVoidAssignments.errors.txt | 12 +- .../lastPropertyInLiteralWins.errors.txt | 12 +- ...InterfacesWithInheritedPrivates.errors.txt | 12 +- ...nterfacesWithInheritedPrivates2.errors.txt | 18 +- ...nterfacesWithInheritedPrivates3.errors.txt | 8 +- ...gedInterfacesWithMultipleBases4.errors.txt | 4 +- ...citTypeParameterAndArgumentType.errors.txt | 4 +- .../reference/multiLineErrors.errors.txt | 18 +- ...rfaesWithIncompatibleProperties.errors.txt | 4 +- .../reference/multipleInheritance.errors.txt | 10 +- .../noImplicitAnyInCastExpression.errors.txt | 6 +- ...rConstrainsPropertyDeclarations.errors.txt | 14 +- ...ConstrainsPropertyDeclarations2.errors.txt | 14 +- .../numericIndexerConstraint1.errors.txt | 6 +- .../numericIndexerConstraint2.errors.txt | 6 +- .../numericIndexerConstraint5.errors.txt | 6 +- ...objectLitStructuralTypeMismatch.errors.txt | 6 +- .../objectLitTargetTypeCallSite.errors.txt | 4 +- .../objectLiteralIndexerErrors.errors.txt | 14 +- ...tLiteralWithNumericPropertyName.errors.txt | 10 +- ...MembersOfObjectAssignmentCompat.errors.txt | 42 ++-- ...embersOfObjectAssignmentCompat2.errors.txt | 70 +++--- ...ypeWithRecursiveWrappedProperty.errors.txt | 6 +- ...peWithRecursiveWrappedProperty2.errors.txt | 6 +- ...WrappedPropertyCheckedNominally.errors.txt | 20 +- ...bjectTypesIdentityWithPrivates3.errors.txt | 6 +- ...ptionalFunctionArgAssignability.errors.txt | 18 +- .../optionalParamAssignmentCompat.errors.txt | 10 +- .../optionalParamTypeComparison.errors.txt | 20 +- .../optionalPropertiesInClasses.errors.txt | 6 +- .../optionalPropertiesTest.errors.txt | 24 +- ...erEagerReturnTypeSpecialization.errors.txt | 6 +- .../overloadOnConstInheritance2.errors.txt | 10 +- .../overloadOnConstInheritance3.errors.txt | 10 +- .../overloadResolutionTest1.errors.txt | 16 +- .../overloadingOnConstants1.errors.txt | 24 +- .../overridingPrivateStaticMembers.errors.txt | 6 +- .../baselines/reference/parseTypes.errors.txt | 6 +- .../reference/parser15.4.4.14-9-2.errors.txt | 4 +- .../parserObjectCreation1.errors.txt | 6 +- .../privateInterfaceProperties.errors.txt | 6 +- .../reference/promisePermutations.errors.txt | 28 +-- .../reference/promisePermutations2.errors.txt | 28 +-- .../reference/promisePermutations3.errors.txt | 28 +-- ...opertyParameterWithQuestionMark.errors.txt | 12 +- .../reference/protectedMembers.errors.txt | 18 +- ...lementedAsPrivateInDerivedClass.errors.txt | 6 +- tests/baselines/reference/qualify.errors.txt | 36 +-- .../recursiveFunctionTypes.errors.txt | 6 +- .../recursiveInheritance3.errors.txt | 6 +- .../reference/redefineArray.errors.txt | 6 +- .../restArgAssignmentCompat.errors.txt | 14 +- .../baselines/reference/scopeTests.errors.txt | 6 +- .../reference/shadowPrivateMembers.errors.txt | 6 +- ...gnsToConstructorFunctionMembers.errors.txt | 6 +- ...cMemberOfAnotherClassAssignment.errors.txt | 24 +- .../stringIndexerAssignments1.errors.txt | 16 +- .../stringIndexerAssignments2.errors.txt | 16 +- ...rConstrainsPropertyDeclarations.errors.txt | 14 +- ...ConstrainsPropertyDeclarations2.errors.txt | 14 +- .../subtypesOfTypeParameter.errors.txt | 10 +- ...sOfTypeParameterWithConstraints.errors.txt | 200 +++++++-------- ...OfTypeParameterWithConstraints4.errors.txt | 54 ++-- ...rameterWithRecursiveConstraints.errors.txt | 60 ++--- ...ignaturesWithOptionalParameters.errors.txt | 20 +- ...allSignaturesWithRestParameters.errors.txt | 198 +++++++-------- ...aturesWithSpecializedSignatures.errors.txt | 14 +- ...ignaturesWithOptionalParameters.errors.txt | 20 +- ...aturesWithSpecializedSignatures.errors.txt | 14 +- ...ignaturesWithOptionalParameters.errors.txt | 60 ++--- ...ignaturesWithOptionalParameters.errors.txt | 60 ++--- .../subtypingWithNumericIndexer.errors.txt | 20 +- .../subtypingWithNumericIndexer2.errors.txt | 50 ++-- .../subtypingWithNumericIndexer3.errors.txt | 50 ++-- .../subtypingWithNumericIndexer4.errors.txt | 44 ++-- .../subtypingWithNumericIndexer5.errors.txt | 44 ++-- .../subtypingWithObjectMembers.errors.txt | 84 +++---- .../subtypingWithObjectMembers2.errors.txt | 84 +++---- .../subtypingWithObjectMembers3.errors.txt | 84 +++---- .../subtypingWithObjectMembers5.errors.txt | 18 +- ...gWithObjectMembersAccessibility.errors.txt | 18 +- ...WithObjectMembersAccessibility2.errors.txt | 36 +-- ...ngWithObjectMembersOptionality2.errors.txt | 18 +- .../subtypingWithStringIndexer.errors.txt | 20 +- .../subtypingWithStringIndexer2.errors.txt | 50 ++-- .../subtypingWithStringIndexer3.errors.txt | 50 ++-- .../subtypingWithStringIndexer4.errors.txt | 44 ++-- .../reference/targetTypeTest3.errors.txt | 10 +- ...ommaInHeterogenousArrayLiteral1.errors.txt | 8 +- .../baselines/reference/tupleTypes.errors.txt | 74 +++--- .../reference/typeArgInference2.errors.txt | 4 +- .../typeArgInference2WithError.errors.txt | 4 +- .../typeArgumentInference.errors.txt | 8 +- ...entInferenceConstructSignatures.errors.txt | 8 +- ...renceWithConstraintAsCommonRoot.errors.txt | 4 +- ...rgumentInferenceWithConstraints.errors.txt | 8 +- .../reference/typeAssertions.errors.txt | 12 +- .../typeIdentityConsidersBrands.errors.txt | 6 +- .../baselines/reference/typeInfer1.errors.txt | 6 +- ...eInferenceConflictingCandidates.errors.txt | 4 +- .../baselines/reference/typeMatch1.errors.txt | 12 +- .../baselines/reference/typeMatch2.errors.txt | 48 ++-- .../baselines/reference/typeName1.errors.txt | 72 +++--- ...ypeParameterArgumentEquivalence.errors.txt | 20 +- ...peParameterArgumentEquivalence2.errors.txt | 20 +- ...peParameterArgumentEquivalence3.errors.txt | 12 +- ...peParameterArgumentEquivalence4.errors.txt | 12 +- ...peParameterArgumentEquivalence5.errors.txt | 20 +- .../typeParameterAssignmentCompat1.errors.txt | 24 +- .../typeofAmbientExternalModules.errors.txt | 12 +- .../typeofExternalModules.errors.txt | 12 +- .../typeofInternalModules.errors.txt | 12 +- ...yExternalModuleStillHasInstance.errors.txt | 6 +- ...unctionCallsWithTypeParameters1.errors.txt | 6 +- .../reference/widenedTypes.errors.txt | 16 +- .../wrappedRecursiveGenericType.errors.txt | 6 +- 359 files changed, 4016 insertions(+), 4062 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index be0ae42b848..ab5064e6776 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3182,18 +3182,17 @@ module ts { target: Type, errorNode: Node, chainedMessage?: DiagnosticMessage, - terminalMessage?: DiagnosticMessage, containingMessageChain?: DiagnosticMessageChain): boolean { - return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, chainedMessage, terminalMessage, containingMessageChain); + return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, chainedMessage, containingMessageChain); } function isTypeAssignableTo(source: Type, target: Type): boolean { return checkTypeAssignableTo(source, target, /*errorNode*/ undefined); } - function checkTypeAssignableTo(source: Type, target: Type, errorNode: Node, chainedMessage?: DiagnosticMessage, terminalMessage?: DiagnosticMessage): boolean { - return checkTypeRelatedTo(source, target, assignableRelation, errorNode, chainedMessage, terminalMessage); + function checkTypeAssignableTo(source: Type, target: Type, errorNode: Node, chainedMessage?: DiagnosticMessage): boolean { + return checkTypeRelatedTo(source, target, assignableRelation, errorNode, chainedMessage); } function isTypeRelatedTo(source: Type, target: Type, relation: Map): boolean { @@ -3237,7 +3236,7 @@ module ts { var typeName2 = typeToString(base); var errorInfo = chainDiagnosticMessages(undefined, Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); - errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon, typeToString(type), typeName1, typeName2); + errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); addDiagnostic(createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); } } @@ -3273,7 +3272,6 @@ module ts { relation: Map, errorNode: Node, chainedMessage?: DiagnosticMessage, - terminalMessage?: DiagnosticMessage, containingMessageChain?: DiagnosticMessageChain): boolean { var errorInfo: DiagnosticMessageChain; @@ -3285,7 +3283,7 @@ module ts { Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, chainedMessage, terminalMessage); + var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, chainedMessage); if (overflow) { error(errorNode, Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } @@ -3302,10 +3300,10 @@ module ts { } function isRelatedTo(source: Type, target: Type, reportErrors?: boolean): boolean { - return isRelatedToWithCustomErrors(source, target, reportErrors, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + return isRelatedToWithCustomErrors(source, target, reportErrors, /*chainedMessage*/ undefined); } - function isRelatedToWithCustomErrors(source: Type, target: Type, reportErrors: boolean, chainedMessage: DiagnosticMessage, terminalMessage: DiagnosticMessage): boolean { + function isRelatedToWithCustomErrors(source: Type, target: Type, reportErrors: boolean, chainedMessage: DiagnosticMessage): boolean { if (relation === identityRelation) { // both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases if (source === target) return true; @@ -3357,15 +3355,9 @@ module ts { } } if (reportErrors) { - // The error should end in a period when this is the deepest error in the chain - // (when errorInfo is undefined). Otherwise, it has a colon before the nested - // error. - - chainedMessage = chainedMessage || Diagnostics.Type_0_is_not_assignable_to_type_1_Colon; - terminalMessage = terminalMessage || Diagnostics.Type_0_is_not_assignable_to_type_1; - var diagnosticKey = errorInfo ? chainedMessage : terminalMessage; - Debug.assert(diagnosticKey); - reportError(diagnosticKey, typeToString(source), typeToString(target)); + chainedMessage = chainedMessage || Diagnostics.Type_0_is_not_assignable_to_type_1; + Debug.assert(chainedMessage); + reportError(chainedMessage, typeToString(source), typeToString(target)); } return false; } @@ -3545,7 +3537,7 @@ module ts { } if (!isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors)) { if (reportErrors) { - reportError(Diagnostics.Types_of_property_0_are_incompatible_Colon, symbolToString(targetProp)); + reportError(Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp)); } return false; } @@ -3651,7 +3643,7 @@ module ts { if (!isRelatedTo(s, t, reportErrors)) { if (!isRelatedTo(t, s, false)) { if (reportErrors) { - reportError(Diagnostics.Types_of_parameters_0_and_1_are_incompatible_Colon, + reportError(Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); } @@ -3695,7 +3687,7 @@ module ts { } if (!isRelatedTo(sourceType, targetType, reportErrors)) { if (reportErrors) { - reportError(Diagnostics.Index_signatures_are_incompatible_Colon); + reportError(Diagnostics.Index_signatures_are_incompatible); } return false; } @@ -3726,7 +3718,7 @@ module ts { } if (!compatible) { if (reportErrors) { - reportError(Diagnostics.Index_signatures_are_incompatible_Colon); + reportError(Diagnostics.Index_signatures_are_incompatible); } return false; } @@ -3819,8 +3811,7 @@ module ts { // In the following errors, the {1} slot is before the {0} slot because checkTypeSubtypeOf supplies the // subtype as the first argument to the error - checkTypeSubtypeOf(bestSupertypeDownfallType, bestSupertype, errorLocation, - Diagnostics.Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0_Colon, + checkTypeSubtypeOf(bestSupertypeDownfallType, bestSupertype, errorLocation, Diagnostics.Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0, errorMessageChainHead); } @@ -3932,8 +3923,8 @@ module ts { callback(s, t); } } - - function createInferenceContext(typeParameters: TypeParameter[], inferUnionTypes: boolean): InferenceContext { + + function createInferenceContext(typeParameters: TypeParameter[], inferUnionTypes: boolean): InferenceContext { var inferences: Type[][] = []; for (var i = 0; i < typeParameters.length; i++) inferences.push([]); return { @@ -5158,8 +5149,8 @@ module ts { } function inferTypeArguments(signature: Signature, args: Expression[], excludeArgument?: boolean[]): InferenceContext { - var typeParameters = signature.typeParameters; - var context = createInferenceContext(typeParameters, /*inferUnionTypes*/ false); + var typeParameters = signature.typeParameters; + var context = createInferenceContext(typeParameters, /*inferUnionTypes*/ false); var mapper = createInferenceMapper(context); // First infer from arguments that are not context sensitive for (var i = 0; i < args.length; i++) { @@ -5209,7 +5200,7 @@ module ts { var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, constraint, reportErrors ? typeArgNode : undefined, - Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } } @@ -5230,7 +5221,6 @@ module ts { checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); // Use argument expression as error location when reporting errors var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, - Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1, Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); if (!isValidArgument) { return false; @@ -5330,7 +5320,7 @@ module ts { var inferenceCandidates = resultOfFailedInference.inferences[resultOfFailedInference.failedTypeParameterIndex]; var diagnosticChainHead = chainDiagnosticMessages(/*details*/ undefined, // details will be provided by call to reportNoCommonSupertypeError - Diagnostics.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly_Colon, + Diagnostics.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly, typeToString(failedTypeParameter)); reportNoCommonSupertypeError(inferenceCandidates, node.func, diagnosticChainHead); @@ -5607,7 +5597,7 @@ module ts { if (fullTypeCheck && targetType !== unknownType) { var widenedType = getWidenedType(exprType, /*supressNoImplicitAnyErrors*/ true); if (!(isTypeAssignableTo(targetType, widenedType))) { - checkTypeAssignableTo(exprType, targetType, node, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); + checkTypeAssignableTo(exprType, targetType, node, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); } } return targetType; @@ -5788,7 +5778,7 @@ module ts { else { var exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined, undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, /*chainedMessage*/ undefined); } checkFunctionExpressionBodies(node.body); } @@ -6094,7 +6084,7 @@ module ts { // Use default messages if (ok) { // to avoid cascading errors check assignability only if 'isReference' check succeeded and no errors were reported - checkTypeAssignableTo(valueType, leftType, node.left, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + checkTypeAssignableTo(valueType, leftType, node.left, /*chainedMessage*/ undefined); } } } @@ -6475,7 +6465,7 @@ module ts { var constraint = getConstraintOfTypeParameter((type).target.typeParameters[i]); if (fullTypeCheck && constraint) { var typeArgument = (type).typeArguments[i]; - checkTypeAssignableTo(typeArgument, constraint, node, Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + checkTypeAssignableTo(typeArgument, constraint, node, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } } @@ -7117,7 +7107,7 @@ module ts { if (node.initializer) { if (!(getNodeLinks(node.initializer).flags & NodeCheckFlags.TypeChecked)) { // Use default messages - checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, /*chainedMessage*/ undefined); } checkCollisionWithConstDeclarations(node); } @@ -7230,7 +7220,7 @@ module ts { func.type || (func.kind === SyntaxKind.GetAccessor && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, SyntaxKind.SetAccessor))); if (checkAssignability) { - checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, /*chainedMessage*/ undefined); } else if (func.kind == SyntaxKind.Constructor) { // constructor doesn't have explicit return type annotation and yet its return type is known - declaring type @@ -7258,7 +7248,7 @@ module ts { var caseType = checkExpression(clause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { // check 'expressionType isAssignableTo caseType' failed, try the reversed check and report errors if it fails - checkTypeAssignableTo(caseType, expressionType, clause.expression, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + checkTypeAssignableTo(caseType, expressionType, clause.expression, /*chainedMessage*/ undefined); } } checkBlock(clause); @@ -7395,10 +7385,10 @@ module ts { if (type.baseTypes.length) { if (fullTypeCheck) { var baseType = type.baseTypes[0]; - checkTypeAssignableTo(type, baseType, node.name, Diagnostics.Class_0_incorrectly_extends_base_class_1_Colon, Diagnostics.Class_0_incorrectly_extends_base_class_1); + checkTypeAssignableTo(type, baseType, node.name, Diagnostics.Class_0_incorrectly_extends_base_class_1); var staticBaseType = getTypeOfSymbol(baseType.symbol); checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, - Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon, Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); + Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, SymbolFlags.Value)) { error(node.baseType, Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); } @@ -7417,7 +7407,7 @@ module ts { if (t !== unknownType) { var declaredType = (t.flags & TypeFlags.Reference) ? (t).target : t; if (declaredType.flags & (TypeFlags.Class | TypeFlags.Interface)) { - checkTypeAssignableTo(type, t, node.name, Diagnostics.Class_0_incorrectly_implements_interface_1_Colon, Diagnostics.Class_0_incorrectly_implements_interface_1); + checkTypeAssignableTo(type, t, node.name, Diagnostics.Class_0_incorrectly_implements_interface_1); } else { error(typeRefNode, Diagnostics.A_class_may_only_implement_another_class_or_interface); @@ -7562,7 +7552,7 @@ module ts { // run subsequent checks only if first set succeeded if (checkInheritedPropertiesAreIdentical(type, node.name)) { forEach(type.baseTypes, baseType => { - checkTypeAssignableTo(type, baseType, node.name, Diagnostics.Interface_0_incorrectly_extends_interface_1_Colon, Diagnostics.Interface_0_incorrectly_extends_interface_1); + checkTypeAssignableTo(type, baseType, node.name , Diagnostics.Interface_0_incorrectly_extends_interface_1); }); checkIndexConstraints(type); } @@ -7614,7 +7604,7 @@ module ts { // If it is a constant value (not undefined), it is syntactically constrained to be a number. // Also, we do not need to check this for ambients because there is already // a syntax error if it is not a constant. - checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, /*chainedMessage*/ undefined); } } else if (ambient) { diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 52cf4d77ff9..cf0600ca453 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -140,17 +140,16 @@ module ts { Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: DiagnosticCategory.Error, key: "Global type '{0}' must have {1} type parameter(s)." }, Cannot_find_global_type_0: { code: 2318, category: DiagnosticCategory.Error, key: "Cannot find global type '{0}'." }, Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: DiagnosticCategory.Error, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon: { code: 2320, category: DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':" }, + Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: DiagnosticCategory.Error, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1_Colon: { code: 2322, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}':" }, Type_0_is_not_assignable_to_type_1: { code: 2323, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." }, Property_0_is_missing_in_type_1: { code: 2324, category: DiagnosticCategory.Error, key: "Property '{0}' is missing in type '{1}'." }, Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: DiagnosticCategory.Error, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, - Types_of_property_0_are_incompatible_Colon: { code: 2326, category: DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible:" }, + Types_of_property_0_are_incompatible: { code: 2326, category: DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible." }, Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: DiagnosticCategory.Error, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, - Types_of_parameters_0_and_1_are_incompatible_Colon: { code: 2328, category: DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, + Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible." }, Index_signature_is_missing_in_type_0: { code: 2329, category: DiagnosticCategory.Error, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible_Colon: { code: 2330, category: DiagnosticCategory.Error, key: "Index signatures are incompatible:" }, + Index_signatures_are_incompatible: { code: 2330, category: DiagnosticCategory.Error, key: "Index signatures are incompatible." }, this_cannot_be_referenced_in_a_module_body: { code: 2331, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in a module body." }, this_cannot_be_referenced_in_current_location: { code: 2332, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in current location." }, this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in constructor arguments." }, @@ -163,7 +162,6 @@ module ts { Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: DiagnosticCategory.Error, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: DiagnosticCategory.Error, key: "Property '{0}' is private and only accessible within class '{1}'." }, An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: DiagnosticCategory.Error, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 2343, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}':" }, Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}'." }, Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: DiagnosticCategory.Error, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: DiagnosticCategory.Error, key: "Supplied parameters do not match any signature of call target." }, @@ -173,7 +171,6 @@ module ts { Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: DiagnosticCategory.Error, key: "Only a void function can be called with the 'new' keyword." }, Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: DiagnosticCategory.Error, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 2353, category: DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, No_best_common_type_exists_among_return_expressions: { code: 2354, category: DiagnosticCategory.Error, key: "No best common type exists among return expressions." }, A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: DiagnosticCategory.Error, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: DiagnosticCategory.Error, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, @@ -234,12 +231,9 @@ module ts { Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: DiagnosticCategory.Error, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, Class_name_cannot_be_0: { code: 2414, category: DiagnosticCategory.Error, key: "Class name cannot be '{0}'" }, Class_0_incorrectly_extends_base_class_1: { code: 2415, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_0_incorrectly_extends_base_class_1_Colon: { code: 2416, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}':" }, Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: 2418, category: DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: DiagnosticCategory.Error, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, Class_0_incorrectly_implements_interface_1: { code: 2420, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}'." }, - Class_0_incorrectly_implements_interface_1_Colon: { code: 2421, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}':" }, A_class_may_only_implement_another_class_or_interface: { code: 2422, category: DiagnosticCategory.Error, key: "A class may only implement another class or interface." }, Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, @@ -247,7 +241,6 @@ module ts { Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, Interface_name_cannot_be_0: { code: 2427, category: DiagnosticCategory.Error, key: "Interface name cannot be '{0}'" }, All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: DiagnosticCategory.Error, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1_Colon: { code: 2429, category: DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}':" }, Interface_0_incorrectly_extends_interface_1: { code: 2430, category: DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}'." }, Enum_name_cannot_be_0: { code: 2431, category: DiagnosticCategory.Error, key: "Enum name cannot be '{0}'" }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: DiagnosticCategory.Error, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, @@ -271,8 +264,7 @@ module ts { Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: DiagnosticCategory.Error, key: "Left-hand side of assignment expression cannot be a constant.", isEarly: true }, Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: DiagnosticCategory.Error, key: "Cannot redeclare block-scoped variable '{0}'.", isEarly: true }, An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: DiagnosticCategory.Error, key: "An enum member cannot have a numeric name." }, - The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly_Colon: { code: 2453, category: DiagnosticCategory.Error, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly:" }, - Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0_Colon: { code: 2454, category: DiagnosticCategory.Error, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}':" }, + The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: DiagnosticCategory.Error, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: DiagnosticCategory.Error, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 00888a68761..f198ea5482f 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -552,7 +552,7 @@ "category": "Error", "code": 2319 }, - "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':": { + "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'.": { "category": "Error", "code": 2320 }, @@ -560,7 +560,7 @@ "category": "Error", "code": 2321 }, - "Type '{0}' is not assignable to type '{1}':": { + "Type '{0}' is not assignable to type '{1}'.": { "category": "Error", "code": 2322 }, @@ -576,7 +576,7 @@ "category": "Error", "code": 2325 }, - "Types of property '{0}' are incompatible:": { + "Types of property '{0}' are incompatible.": { "category": "Error", "code": 2326 }, @@ -584,7 +584,7 @@ "category": "Error", "code": 2327 }, - "Types of parameters '{0}' and '{1}' are incompatible:": { + "Types of parameters '{0}' and '{1}' are incompatible.": { "category": "Error", "code": 2328 }, @@ -592,7 +592,7 @@ "category": "Error", "code": 2329 }, - "Index signatures are incompatible:": { + "Index signatures are incompatible.": { "category": "Error", "code": 2330 }, @@ -644,10 +644,6 @@ "category": "Error", "code": 2342 }, - "Type '{0}' does not satisfy the constraint '{1}':": { - "category": "Error", - "code": 2343 - }, "Type '{0}' does not satisfy the constraint '{1}'.": { "category": "Error", "code": 2344 @@ -684,10 +680,6 @@ "category": "Error", "code": 2352 }, - "Neither type '{0}' nor type '{1}' is assignable to the other:": { - "category": "Error", - "code": 2353 - }, "No best common type exists among return expressions.": { "category": "Error", "code": 2354 @@ -928,18 +920,10 @@ "category": "Error", "code": 2415 }, - "Class '{0}' incorrectly extends base class '{1}':": { - "category": "Error", - "code": 2416 - }, "Class static side '{0}' incorrectly extends base class static side '{1}'.": { "category": "Error", "code": 2417 }, - "Class static side '{0}' incorrectly extends base class static side '{1}':": { - "category": "Error", - "code": 2418 - }, "Type name '{0}' in extends clause does not reference constructor function for '{0}'.": { "category": "Error", "code": 2419 @@ -948,10 +932,6 @@ "category": "Error", "code": 2420 }, - "Class '{0}' incorrectly implements interface '{1}':": { - "category": "Error", - "code": 2421 - }, "A class may only implement another class or interface.": { "category": "Error", "code": 2422 @@ -980,10 +960,6 @@ "category": "Error", "code": 2428 }, - "Interface '{0}' incorrectly extends interface '{1}':": { - "category": "Error", - "code": 2429 - }, "Interface '{0}' incorrectly extends interface '{1}'.": { "category": "Error", "code": 2430 @@ -1080,14 +1056,10 @@ "category": "Error", "code": 2452 }, - "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly:": { + "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly.": { "category": "Error", "code": 2453 }, - "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}':": { - "category": "Error", - "code": 2454 - }, "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'.": { "category": "Error", "code": 2455 diff --git a/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt b/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt index 6fca82a677f..4b6255688f8 100644 --- a/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt +++ b/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2429: Interface 'Bar' incorrectly extends interface 'Foo': - Types of property 'f' are incompatible: +tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2430: Interface 'Bar' incorrectly extends interface 'Foo'. + Types of property 'f' are incompatible. Type '(key: string) => string' is not assignable to type '() => string'. @@ -10,9 +10,9 @@ tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2429: Int interface Bar extends Foo { ~~~ -!!! error TS2429: Interface 'Bar' incorrectly extends interface 'Foo': -!!! error TS2429: Types of property 'f' are incompatible: -!!! error TS2429: Type '(key: string) => string' is not assignable to type '() => string'. +!!! error TS2430: Interface 'Bar' incorrectly extends interface 'Foo'. +!!! error TS2430: Types of property 'f' are incompatible. +!!! error TS2430: Type '(key: string) => string' is not assignable to type '() => string'. f(key: string): string; } \ No newline at end of file diff --git a/tests/baselines/reference/aliasAssignments.errors.txt b/tests/baselines/reference/aliasAssignments.errors.txt index 1c49a377356..54190485c3d 100644 --- a/tests/baselines/reference/aliasAssignments.errors.txt +++ b/tests/baselines/reference/aliasAssignments.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"': +tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2323: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. Property 'someClass' is missing in type 'Number'. tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2323: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'. @@ -8,8 +8,8 @@ tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2323: Type 'typeof "tes var x = moduleA; x = 1; // Should be error ~ -!!! error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"': -!!! error TS2322: Property 'someClass' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. +!!! error TS2323: Property 'someClass' is missing in type 'Number'. var y = 1; y = moduleA; // should be error ~ diff --git a/tests/baselines/reference/apparentTypeSubtyping.errors.txt b/tests/baselines/reference/apparentTypeSubtyping.errors.txt index a9a97c22722..e1a53ef6a73 100644 --- a/tests/baselines/reference/apparentTypeSubtyping.errors.txt +++ b/tests/baselines/reference/apparentTypeSubtyping.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSubtyping.ts(9,7): error TS2416: Class 'Derived' incorrectly extends base class 'Base': - Types of property 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSubtyping.ts(9,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. + Types of property 'x' are incompatible. Type 'String' is not assignable to type 'string'. @@ -14,9 +14,9 @@ tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSubtypi // is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T) class Derived extends Base { // error ~~~~~~~ -!!! error TS2416: Class 'Derived' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'x' are incompatible: -!!! error TS2416: Type 'String' is not assignable to type 'string'. +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type 'String' is not assignable to type 'string'. x: String; } diff --git a/tests/baselines/reference/apparentTypeSupertype.errors.txt b/tests/baselines/reference/apparentTypeSupertype.errors.txt index 78c667541d6..7d653f34bf9 100644 --- a/tests/baselines/reference/apparentTypeSupertype.errors.txt +++ b/tests/baselines/reference/apparentTypeSupertype.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSupertype.ts(9,7): error TS2416: Class 'Derived' incorrectly extends base class 'Base': - Types of property 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSupertype.ts(9,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. + Types of property 'x' are incompatible. Type 'U' is not assignable to type 'string'. @@ -14,8 +14,8 @@ tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSuperty // is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T) class Derived extends Base { // error ~~~~~~~ -!!! error TS2416: Class 'Derived' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'x' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'string'. +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'string'. x: U; } \ No newline at end of file diff --git a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt index 9d5847a77b0..53caecf63cb 100644 --- a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt +++ b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2322: Type 'number' is not assignable to type 'IArguments': +tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2323: Type 'number' is not assignable to type 'IArguments'. Property 'length' is missing in type 'Number'. @@ -7,6 +7,6 @@ tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS function foo(a) { arguments = 10; /// This shouldnt be of type number and result in error. ~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'IArguments': -!!! error TS2322: Property 'length' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type 'IArguments'. +!!! error TS2323: Property 'length' is missing in type 'Number'. } \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest1.errors.txt b/tests/baselines/reference/arrayAssignmentTest1.errors.txt index 926bf0d4316..9d606ec6d90 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest1.errors.txt @@ -1,49 +1,49 @@ -tests/cases/compiler/arrayAssignmentTest1.ts(46,5): error TS2322: Type 'undefined[]' is not assignable to type 'I1': +tests/cases/compiler/arrayAssignmentTest1.ts(46,5): error TS2323: Type 'undefined[]' is not assignable to type 'I1'. Property 'IM1' is missing in type 'undefined[]'. -tests/cases/compiler/arrayAssignmentTest1.ts(47,5): error TS2322: Type 'undefined[]' is not assignable to type 'C1': +tests/cases/compiler/arrayAssignmentTest1.ts(47,5): error TS2323: Type 'undefined[]' is not assignable to type 'C1'. Property 'IM1' is missing in type 'undefined[]'. -tests/cases/compiler/arrayAssignmentTest1.ts(48,5): error TS2322: Type 'undefined[]' is not assignable to type 'C2': +tests/cases/compiler/arrayAssignmentTest1.ts(48,5): error TS2323: Type 'undefined[]' is not assignable to type 'C2'. Property 'C2M1' is missing in type 'undefined[]'. -tests/cases/compiler/arrayAssignmentTest1.ts(49,5): error TS2322: Type 'undefined[]' is not assignable to type 'C3': +tests/cases/compiler/arrayAssignmentTest1.ts(49,5): error TS2323: Type 'undefined[]' is not assignable to type 'C3'. Property 'CM3M1' is missing in type 'undefined[]'. -tests/cases/compiler/arrayAssignmentTest1.ts(60,1): error TS2322: Type 'C3[]' is not assignable to type 'I1[]': - Type 'C3' is not assignable to type 'I1': +tests/cases/compiler/arrayAssignmentTest1.ts(60,1): error TS2323: Type 'C3[]' is not assignable to type 'I1[]'. + Type 'C3' is not assignable to type 'I1'. Property 'IM1' is missing in type 'C3'. -tests/cases/compiler/arrayAssignmentTest1.ts(64,1): error TS2322: Type 'I1[]' is not assignable to type 'C1[]': - Type 'I1' is not assignable to type 'C1': +tests/cases/compiler/arrayAssignmentTest1.ts(64,1): error TS2323: Type 'I1[]' is not assignable to type 'C1[]'. + Type 'I1' is not assignable to type 'C1'. Property 'C1M1' is missing in type 'I1'. -tests/cases/compiler/arrayAssignmentTest1.ts(65,1): error TS2322: Type 'C3[]' is not assignable to type 'C1[]': - Type 'C3' is not assignable to type 'C1': +tests/cases/compiler/arrayAssignmentTest1.ts(65,1): error TS2323: Type 'C3[]' is not assignable to type 'C1[]'. + Type 'C3' is not assignable to type 'C1'. Property 'IM1' is missing in type 'C3'. -tests/cases/compiler/arrayAssignmentTest1.ts(68,1): error TS2322: Type 'C1[]' is not assignable to type 'C2[]': - Type 'C1' is not assignable to type 'C2': +tests/cases/compiler/arrayAssignmentTest1.ts(68,1): error TS2323: Type 'C1[]' is not assignable to type 'C2[]'. + Type 'C1' is not assignable to type 'C2'. Property 'C2M1' is missing in type 'C1'. -tests/cases/compiler/arrayAssignmentTest1.ts(69,1): error TS2322: Type 'I1[]' is not assignable to type 'C2[]': - Type 'I1' is not assignable to type 'C2': +tests/cases/compiler/arrayAssignmentTest1.ts(69,1): error TS2323: Type 'I1[]' is not assignable to type 'C2[]'. + Type 'I1' is not assignable to type 'C2'. Property 'C2M1' is missing in type 'I1'. -tests/cases/compiler/arrayAssignmentTest1.ts(70,1): error TS2322: Type 'C3[]' is not assignable to type 'C2[]': - Type 'C3' is not assignable to type 'C2': +tests/cases/compiler/arrayAssignmentTest1.ts(70,1): error TS2323: Type 'C3[]' is not assignable to type 'C2[]'. + Type 'C3' is not assignable to type 'C2'. Property 'C2M1' is missing in type 'C3'. -tests/cases/compiler/arrayAssignmentTest1.ts(75,1): error TS2322: Type 'C2[]' is not assignable to type 'C3[]': - Type 'C2' is not assignable to type 'C3': +tests/cases/compiler/arrayAssignmentTest1.ts(75,1): error TS2323: Type 'C2[]' is not assignable to type 'C3[]'. + Type 'C2' is not assignable to type 'C3'. Property 'CM3M1' is missing in type 'C2'. -tests/cases/compiler/arrayAssignmentTest1.ts(76,1): error TS2322: Type 'C1[]' is not assignable to type 'C3[]': - Type 'C1' is not assignable to type 'C3': +tests/cases/compiler/arrayAssignmentTest1.ts(76,1): error TS2323: Type 'C1[]' is not assignable to type 'C3[]'. + Type 'C1' is not assignable to type 'C3'. Property 'CM3M1' is missing in type 'C1'. -tests/cases/compiler/arrayAssignmentTest1.ts(77,1): error TS2322: Type 'I1[]' is not assignable to type 'C3[]': - Type 'I1' is not assignable to type 'C3': +tests/cases/compiler/arrayAssignmentTest1.ts(77,1): error TS2323: Type 'I1[]' is not assignable to type 'C3[]'. + Type 'I1' is not assignable to type 'C3'. Property 'CM3M1' is missing in type 'I1'. -tests/cases/compiler/arrayAssignmentTest1.ts(79,1): error TS2322: Type '() => C1' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest1.ts(79,1): error TS2323: Type '() => C1' is not assignable to type 'any[]'. Property 'push' is missing in type '() => C1'. -tests/cases/compiler/arrayAssignmentTest1.ts(80,1): error TS2322: Type '{ one: number; }' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest1.ts(80,1): error TS2323: Type '{ one: number; }' is not assignable to type 'any[]'. Property 'length' is missing in type '{ one: number; }'. -tests/cases/compiler/arrayAssignmentTest1.ts(82,1): error TS2322: Type 'C1' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest1.ts(82,1): error TS2323: Type 'C1' is not assignable to type 'any[]'. Property 'length' is missing in type 'C1'. -tests/cases/compiler/arrayAssignmentTest1.ts(83,1): error TS2322: Type 'C2' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest1.ts(83,1): error TS2323: Type 'C2' is not assignable to type 'any[]'. Property 'length' is missing in type 'C2'. -tests/cases/compiler/arrayAssignmentTest1.ts(84,1): error TS2322: Type 'C3' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest1.ts(84,1): error TS2323: Type 'C3' is not assignable to type 'any[]'. Property 'length' is missing in type 'C3'. -tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2323: Type 'I1' is not assignable to type 'any[]'. Property 'length' is missing in type 'I1'. @@ -95,20 +95,20 @@ tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is n var i1_error: I1 = []; // should be an error - is ~~~~~~~~ -!!! error TS2322: Type 'undefined[]' is not assignable to type 'I1': -!!! error TS2322: Property 'IM1' is missing in type 'undefined[]'. +!!! error TS2323: Type 'undefined[]' is not assignable to type 'I1'. +!!! error TS2323: Property 'IM1' is missing in type 'undefined[]'. var c1_error: C1 = []; // should be an error - is ~~~~~~~~ -!!! error TS2322: Type 'undefined[]' is not assignable to type 'C1': -!!! error TS2322: Property 'IM1' is missing in type 'undefined[]'. +!!! error TS2323: Type 'undefined[]' is not assignable to type 'C1'. +!!! error TS2323: Property 'IM1' is missing in type 'undefined[]'. var c2_error: C2 = []; // should be an error - is ~~~~~~~~ -!!! error TS2322: Type 'undefined[]' is not assignable to type 'C2': -!!! error TS2322: Property 'C2M1' is missing in type 'undefined[]'. +!!! error TS2323: Type 'undefined[]' is not assignable to type 'C2'. +!!! error TS2323: Property 'C2M1' is missing in type 'undefined[]'. var c3_error: C3 = []; // should be an error - is ~~~~~~~~ -!!! error TS2322: Type 'undefined[]' is not assignable to type 'C3': -!!! error TS2322: Property 'CM3M1' is missing in type 'undefined[]'. +!!! error TS2323: Type 'undefined[]' is not assignable to type 'C3'. +!!! error TS2323: Property 'CM3M1' is missing in type 'undefined[]'. arr_any = arr_i1; // should be ok - is @@ -121,81 +121,81 @@ tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is n arr_i1 = arr_c2; // should be ok - subtype relationship - is arr_i1 = arr_c3; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'C3[]' is not assignable to type 'I1[]': -!!! error TS2322: Type 'C3' is not assignable to type 'I1': -!!! error TS2322: Property 'IM1' is missing in type 'C3'. +!!! error TS2323: Type 'C3[]' is not assignable to type 'I1[]'. +!!! error TS2323: Type 'C3' is not assignable to type 'I1'. +!!! error TS2323: Property 'IM1' is missing in type 'C3'. arr_c1 = arr_c1; // should be ok - subtype relationship - is arr_c1 = arr_c2; // should be ok - subtype relationship - is arr_c1 = arr_i1; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'I1[]' is not assignable to type 'C1[]': -!!! error TS2322: Type 'I1' is not assignable to type 'C1': -!!! error TS2322: Property 'C1M1' is missing in type 'I1'. +!!! error TS2323: Type 'I1[]' is not assignable to type 'C1[]'. +!!! error TS2323: Type 'I1' is not assignable to type 'C1'. +!!! error TS2323: Property 'C1M1' is missing in type 'I1'. arr_c1 = arr_c3; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'C3[]' is not assignable to type 'C1[]': -!!! error TS2322: Type 'C3' is not assignable to type 'C1': -!!! error TS2322: Property 'IM1' is missing in type 'C3'. +!!! error TS2323: Type 'C3[]' is not assignable to type 'C1[]'. +!!! error TS2323: Type 'C3' is not assignable to type 'C1'. +!!! error TS2323: Property 'IM1' is missing in type 'C3'. arr_c2 = arr_c2; // should be ok - subtype relationship - is arr_c2 = arr_c1; // should be an error - subtype relationship - is ~~~~~~ -!!! error TS2322: Type 'C1[]' is not assignable to type 'C2[]': -!!! error TS2322: Type 'C1' is not assignable to type 'C2': -!!! error TS2322: Property 'C2M1' is missing in type 'C1'. +!!! error TS2323: Type 'C1[]' is not assignable to type 'C2[]'. +!!! error TS2323: Type 'C1' is not assignable to type 'C2'. +!!! error TS2323: Property 'C2M1' is missing in type 'C1'. arr_c2 = arr_i1; // should be an error - subtype relationship - is ~~~~~~ -!!! error TS2322: Type 'I1[]' is not assignable to type 'C2[]': -!!! error TS2322: Type 'I1' is not assignable to type 'C2': -!!! error TS2322: Property 'C2M1' is missing in type 'I1'. +!!! error TS2323: Type 'I1[]' is not assignable to type 'C2[]'. +!!! error TS2323: Type 'I1' is not assignable to type 'C2'. +!!! error TS2323: Property 'C2M1' is missing in type 'I1'. arr_c2 = arr_c3; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'C3[]' is not assignable to type 'C2[]': -!!! error TS2322: Type 'C3' is not assignable to type 'C2': -!!! error TS2322: Property 'C2M1' is missing in type 'C3'. +!!! error TS2323: Type 'C3[]' is not assignable to type 'C2[]'. +!!! error TS2323: Type 'C3' is not assignable to type 'C2'. +!!! error TS2323: Property 'C2M1' is missing in type 'C3'. // "clean up bug" occurs at this point // if you move these three expressions to another file, they raise an error // something to do with state from the above propagating forward? arr_c3 = arr_c2_2; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'C2[]' is not assignable to type 'C3[]': -!!! error TS2322: Type 'C2' is not assignable to type 'C3': -!!! error TS2322: Property 'CM3M1' is missing in type 'C2'. +!!! error TS2323: Type 'C2[]' is not assignable to type 'C3[]'. +!!! error TS2323: Type 'C2' is not assignable to type 'C3'. +!!! error TS2323: Property 'CM3M1' is missing in type 'C2'. arr_c3 = arr_c1_2; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'C1[]' is not assignable to type 'C3[]': -!!! error TS2322: Type 'C1' is not assignable to type 'C3': -!!! error TS2322: Property 'CM3M1' is missing in type 'C1'. +!!! error TS2323: Type 'C1[]' is not assignable to type 'C3[]'. +!!! error TS2323: Type 'C1' is not assignable to type 'C3'. +!!! error TS2323: Property 'CM3M1' is missing in type 'C1'. arr_c3 = arr_i1_2; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'I1[]' is not assignable to type 'C3[]': -!!! error TS2322: Type 'I1' is not assignable to type 'C3': -!!! error TS2322: Property 'CM3M1' is missing in type 'I1'. +!!! error TS2323: Type 'I1[]' is not assignable to type 'C3[]'. +!!! error TS2323: Type 'I1' is not assignable to type 'C3'. +!!! error TS2323: Property 'CM3M1' is missing in type 'I1'. arr_any = f1; // should be an error - is ~~~~~~~ -!!! error TS2322: Type '() => C1' is not assignable to type 'any[]': -!!! error TS2322: Property 'push' is missing in type '() => C1'. +!!! error TS2323: Type '() => C1' is not assignable to type 'any[]'. +!!! error TS2323: Property 'push' is missing in type '() => C1'. arr_any = o1; // should be an error - is ~~~~~~~ -!!! error TS2322: Type '{ one: number; }' is not assignable to type 'any[]': -!!! error TS2322: Property 'length' is missing in type '{ one: number; }'. +!!! error TS2323: Type '{ one: number; }' is not assignable to type 'any[]'. +!!! error TS2323: Property 'length' is missing in type '{ one: number; }'. arr_any = a1; // should be ok - is arr_any = c1; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'C1' is not assignable to type 'any[]': -!!! error TS2322: Property 'length' is missing in type 'C1'. +!!! error TS2323: Type 'C1' is not assignable to type 'any[]'. +!!! error TS2323: Property 'length' is missing in type 'C1'. arr_any = c2; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'C2' is not assignable to type 'any[]': -!!! error TS2322: Property 'length' is missing in type 'C2'. +!!! error TS2323: Type 'C2' is not assignable to type 'any[]'. +!!! error TS2323: Property 'length' is missing in type 'C2'. arr_any = c3; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'C3' is not assignable to type 'any[]': -!!! error TS2322: Property 'length' is missing in type 'C3'. +!!! error TS2323: Type 'C3' is not assignable to type 'any[]'. +!!! error TS2323: Property 'length' is missing in type 'C3'. arr_any = i1; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'I1' is not assignable to type 'any[]': -!!! error TS2322: Property 'length' is missing in type 'I1'. \ No newline at end of file +!!! error TS2323: Type 'I1' is not assignable to type 'any[]'. +!!! error TS2323: Property 'length' is missing in type 'I1'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest2.errors.txt b/tests/baselines/reference/arrayAssignmentTest2.errors.txt index c9364ab555b..d1bd15d6db5 100644 --- a/tests/baselines/reference/arrayAssignmentTest2.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest2.errors.txt @@ -1,25 +1,25 @@ -tests/cases/compiler/arrayAssignmentTest2.ts(47,1): error TS2322: Type 'C2[]' is not assignable to type 'C3[]': - Type 'C2' is not assignable to type 'C3': +tests/cases/compiler/arrayAssignmentTest2.ts(47,1): error TS2323: Type 'C2[]' is not assignable to type 'C3[]'. + Type 'C2' is not assignable to type 'C3'. Property 'CM3M1' is missing in type 'C2'. -tests/cases/compiler/arrayAssignmentTest2.ts(48,1): error TS2322: Type 'C1[]' is not assignable to type 'C3[]': - Type 'C1' is not assignable to type 'C3': +tests/cases/compiler/arrayAssignmentTest2.ts(48,1): error TS2323: Type 'C1[]' is not assignable to type 'C3[]'. + Type 'C1' is not assignable to type 'C3'. Property 'CM3M1' is missing in type 'C1'. -tests/cases/compiler/arrayAssignmentTest2.ts(49,1): error TS2322: Type 'I1[]' is not assignable to type 'C3[]': - Type 'I1' is not assignable to type 'C3': +tests/cases/compiler/arrayAssignmentTest2.ts(49,1): error TS2323: Type 'I1[]' is not assignable to type 'C3[]'. + Type 'I1' is not assignable to type 'C3'. Property 'CM3M1' is missing in type 'I1'. -tests/cases/compiler/arrayAssignmentTest2.ts(51,1): error TS2322: Type '() => C1' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest2.ts(51,1): error TS2323: Type '() => C1' is not assignable to type 'any[]'. Property 'push' is missing in type '() => C1'. -tests/cases/compiler/arrayAssignmentTest2.ts(52,1): error TS2322: Type '() => any' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest2.ts(52,1): error TS2323: Type '() => any' is not assignable to type 'any[]'. Property 'push' is missing in type '() => any'. -tests/cases/compiler/arrayAssignmentTest2.ts(53,1): error TS2322: Type '{ one: number; }' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest2.ts(53,1): error TS2323: Type '{ one: number; }' is not assignable to type 'any[]'. Property 'length' is missing in type '{ one: number; }'. -tests/cases/compiler/arrayAssignmentTest2.ts(55,1): error TS2322: Type 'C1' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest2.ts(55,1): error TS2323: Type 'C1' is not assignable to type 'any[]'. Property 'length' is missing in type 'C1'. -tests/cases/compiler/arrayAssignmentTest2.ts(56,1): error TS2322: Type 'C2' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest2.ts(56,1): error TS2323: Type 'C2' is not assignable to type 'any[]'. Property 'length' is missing in type 'C2'. -tests/cases/compiler/arrayAssignmentTest2.ts(57,1): error TS2322: Type 'C3' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest2.ts(57,1): error TS2323: Type 'C3' is not assignable to type 'any[]'. Property 'length' is missing in type 'C3'. -tests/cases/compiler/arrayAssignmentTest2.ts(58,1): error TS2322: Type 'I1' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest2.ts(58,1): error TS2323: Type 'I1' is not assignable to type 'any[]'. Property 'length' is missing in type 'I1'. @@ -72,47 +72,47 @@ tests/cases/compiler/arrayAssignmentTest2.ts(58,1): error TS2322: Type 'I1' is n // "clean up error" occurs at this point arr_c3 = arr_c2_2; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'C2[]' is not assignable to type 'C3[]': -!!! error TS2322: Type 'C2' is not assignable to type 'C3': -!!! error TS2322: Property 'CM3M1' is missing in type 'C2'. +!!! error TS2323: Type 'C2[]' is not assignable to type 'C3[]'. +!!! error TS2323: Type 'C2' is not assignable to type 'C3'. +!!! error TS2323: Property 'CM3M1' is missing in type 'C2'. arr_c3 = arr_c1_2; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'C1[]' is not assignable to type 'C3[]': -!!! error TS2322: Type 'C1' is not assignable to type 'C3': -!!! error TS2322: Property 'CM3M1' is missing in type 'C1'. +!!! error TS2323: Type 'C1[]' is not assignable to type 'C3[]'. +!!! error TS2323: Type 'C1' is not assignable to type 'C3'. +!!! error TS2323: Property 'CM3M1' is missing in type 'C1'. arr_c3 = arr_i1_2; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'I1[]' is not assignable to type 'C3[]': -!!! error TS2322: Type 'I1' is not assignable to type 'C3': -!!! error TS2322: Property 'CM3M1' is missing in type 'I1'. +!!! error TS2323: Type 'I1[]' is not assignable to type 'C3[]'. +!!! error TS2323: Type 'I1' is not assignable to type 'C3'. +!!! error TS2323: Property 'CM3M1' is missing in type 'I1'. arr_any = f1; // should be an error - is ~~~~~~~ -!!! error TS2322: Type '() => C1' is not assignable to type 'any[]': -!!! error TS2322: Property 'push' is missing in type '() => C1'. +!!! error TS2323: Type '() => C1' is not assignable to type 'any[]'. +!!! error TS2323: Property 'push' is missing in type '() => C1'. arr_any = function () { return null;} // should be an error - is ~~~~~~~ -!!! error TS2322: Type '() => any' is not assignable to type 'any[]': -!!! error TS2322: Property 'push' is missing in type '() => any'. +!!! error TS2323: Type '() => any' is not assignable to type 'any[]'. +!!! error TS2323: Property 'push' is missing in type '() => any'. arr_any = o1; // should be an error - is ~~~~~~~ -!!! error TS2322: Type '{ one: number; }' is not assignable to type 'any[]': -!!! error TS2322: Property 'length' is missing in type '{ one: number; }'. +!!! error TS2323: Type '{ one: number; }' is not assignable to type 'any[]'. +!!! error TS2323: Property 'length' is missing in type '{ one: number; }'. arr_any = a1; // should be ok - is arr_any = c1; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'C1' is not assignable to type 'any[]': -!!! error TS2322: Property 'length' is missing in type 'C1'. +!!! error TS2323: Type 'C1' is not assignable to type 'any[]'. +!!! error TS2323: Property 'length' is missing in type 'C1'. arr_any = c2; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'C2' is not assignable to type 'any[]': -!!! error TS2322: Property 'length' is missing in type 'C2'. +!!! error TS2323: Type 'C2' is not assignable to type 'any[]'. +!!! error TS2323: Property 'length' is missing in type 'C2'. arr_any = c3; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'C3' is not assignable to type 'any[]': -!!! error TS2322: Property 'length' is missing in type 'C3'. +!!! error TS2323: Type 'C3' is not assignable to type 'any[]'. +!!! error TS2323: Property 'length' is missing in type 'C3'. arr_any = i1; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'I1' is not assignable to type 'any[]': -!!! error TS2322: Property 'length' is missing in type 'I1'. +!!! error TS2323: Type 'I1' is not assignable to type 'any[]'. +!!! error TS2323: Property 'length' is missing in type 'I1'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest4.errors.txt b/tests/baselines/reference/arrayAssignmentTest4.errors.txt index 0d346e48293..2ef303cc2bb 100644 --- a/tests/baselines/reference/arrayAssignmentTest4.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest4.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/arrayAssignmentTest4.ts(24,1): error TS2322: Type '() => any' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest4.ts(24,1): error TS2323: Type '() => any' is not assignable to type 'any[]'. Property 'push' is missing in type '() => any'. -tests/cases/compiler/arrayAssignmentTest4.ts(25,1): error TS2322: Type 'C3' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest4.ts(25,1): error TS2323: Type 'C3' is not assignable to type 'any[]'. Property 'length' is missing in type 'C3'. @@ -30,10 +30,10 @@ tests/cases/compiler/arrayAssignmentTest4.ts(25,1): error TS2322: Type 'C3' is n arr_any = function () { return null;} // should be an error - is ~~~~~~~ -!!! error TS2322: Type '() => any' is not assignable to type 'any[]': -!!! error TS2322: Property 'push' is missing in type '() => any'. +!!! error TS2323: Type '() => any' is not assignable to type 'any[]'. +!!! error TS2323: Property 'push' is missing in type '() => any'. arr_any = c3; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'C3' is not assignable to type 'any[]': -!!! error TS2322: Property 'length' is missing in type 'C3'. +!!! error TS2323: Type 'C3' is not assignable to type 'any[]'. +!!! error TS2323: Property 'length' is missing in type 'C3'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest5.errors.txt b/tests/baselines/reference/arrayAssignmentTest5.errors.txt index 417430b8e43..37252bbf1d1 100644 --- a/tests/baselines/reference/arrayAssignmentTest5.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest5.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/arrayAssignmentTest5.ts(23,17): error TS2322: Type 'IToken[]' is not assignable to type 'IStateToken[]': - Type 'IToken' is not assignable to type 'IStateToken': +tests/cases/compiler/arrayAssignmentTest5.ts(23,17): error TS2323: Type 'IToken[]' is not assignable to type 'IStateToken[]'. + Type 'IToken' is not assignable to type 'IStateToken'. Property 'state' is missing in type 'IToken'. @@ -28,9 +28,9 @@ tests/cases/compiler/arrayAssignmentTest5.ts(23,17): error TS2322: Type 'IToken[ var lineTokens:ILineTokens= this.tokenize(line, state, true); var tokens:IStateToken[]= lineTokens.tokens; ~~~~~~ -!!! error TS2322: Type 'IToken[]' is not assignable to type 'IStateToken[]': -!!! error TS2322: Type 'IToken' is not assignable to type 'IStateToken': -!!! error TS2322: Property 'state' is missing in type 'IToken'. +!!! error TS2323: Type 'IToken[]' is not assignable to type 'IStateToken[]'. +!!! error TS2323: Type 'IToken' is not assignable to type 'IStateToken'. +!!! error TS2323: Property 'state' is missing in type 'IToken'. if (tokens.length === 0) { return this.onEnter(line, tokens, offset); // <== this should produce an error since onEnter can not be called with (string, IStateToken[], offset) } diff --git a/tests/baselines/reference/arrayCast.errors.txt b/tests/baselines/reference/arrayCast.errors.txt index 2218bbf5a75..10562cc57e4 100644 --- a/tests/baselines/reference/arrayCast.errors.txt +++ b/tests/baselines/reference/arrayCast.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/arrayCast.ts(3,1): error TS2353: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other: - Type '{ foo: string; }' is not assignable to type '{ id: number; }': +tests/cases/compiler/arrayCast.ts(3,1): error TS2352: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other. + Type '{ foo: string; }' is not assignable to type '{ id: number; }'. Property 'id' is missing in type '{ foo: string; }'. @@ -8,9 +8,9 @@ tests/cases/compiler/arrayCast.ts(3,1): error TS2353: Neither type '{ foo: strin // has type { foo: string }[], which is not assignable to { id: number }[]. <{ id: number; }[]>[{ foo: "s" }]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other: -!!! error TS2353: Type '{ foo: string; }' is not assignable to type '{ id: number; }': -!!! error TS2353: Property 'id' is missing in type '{ foo: string; }'. +!!! error TS2352: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other. +!!! error TS2352: Type '{ foo: string; }' is not assignable to type '{ id: number; }'. +!!! error TS2352: Property 'id' is missing in type '{ foo: string; }'. // Should succeed, as the {} element causes the type of the array to be {}[] <{ id: number; }[]>[{ foo: "s" }, {}]; \ No newline at end of file diff --git a/tests/baselines/reference/arraySigChecking.errors.txt b/tests/baselines/reference/arraySigChecking.errors.txt index 055c62c479b..50eb6a0cc9d 100644 --- a/tests/baselines/reference/arraySigChecking.errors.txt +++ b/tests/baselines/reference/arraySigChecking.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/arraySigChecking.ts(11,17): error TS1023: An index signature parameter type must be 'string' or 'number'. -tests/cases/compiler/arraySigChecking.ts(18,5): error TS2322: Type 'void[]' is not assignable to type 'string[]': +tests/cases/compiler/arraySigChecking.ts(18,5): error TS2323: Type 'void[]' is not assignable to type 'string[]'. Type 'void' is not assignable to type 'string'. -tests/cases/compiler/arraySigChecking.ts(22,1): error TS2322: Type 'number[][]' is not assignable to type 'number[][][]': - Type 'number[]' is not assignable to type 'number[][]': - Type 'number' is not assignable to type 'number[]': +tests/cases/compiler/arraySigChecking.ts(22,1): error TS2323: Type 'number[][]' is not assignable to type 'number[][][]'. + Type 'number[]' is not assignable to type 'number[][]'. + Type 'number' is not assignable to type 'number[]'. Property 'length' is missing in type 'Number'. @@ -29,17 +29,17 @@ tests/cases/compiler/arraySigChecking.ts(22,1): error TS2322: Type 'number[][]' var myVar: myInt; var strArray: string[] = [myVar.voidFn()]; ~~~~~~~~ -!!! error TS2322: Type 'void[]' is not assignable to type 'string[]': -!!! error TS2322: Type 'void' is not assignable to type 'string'. +!!! error TS2323: Type 'void[]' is not assignable to type 'string[]'. +!!! error TS2323: Type 'void' is not assignable to type 'string'. var myArray: number[][][]; myArray = [[1, 2]]; ~~~~~~~ -!!! error TS2322: Type 'number[][]' is not assignable to type 'number[][][]': -!!! error TS2322: Type 'number[]' is not assignable to type 'number[][]': -!!! error TS2322: Type 'number' is not assignable to type 'number[]': -!!! error TS2322: Property 'length' is missing in type 'Number'. +!!! error TS2323: Type 'number[][]' is not assignable to type 'number[][][]'. +!!! error TS2323: Type 'number[]' is not assignable to type 'number[][]'. +!!! error TS2323: Type 'number' is not assignable to type 'number[]'. +!!! error TS2323: Property 'length' is missing in type 'Number'. function isEmpty(l: { length: number }) { return l.length === 0; diff --git a/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt b/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt index bb4867702ec..807227cc10b 100644 --- a/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt +++ b/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts( tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,30): error TS1109: Expression expected. tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,22): error TS1005: '=' expected. tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,32): error TS1109: Expression expected. -tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,5): error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }': +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,5): error TS2323: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. Property 'isArray' is missing in type 'Number'. tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,5): error TS2323: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. @@ -19,8 +19,8 @@ tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts( ~ !!! error TS1109: Expression expected. ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }': -!!! error TS2322: Property 'isArray' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. +!!! error TS2323: Property 'isArray' is missing in type 'Number'. var xs4: typeof Array; ~ !!! error TS1005: '=' expected. diff --git a/tests/baselines/reference/assignmentCompat1.errors.txt b/tests/baselines/reference/assignmentCompat1.errors.txt index 0e22bd1b391..6f5fc93d136 100644 --- a/tests/baselines/reference/assignmentCompat1.errors.txt +++ b/tests/baselines/reference/assignmentCompat1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2322: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }': +tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2323: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }'. Property 'one' is missing in type '{ [x: string]: any; }'. -tests/cases/compiler/assignmentCompat1.ts(5,1): error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }': +tests/cases/compiler/assignmentCompat1.ts(5,1): error TS2323: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }'. Index signature is missing in type '{ one: number; }'. @@ -10,9 +10,9 @@ tests/cases/compiler/assignmentCompat1.ts(5,1): error TS2322: Type '{ one: numbe x = y; ~ -!!! error TS2322: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }': -!!! error TS2322: Property 'one' is missing in type '{ [x: string]: any; }'. +!!! error TS2323: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }'. +!!! error TS2323: Property 'one' is missing in type '{ [x: string]: any; }'. y = x; ~ -!!! error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }': -!!! error TS2322: Index signature is missing in type '{ one: number; }'. \ No newline at end of file +!!! error TS2323: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }'. +!!! error TS2323: Index signature is missing in type '{ one: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt index 2395f2bf364..7b74aed499f 100644 --- a/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt +++ b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(17,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]': - Types of property 'pop' are incompatible: - Type '() => string | number' is not assignable to type '() => number': - Type 'string | number' is not assignable to type 'number': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(17,1): error TS2323: Type '[number, string]' is not assignable to type 'number[]'. + Types of property 'pop' are incompatible. + Type '() => string | number' is not assignable to type '() => number'. + Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(18,1): error TS2322: Type '{}[]' is not assignable to type '[{}]': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(18,1): error TS2323: Type '{}[]' is not assignable to type '[{}]'. Property '0' is missing in type '{}[]'. @@ -26,13 +26,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // error numArray = numStrTuple; ~~~~~~~~ -!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]': -!!! error TS2322: Types of property 'pop' are incompatible: -!!! error TS2322: Type '() => string | number' is not assignable to type '() => number': -!!! error TS2322: Type 'string | number' is not assignable to type 'number': -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '[number, string]' is not assignable to type 'number[]'. +!!! error TS2323: Types of property 'pop' are incompatible. +!!! error TS2323: Type '() => string | number' is not assignable to type '() => number'. +!!! error TS2323: Type 'string | number' is not assignable to type 'number'. +!!! error TS2323: Type 'string' is not assignable to type 'number'. emptyObjTuple = emptyObjArray; ~~~~~~~~~~~~~ -!!! error TS2322: Type '{}[]' is not assignable to type '[{}]': -!!! error TS2322: Property '0' is missing in type '{}[]'. +!!! error TS2323: Type '{}[]' is not assignable to type '[{}]'. +!!! error TS2323: Property '0' is missing in type '{}[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatBug2.errors.txt b/tests/baselines/reference/assignmentCompatBug2.errors.txt index 260aa868dfd..683846b26c1 100644 --- a/tests/baselines/reference/assignmentCompatBug2.errors.txt +++ b/tests/baselines/reference/assignmentCompatBug2.errors.txt @@ -1,25 +1,25 @@ -tests/cases/compiler/assignmentCompatBug2.ts(1,5): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }': +tests/cases/compiler/assignmentCompatBug2.ts(1,5): error TS2323: Type '{ a: number; }' is not assignable to type '{ b: number; }'. Property 'b' is missing in type '{ a: number; }'. -tests/cases/compiler/assignmentCompatBug2.ts(3,1): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }': +tests/cases/compiler/assignmentCompatBug2.ts(3,1): error TS2323: Type '{ a: number; }' is not assignable to type '{ b: number; }'. Property 'b' is missing in type '{ a: number; }'. -tests/cases/compiler/assignmentCompatBug2.ts(15,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': +tests/cases/compiler/assignmentCompatBug2.ts(15,1): error TS2323: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'. -tests/cases/compiler/assignmentCompatBug2.ts(20,1): error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': +tests/cases/compiler/assignmentCompatBug2.ts(20,1): error TS2323: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'. -tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': +tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2323: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'. ==== tests/cases/compiler/assignmentCompatBug2.ts (5 errors) ==== var b2: { b: number;} = { a: 0 }; // error ~~ -!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }': -!!! error TS2322: Property 'b' is missing in type '{ a: number; }'. +!!! error TS2323: Type '{ a: number; }' is not assignable to type '{ b: number; }'. +!!! error TS2323: Property 'b' is missing in type '{ a: number; }'. b2 = { a: 0 }; // error ~~ -!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }': -!!! error TS2322: Property 'b' is missing in type '{ a: number; }'. +!!! error TS2323: Type '{ a: number; }' is not assignable to type '{ b: number; }'. +!!! error TS2323: Property 'b' is missing in type '{ a: number; }'. b2 = {b: 0, a: 0 }; @@ -33,16 +33,16 @@ tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: b3 = { ~~ -!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': -!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'. +!!! error TS2323: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +!!! error TS2323: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'. f: (n) => { return 0; }, g: (s) => { return 0; }, }; // error b3 = { ~~ -!!! error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': -!!! error TS2322: Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'. +!!! error TS2323: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +!!! error TS2323: Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'. f: (n) => { return 0; }, m: 0, }; // error @@ -57,8 +57,8 @@ tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: b3 = { ~~ -!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': -!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'. +!!! error TS2323: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +!!! error TS2323: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'. f: (n) => { return 0; }, g: (s) => { return 0; }, n: 0, diff --git a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt index a17c09988a3..2316320f480 100644 --- a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt +++ b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration. tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(4,5): error TS2345: Argument of type '{ id: number; name: boolean; }' is not assignable to parameter of type '{ id: number; name?: string; }'. - Types of property 'name' are incompatible: + Types of property 'name' are incompatible. Type 'boolean' is not assignable to type 'string'. tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(5,5): error TS2345: Argument of type '{ name: string; }' is not assignable to parameter of type '{ id: number; name?: string; }'. Property 'id' is missing in type '{ name: string; }'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(5,5): error TS foo({ id: 1234, name: false }); // Error, name of wrong type ~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ id: number; name: boolean; }' is not assignable to parameter of type '{ id: number; name?: string; }'. -!!! error TS2345: Types of property 'name' are incompatible: +!!! error TS2345: Types of property 'name' are incompatible. !!! error TS2345: Type 'boolean' is not assignable to type 'string'. foo({ name: "hello" }); // Error, id required but missing ~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt index e2016fb7029..8ad90d773f4 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt @@ -1,26 +1,26 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(35,1): error TS2322: Type 'S2' is not assignable to type 'T': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(35,1): error TS2323: Type 'S2' is not assignable to type 'T'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(36,1): error TS2322: Type '(x: string) => void' is not assignable to type 'T': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(36,1): error TS2323: Type '(x: string) => void' is not assignable to type 'T'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(37,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(37,1): error TS2323: Type '(x: string) => number' is not assignable to type 'T'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(38,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(38,1): error TS2323: Type '(x: string) => string' is not assignable to type 'T'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(39,1): error TS2322: Type 'S2' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(39,1): error TS2323: Type 'S2' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(40,1): error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(40,1): error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(41,1): error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(41,1): error TS2323: Type '(x: string) => number' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(42,1): error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(42,1): error TS2323: Type '(x: string) => string' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. @@ -61,42 +61,42 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // these are errors t = s2; ~ -!!! error TS2322: Type 'S2' is not assignable to type 'T': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'S2' is not assignable to type 'T'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. t = a3; ~ -!!! error TS2322: Type '(x: string) => void' is not assignable to type 'T': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '(x: string) => void' is not assignable to type 'T'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. t = (x: string) => 1; ~ -!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '(x: string) => number' is not assignable to type 'T'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. t = function (x: string) { return ''; } ~ -!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '(x: string) => string' is not assignable to type 'T'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. a = s2; ~ -!!! error TS2322: Type 'S2' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'S2' is not assignable to type '(x: number) => void'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. a = a3; ~ -!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. a = (x: string) => 1; ~ -!!! error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '(x: string) => number' is not assignable to type '(x: number) => void'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. a = function (x: string) { return ''; } ~ -!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '(x: string) => string' is not assignable to type '(x: number) => void'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt index 1aed50f25f1..ff12410e875 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt @@ -1,38 +1,38 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(31,1): error TS2322: Type '() => number' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(31,1): error TS2323: Type '() => number' is not assignable to type 'T'. Property 'f' is missing in type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(32,1): error TS2322: Type '(x: number) => string' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(32,1): error TS2323: Type '(x: number) => string' is not assignable to type 'T'. Property 'f' is missing in type '(x: number) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(33,1): error TS2322: Type '() => number' is not assignable to type '{ f(x: number): void; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(33,1): error TS2323: Type '() => number' is not assignable to type '{ f(x: number): void; }'. Property 'f' is missing in type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(34,1): error TS2322: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(34,1): error TS2323: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }'. Property 'f' is missing in type '(x: number) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(42,1): error TS2322: Type 'S2' is not assignable to type 'T': - Types of property 'f' are incompatible: - Type '(x: string) => void' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(42,1): error TS2323: Type 'S2' is not assignable to type 'T'. + Types of property 'f' are incompatible. + Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(43,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T': - Types of property 'f' are incompatible: - Type '(x: string) => void' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(43,1): error TS2323: Type '{ f(x: string): void; }' is not assignable to type 'T'. + Types of property 'f' are incompatible. + Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(44,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(44,1): error TS2323: Type '(x: string) => number' is not assignable to type 'T'. Property 'f' is missing in type '(x: string) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(45,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(45,1): error TS2323: Type '(x: string) => string' is not assignable to type 'T'. Property 'f' is missing in type '(x: string) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(46,1): error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }': - Types of property 'f' are incompatible: - Type '(x: string) => void' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(46,1): error TS2323: Type 'S2' is not assignable to type '{ f(x: number): void; }'. + Types of property 'f' are incompatible. + Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(47,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }': - Types of property 'f' are incompatible: - Type '(x: string) => void' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(47,1): error TS2323: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }'. + Types of property 'f' are incompatible. + Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(48,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(48,1): error TS2323: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'. Property 'f' is missing in type '(x: string) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(49,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(49,1): error TS2323: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }'. Property 'f' is missing in type '(x: string) => string'. @@ -69,20 +69,20 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // errors t = () => 1; ~ -!!! error TS2322: Type '() => number' is not assignable to type 'T': -!!! error TS2322: Property 'f' is missing in type '() => number'. +!!! error TS2323: Type '() => number' is not assignable to type 'T'. +!!! error TS2323: Property 'f' is missing in type '() => number'. t = function (x: number) { return ''; } ~ -!!! error TS2322: Type '(x: number) => string' is not assignable to type 'T': -!!! error TS2322: Property 'f' is missing in type '(x: number) => string'. +!!! error TS2323: Type '(x: number) => string' is not assignable to type 'T'. +!!! error TS2323: Property 'f' is missing in type '(x: number) => string'. a = () => 1; ~ -!!! error TS2322: Type '() => number' is not assignable to type '{ f(x: number): void; }': -!!! error TS2322: Property 'f' is missing in type '() => number'. +!!! error TS2323: Type '() => number' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2323: Property 'f' is missing in type '() => number'. a = function (x: number) { return ''; } ~ -!!! error TS2322: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }': -!!! error TS2322: Property 'f' is missing in type '(x: number) => string'. +!!! error TS2323: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2323: Property 'f' is missing in type '(x: number) => string'. interface S2 { f(x: string): void; @@ -92,46 +92,46 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // these are errors t = s2; ~ -!!! error TS2322: Type 'S2' is not assignable to type 'T': -!!! error TS2322: Types of property 'f' are incompatible: -!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'S2' is not assignable to type 'T'. +!!! error TS2323: Types of property 'f' are incompatible. +!!! error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. t = a3; ~ -!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T': -!!! error TS2322: Types of property 'f' are incompatible: -!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '{ f(x: string): void; }' is not assignable to type 'T'. +!!! error TS2323: Types of property 'f' are incompatible. +!!! error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. t = (x: string) => 1; ~ -!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T': -!!! error TS2322: Property 'f' is missing in type '(x: string) => number'. +!!! error TS2323: Type '(x: string) => number' is not assignable to type 'T'. +!!! error TS2323: Property 'f' is missing in type '(x: string) => number'. t = function (x: string) { return ''; } ~ -!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T': -!!! error TS2322: Property 'f' is missing in type '(x: string) => string'. +!!! error TS2323: Type '(x: string) => string' is not assignable to type 'T'. +!!! error TS2323: Property 'f' is missing in type '(x: string) => string'. a = s2; ~ -!!! error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }': -!!! error TS2322: Types of property 'f' are incompatible: -!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'S2' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2323: Types of property 'f' are incompatible. +!!! error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. a = a3; ~ -!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }': -!!! error TS2322: Types of property 'f' are incompatible: -!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2323: Types of property 'f' are incompatible. +!!! error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. a = (x: string) => 1; ~ -!!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }': -!!! error TS2322: Property 'f' is missing in type '(x: string) => number'. +!!! error TS2323: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2323: Property 'f' is missing in type '(x: string) => number'. a = function (x: string) { return ''; } ~ -!!! error TS2322: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }': -!!! error TS2322: Property 'f' is missing in type '(x: string) => string'. +!!! error TS2323: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2323: Property 'f' is missing in type '(x: string) => string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt index 92bc30a7144..65b0a55a386 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(52,9): error TS2322: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': - Types of parameters 'y' and 'y' are incompatible: - Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': - Types of parameters 'arg2' and 'arg2' are incompatible: - Type '{ foo: number; }' is not assignable to type 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(52,9): error TS2323: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(53,9): error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U': - Types of parameters 'y' and 'y' are incompatible: - Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any': - Types of parameters 'arg2' and 'arg2' are incompatible: - Type 'Base' is not assignable to type '{ foo: number; }': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(53,9): error TS2323: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type 'Base' is not assignable to type '{ foo: number; }'. + Types of property 'foo' are incompatible. Type 'string' is not assignable to type 'number'. @@ -68,22 +68,22 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b8: (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; a8 = b8; // error, { foo: number } and Base are incompatible ~~ -!!! error TS2322: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': -!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible: -!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. +!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2323: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2323: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2323: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. b8 = a8; // error, { foo: number } and Base are incompatible ~~ -!!! error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any': -!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type '{ foo: number; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. +!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2323: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. +!!! error TS2323: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type '{ foo: number; }'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. var b10: (...x: T[]) => T; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt index 117f6cae0e9..79fa3452394 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt @@ -1,29 +1,29 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(13,5): error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number': - Types of parameters 'args' and 'args' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(13,5): error TS2323: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. + Types of parameters 'args' and 'args' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(17,5): error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number': - Types of parameters 'x' and 'args' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(17,5): error TS2323: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. + Types of parameters 'x' and 'args' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(26,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number': - Types of parameters 'args' and 'z' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(26,5): error TS2323: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. + Types of parameters 'args' and 'z' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(35,5): error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': - Types of parameters 'y' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(35,5): error TS2323: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(36,5): error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': - Types of parameters 'z' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(36,5): error TS2323: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Types of parameters 'z' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(37,5): error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(37,5): error TS2323: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(41,5): error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': - Types of parameters 'y' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(41,5): error TS2323: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. + Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(43,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': - Types of parameters 'y' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(43,5): error TS2323: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. + Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': - Types of parameters 'args' and 'z' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2323: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. + Types of parameters 'args' and 'z' are incompatible. Type 'string' is not assignable to type 'number'. @@ -42,17 +42,17 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = (...args: number[]) => 1; // ok, same number of required params a = (...args: string[]) => 1; // error, type mismatch ~ -!!! error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number': -!!! error TS2322: Types of parameters 'args' and 'args' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. +!!! error TS2323: Types of parameters 'args' and 'args' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. a = (x?: number) => 1; // ok, same number of required params a = (x?: number, y?: number, z?: number) => 1; // ok, same number of required params a = (x: number) => 1; // ok, rest param corresponds to infinite number of params a = (x?: string) => 1; // error, incompatible type ~ -!!! error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number': -!!! error TS2322: Types of parameters 'x' and 'args' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. +!!! error TS2323: Types of parameters 'x' and 'args' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. var a2: (x: number, ...z: number[]) => number; @@ -63,9 +63,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = (x: number, ...args: number[]) => 1; // ok, same number of required params a2 = (x: number, ...args: string[]) => 1; // should be type mismatch error ~~ -!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number': -!!! error TS2322: Types of parameters 'args' and 'z' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. +!!! error TS2323: Types of parameters 'args' and 'z' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. a2 = (x: number, y: number) => 1; // ok, rest param corresponds to infinite number of params a2 = (x: number, y?: number) => 1; // ok, same number of required params @@ -76,36 +76,36 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = (x: number, y: string) => 1; // ok, all present params match a3 = (x: number, y?: number, z?: number) => 1; // error ~~ -!!! error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. a3 = (x: number, ...z: number[]) => 1; // error ~~ -!!! error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': -!!! error TS2322: Types of parameters 'z' and 'y' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2323: Types of parameters 'z' and 'y' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. a3 = (x: string, y?: string, z?: string) => 1; // error ~~ -!!! error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. var a4: (x?: number, y?: string, ...z: number[]) => number; a4 = () => 1; // ok, fewer required params a4 = (x?: number, y?: number) => 1; // error, type mismatch ~~ -!!! error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. a4 = (x: number) => 1; // ok, all present params match a4 = (x: number, y?: number) => 1; // error, second param has type mismatch ~~ -!!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. a4 = (x?: number, y?: string) => 1; // ok, same number of required params with matching types a4 = (x: number, ...args: string[]) => 1; // error, rest params have type mismatch ~~ -!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': -!!! error TS2322: Types of parameters 'args' and 'z' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2323: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2323: Types of parameters 'args' and 'z' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt index 6213a2c27ce..7756bb82bda 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt @@ -1,30 +1,30 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(23,1): error TS2322: Type '() => number' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(23,1): error TS2323: Type '() => number' is not assignable to type 'T'. Property 'f' is missing in type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(24,1): error TS2322: Type '(x: number) => string' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(24,1): error TS2323: Type '(x: number) => string' is not assignable to type 'T'. Property 'f' is missing in type '(x: number) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(25,1): error TS2322: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(25,1): error TS2323: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }'. Property 'f' is missing in type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(26,1): error TS2322: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(26,1): error TS2323: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }'. Property 'f' is missing in type '(x: number) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(34,1): error TS2322: Type 'S2' is not assignable to type 'T': - Types of property 'f' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(34,1): error TS2323: Type 'S2' is not assignable to type 'T'. + Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(35,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T': - Types of property 'f' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(35,1): error TS2323: Type '{ f(x: string): void; }' is not assignable to type 'T'. + Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(36,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(36,1): error TS2323: Type '(x: string) => number' is not assignable to type 'T'. Property 'f' is missing in type '(x: string) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(37,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(37,1): error TS2323: Type '(x: string) => string' is not assignable to type 'T'. Property 'f' is missing in type '(x: string) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(38,1): error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }': - Types of property 'f' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(38,1): error TS2323: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'. + Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(39,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }': - Types of property 'f' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(39,1): error TS2323: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'. + Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(40,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(40,1): error TS2323: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'. Property 'f' is missing in type '(x: string) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(41,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(41,1): error TS2323: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }'. Property 'f' is missing in type '(x: string) => string'. @@ -53,20 +53,20 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // errors t = () => 1; ~ -!!! error TS2322: Type '() => number' is not assignable to type 'T': -!!! error TS2322: Property 'f' is missing in type '() => number'. +!!! error TS2323: Type '() => number' is not assignable to type 'T'. +!!! error TS2323: Property 'f' is missing in type '() => number'. t = function (x: number) { return ''; } ~ -!!! error TS2322: Type '(x: number) => string' is not assignable to type 'T': -!!! error TS2322: Property 'f' is missing in type '(x: number) => string'. +!!! error TS2323: Type '(x: number) => string' is not assignable to type 'T'. +!!! error TS2323: Property 'f' is missing in type '(x: number) => string'. a = () => 1; ~ -!!! error TS2322: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }': -!!! error TS2322: Property 'f' is missing in type '() => number'. +!!! error TS2323: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2323: Property 'f' is missing in type '() => number'. a = function (x: number) { return ''; } ~ -!!! error TS2322: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }': -!!! error TS2322: Property 'f' is missing in type '(x: number) => string'. +!!! error TS2323: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2323: Property 'f' is missing in type '(x: number) => string'. interface S2 { f(x: string): void; @@ -76,38 +76,38 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // these are errors t = s2; ~ -!!! error TS2322: Type 'S2' is not assignable to type 'T': -!!! error TS2322: Types of property 'f' are incompatible: -!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2323: Type 'S2' is not assignable to type 'T'. +!!! error TS2323: Types of property 'f' are incompatible. +!!! error TS2323: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. t = a3; ~ -!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T': -!!! error TS2322: Types of property 'f' are incompatible: -!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2323: Type '{ f(x: string): void; }' is not assignable to type 'T'. +!!! error TS2323: Types of property 'f' are incompatible. +!!! error TS2323: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. t = (x: string) => 1; ~ -!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T': -!!! error TS2322: Property 'f' is missing in type '(x: string) => number'. +!!! error TS2323: Type '(x: string) => number' is not assignable to type 'T'. +!!! error TS2323: Property 'f' is missing in type '(x: string) => number'. t = function (x: string) { return ''; } ~ -!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T': -!!! error TS2322: Property 'f' is missing in type '(x: string) => string'. +!!! error TS2323: Type '(x: string) => string' is not assignable to type 'T'. +!!! error TS2323: Property 'f' is missing in type '(x: string) => string'. a = s2; ~ -!!! error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }': -!!! error TS2322: Types of property 'f' are incompatible: -!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2323: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2323: Types of property 'f' are incompatible. +!!! error TS2323: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. a = a3; ~ -!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }': -!!! error TS2322: Types of property 'f' are incompatible: -!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2323: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2323: Types of property 'f' are incompatible. +!!! error TS2323: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. a = (x: string) => 1; ~ -!!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }': -!!! error TS2322: Property 'f' is missing in type '(x: string) => number'. +!!! error TS2323: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2323: Property 'f' is missing in type '(x: string) => number'. a = function (x: string) { return ''; } ~ -!!! error TS2322: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }': -!!! error TS2322: Property 'f' is missing in type '(x: string) => string'. +!!! error TS2323: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2323: Property 'f' is missing in type '(x: string) => string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt index b88beac6099..a701b2834d1 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt @@ -1,28 +1,28 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(52,9): error TS2322: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': - Types of parameters 'y' and 'y' are incompatible: - Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': - Types of parameters 'arg2' and 'arg2' are incompatible: - Type '{ foo: number; }' is not assignable to type 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(52,9): error TS2323: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(53,9): error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U': - Types of parameters 'y' and 'y' are incompatible: - Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any': - Types of parameters 'arg2' and 'arg2' are incompatible: - Type 'Base' is not assignable to type '{ foo: number; }': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(53,9): error TS2323: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type 'Base' is not assignable to type '{ foo: number; }'. + Types of property 'foo' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(77,9): error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(77,9): error TS2323: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'. + Types of parameters 'x' and 'x' are incompatible. Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(78,9): error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(78,9): error TS2323: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. + Types of parameters 'x' and 'x' are incompatible. Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(81,9): error TS2322: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(81,9): error TS2323: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }'. + Types of parameters 'x' and 'x' are incompatible. Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(82,9): error TS2322: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(82,9): error TS2323: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]'. + Types of parameters 'x' and 'x' are incompatible. Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. @@ -80,22 +80,22 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b8: new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; a8 = b8; // error, type mismatch ~~ -!!! error TS2322: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': -!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible: -!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. +!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2323: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2323: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2323: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. b8 = a8; // error ~~ -!!! error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any': -!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type '{ foo: number; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. +!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2323: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. +!!! error TS2323: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type '{ foo: number; }'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. var b10: new (...x: T[]) => T; @@ -121,26 +121,26 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b16: new (x: (a: T) => T) => T[]; a16 = b16; // error ~~~ -!!! error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. +!!! error TS2323: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. b16 = a16; // error ~~~ -!!! error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. +!!! error TS2323: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. var b17: new (x: (a: T) => T) => any[]; a17 = b17; // error ~~~ -!!! error TS2322: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. +!!! error TS2323: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. b17 = a17; // error ~~~ -!!! error TS2322: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. +!!! error TS2323: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. } module WithGenericSignaturesInBaseType { diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt index c4111661b14..04816fdfc9c 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt @@ -1,24 +1,24 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(14,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(14,1): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(18,1): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(32,9): error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(33,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }': - Index signatures are incompatible: - Type 'T' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(33,9): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(36,9): error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(36,9): error TS2323: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(37,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': - Index signatures are incompatible: - Type 'T' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(37,9): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. @@ -38,19 +38,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; b = a; // error ~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Base'. var b2: { [x: number]: Derived2; } a = b2; b2 = a; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Base'. module Generics { class A { @@ -66,28 +66,28 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b: { [x: number]: Derived; } a = b; // error ~ -!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Derived' is not assignable to type 'T'. +!!! error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Derived' is not assignable to type 'T'. b = a; // error ~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'T' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Base'. var b2: { [x: number]: Derived2; } a = b2; // error ~ -!!! error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2323: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Derived2' is not assignable to type 'T'. b2 = a; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'T' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Base'. var b3: { [x: number]: T; } a = b3; // ok diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt index fcd337ee615..0c6bba73489 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt @@ -1,24 +1,24 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(14,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(14,1): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(18,1): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(32,9): error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(33,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }': - Index signatures are incompatible: - Type 'T' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(33,9): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(36,9): error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(36,9): error TS2323: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(37,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': - Index signatures are incompatible: - Type 'T' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(37,9): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. @@ -38,19 +38,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; b = a; // error ~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Base'. var b2: { [x: number]: Derived2; } a = b2; b2 = a; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Base'. module Generics { interface A { @@ -66,28 +66,28 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b: { [x: number]: Derived; } a = b; // error ~ -!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Derived' is not assignable to type 'T'. +!!! error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Derived' is not assignable to type 'T'. b = a; // error ~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'T' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Base'. var b2: { [x: number]: Derived2; } a = b2; // error ~ -!!! error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2323: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Derived2' is not assignable to type 'T'. b2 = a; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'T' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Base'. var b3: { [x: number]: T; } a = b3; // ok diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt index 84b51350785..966b5f1b55f 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt @@ -1,13 +1,13 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(14,1): error TS2322: Type '{ [x: number]: Base; }' is not assignable to type 'A': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(14,1): error TS2323: Type '{ [x: number]: Base; }' is not assignable to type 'A'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(23,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': - Index signatures are incompatible: - Type 'Derived' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(23,1): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. + Index signatures are incompatible. + Type 'Derived' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(33,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(33,9): error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. @@ -27,10 +27,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; // error ~ -!!! error TS2322: Type '{ [x: number]: Base; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2323: Type '{ [x: number]: Base; }' is not assignable to type 'A'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Base'. b = a; // ok class B2 extends A { @@ -41,10 +41,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b2; // ok b2 = a; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Derived'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Derived' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Derived'. module Generics { class A { @@ -56,9 +56,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b: { [x: number]: Derived; }; a = b; // error ~ -!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Derived' is not assignable to type 'T'. +!!! error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Derived' is not assignable to type 'T'. b = a; // ok var b2: { [x: number]: T; }; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt index 606eef809f0..90d2c9fb6f9 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt @@ -1,70 +1,70 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(24,5): error TS2322: Type 'T' is not assignable to type 'S': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(24,5): error TS2323: Type 'T' is not assignable to type 'S'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(25,5): error TS2322: Type 'S' is not assignable to type 'T': - Types of property 'foo' are incompatible: - Type 'Derived' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(25,5): error TS2323: Type 'S' is not assignable to type 'T'. + Types of property 'foo' are incompatible. + Type 'Derived' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(29,5): error TS2322: Type 'T2' is not assignable to type 'S2': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(29,5): error TS2323: Type 'T2' is not assignable to type 'S2'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(30,5): error TS2322: Type 'S2' is not assignable to type 'T2': - Types of property 'foo' are incompatible: - Type 'Derived' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(30,5): error TS2323: Type 'S2' is not assignable to type 'T2'. + Types of property 'foo' are incompatible. + Type 'Derived' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(31,5): error TS2322: Type 'T' is not assignable to type 'S2': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(31,5): error TS2323: Type 'T' is not assignable to type 'S2'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(32,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type 'S2': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(32,5): error TS2323: Type '{ foo: Derived2; }' is not assignable to type 'S2'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(35,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(35,5): error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(36,5): error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }': - Types of property 'foo' are incompatible: - Type 'Derived' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(36,5): error TS2323: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. + Types of property 'foo' are incompatible. + Type 'Derived' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(41,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(41,5): error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(42,5): error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }': - Types of property 'foo' are incompatible: - Type 'Derived' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(42,5): error TS2323: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. + Types of property 'foo' are incompatible. + Type 'Derived' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(43,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(43,5): error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(44,5): error TS2322: Type 'T2' is not assignable to type '{ foo: Derived; }': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(44,5): error TS2323: Type 'T2' is not assignable to type '{ foo: Derived; }'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(45,5): error TS2322: Type 'T' is not assignable to type '{ foo: Derived; }': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(45,5): error TS2323: Type 'T' is not assignable to type '{ foo: Derived; }'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(70,5): error TS2322: Type 'S' is not assignable to type 'T': - Types of property 'foo' are incompatible: - Type 'Base' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(70,5): error TS2323: Type 'S' is not assignable to type 'T'. + Types of property 'foo' are incompatible. + Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(75,5): error TS2322: Type 'S2' is not assignable to type 'T2': - Types of property 'foo' are incompatible: - Type 'Base' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(75,5): error TS2323: Type 'S2' is not assignable to type 'T2'. + Types of property 'foo' are incompatible. + Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(81,5): error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }': - Types of property 'foo' are incompatible: - Type 'Base' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(81,5): error TS2323: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. + Types of property 'foo' are incompatible. + Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(87,5): error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }': - Types of property 'foo' are incompatible: - Type 'Base' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(87,5): error TS2323: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. + Types of property 'foo' are incompatible. + Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. @@ -94,91 +94,91 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s = t; // error ~ -!!! error TS2322: Type 'T' is not assignable to type 'S': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2323: Type 'T' is not assignable to type 'S'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Derived2'. t = s; // error ~ -!!! error TS2322: Type 'S' is not assignable to type 'T': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Derived'. +!!! error TS2323: Type 'S' is not assignable to type 'T'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'Derived' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Derived'. s = s2; // ok s = a2; // ok s2 = t2; // error ~~ -!!! error TS2322: Type 'T2' is not assignable to type 'S2': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2323: Type 'T2' is not assignable to type 'S2'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Derived2'. t2 = s2; // error ~~ -!!! error TS2322: Type 'S2' is not assignable to type 'T2': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Derived'. +!!! error TS2323: Type 'S2' is not assignable to type 'T2'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'Derived' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Derived'. s2 = t; // error ~~ -!!! error TS2322: Type 'T' is not assignable to type 'S2': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2323: Type 'T' is not assignable to type 'S2'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Derived2'. s2 = b; // error ~~ -!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type 'S2': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2323: Type '{ foo: Derived2; }' is not assignable to type 'S2'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Derived2'. s2 = a2; // ok a = b; // error ~ -!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Derived2'. b = a; // error ~ -!!! error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Derived'. +!!! error TS2323: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'Derived' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Derived'. a = s; // ok a = s2; // ok a = a2; // ok a2 = b2; // error ~~ -!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Derived2'. b2 = a2; // error ~~ -!!! error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Derived'. +!!! error TS2323: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'Derived' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Derived'. a2 = b; // error ~~ -!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Derived2'. a2 = t2; // error ~~ -!!! error TS2322: Type 'T2' is not assignable to type '{ foo: Derived; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2323: Type 'T2' is not assignable to type '{ foo: Derived; }'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Derived2'. a2 = t; // error ~~ -!!! error TS2322: Type 'T' is not assignable to type '{ foo: Derived; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2323: Type 'T' is not assignable to type '{ foo: Derived; }'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Derived2'. } module WithBase { @@ -205,20 +205,20 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s = t; // ok t = s; // error ~ -!!! error TS2322: Type 'S' is not assignable to type 'T': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2323: Type 'S' is not assignable to type 'T'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Base'. s = s2; // ok s = a2; // ok s2 = t2; // ok t2 = s2; // error ~~ -!!! error TS2322: Type 'S2' is not assignable to type 'T2': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2323: Type 'S2' is not assignable to type 'T2'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Base'. s2 = t; // ok s2 = b; // ok s2 = a2; // ok @@ -226,10 +226,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; // ok b = a; // error ~ -!!! error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2323: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Base'. a = s; // ok a = s2; // ok a = a2; // ok @@ -237,10 +237,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = b2; // ok b2 = a2; // error ~~ -!!! error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2323: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Base'. a2 = b; // ok a2 = t2; // ok a2 = t; // ok diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt index c63813d343d..8c0a69c2663 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(13,1): error TS2322: Type 'I' is not assignable to type 'C': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(13,1): error TS2323: Type 'I' is not assignable to type 'C'. Property 'foo' is missing in type 'I'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(14,1): error TS2322: Type 'C' is not assignable to type 'I': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(14,1): error TS2323: Type 'C' is not assignable to type 'I'. Property 'fooo' is missing in type 'C'. @@ -19,9 +19,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme c = i; // error ~ -!!! error TS2322: Type 'I' is not assignable to type 'C': -!!! error TS2322: Property 'foo' is missing in type 'I'. +!!! error TS2323: Type 'I' is not assignable to type 'C'. +!!! error TS2323: Property 'foo' is missing in type 'I'. i = c; // error ~ -!!! error TS2322: Type 'C' is not assignable to type 'I': -!!! error TS2322: Property 'fooo' is missing in type 'C'. \ No newline at end of file +!!! error TS2323: Type 'C' is not assignable to type 'I'. +!!! error TS2323: Property 'fooo' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt index ab9ddb553d3..8040ceb3003 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt @@ -1,50 +1,50 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(31,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(31,5): error TS2323: Type 'E' is not assignable to type '{ foo: string; }'. Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(36,5): error TS2322: Type 'E' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(36,5): error TS2323: Type 'E' is not assignable to type 'Base'. Property 'foo' is private in type 'E' but not in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(41,5): error TS2322: Type 'E' is not assignable to type 'I': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(41,5): error TS2323: Type 'E' is not assignable to type 'I'. Property 'foo' is private in type 'E' but not in type 'I'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(46,5): error TS2322: Type 'E' is not assignable to type 'D': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(46,5): error TS2323: Type 'E' is not assignable to type 'D'. Property 'foo' is private in type 'E' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(48,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(48,5): error TS2323: Type '{ foo: string; }' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(49,5): error TS2322: Type 'Base' is not assignable to type 'E': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(49,5): error TS2323: Type 'Base' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(50,5): error TS2322: Type 'I' is not assignable to type 'E': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(50,5): error TS2323: Type 'I' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type 'I'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(51,5): error TS2322: Type 'D' is not assignable to type 'E': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(51,5): error TS2323: Type 'D' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(81,5): error TS2322: Type 'Base' is not assignable to type '{ foo: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(81,5): error TS2323: Type 'Base' is not assignable to type '{ foo: string; }'. Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(82,5): error TS2322: Type 'I' is not assignable to type '{ foo: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(82,5): error TS2323: Type 'I' is not assignable to type '{ foo: string; }'. Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(84,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(84,5): error TS2323: Type 'E' is not assignable to type '{ foo: string; }'. Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(86,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(86,5): error TS2323: Type '{ foo: string; }' is not assignable to type 'Base'. Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(88,5): error TS2322: Type 'D' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(88,5): error TS2323: Type 'D' is not assignable to type 'Base'. Property 'foo' is private in type 'Base' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(89,5): error TS2322: Type 'E' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(89,5): error TS2323: Type 'E' is not assignable to type 'Base'. Types have separate declarations of a private property 'foo'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(92,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'I': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(92,5): error TS2323: Type '{ foo: string; }' is not assignable to type 'I'. Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(94,5): error TS2322: Type 'D' is not assignable to type 'I': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(94,5): error TS2323: Type 'D' is not assignable to type 'I'. Property 'foo' is private in type 'I' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(95,5): error TS2322: Type 'E' is not assignable to type 'I': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(95,5): error TS2323: Type 'E' is not assignable to type 'I'. Types have separate declarations of a private property 'foo'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(99,5): error TS2322: Type 'Base' is not assignable to type 'D': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(99,5): error TS2323: Type 'Base' is not assignable to type 'D'. Property 'foo' is private in type 'Base' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(100,5): error TS2322: Type 'I' is not assignable to type 'D': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(100,5): error TS2323: Type 'I' is not assignable to type 'D'. Property 'foo' is private in type 'I' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(101,5): error TS2322: Type 'E' is not assignable to type 'D': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(101,5): error TS2323: Type 'E' is not assignable to type 'D'. Property 'foo' is private in type 'E' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(103,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(103,5): error TS2323: Type '{ foo: string; }' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(104,5): error TS2322: Type 'Base' is not assignable to type 'E': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(104,5): error TS2323: Type 'Base' is not assignable to type 'E'. Types have separate declarations of a private property 'foo'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(105,5): error TS2322: Type 'I' is not assignable to type 'E': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(105,5): error TS2323: Type 'I' is not assignable to type 'E'. Types have separate declarations of a private property 'foo'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D' is not assignable to type 'E': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2323: Type 'D' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type 'D'. @@ -81,49 +81,49 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = d; a = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }': -!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. +!!! error TS2323: Type 'E' is not assignable to type '{ foo: string; }'. +!!! error TS2323: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. b = a; b = i; b = d; b = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type 'Base': -!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'Base'. +!!! error TS2323: Type 'E' is not assignable to type 'Base'. +!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'Base'. i = a; i = b; i = d; i = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type 'I': -!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'I'. +!!! error TS2323: Type 'E' is not assignable to type 'I'. +!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'I'. d = a; d = b; d = i; d = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type 'D': -!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'. +!!! error TS2323: Type 'E' is not assignable to type 'D'. +!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'D'. e = a; // errror ~ -!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E': -!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. +!!! error TS2323: Type '{ foo: string; }' is not assignable to type 'E'. +!!! error TS2323: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. e = b; // errror ~ -!!! error TS2322: Type 'Base' is not assignable to type 'E': -!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'Base'. +!!! error TS2323: Type 'Base' is not assignable to type 'E'. +!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'Base'. e = i; // errror ~ -!!! error TS2322: Type 'I' is not assignable to type 'E': -!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'I'. +!!! error TS2323: Type 'I' is not assignable to type 'E'. +!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'I'. e = d; // errror ~ -!!! error TS2322: Type 'D' is not assignable to type 'E': -!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'. +!!! error TS2323: Type 'D' is not assignable to type 'E'. +!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'D'. e = e; } @@ -155,78 +155,78 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; // error ~ -!!! error TS2322: Type 'Base' is not assignable to type '{ foo: string; }': -!!! error TS2322: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. +!!! error TS2323: Type 'Base' is not assignable to type '{ foo: string; }'. +!!! error TS2323: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. a = i; // error ~ -!!! error TS2322: Type 'I' is not assignable to type '{ foo: string; }': -!!! error TS2322: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. +!!! error TS2323: Type 'I' is not assignable to type '{ foo: string; }'. +!!! error TS2323: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. a = d; a = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }': -!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. +!!! error TS2323: Type 'E' is not assignable to type '{ foo: string; }'. +!!! error TS2323: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. b = a; // error ~ -!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'Base': -!!! error TS2322: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. +!!! error TS2323: Type '{ foo: string; }' is not assignable to type 'Base'. +!!! error TS2323: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. b = i; b = d; // error ~ -!!! error TS2322: Type 'D' is not assignable to type 'Base': -!!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'. +!!! error TS2323: Type 'D' is not assignable to type 'Base'. +!!! error TS2323: Property 'foo' is private in type 'Base' but not in type 'D'. b = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type 'Base': -!!! error TS2322: Types have separate declarations of a private property 'foo'. +!!! error TS2323: Type 'E' is not assignable to type 'Base'. +!!! error TS2323: Types have separate declarations of a private property 'foo'. b = b; i = a; // error ~ -!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'I': -!!! error TS2322: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. +!!! error TS2323: Type '{ foo: string; }' is not assignable to type 'I'. +!!! error TS2323: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. i = b; i = d; // error ~ -!!! error TS2322: Type 'D' is not assignable to type 'I': -!!! error TS2322: Property 'foo' is private in type 'I' but not in type 'D'. +!!! error TS2323: Type 'D' is not assignable to type 'I'. +!!! error TS2323: Property 'foo' is private in type 'I' but not in type 'D'. i = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type 'I': -!!! error TS2322: Types have separate declarations of a private property 'foo'. +!!! error TS2323: Type 'E' is not assignable to type 'I'. +!!! error TS2323: Types have separate declarations of a private property 'foo'. i = i; d = a; d = b; // error ~ -!!! error TS2322: Type 'Base' is not assignable to type 'D': -!!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'. +!!! error TS2323: Type 'Base' is not assignable to type 'D'. +!!! error TS2323: Property 'foo' is private in type 'Base' but not in type 'D'. d = i; // error ~ -!!! error TS2322: Type 'I' is not assignable to type 'D': -!!! error TS2322: Property 'foo' is private in type 'I' but not in type 'D'. +!!! error TS2323: Type 'I' is not assignable to type 'D'. +!!! error TS2323: Property 'foo' is private in type 'I' but not in type 'D'. d = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type 'D': -!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'. +!!! error TS2323: Type 'E' is not assignable to type 'D'. +!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'D'. e = a; // errror ~ -!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E': -!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. +!!! error TS2323: Type '{ foo: string; }' is not assignable to type 'E'. +!!! error TS2323: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. e = b; // errror ~ -!!! error TS2322: Type 'Base' is not assignable to type 'E': -!!! error TS2322: Types have separate declarations of a private property 'foo'. +!!! error TS2323: Type 'Base' is not assignable to type 'E'. +!!! error TS2323: Types have separate declarations of a private property 'foo'. e = i; // errror ~ -!!! error TS2322: Type 'I' is not assignable to type 'E': -!!! error TS2322: Types have separate declarations of a private property 'foo'. +!!! error TS2323: Type 'I' is not assignable to type 'E'. +!!! error TS2323: Types have separate declarations of a private property 'foo'. e = d; // errror ~ -!!! error TS2322: Type 'D' is not assignable to type 'E': -!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'. +!!! error TS2323: Type 'D' is not assignable to type 'E'. +!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'D'. e = e; } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt index 44577bf1c8d..2f931d4fc89 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(73,5): error TS2322: Type 'D' is not assignable to type 'C': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(73,5): error TS2323: Type 'D' is not assignable to type 'C'. Property 'opt' is optional in type 'D' but required in type 'C'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(74,5): error TS2322: Type 'E' is not assignable to type 'C': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(74,5): error TS2323: Type 'E' is not assignable to type 'C'. Property 'opt' is optional in type 'E' but required in type 'C'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(78,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(78,5): error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'. Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(79,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(79,5): error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'. Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(83,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(83,5): error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'. Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(84,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(84,5): error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'. Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. @@ -87,34 +87,34 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme c = d; // error ~ -!!! error TS2322: Type 'D' is not assignable to type 'C': -!!! error TS2322: Property 'opt' is optional in type 'D' but required in type 'C'. +!!! error TS2323: Type 'D' is not assignable to type 'C'. +!!! error TS2323: Property 'opt' is optional in type 'D' but required in type 'C'. c = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type 'C': -!!! error TS2322: Property 'opt' is optional in type 'E' but required in type 'C'. +!!! error TS2323: Type 'E' is not assignable to type 'C'. +!!! error TS2323: Property 'opt' is optional in type 'E' but required in type 'C'. c = f; // ok c = a; // ok a = d; // error ~ -!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }': -!!! error TS2322: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. +!!! error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'. +!!! error TS2323: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. a = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }': -!!! error TS2322: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. +!!! error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'. +!!! error TS2323: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. a = f; // ok a = c; // ok b = d; // error ~ -!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }': -!!! error TS2322: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. +!!! error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'. +!!! error TS2323: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. b = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }': -!!! error TS2322: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. +!!! error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'. +!!! error TS2323: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. b = f; // ok b = a; // ok b = c; // ok diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt index e1bf35ef2c2..3bce83ada4b 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt @@ -1,20 +1,20 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(74,5): error TS2322: Type 'D' is not assignable to type 'C': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(74,5): error TS2323: Type 'D' is not assignable to type 'C'. Property 'opt' is missing in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(75,5): error TS2322: Type 'E' is not assignable to type 'C': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(75,5): error TS2323: Type 'E' is not assignable to type 'C'. Property 'opt' is missing in type 'E'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(76,5): error TS2322: Type 'F' is not assignable to type 'C': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(76,5): error TS2323: Type 'F' is not assignable to type 'C'. Property 'opt' is missing in type 'F'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(79,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(79,5): error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(80,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(80,5): error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'E'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(81,5): error TS2322: Type 'F' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(81,5): error TS2323: Type 'F' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'F'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(84,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(84,5): error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(85,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(85,5): error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'E'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(86,5): error TS2322: Type 'F' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(86,5): error TS2323: Type 'F' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'F'. @@ -94,44 +94,44 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme c = d; // error ~ -!!! error TS2322: Type 'D' is not assignable to type 'C': -!!! error TS2322: Property 'opt' is missing in type 'D'. +!!! error TS2323: Type 'D' is not assignable to type 'C'. +!!! error TS2323: Property 'opt' is missing in type 'D'. c = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type 'C': -!!! error TS2322: Property 'opt' is missing in type 'E'. +!!! error TS2323: Type 'E' is not assignable to type 'C'. +!!! error TS2323: Property 'opt' is missing in type 'E'. c = f; // error ~ -!!! error TS2322: Type 'F' is not assignable to type 'C': -!!! error TS2322: Property 'opt' is missing in type 'F'. +!!! error TS2323: Type 'F' is not assignable to type 'C'. +!!! error TS2323: Property 'opt' is missing in type 'F'. c = a; // ok a = d; // error ~ -!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }': -!!! error TS2322: Property 'opt' is missing in type 'D'. +!!! error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'. +!!! error TS2323: Property 'opt' is missing in type 'D'. a = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }': -!!! error TS2322: Property 'opt' is missing in type 'E'. +!!! error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'. +!!! error TS2323: Property 'opt' is missing in type 'E'. a = f; // error ~ -!!! error TS2322: Type 'F' is not assignable to type '{ opt: Base; }': -!!! error TS2322: Property 'opt' is missing in type 'F'. +!!! error TS2323: Type 'F' is not assignable to type '{ opt: Base; }'. +!!! error TS2323: Property 'opt' is missing in type 'F'. a = c; // ok b = d; // error ~ -!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }': -!!! error TS2322: Property 'opt' is missing in type 'D'. +!!! error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'. +!!! error TS2323: Property 'opt' is missing in type 'D'. b = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }': -!!! error TS2322: Property 'opt' is missing in type 'E'. +!!! error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'. +!!! error TS2323: Property 'opt' is missing in type 'E'. b = f; // error ~ -!!! error TS2322: Type 'F' is not assignable to type '{ opt: Base; }': -!!! error TS2322: Property 'opt' is missing in type 'F'. +!!! error TS2323: Type 'F' is not assignable to type '{ opt: Base; }'. +!!! error TS2323: Property 'opt' is missing in type 'F'. b = a; // ok b = c; // ok } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt index 370355a7373..b70cee86a4d 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt @@ -1,60 +1,60 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(21,5): error TS2322: Type 'T' is not assignable to type 'S': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(21,5): error TS2323: Type 'T' is not assignable to type 'S'. Property ''1'' is missing in type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(22,5): error TS2322: Type 'S' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(22,5): error TS2323: Type 'S' is not assignable to type 'T'. Property ''1.'' is missing in type 'S'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(24,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(24,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S'. Property ''1'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(26,5): error TS2322: Type 'T2' is not assignable to type 'S2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(26,5): error TS2323: Type 'T2' is not assignable to type 'S2'. Property ''1'' is missing in type 'T2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(27,5): error TS2322: Type 'S2' is not assignable to type 'T2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(27,5): error TS2323: Type 'S2' is not assignable to type 'T2'. Property ''1.0'' is missing in type 'S2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(28,5): error TS2322: Type 'T' is not assignable to type 'S2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(28,5): error TS2323: Type 'T' is not assignable to type 'S2'. Property ''1'' is missing in type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(29,5): error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(29,5): error TS2323: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2'. Property ''1'' is missing in type '{ '1.0': string; baz?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(30,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(30,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S2'. Property ''1'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(32,5): error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(32,5): error TS2323: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type '{ '1.0': string; baz?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(33,5): error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(33,5): error TS2323: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }'. Property ''1.0'' is missing in type '{ '1.': string; bar?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(34,5): error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(34,5): error TS2323: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type 'S'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(35,5): error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(35,5): error TS2323: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type 'S2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(36,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(36,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(38,5): error TS2322: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(38,5): error TS2323: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type '{ '1': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(39,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(39,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }'. Property ''1'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(42,5): error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(42,5): error TS2323: Type 'T' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(65,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(65,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S'. Property ''1'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(71,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(71,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S2'. Property ''1'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(73,5): error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(73,5): error TS2323: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type '{ 1.0: string; baz?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(74,5): error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(74,5): error TS2323: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }'. Property '1.0' is missing in type '{ '1.': string; bar?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(75,5): error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(75,5): error TS2323: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type 'S'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(76,5): error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(76,5): error TS2323: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type 'S2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(77,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(77,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(78,5): error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(78,5): error TS2323: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type '{ 1.: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(80,5): error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(80,5): error TS2323: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type '{ 1.: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(81,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(81,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }'. Property '1.' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(82,5): error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(82,5): error TS2323: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type '{ 1.0: string; baz?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(83,5): error TS2322: Type 'T2' is not assignable to type '{ '1.0': string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(83,5): error TS2323: Type 'T2' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type 'T2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(84,5): error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(84,5): error TS2323: Type 'T' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type 'T'. @@ -81,74 +81,74 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s = t; ~ -!!! error TS2322: Type 'T' is not assignable to type 'S': -!!! error TS2322: Property ''1'' is missing in type 'T'. +!!! error TS2323: Type 'T' is not assignable to type 'S'. +!!! error TS2323: Property ''1'' is missing in type 'T'. t = s; ~ -!!! error TS2322: Type 'S' is not assignable to type 'T': -!!! error TS2322: Property ''1.'' is missing in type 'S'. +!!! error TS2323: Type 'S' is not assignable to type 'T'. +!!! error TS2323: Property ''1.'' is missing in type 'S'. s = s2; // ok s = a2; ~ -!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S': -!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S'. +!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; }'. s2 = t2; ~~ -!!! error TS2322: Type 'T2' is not assignable to type 'S2': -!!! error TS2322: Property ''1'' is missing in type 'T2'. +!!! error TS2323: Type 'T2' is not assignable to type 'S2'. +!!! error TS2323: Property ''1'' is missing in type 'T2'. t2 = s2; ~~ -!!! error TS2322: Type 'S2' is not assignable to type 'T2': -!!! error TS2322: Property ''1.0'' is missing in type 'S2'. +!!! error TS2323: Type 'S2' is not assignable to type 'T2'. +!!! error TS2323: Property ''1.0'' is missing in type 'S2'. s2 = t; ~~ -!!! error TS2322: Type 'T' is not assignable to type 'S2': -!!! error TS2322: Property ''1'' is missing in type 'T'. +!!! error TS2323: Type 'T' is not assignable to type 'S2'. +!!! error TS2323: Property ''1'' is missing in type 'T'. s2 = b; ~~ -!!! error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2': -!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; baz?: string; }'. +!!! error TS2323: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2'. +!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; baz?: string; }'. s2 = a2; ~~ -!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2': -!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S2'. +!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; }'. a = b; ~ -!!! error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }': -!!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; baz?: string; }'. +!!! error TS2323: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2323: Property ''1.'' is missing in type '{ '1.0': string; baz?: string; }'. b = a; ~ -!!! error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }': -!!! error TS2322: Property ''1.0'' is missing in type '{ '1.': string; bar?: string; }'. +!!! error TS2323: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }'. +!!! error TS2323: Property ''1.0'' is missing in type '{ '1.': string; bar?: string; }'. a = s; ~ -!!! error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }': -!!! error TS2322: Property ''1.'' is missing in type 'S'. +!!! error TS2323: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2323: Property ''1.'' is missing in type 'S'. a = s2; ~ -!!! error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }': -!!! error TS2322: Property ''1.'' is missing in type 'S2'. +!!! error TS2323: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2323: Property ''1.'' is missing in type 'S2'. a = a2; ~ -!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }': -!!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; }'. +!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2323: Property ''1.'' is missing in type '{ '1.0': string; }'. a2 = b2; ~~ -!!! error TS2322: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }': -!!! error TS2322: Property ''1.0'' is missing in type '{ '1': string; }'. +!!! error TS2323: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }'. +!!! error TS2323: Property ''1.0'' is missing in type '{ '1': string; }'. b2 = a2; ~~ -!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }': -!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }'. +!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; }'. a2 = b; // ok a2 = t2; // ok a2 = t; ~~ -!!! error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }': -!!! error TS2322: Property ''1.0'' is missing in type 'T'. +!!! error TS2323: Type 'T' is not assignable to type '{ '1.0': string; }'. +!!! error TS2323: Property ''1.0'' is missing in type 'T'. } module NumbersAndStrings { @@ -173,8 +173,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s = s2; // ok s = a2; // error ~ -!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S': -!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S'. +!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; }'. s2 = t2; // ok t2 = s2; // ok @@ -182,52 +182,52 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s2 = b; // ok s2 = a2; // error ~~ -!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2': -!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S2'. +!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; }'. a = b; // error ~ -!!! error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }': -!!! error TS2322: Property ''1.'' is missing in type '{ 1.0: string; baz?: string; }'. +!!! error TS2323: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2323: Property ''1.'' is missing in type '{ 1.0: string; baz?: string; }'. b = a; // error ~ -!!! error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }': -!!! error TS2322: Property '1.0' is missing in type '{ '1.': string; bar?: string; }'. +!!! error TS2323: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }'. +!!! error TS2323: Property '1.0' is missing in type '{ '1.': string; bar?: string; }'. a = s; // error ~ -!!! error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }': -!!! error TS2322: Property ''1.'' is missing in type 'S'. +!!! error TS2323: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2323: Property ''1.'' is missing in type 'S'. a = s2; // error ~ -!!! error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }': -!!! error TS2322: Property ''1.'' is missing in type 'S2'. +!!! error TS2323: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2323: Property ''1.'' is missing in type 'S2'. a = a2; // error ~ -!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }': -!!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; }'. +!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2323: Property ''1.'' is missing in type '{ '1.0': string; }'. a = b2; // error ~ -!!! error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }': -!!! error TS2322: Property ''1.'' is missing in type '{ 1.: string; }'. +!!! error TS2323: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2323: Property ''1.'' is missing in type '{ 1.: string; }'. a2 = b2; // error ~~ -!!! error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }': -!!! error TS2322: Property ''1.0'' is missing in type '{ 1.: string; }'. +!!! error TS2323: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }'. +!!! error TS2323: Property ''1.0'' is missing in type '{ 1.: string; }'. b2 = a2; // error ~~ -!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }': -!!! error TS2322: Property '1.' is missing in type '{ '1.0': string; }'. +!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }'. +!!! error TS2323: Property '1.' is missing in type '{ '1.0': string; }'. a2 = b; // error ~~ -!!! error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }': -!!! error TS2322: Property ''1.0'' is missing in type '{ 1.0: string; baz?: string; }'. +!!! error TS2323: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }'. +!!! error TS2323: Property ''1.0'' is missing in type '{ 1.0: string; baz?: string; }'. a2 = t2; // error ~~ -!!! error TS2322: Type 'T2' is not assignable to type '{ '1.0': string; }': -!!! error TS2322: Property ''1.0'' is missing in type 'T2'. +!!! error TS2323: Type 'T2' is not assignable to type '{ '1.0': string; }'. +!!! error TS2323: Property ''1.0'' is missing in type 'T2'. a2 = t; // error ~~ -!!! error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }': -!!! error TS2322: Property ''1.0'' is missing in type 'T'. +!!! error TS2323: Type 'T' is not assignable to type '{ '1.0': string; }'. +!!! error TS2323: Property ''1.0'' is missing in type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt b/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt index 55e62ae2266..e5741c8601e 100644 --- a/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/assignmentCompatWithOverloads.ts(17,1): error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number': +tests/cases/compiler/assignmentCompatWithOverloads.ts(17,1): error TS2323: Type '(x: string) => string' is not assignable to type '(s1: string) => number'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/assignmentCompatWithOverloads.ts(19,1): error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number': - Types of parameters 'x' and 's1' are incompatible: +tests/cases/compiler/assignmentCompatWithOverloads.ts(19,1): error TS2323: Type '(x: number) => number' is not assignable to type '(s1: string) => number'. + Types of parameters 'x' and 's1' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/assignmentCompatWithOverloads.ts(21,1): error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number': +tests/cases/compiler/assignmentCompatWithOverloads.ts(21,1): error TS2323: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2323: Type 'typeof C' is not assignable to type 'new (x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. @@ -29,19 +29,19 @@ tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type g = f2; // Error ~ -!!! error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number': -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '(x: string) => string' is not assignable to type '(s1: string) => number'. +!!! error TS2323: Type 'string' is not assignable to type 'number'. g = f3; // Error ~ -!!! error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number': -!!! error TS2322: Types of parameters 'x' and 's1' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '(x: number) => number' is not assignable to type '(s1: string) => number'. +!!! error TS2323: Types of parameters 'x' and 's1' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. g = f4; // Error ~ -!!! error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number': -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'. +!!! error TS2323: Type 'string' is not assignable to type 'number'. class C { constructor(x: string); @@ -52,6 +52,6 @@ tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type d = C; // Error ~ -!!! error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2323: Type 'typeof C' is not assignable to type 'new (x: number) => void'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt index 630c508fc75..3d6a3c48d68 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt @@ -1,32 +1,32 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(15,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(15,1): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(19,1): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(33,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(33,5): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(41,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(41,5): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(46,9): error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(46,9): error TS2323: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(47,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': - Index signatures are incompatible: - Type 'T' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(47,9): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(50,9): error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(50,9): error TS2323: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': - Index signatures are incompatible: - Type 'T' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(51,9): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. @@ -47,19 +47,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; // ok b = a; // error ~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Base'. var b2: { [x: string]: Derived2; } a = b2; // ok b2 = a; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Base'. module Generics { class A { @@ -75,10 +75,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a1 = b1; // ok b1 = a1; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Base'. class B2 extends A { [x: string]: Derived2; // ok @@ -88,37 +88,37 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a1 = b2; // ok b2 = a1; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Base'. function foo() { var b3: { [x: string]: Derived; }; var a3: A; a3 = b3; // error ~~ -!!! error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Derived' is not assignable to type 'T'. +!!! error TS2323: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Derived' is not assignable to type 'T'. b3 = a3; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'T' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Base'. var b4: { [x: string]: Derived2; }; a3 = b4; // error ~~ -!!! error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2323: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Derived2' is not assignable to type 'T'. b4 = a3; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'T' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Base'. } } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt index de88bc13bad..d84196f9dcc 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt @@ -1,32 +1,32 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(15,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(15,1): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(19,1): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(33,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(33,5): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(41,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(41,5): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(46,9): error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(46,9): error TS2323: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(47,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': - Index signatures are incompatible: - Type 'T' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(47,9): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(50,9): error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(50,9): error TS2323: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': - Index signatures are incompatible: - Type 'T' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(51,9): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. @@ -47,19 +47,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; // ok b = a; // error ~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Base'. var b2: { [x: string]: Derived2; } a = b2; // ok b2 = a; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Base'. module Generics { interface A { @@ -75,10 +75,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a1 = b1; // ok b1 = a1; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Base'. interface B2 extends A { [x: string]: Derived2; // ok @@ -88,37 +88,37 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a1 = b2; // ok b2 = a1; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Base'. function foo() { var b3: { [x: string]: Derived; }; var a3: A; a3 = b3; // error ~~ -!!! error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Derived' is not assignable to type 'T'. +!!! error TS2323: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Derived' is not assignable to type 'T'. b3 = a3; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'T' is not assignable to type 'Derived'. +!!! error TS2323: Property 'bar' is missing in type 'Base'. var b4: { [x: string]: Derived2; }; a3 = b4; // error ~~ -!!! error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2323: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'Derived2' is not assignable to type 'T'. b4 = a3; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'T' is not assignable to type 'Derived2'. +!!! error TS2323: Property 'baz' is missing in type 'Base'. } } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt index 86913461d44..03f9a5de6b1 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(7,8): error TS2304: Cannot find name 'A'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(20,9): error TS2322: Type '{ [x: string]: string; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(20,9): error TS2323: Type '{ [x: string]: string; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'string' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(21,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: string; }': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(21,9): error TS2323: Type 'A' is not assignable to type '{ [x: string]: string; }'. + Index signatures are incompatible. Type 'T' is not assignable to type 'string'. @@ -31,13 +31,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b: { [x: string]: string; } a = b; // error ~ -!!! error TS2322: Type '{ [x: string]: string; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'T'. +!!! error TS2323: Type '{ [x: string]: string; }' is not assignable to type 'A'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'T'. b = a; // error ~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: string; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'string'. +!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'T' is not assignable to type 'string'. } } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability10.errors.txt b/tests/baselines/reference/assignmentCompatability10.errors.txt index f1fe353c906..6b553d2f5d4 100644 --- a/tests/baselines/reference/assignmentCompatability10.errors.txt +++ b/tests/baselines/reference/assignmentCompatability10.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability10.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicAndOptional': +tests/cases/compiler/assignmentCompatability10.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicAndOptional'. Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability10.ts(9,1): error TS2322: Type 'inte } __test2__.__val__x4 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicAndOptional': -!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithPublicAndOptional'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicAndOptional'. +!!! error TS2323: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability11.errors.txt b/tests/baselines/reference/assignmentCompatability11.errors.txt index 1485c3abdba..135daf32d8e 100644 --- a/tests/baselines/reference/assignmentCompatability11.errors.txt +++ b/tests/baselines/reference/assignmentCompatability11.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assignmentCompatability11.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }': - Types of property 'two' are incompatible: +tests/cases/compiler/assignmentCompatability11.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. + Types of property 'two' are incompatible. Type 'string' is not assignable to type 'number'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability11.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }': -!!! error TS2322: Types of property 'two' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. +!!! error TS2323: Types of property 'two' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability12.errors.txt b/tests/baselines/reference/assignmentCompatability12.errors.txt index 4a0f9cc8f65..f896763d608 100644 --- a/tests/baselines/reference/assignmentCompatability12.errors.txt +++ b/tests/baselines/reference/assignmentCompatability12.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assignmentCompatability12.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }': - Types of property 'one' are incompatible: +tests/cases/compiler/assignmentCompatability12.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. + Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability12.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. +!!! error TS2323: Types of property 'one' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability13.errors.txt b/tests/baselines/reference/assignmentCompatability13.errors.txt index 909193c6202..33434bd0c20 100644 --- a/tests/baselines/reference/assignmentCompatability13.errors.txt +++ b/tests/baselines/reference/assignmentCompatability13.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability13.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }': +tests/cases/compiler/assignmentCompatability13.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability13.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }': -!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. +!!! error TS2323: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability14.errors.txt b/tests/baselines/reference/assignmentCompatability14.errors.txt index 897f73b8710..a104fd73775 100644 --- a/tests/baselines/reference/assignmentCompatability14.errors.txt +++ b/tests/baselines/reference/assignmentCompatability14.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assignmentCompatability14.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }': - Types of property 'one' are incompatible: +tests/cases/compiler/assignmentCompatability14.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. + Types of property 'one' are incompatible. Type 'number' is not assignable to type 'boolean'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability14.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. +!!! error TS2323: Types of property 'one' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability15.errors.txt b/tests/baselines/reference/assignmentCompatability15.errors.txt index f92f3a7ffd7..6952d9780cc 100644 --- a/tests/baselines/reference/assignmentCompatability15.errors.txt +++ b/tests/baselines/reference/assignmentCompatability15.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assignmentCompatability15.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }': - Types of property 'two' are incompatible: +tests/cases/compiler/assignmentCompatability15.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }'. + Types of property 'two' are incompatible. Type 'string' is not assignable to type 'boolean'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability15.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }': -!!! error TS2322: Types of property 'two' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }'. +!!! error TS2323: Types of property 'two' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability16.errors.txt b/tests/baselines/reference/assignmentCompatability16.errors.txt index b114462c711..7234065e263 100644 --- a/tests/baselines/reference/assignmentCompatability16.errors.txt +++ b/tests/baselines/reference/assignmentCompatability16.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability16.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }': - Types of property 'one' are incompatible: - Type 'number' is not assignable to type 'any[]': +tests/cases/compiler/assignmentCompatability16.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'any[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability16.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'any[]': -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. +!!! error TS2323: Types of property 'one' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'any[]'. +!!! error TS2323: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability17.errors.txt b/tests/baselines/reference/assignmentCompatability17.errors.txt index f30e39de1ae..306d3df4a90 100644 --- a/tests/baselines/reference/assignmentCompatability17.errors.txt +++ b/tests/baselines/reference/assignmentCompatability17.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability17.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }': - Types of property 'two' are incompatible: - Type 'string' is not assignable to type 'any[]': +tests/cases/compiler/assignmentCompatability17.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }'. + Types of property 'two' are incompatible. + Type 'string' is not assignable to type 'any[]'. Property 'push' is missing in type 'String'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability17.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }': -!!! error TS2322: Types of property 'two' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'any[]': -!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }'. +!!! error TS2323: Types of property 'two' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'any[]'. +!!! error TS2323: Property 'push' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability18.errors.txt b/tests/baselines/reference/assignmentCompatability18.errors.txt index d619b4847ad..e19b8133556 100644 --- a/tests/baselines/reference/assignmentCompatability18.errors.txt +++ b/tests/baselines/reference/assignmentCompatability18.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability18.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }': - Types of property 'one' are incompatible: - Type 'number' is not assignable to type 'number[]': +tests/cases/compiler/assignmentCompatability18.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'number[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability18.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'number[]': -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. +!!! error TS2323: Types of property 'one' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'number[]'. +!!! error TS2323: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability19.errors.txt b/tests/baselines/reference/assignmentCompatability19.errors.txt index 1c61c2bc808..ab552ef2a29 100644 --- a/tests/baselines/reference/assignmentCompatability19.errors.txt +++ b/tests/baselines/reference/assignmentCompatability19.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability19.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }': - Types of property 'two' are incompatible: - Type 'string' is not assignable to type 'number[]': +tests/cases/compiler/assignmentCompatability19.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }'. + Types of property 'two' are incompatible. + Type 'string' is not assignable to type 'number[]'. Property 'push' is missing in type 'String'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability19.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }': -!!! error TS2322: Types of property 'two' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number[]': -!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }'. +!!! error TS2323: Types of property 'two' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number[]'. +!!! error TS2323: Property 'push' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability20.errors.txt b/tests/baselines/reference/assignmentCompatability20.errors.txt index b9d966a09a5..001331c1afd 100644 --- a/tests/baselines/reference/assignmentCompatability20.errors.txt +++ b/tests/baselines/reference/assignmentCompatability20.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability20.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }': - Types of property 'one' are incompatible: - Type 'number' is not assignable to type 'string[]': +tests/cases/compiler/assignmentCompatability20.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'string[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability20.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string[]': -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. +!!! error TS2323: Types of property 'one' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string[]'. +!!! error TS2323: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability21.errors.txt b/tests/baselines/reference/assignmentCompatability21.errors.txt index 72a690c5d16..1ff8585b2f8 100644 --- a/tests/baselines/reference/assignmentCompatability21.errors.txt +++ b/tests/baselines/reference/assignmentCompatability21.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability21.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }': - Types of property 'two' are incompatible: - Type 'string' is not assignable to type 'string[]': +tests/cases/compiler/assignmentCompatability21.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }'. + Types of property 'two' are incompatible. + Type 'string' is not assignable to type 'string[]'. Property 'push' is missing in type 'String'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability21.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }': -!!! error TS2322: Types of property 'two' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'string[]': -!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }'. +!!! error TS2323: Types of property 'two' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'string[]'. +!!! error TS2323: Property 'push' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability22.errors.txt b/tests/baselines/reference/assignmentCompatability22.errors.txt index b033522049d..6ac985e5de0 100644 --- a/tests/baselines/reference/assignmentCompatability22.errors.txt +++ b/tests/baselines/reference/assignmentCompatability22.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability22.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }': - Types of property 'one' are incompatible: - Type 'number' is not assignable to type 'boolean[]': +tests/cases/compiler/assignmentCompatability22.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'boolean[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability22.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'boolean[]': -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. +!!! error TS2323: Types of property 'one' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'boolean[]'. +!!! error TS2323: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability23.errors.txt b/tests/baselines/reference/assignmentCompatability23.errors.txt index f50d2ba943e..315f3bc12bc 100644 --- a/tests/baselines/reference/assignmentCompatability23.errors.txt +++ b/tests/baselines/reference/assignmentCompatability23.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability23.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }': - Types of property 'two' are incompatible: - Type 'string' is not assignable to type 'boolean[]': +tests/cases/compiler/assignmentCompatability23.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }'. + Types of property 'two' are incompatible. + Type 'string' is not assignable to type 'boolean[]'. Property 'push' is missing in type 'String'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability23.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }': -!!! error TS2322: Types of property 'two' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'boolean[]': -!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }'. +!!! error TS2323: Types of property 'two' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'boolean[]'. +!!! error TS2323: Property 'push' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability25.errors.txt b/tests/baselines/reference/assignmentCompatability25.errors.txt index c02b876e4e0..76f462d635d 100644 --- a/tests/baselines/reference/assignmentCompatability25.errors.txt +++ b/tests/baselines/reference/assignmentCompatability25.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assignmentCompatability25.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }': - Types of property 'two' are incompatible: +tests/cases/compiler/assignmentCompatability25.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. + Types of property 'two' are incompatible. Type 'string' is not assignable to type 'number'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability25.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }': -!!! error TS2322: Types of property 'two' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. +!!! error TS2323: Types of property 'two' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability26.errors.txt b/tests/baselines/reference/assignmentCompatability26.errors.txt index 253c8af2c16..6b6497a5f6d 100644 --- a/tests/baselines/reference/assignmentCompatability26.errors.txt +++ b/tests/baselines/reference/assignmentCompatability26.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assignmentCompatability26.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }': - Types of property 'one' are incompatible: +tests/cases/compiler/assignmentCompatability26.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. + Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability26.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. +!!! error TS2323: Types of property 'one' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability27.errors.txt b/tests/baselines/reference/assignmentCompatability27.errors.txt index 3c033c8d98d..2751bd38f19 100644 --- a/tests/baselines/reference/assignmentCompatability27.errors.txt +++ b/tests/baselines/reference/assignmentCompatability27.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability27.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }': +tests/cases/compiler/assignmentCompatability27.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability27.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }': -!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. +!!! error TS2323: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability28.errors.txt b/tests/baselines/reference/assignmentCompatability28.errors.txt index ce604747051..756411d654c 100644 --- a/tests/baselines/reference/assignmentCompatability28.errors.txt +++ b/tests/baselines/reference/assignmentCompatability28.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assignmentCompatability28.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }': - Types of property 'one' are incompatible: +tests/cases/compiler/assignmentCompatability28.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. + Types of property 'one' are incompatible. Type 'number' is not assignable to type 'boolean'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability28.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. +!!! error TS2323: Types of property 'one' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability29.errors.txt b/tests/baselines/reference/assignmentCompatability29.errors.txt index fe9e390b482..88f936d1466 100644 --- a/tests/baselines/reference/assignmentCompatability29.errors.txt +++ b/tests/baselines/reference/assignmentCompatability29.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability29.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }': - Types of property 'one' are incompatible: - Type 'number' is not assignable to type 'any[]': +tests/cases/compiler/assignmentCompatability29.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'any[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability29.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'any[]': -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. +!!! error TS2323: Types of property 'one' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'any[]'. +!!! error TS2323: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability30.errors.txt b/tests/baselines/reference/assignmentCompatability30.errors.txt index 663d8eaa299..cba16799c66 100644 --- a/tests/baselines/reference/assignmentCompatability30.errors.txt +++ b/tests/baselines/reference/assignmentCompatability30.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability30.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }': - Types of property 'one' are incompatible: - Type 'number' is not assignable to type 'number[]': +tests/cases/compiler/assignmentCompatability30.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'number[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability30.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'number[]': -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. +!!! error TS2323: Types of property 'one' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'number[]'. +!!! error TS2323: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability31.errors.txt b/tests/baselines/reference/assignmentCompatability31.errors.txt index 00d5dd59188..c7f48f70835 100644 --- a/tests/baselines/reference/assignmentCompatability31.errors.txt +++ b/tests/baselines/reference/assignmentCompatability31.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability31.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }': - Types of property 'one' are incompatible: - Type 'number' is not assignable to type 'string[]': +tests/cases/compiler/assignmentCompatability31.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'string[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability31.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string[]': -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. +!!! error TS2323: Types of property 'one' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string[]'. +!!! error TS2323: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability32.errors.txt b/tests/baselines/reference/assignmentCompatability32.errors.txt index c4f20881a44..07e8b7de26f 100644 --- a/tests/baselines/reference/assignmentCompatability32.errors.txt +++ b/tests/baselines/reference/assignmentCompatability32.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability32.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }': - Types of property 'one' are incompatible: - Type 'number' is not assignable to type 'boolean[]': +tests/cases/compiler/assignmentCompatability32.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'boolean[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability32.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'boolean[]': -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. +!!! error TS2323: Types of property 'one' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'boolean[]'. +!!! error TS2323: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability35.errors.txt b/tests/baselines/reference/assignmentCompatability35.errors.txt index 4ae2aaf42d8..06f83c1e78f 100644 --- a/tests/baselines/reference/assignmentCompatability35.errors.txt +++ b/tests/baselines/reference/assignmentCompatability35.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability35.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: number]: number; }': +tests/cases/compiler/assignmentCompatability35.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: number]: number; }'. Index signature is missing in type 'interfaceWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability35.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: number]: number; }': -!!! error TS2322: Index signature is missing in type 'interfaceWithPublicAndOptional'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: number]: number; }'. +!!! error TS2323: Index signature is missing in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability36.errors.txt b/tests/baselines/reference/assignmentCompatability36.errors.txt index 013f5ae33b6..eb02058ad8b 100644 --- a/tests/baselines/reference/assignmentCompatability36.errors.txt +++ b/tests/baselines/reference/assignmentCompatability36.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability36.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: string]: any; }': +tests/cases/compiler/assignmentCompatability36.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: string]: any; }'. Index signature is missing in type 'interfaceWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability36.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: string]: any; }': -!!! error TS2322: Index signature is missing in type 'interfaceWithPublicAndOptional'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: string]: any; }'. +!!! error TS2323: Index signature is missing in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability39.errors.txt b/tests/baselines/reference/assignmentCompatability39.errors.txt index 3ab5cee7887..4c7f14ba68f 100644 --- a/tests/baselines/reference/assignmentCompatability39.errors.txt +++ b/tests/baselines/reference/assignmentCompatability39.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability39.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic': +tests/cases/compiler/assignmentCompatability39.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic'. Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithTwoPublic'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability39.ts(9,1): error TS2322: Type 'inte } __test2__.__val__x2 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic': -!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithTwoPublic'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic'. +!!! error TS2323: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithTwoPublic'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability40.errors.txt b/tests/baselines/reference/assignmentCompatability40.errors.txt index 4be86ebc805..9282af2c121 100644 --- a/tests/baselines/reference/assignmentCompatability40.errors.txt +++ b/tests/baselines/reference/assignmentCompatability40.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability40.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPrivate': +tests/cases/compiler/assignmentCompatability40.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPrivate'. Property 'one' is private in type 'classWithPrivate' but not in type 'interfaceWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability40.ts(9,1): error TS2322: Type 'inte } __test2__.__val__x5 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPrivate': -!!! error TS2322: Property 'one' is private in type 'classWithPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPrivate'. +!!! error TS2323: Property 'one' is private in type 'classWithPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability41.errors.txt b/tests/baselines/reference/assignmentCompatability41.errors.txt index 018beb23358..75c3ddd90bf 100644 --- a/tests/baselines/reference/assignmentCompatability41.errors.txt +++ b/tests/baselines/reference/assignmentCompatability41.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability41.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPrivate': +tests/cases/compiler/assignmentCompatability41.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPrivate'. Property 'one' is private in type 'classWithTwoPrivate' but not in type 'interfaceWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability41.ts(9,1): error TS2322: Type 'inte } __test2__.__val__x6 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPrivate': -!!! error TS2322: Property 'one' is private in type 'classWithTwoPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPrivate'. +!!! error TS2323: Property 'one' is private in type 'classWithTwoPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability42.errors.txt b/tests/baselines/reference/assignmentCompatability42.errors.txt index de6fd79041e..bd20a1d56b2 100644 --- a/tests/baselines/reference/assignmentCompatability42.errors.txt +++ b/tests/baselines/reference/assignmentCompatability42.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability42.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicPrivate': +tests/cases/compiler/assignmentCompatability42.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicPrivate'. Property 'two' is private in type 'classWithPublicPrivate' but not in type 'interfaceWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability42.ts(9,1): error TS2322: Type 'inte } __test2__.__val__x7 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicPrivate': -!!! error TS2322: Property 'two' is private in type 'classWithPublicPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicPrivate'. +!!! error TS2323: Property 'two' is private in type 'classWithPublicPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability43.errors.txt b/tests/baselines/reference/assignmentCompatability43.errors.txt index 3f5fc9789b9..9cc919f34bf 100644 --- a/tests/baselines/reference/assignmentCompatability43.errors.txt +++ b/tests/baselines/reference/assignmentCompatability43.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability43.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo': +tests/cases/compiler/assignmentCompatability43.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo'. Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'interfaceTwo'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability43.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj2 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo': -!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'interfaceTwo'. \ No newline at end of file +!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo'. +!!! error TS2323: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'interfaceTwo'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt index 3c6f6c72b55..29764fec7a7 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt +++ b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Applicable': +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(10,1): error TS2323: Type 'string' is not assignable to type 'Applicable'. Property 'apply' is missing in type 'String'. -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Applicable': +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(11,1): error TS2323: Type 'string[]' is not assignable to type 'Applicable'. Property 'apply' is missing in type 'string[]'. -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Applicable': +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(12,1): error TS2323: Type 'number' is not assignable to type 'Applicable'. Property 'apply' is missing in type 'Number'. -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Applicable': +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(13,1): error TS2323: Type '{}' is not assignable to type 'Applicable'. Property 'apply' is missing in type '{}'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Applicable'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(23,4): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Applicable'. @@ -25,20 +25,20 @@ tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-functi // Should fail x = ''; ~ -!!! error TS2322: Type 'string' is not assignable to type 'Applicable': -!!! error TS2322: Property 'apply' is missing in type 'String'. +!!! error TS2323: Type 'string' is not assignable to type 'Applicable'. +!!! error TS2323: Property 'apply' is missing in type 'String'. x = ['']; ~ -!!! error TS2322: Type 'string[]' is not assignable to type 'Applicable': -!!! error TS2322: Property 'apply' is missing in type 'string[]'. +!!! error TS2323: Type 'string[]' is not assignable to type 'Applicable'. +!!! error TS2323: Property 'apply' is missing in type 'string[]'. x = 4; ~ -!!! error TS2322: Type 'number' is not assignable to type 'Applicable': -!!! error TS2322: Property 'apply' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type 'Applicable'. +!!! error TS2323: Property 'apply' is missing in type 'Number'. x = {}; ~ -!!! error TS2322: Type '{}' is not assignable to type 'Applicable': -!!! error TS2322: Property 'apply' is missing in type '{}'. +!!! error TS2323: Type '{}' is not assignable to type 'Applicable'. +!!! error TS2323: Property 'apply' is missing in type '{}'. // Should work function f() { }; diff --git a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt index ab9b4985cc2..2abefbf7099 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt +++ b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Callable': +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(10,1): error TS2323: Type 'string' is not assignable to type 'Callable'. Property 'call' is missing in type 'String'. -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Callable': +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(11,1): error TS2323: Type 'string[]' is not assignable to type 'Callable'. Property 'call' is missing in type 'string[]'. -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Callable': +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(12,1): error TS2323: Type 'number' is not assignable to type 'Callable'. Property 'call' is missing in type 'Number'. -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Callable': +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(13,1): error TS2323: Type '{}' is not assignable to type 'Callable'. Property 'call' is missing in type '{}'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Callable'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(23,4): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Callable'. @@ -25,20 +25,20 @@ tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-functio // Should fail x = ''; ~ -!!! error TS2322: Type 'string' is not assignable to type 'Callable': -!!! error TS2322: Property 'call' is missing in type 'String'. +!!! error TS2323: Type 'string' is not assignable to type 'Callable'. +!!! error TS2323: Property 'call' is missing in type 'String'. x = ['']; ~ -!!! error TS2322: Type 'string[]' is not assignable to type 'Callable': -!!! error TS2322: Property 'call' is missing in type 'string[]'. +!!! error TS2323: Type 'string[]' is not assignable to type 'Callable'. +!!! error TS2323: Property 'call' is missing in type 'string[]'. x = 4; ~ -!!! error TS2322: Type 'number' is not assignable to type 'Callable': -!!! error TS2322: Property 'call' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type 'Callable'. +!!! error TS2323: Property 'call' is missing in type 'Number'. x = {}; ~ -!!! error TS2322: Type '{}' is not assignable to type 'Callable': -!!! error TS2322: Property 'call' is missing in type '{}'. +!!! error TS2323: Type '{}' is not assignable to type 'Callable'. +!!! error TS2323: Property 'call' is missing in type '{}'. // Should work function f() { }; diff --git a/tests/baselines/reference/assignmentToObject.errors.txt b/tests/baselines/reference/assignmentToObject.errors.txt index bfb270b71b6..4be2392fce1 100644 --- a/tests/baselines/reference/assignmentToObject.errors.txt +++ b/tests/baselines/reference/assignmentToObject.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assignmentToObject.ts(3,5): error TS2322: Type '{ toString: number; }' is not assignable to type 'Object': - Types of property 'toString' are incompatible: +tests/cases/compiler/assignmentToObject.ts(3,5): error TS2323: Type '{ toString: number; }' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. Type 'number' is not assignable to type '() => string'. @@ -8,7 +8,7 @@ tests/cases/compiler/assignmentToObject.ts(3,5): error TS2322: Type '{ toString: var b: {} = a; // ok var c: Object = a; // should be error ~ -!!! error TS2322: Type '{ toString: number; }' is not assignable to type 'Object': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type '() => string'. +!!! error TS2323: Type '{ toString: number; }' is not assignable to type 'Object'. +!!! error TS2323: Types of property 'toString' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type '() => string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt index c6ba4e7dfe3..82ca1be0cfc 100644 --- a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt +++ b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt @@ -1,19 +1,19 @@ -tests/cases/compiler/assignmentToObjectAndFunction.ts(1,5): error TS2322: Type '{ toString: number; }' is not assignable to type 'Object': - Types of property 'toString' are incompatible: +tests/cases/compiler/assignmentToObjectAndFunction.ts(1,5): error TS2323: Type '{ toString: number; }' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. Type 'number' is not assignable to type '() => string'. -tests/cases/compiler/assignmentToObjectAndFunction.ts(8,5): error TS2322: Type '{}' is not assignable to type 'Function': +tests/cases/compiler/assignmentToObjectAndFunction.ts(8,5): error TS2323: Type '{}' is not assignable to type 'Function'. Property 'apply' is missing in type '{}'. -tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type 'typeof bad' is not assignable to type 'Function': - Types of property 'apply' are incompatible: +tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2323: Type 'typeof bad' is not assignable to type 'Function'. + Types of property 'apply' are incompatible. Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'. ==== tests/cases/compiler/assignmentToObjectAndFunction.ts (3 errors) ==== var errObj: Object = { toString: 0 }; // Error, incompatible toString ~~~~~~ -!!! error TS2322: Type '{ toString: number; }' is not assignable to type 'Object': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type '() => string'. +!!! error TS2323: Type '{ toString: number; }' is not assignable to type 'Object'. +!!! error TS2323: Types of property 'toString' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type '() => string'. var goodObj: Object = { toString(x?) { return ""; @@ -22,8 +22,8 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type var errFun: Function = {}; // Error for no call signature ~~~~~~ -!!! error TS2322: Type '{}' is not assignable to type 'Function': -!!! error TS2322: Property 'apply' is missing in type '{}'. +!!! error TS2323: Type '{}' is not assignable to type 'Function'. +!!! error TS2323: Property 'apply' is missing in type '{}'. function foo() { } module foo { @@ -46,6 +46,6 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type var badFundule: Function = bad; // error ~~~~~~~~~~ -!!! error TS2322: Type 'typeof bad' is not assignable to type 'Function': -!!! error TS2322: Types of property 'apply' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'. \ No newline at end of file +!!! error TS2323: Type 'typeof bad' is not assignable to type 'Function'. +!!! error TS2323: Types of property 'apply' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt index 070b5497121..67dee955566 100644 --- a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt +++ b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt @@ -6,14 +6,14 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(17,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(25,5): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3': - Types of property 'x' are incompatible: +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,1): error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3': - Types of property 'x' are incompatible: +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,1): error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3': - Types of property 'x' are incompatible: +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,1): error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(37,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(38,1): error TS2364: Invalid left-hand side of assignment expression. @@ -79,19 +79,19 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize M2.M3 = { x: '' }; // Error ~~~~~ -!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'. +!!! error TS2323: Types of property 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. (M2).M3 = { x: '' }; // Error ~~~~~~~ -!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'. +!!! error TS2323: Types of property 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. (M2.M3) = { x: '' }; // Error ~~~~~~~ -!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'. +!!! error TS2323: Types of property 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. function fn() { } diff --git a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt index 2c165c2395c..8a5899d2377 100644 --- a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt +++ b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(15,5): error TS2322: Type '{}' is not assignable to type '{ [x: number]: Foo; }': +tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(15,5): error TS2323: Type '{}' is not assignable to type '{ [x: number]: Foo; }'. Index signature is missing in type '{}'. -tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(19,5): error TS2322: Type '() => void' is not assignable to type '{ [x: number]: Bar; }': +tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(19,5): error TS2323: Type '() => void' is not assignable to type '{ [x: number]: Bar; }'. Index signature is missing in type '() => void'. @@ -21,14 +21,14 @@ tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignatur var v1: { ~~ -!!! error TS2322: Type '{}' is not assignable to type '{ [x: number]: Foo; }': -!!! error TS2322: Index signature is missing in type '{}'. +!!! error TS2323: Type '{}' is not assignable to type '{ [x: number]: Foo; }'. +!!! error TS2323: Index signature is missing in type '{}'. [n: number]: Foo } = o; // Should be allowed var v2: { ~~ -!!! error TS2322: Type '() => void' is not assignable to type '{ [x: number]: Bar; }': -!!! error TS2322: Index signature is missing in type '() => void'. +!!! error TS2323: Type '() => void' is not assignable to type '{ [x: number]: Bar; }'. +!!! error TS2323: Index signature is missing in type '() => void'. [n: number]: Bar } = f; // Should be allowed \ No newline at end of file diff --git a/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt b/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt index f55bca8e0e2..eca303ff72c 100644 --- a/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt +++ b/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/baseTypePrivateMemberClash.ts(8,11): error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y': +tests/cases/compiler/baseTypePrivateMemberClash.ts(8,11): error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y'. Named properties 'm' of types 'X' and 'Y' are not identical. @@ -12,5 +12,5 @@ tests/cases/compiler/baseTypePrivateMemberClash.ts(8,11): error TS2320: Interfac interface Z extends X, Y { } ~ -!!! error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y': +!!! error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y'. !!! error TS2320: Named properties 'm' of types 'X' and 'Y' are not identical. \ No newline at end of file diff --git a/tests/baselines/reference/bases.errors.txt b/tests/baselines/reference/bases.errors.txt index a4a04af142d..c9eabafaf80 100644 --- a/tests/baselines/reference/bases.errors.txt +++ b/tests/baselines/reference/bases.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/bases.ts(7,15): error TS1005: ';' expected. tests/cases/compiler/bases.ts(13,15): error TS1005: ';' expected. tests/cases/compiler/bases.ts(7,14): error TS2339: Property 'y' does not exist on type 'B'. tests/cases/compiler/bases.ts(7,17): error TS2304: Cannot find name 'any'. -tests/cases/compiler/bases.ts(11,7): error TS2421: Class 'C' incorrectly implements interface 'I': +tests/cases/compiler/bases.ts(11,7): error TS2420: Class 'C' incorrectly implements interface 'I'. Property 'x' is missing in type 'C'. tests/cases/compiler/bases.ts(12,5): error TS2377: Constructors for derived classes must contain a 'super' call. tests/cases/compiler/bases.ts(13,14): error TS2339: Property 'x' does not exist on type 'C'. @@ -30,8 +30,8 @@ tests/cases/compiler/bases.ts(18,9): error TS2339: Property 'y' does not exist o class C extends B implements I { ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'I': -!!! error TS2421: Property 'x' is missing in type 'C'. +!!! error TS2420: Class 'C' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is missing in type 'C'. constructor() { ~~~~~~~~~~~~~~~ this.x: any; diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt index d0e31f4a246..d6efdd66868 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance.ts(57,15): error TS2429: Interface 'I2' incorrectly extends interface 'Base2': - Types of property 'a' are incompatible: - Type '(x: number) => string' is not assignable to type '(x: number) => number': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance.ts(57,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. + Type '(x: number) => string' is not assignable to type '(x: number) => number'. Type 'string' is not assignable to type 'number'. @@ -63,10 +63,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign // S's interface I2 extends Base2 { ~~ -!!! error TS2429: Interface 'I2' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type '(x: number) => string' is not assignable to type '(x: number) => number': -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type '(x: number) => string' is not assignable to type '(x: number) => number'. +!!! error TS2430: Type 'string' is not assignable to type 'number'. // N's a: (x: number) => string; // error because base returns non-void; } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt index 51bf9695692..7e9d75b1b41 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(51,19): error TS2429: Interface 'I2' incorrectly extends interface 'A': - Types of property 'a2' are incompatible: - Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(51,19): error TS2430: Interface 'I2' incorrectly extends interface 'A'. + Types of property 'a2' are incompatible. + Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]'. + Types of parameters 'x' and 'x' are incompatible. Type 'T' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(60,19): error TS2429: Interface 'I4' incorrectly extends interface 'A': - Types of property 'a8' are incompatible: - Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': - Types of parameters 'y' and 'y' are incompatible: - Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': - Types of parameters 'arg2' and 'arg2' are incompatible: - Type '{ foo: number; }' is not assignable to type 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(60,19): error TS2430: Interface 'I4' incorrectly extends interface 'A'. + Types of property 'a8' are incompatible. + Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. Type 'number' is not assignable to type 'string'. @@ -67,11 +67,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign interface I2 extends A { ~~ -!!! error TS2429: Interface 'I2' incorrectly extends interface 'A': -!!! error TS2429: Types of property 'a2' are incompatible: -!!! error TS2429: Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]': -!!! error TS2429: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2429: Type 'T' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'a2' are incompatible. +!!! error TS2430: Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]'. +!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type 'number'. a2: (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic } @@ -82,15 +82,15 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign interface I4 extends A { ~~ -!!! error TS2429: Interface 'I4' incorrectly extends interface 'A': -!!! error TS2429: Types of property 'a8' are incompatible: -!!! error TS2429: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': -!!! error TS2429: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2429: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': -!!! error TS2429: Types of parameters 'arg2' and 'arg2' are incompatible: -!!! error TS2429: Type '{ foo: number; }' is not assignable to type 'Base': -!!! error TS2429: Types of property 'foo' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I4' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'a8' are incompatible. +!!! error TS2430: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. +!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2430: Types of property 'foo' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a8: (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch } diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt index aada6c9f8a1..5fabfd0b7ad 100644 --- a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(8,11): error TS2320: Interface 'A' cannot simultaneously extend types 'I' and 'I': +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(8,11): error TS2320: Interface 'A' cannot simultaneously extend types 'I' and 'I'. Named properties 'foo' of types 'I' and 'I' are not identical. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(13,16): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. @@ -13,7 +13,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesTha interface A extends I, I { } ~ -!!! error TS2320: Interface 'A' cannot simultaneously extend types 'I' and 'I': +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'I' and 'I'. !!! error TS2320: Named properties 'foo' of types 'I' and 'I' are not identical. var x: A; diff --git a/tests/baselines/reference/castingTuple.errors.txt b/tests/baselines/reference/castingTuple.errors.txt index c3079699a80..9bf9c4f24fb 100644 --- a/tests/baselines/reference/castingTuple.errors.txt +++ b/tests/baselines/reference/castingTuple.errors.txt @@ -1,19 +1,19 @@ -tests/cases/conformance/types/tuple/castingTuple.ts(13,23): error TS2353: Neither type '[number, string]' nor type '[number, string, boolean]' is assignable to the other: +tests/cases/conformance/types/tuple/castingTuple.ts(13,23): error TS2352: Neither type '[number, string]' nor type '[number, string, boolean]' is assignable to the other. Property '2' is missing in type '[number, string]'. -tests/cases/conformance/types/tuple/castingTuple.ts(16,21): error TS2353: Neither type '[C, D]' nor type '[C, D, A]' is assignable to the other: +tests/cases/conformance/types/tuple/castingTuple.ts(16,21): error TS2352: Neither type '[C, D]' nor type '[C, D, A]' is assignable to the other. Property '2' is missing in type '[C, D]'. -tests/cases/conformance/types/tuple/castingTuple.ts(24,10): error TS2353: Neither type '[number, string]' nor type '[number, number]' is assignable to the other: - Types of property '1' are incompatible: +tests/cases/conformance/types/tuple/castingTuple.ts(24,10): error TS2352: Neither type '[number, string]' nor type '[number, number]' is assignable to the other. + Types of property '1' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/tuple/castingTuple.ts(25,10): error TS2353: Neither type '[C, D]' nor type '[A, I]' is assignable to the other: - Types of property '0' are incompatible: - Type 'C' is not assignable to type 'A': +tests/cases/conformance/types/tuple/castingTuple.ts(25,10): error TS2352: Neither type '[C, D]' nor type '[A, I]' is assignable to the other. + Types of property '0' are incompatible. + Type 'C' is not assignable to type 'A'. Property 'a' is missing in type 'C'. tests/cases/conformance/types/tuple/castingTuple.ts(26,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'. -tests/cases/conformance/types/tuple/castingTuple.ts(26,14): error TS2353: Neither type '[number, string]' nor type 'number[]' is assignable to the other: - Types of property 'pop' are incompatible: - Type '() => string | number' is not assignable to type '() => number': - Type 'string | number' is not assignable to type 'number': +tests/cases/conformance/types/tuple/castingTuple.ts(26,14): error TS2352: Neither type '[number, string]' nor type 'number[]' is assignable to the other. + Types of property 'pop' are incompatible. + Type '() => string | number' is not assignable to type '() => number'. + Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/tuple/castingTuple.ts(27,1): error TS2304: Cannot find name 't4'. @@ -33,14 +33,14 @@ tests/cases/conformance/types/tuple/castingTuple.ts(27,1): error TS2304: Cannot var emptyObjTuple = <[{}, {}]>numStrTuple; var numStrBoolTuple = <[number, string, boolean]>numStrTuple; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '[number, string]' nor type '[number, string, boolean]' is assignable to the other: -!!! error TS2353: Property '2' is missing in type '[number, string]'. +!!! error TS2352: Neither type '[number, string]' nor type '[number, string, boolean]' is assignable to the other. +!!! error TS2352: Property '2' is missing in type '[number, string]'. var classCDTuple: [C, D] = [new C(), new D()]; var interfaceIITuple = <[I, I]>classCDTuple; var classCDATuple = <[C, D, A]>classCDTuple; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '[C, D]' nor type '[C, D, A]' is assignable to the other: -!!! error TS2353: Property '2' is missing in type '[C, D]'. +!!! error TS2352: Neither type '[C, D]' nor type '[C, D, A]' is assignable to the other. +!!! error TS2352: Property '2' is missing in type '[C, D]'. var eleFromCDA1 = classCDATuple[2]; // A var eleFromCDA2 = classCDATuple[5]; // {} var t10: [E1, E2] = [E1.one, E2.one]; @@ -50,24 +50,24 @@ tests/cases/conformance/types/tuple/castingTuple.ts(27,1): error TS2304: Cannot // error var t3 = <[number, number]>numStrTuple; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '[number, string]' nor type '[number, number]' is assignable to the other: -!!! error TS2353: Types of property '1' are incompatible: -!!! error TS2353: Type 'string' is not assignable to type 'number'. +!!! error TS2352: Neither type '[number, string]' nor type '[number, number]' is assignable to the other. +!!! error TS2352: Types of property '1' are incompatible. +!!! error TS2352: Type 'string' is not assignable to type 'number'. var t9 = <[A, I]>classCDTuple; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '[C, D]' nor type '[A, I]' is assignable to the other: -!!! error TS2353: Types of property '0' are incompatible: -!!! error TS2353: Type 'C' is not assignable to type 'A': -!!! error TS2353: Property 'a' is missing in type 'C'. +!!! error TS2352: Neither type '[C, D]' nor type '[A, I]' is assignable to the other. +!!! error TS2352: Types of property '0' are incompatible. +!!! error TS2352: Type 'C' is not assignable to type 'A'. +!!! error TS2352: Property 'a' is missing in type 'C'. var array1 = numStrTuple; ~~~~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'. ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '[number, string]' nor type 'number[]' is assignable to the other: -!!! error TS2353: Types of property 'pop' are incompatible: -!!! error TS2353: Type '() => string | number' is not assignable to type '() => number': -!!! error TS2353: Type 'string | number' is not assignable to type 'number': -!!! error TS2353: Type 'string' is not assignable to type 'number'. +!!! error TS2352: Neither type '[number, string]' nor type 'number[]' is assignable to the other. +!!! error TS2352: Types of property 'pop' are incompatible. +!!! error TS2352: Type '() => string | number' is not assignable to type '() => number'. +!!! error TS2352: Type 'string | number' is not assignable to type 'number'. +!!! error TS2352: Type 'string' is not assignable to type 'number'. t4[2] = 10; ~~ !!! error TS2304: Cannot find name 't4'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedAssignment1.errors.txt b/tests/baselines/reference/chainedAssignment1.errors.txt index 29555d10dcb..6c95a2f4362 100644 --- a/tests/baselines/reference/chainedAssignment1.errors.txt +++ b/tests/baselines/reference/chainedAssignment1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/chainedAssignment1.ts(21,1): error TS2322: Type 'Z' is not assignable to type 'X': +tests/cases/compiler/chainedAssignment1.ts(21,1): error TS2323: Type 'Z' is not assignable to type 'X'. Property 'a' is missing in type 'Z'. -tests/cases/compiler/chainedAssignment1.ts(21,6): error TS2322: Type 'Z' is not assignable to type 'Y': +tests/cases/compiler/chainedAssignment1.ts(21,6): error TS2323: Type 'Z' is not assignable to type 'Y'. Property 'a' is missing in type 'Z'. tests/cases/compiler/chainedAssignment1.ts(22,1): error TS2323: Type 'Z' is not assignable to type 'Y'. @@ -28,11 +28,11 @@ tests/cases/compiler/chainedAssignment1.ts(22,1): error TS2323: Type 'Z' is not var c3 = new Z(); c1 = c2 = c3; // a bug made this not report the same error as below ~~ -!!! error TS2322: Type 'Z' is not assignable to type 'X': -!!! error TS2322: Property 'a' is missing in type 'Z'. +!!! error TS2323: Type 'Z' is not assignable to type 'X'. +!!! error TS2323: Property 'a' is missing in type 'Z'. ~~ -!!! error TS2322: Type 'Z' is not assignable to type 'Y': -!!! error TS2322: Property 'a' is missing in type 'Z'. +!!! error TS2323: Type 'Z' is not assignable to type 'Y'. +!!! error TS2323: Property 'a' is missing in type 'Z'. c2 = c3; // Error TS111: Cannot convert Z to Y ~~ !!! error TS2323: Type 'Z' is not assignable to type 'Y'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedAssignment3.errors.txt b/tests/baselines/reference/chainedAssignment3.errors.txt index 758c3e2a332..1c760f9b37c 100644 --- a/tests/baselines/reference/chainedAssignment3.errors.txt +++ b/tests/baselines/reference/chainedAssignment3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/chainedAssignment3.ts(18,1): error TS2322: Type 'A' is not assignable to type 'B': +tests/cases/compiler/chainedAssignment3.ts(18,1): error TS2323: Type 'A' is not assignable to type 'B'. Property 'value' is missing in type 'A'. tests/cases/compiler/chainedAssignment3.ts(19,5): error TS2323: Type 'A' is not assignable to type 'B'. @@ -23,8 +23,8 @@ tests/cases/compiler/chainedAssignment3.ts(19,5): error TS2323: Type 'A' is not // error cases b = a = new A(); ~ -!!! error TS2322: Type 'A' is not assignable to type 'B': -!!! error TS2322: Property 'value' is missing in type 'A'. +!!! error TS2323: Type 'A' is not assignable to type 'B'. +!!! error TS2323: Property 'value' is missing in type 'A'. a = b = new A(); ~ !!! error TS2323: Type 'A' is not assignable to type 'B'. diff --git a/tests/baselines/reference/chainedAssignmentChecking.errors.txt b/tests/baselines/reference/chainedAssignmentChecking.errors.txt index 3748995e4f0..957c088ab52 100644 --- a/tests/baselines/reference/chainedAssignmentChecking.errors.txt +++ b/tests/baselines/reference/chainedAssignmentChecking.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/chainedAssignmentChecking.ts(21,1): error TS2322: Type 'Z' is not assignable to type 'X': +tests/cases/compiler/chainedAssignmentChecking.ts(21,1): error TS2323: Type 'Z' is not assignable to type 'X'. Property 'a' is missing in type 'Z'. -tests/cases/compiler/chainedAssignmentChecking.ts(21,6): error TS2322: Type 'Z' is not assignable to type 'Y': +tests/cases/compiler/chainedAssignmentChecking.ts(21,6): error TS2323: Type 'Z' is not assignable to type 'Y'. Property 'a' is missing in type 'Z'. @@ -27,9 +27,9 @@ tests/cases/compiler/chainedAssignmentChecking.ts(21,6): error TS2322: Type 'Z' c1 = c2 = c3; // Should be error ~~ -!!! error TS2322: Type 'Z' is not assignable to type 'X': -!!! error TS2322: Property 'a' is missing in type 'Z'. +!!! error TS2323: Type 'Z' is not assignable to type 'X'. +!!! error TS2323: Property 'a' is missing in type 'Z'. ~~ -!!! error TS2322: Type 'Z' is not assignable to type 'Y': -!!! error TS2322: Property 'a' is missing in type 'Z'. +!!! error TS2323: Type 'Z' is not assignable to type 'Y'. +!!! error TS2323: Property 'a' is missing in type 'Z'. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.errors.txt b/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.errors.txt index cff696696b7..ea3927b51d1 100644 --- a/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.errors.txt +++ b/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/classExtendsInterfaceThatExtendsClassWithPrivates1.ts(10,7): error TS2421: Class 'D2' incorrectly implements interface 'I': +tests/cases/compiler/classExtendsInterfaceThatExtendsClassWithPrivates1.ts(10,7): error TS2420: Class 'D2' incorrectly implements interface 'I'. Types have separate declarations of a private property 'x'. @@ -14,8 +14,8 @@ tests/cases/compiler/classExtendsInterfaceThatExtendsClassWithPrivates1.ts(10,7) class D2 implements I { ~~ -!!! error TS2421: Class 'D2' incorrectly implements interface 'I': -!!! error TS2421: Types have separate declarations of a private property 'x'. +!!! error TS2420: Class 'D2' incorrectly implements interface 'I'. +!!! error TS2420: Types have separate declarations of a private property 'x'. public foo(x: any) { return x } private x = 3; other(x: any) { return x } diff --git a/tests/baselines/reference/classImplementsClass2.errors.txt b/tests/baselines/reference/classImplementsClass2.errors.txt index f1fabd8a975..8287eb92ce7 100644 --- a/tests/baselines/reference/classImplementsClass2.errors.txt +++ b/tests/baselines/reference/classImplementsClass2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/classImplementsClass2.ts(2,7): error TS2421: Class 'C' incorrectly implements interface 'A': +tests/cases/compiler/classImplementsClass2.ts(2,7): error TS2420: Class 'C' incorrectly implements interface 'A'. Property 'foo' is missing in type 'C'. -tests/cases/compiler/classImplementsClass2.ts(13,1): error TS2322: Type 'C' is not assignable to type 'C2': +tests/cases/compiler/classImplementsClass2.ts(13,1): error TS2323: Type 'C' is not assignable to type 'C2'. Property 'foo' is missing in type 'C'. @@ -8,8 +8,8 @@ tests/cases/compiler/classImplementsClass2.ts(13,1): error TS2322: Type 'C' is n class A { foo(): number { return 1; } } class C implements A {} // error ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'A': -!!! error TS2421: Property 'foo' is missing in type 'C'. +!!! error TS2420: Class 'C' incorrectly implements interface 'A'. +!!! error TS2420: Property 'foo' is missing in type 'C'. class C2 extends A { foo() { @@ -22,5 +22,5 @@ tests/cases/compiler/classImplementsClass2.ts(13,1): error TS2322: Type 'C' is n c = c2; c2 = c; ~~ -!!! error TS2322: Type 'C' is not assignable to type 'C2': -!!! error TS2322: Property 'foo' is missing in type 'C'. \ No newline at end of file +!!! error TS2323: Type 'C' is not assignable to type 'C2'. +!!! error TS2323: Property 'foo' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsClass4.errors.txt b/tests/baselines/reference/classImplementsClass4.errors.txt index 7539cb1a752..2de30155c8d 100644 --- a/tests/baselines/reference/classImplementsClass4.errors.txt +++ b/tests/baselines/reference/classImplementsClass4.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/classImplementsClass4.ts(5,7): error TS2421: Class 'C' incorrectly implements interface 'A': +tests/cases/compiler/classImplementsClass4.ts(5,7): error TS2420: Class 'C' incorrectly implements interface 'A'. Property 'x' is missing in type 'C'. -tests/cases/compiler/classImplementsClass4.ts(16,1): error TS2322: Type 'C' is not assignable to type 'C2': +tests/cases/compiler/classImplementsClass4.ts(16,1): error TS2323: Type 'C' is not assignable to type 'C2'. Property 'x' is missing in type 'C'. @@ -11,8 +11,8 @@ tests/cases/compiler/classImplementsClass4.ts(16,1): error TS2322: Type 'C' is n } class C implements A { ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'A': -!!! error TS2421: Property 'x' is missing in type 'C'. +!!! error TS2420: Class 'C' incorrectly implements interface 'A'. +!!! error TS2420: Property 'x' is missing in type 'C'. foo() { return 1; } @@ -25,5 +25,5 @@ tests/cases/compiler/classImplementsClass4.ts(16,1): error TS2322: Type 'C' is n c = c2; c2 = c; ~~ -!!! error TS2322: Type 'C' is not assignable to type 'C2': -!!! error TS2322: Property 'x' is missing in type 'C'. \ No newline at end of file +!!! error TS2323: Type 'C' is not assignable to type 'C2'. +!!! error TS2323: Property 'x' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsClass5.errors.txt b/tests/baselines/reference/classImplementsClass5.errors.txt index 6328e595e13..6b5533e65f1 100644 --- a/tests/baselines/reference/classImplementsClass5.errors.txt +++ b/tests/baselines/reference/classImplementsClass5.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/classImplementsClass5.ts(5,7): error TS2421: Class 'C' incorrectly implements interface 'A': +tests/cases/compiler/classImplementsClass5.ts(5,7): error TS2420: Class 'C' incorrectly implements interface 'A'. Types have separate declarations of a private property 'x'. -tests/cases/compiler/classImplementsClass5.ts(16,1): error TS2322: Type 'C2' is not assignable to type 'C': +tests/cases/compiler/classImplementsClass5.ts(16,1): error TS2323: Type 'C2' is not assignable to type 'C'. Types have separate declarations of a private property 'x'. -tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2322: Type 'C' is not assignable to type 'C2': +tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2323: Type 'C' is not assignable to type 'C2'. Types have separate declarations of a private property 'x'. @@ -13,8 +13,8 @@ tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2322: Type 'C' is n } class C implements A { ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'A': -!!! error TS2421: Types have separate declarations of a private property 'x'. +!!! error TS2420: Class 'C' incorrectly implements interface 'A'. +!!! error TS2420: Types have separate declarations of a private property 'x'. private x = 1; foo() { return 1; @@ -27,9 +27,9 @@ tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2322: Type 'C' is n var c2: C2; c = c2; ~ -!!! error TS2322: Type 'C2' is not assignable to type 'C': -!!! error TS2322: Types have separate declarations of a private property 'x'. +!!! error TS2323: Type 'C2' is not assignable to type 'C'. +!!! error TS2323: Types have separate declarations of a private property 'x'. c2 = c; ~~ -!!! error TS2322: Type 'C' is not assignable to type 'C2': -!!! error TS2322: Types have separate declarations of a private property 'x'. \ No newline at end of file +!!! error TS2323: Type 'C' is not assignable to type 'C2'. +!!! error TS2323: Types have separate declarations of a private property 'x'. \ No newline at end of file diff --git a/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt b/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt index 7ba816475fb..88176d95026 100644 --- a/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt +++ b/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classIsSubtypeOfBaseType.ts(11,7): error TS2416: Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>': - Types of property 'foo' are incompatible: - Type '{ bar?: string; }' is not assignable to type '{ bar: string; }': +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classIsSubtypeOfBaseType.ts(11,7): error TS2415: Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>'. + Types of property 'foo' are incompatible. + Type '{ bar?: string; }' is not assignable to type '{ bar: string; }'. Property 'bar' is optional in type '{ bar?: string; }' but required in type '{ bar: string; }'. @@ -17,10 +17,10 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla class Derived2 extends Base<{ bar: string; }> { ~~~~~~~~ -!!! error TS2416: Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type '{ bar?: string; }' is not assignable to type '{ bar: string; }': -!!! error TS2416: Property 'bar' is optional in type '{ bar?: string; }' but required in type '{ bar: string; }'. +!!! error TS2415: Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type '{ bar?: string; }' is not assignable to type '{ bar: string; }'. +!!! error TS2415: Property 'bar' is optional in type '{ bar?: string; }' but required in type '{ bar: string; }'. foo: { bar?: string; // error } diff --git a/tests/baselines/reference/classUpdateTests.errors.txt b/tests/baselines/reference/classUpdateTests.errors.txt index 4548560df15..6bfd7518855 100644 --- a/tests/baselines/reference/classUpdateTests.errors.txt +++ b/tests/baselines/reference/classUpdateTests.errors.txt @@ -9,9 +9,9 @@ tests/cases/compiler/classUpdateTests.ts(43,18): error TS2335: 'super' can only tests/cases/compiler/classUpdateTests.ts(46,17): error TS2311: A class may only extend another class. tests/cases/compiler/classUpdateTests.ts(47,18): error TS2335: 'super' can only be referenced in a derived class. tests/cases/compiler/classUpdateTests.ts(57,2): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. -tests/cases/compiler/classUpdateTests.ts(63,7): error TS2416: Class 'L' incorrectly extends base class 'G': +tests/cases/compiler/classUpdateTests.ts(63,7): error TS2415: Class 'L' incorrectly extends base class 'G'. Property 'p1' is private in type 'L' but not in type 'G'. -tests/cases/compiler/classUpdateTests.ts(69,7): error TS2416: Class 'M' incorrectly extends base class 'G': +tests/cases/compiler/classUpdateTests.ts(69,7): error TS2415: Class 'M' incorrectly extends base class 'G'. Property 'p1' is private in type 'M' but not in type 'G'. tests/cases/compiler/classUpdateTests.ts(70,2): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. tests/cases/compiler/classUpdateTests.ts(105,15): error TS2339: Property 'p1' does not exist on type 'Q'. @@ -96,8 +96,8 @@ tests/cases/compiler/classUpdateTests.ts(111,16): error TS2339: Property 'p1' do class L extends G { ~ -!!! error TS2416: Class 'L' incorrectly extends base class 'G': -!!! error TS2416: Property 'p1' is private in type 'L' but not in type 'G'. +!!! error TS2415: Class 'L' incorrectly extends base class 'G'. +!!! error TS2415: Property 'p1' is private in type 'L' but not in type 'G'. constructor(private p1:number) { super(); // NO ERROR } @@ -105,8 +105,8 @@ tests/cases/compiler/classUpdateTests.ts(111,16): error TS2339: Property 'p1' do class M extends G { ~ -!!! error TS2416: Class 'M' incorrectly extends base class 'G': -!!! error TS2416: Property 'p1' is private in type 'M' but not in type 'G'. +!!! error TS2415: Class 'M' incorrectly extends base class 'G'. +!!! error TS2415: Property 'p1' is private in type 'M' but not in type 'G'. constructor(private p1:number) { // ERROR ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var i = 0; diff --git a/tests/baselines/reference/classWithMultipleBaseClasses.errors.txt b/tests/baselines/reference/classWithMultipleBaseClasses.errors.txt index 5463a3b21ee..37eb63547ed 100644 --- a/tests/baselines/reference/classWithMultipleBaseClasses.errors.txt +++ b/tests/baselines/reference/classWithMultipleBaseClasses.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/classWithMultipleBaseClasses.ts(18,7): error TS2421: Class 'D' incorrectly implements interface 'I': +tests/cases/compiler/classWithMultipleBaseClasses.ts(18,7): error TS2420: Class 'D' incorrectly implements interface 'I'. Property 'foo' is missing in type 'D'. @@ -22,8 +22,8 @@ tests/cases/compiler/classWithMultipleBaseClasses.ts(18,7): error TS2421: Class class D implements I, J { ~ -!!! error TS2421: Class 'D' incorrectly implements interface 'I': -!!! error TS2421: Property 'foo' is missing in type 'D'. +!!! error TS2420: Class 'D' incorrectly implements interface 'I'. +!!! error TS2420: Property 'foo' is missing in type 'D'. baz() { } bat() { } } diff --git a/tests/baselines/reference/clodulesDerivedClasses.errors.txt b/tests/baselines/reference/clodulesDerivedClasses.errors.txt index e4ce78e1875..1753f6051bd 100644 --- a/tests/baselines/reference/clodulesDerivedClasses.errors.txt +++ b/tests/baselines/reference/clodulesDerivedClasses.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/clodulesDerivedClasses.ts(9,7): error TS2418: Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape': - Types of property 'Utils' are incompatible: - Type 'typeof Utils' is not assignable to type 'typeof Utils': +tests/cases/compiler/clodulesDerivedClasses.ts(9,7): error TS2417: Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape'. + Types of property 'Utils' are incompatible. + Type 'typeof Utils' is not assignable to type 'typeof Utils'. Property 'convert' is missing in type 'typeof Utils'. @@ -15,10 +15,10 @@ tests/cases/compiler/clodulesDerivedClasses.ts(9,7): error TS2418: Class static class Path extends Shape { ~~~~ -!!! error TS2418: Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape': -!!! error TS2418: Types of property 'Utils' are incompatible: -!!! error TS2418: Type 'typeof Utils' is not assignable to type 'typeof Utils': -!!! error TS2418: Property 'convert' is missing in type 'typeof Utils'. +!!! error TS2417: Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape'. +!!! error TS2417: Types of property 'Utils' are incompatible. +!!! error TS2417: Type 'typeof Utils' is not assignable to type 'typeof Utils'. +!!! error TS2417: Property 'convert' is missing in type 'typeof Utils'. name: string; } diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt index 2055bbc2b34..bedfb8deba3 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(5,1): error TS2323: Type 'string' is not assignable to type 'boolean'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(8,1): error TS2323: Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(11,1): error TS2323: Type 'string' is not assignable to type 'E'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(14,1): error TS2322: Type 'string' is not assignable to type '{ a: string; }': +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(14,1): error TS2323: Type 'string' is not assignable to type '{ a: string; }'. Property 'a' is missing in type 'String'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(17,1): error TS2323: Type 'string' is not assignable to type 'void'. @@ -28,8 +28,8 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen var x4: {a: string}; x4 += ''; ~~ -!!! error TS2322: Type 'string' is not assignable to type '{ a: string; }': -!!! error TS2322: Property 'a' is missing in type 'String'. +!!! error TS2323: Type 'string' is not assignable to type '{ a: string; }'. +!!! error TS2323: Property 'a' is missing in type 'String'. var x5: void; x5 += ''; diff --git a/tests/baselines/reference/conditionalExpression1.errors.txt b/tests/baselines/reference/conditionalExpression1.errors.txt index 30703c7169e..35066561a38 100644 --- a/tests/baselines/reference/conditionalExpression1.errors.txt +++ b/tests/baselines/reference/conditionalExpression1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/conditionalExpression1.ts(1,5): error TS2322: Type 'string | number' is not assignable to type 'boolean': +tests/cases/compiler/conditionalExpression1.ts(1,5): error TS2323: Type 'string | number' is not assignable to type 'boolean'. Type 'string' is not assignable to type 'boolean'. ==== tests/cases/compiler/conditionalExpression1.ts (1 errors) ==== var x: boolean = (true ? 1 : ""); // should be an error ~ -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean': -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2323: Type 'string | number' is not assignable to type 'boolean'. +!!! error TS2323: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt index b1dd23fc3e3..27c08308c33 100644 --- a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt @@ -1,17 +1,17 @@ -tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(15,5): error TS2322: Type 'A | B' is not assignable to type 'A': - Type 'B' is not assignable to type 'A': +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(15,5): error TS2323: Type 'A | B' is not assignable to type 'A'. + Type 'B' is not assignable to type 'A'. Property 'propertyA' is missing in type 'B'. -tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(16,5): error TS2322: Type 'A | B' is not assignable to type 'B': - Type 'A' is not assignable to type 'B': +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(16,5): error TS2323: Type 'A | B' is not assignable to type 'B'. + Type 'A' is not assignable to type 'B'. Property 'propertyB' is missing in type 'A'. -tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(18,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number': - Type '(n: X) => string' is not assignable to type '(t: X) => number': +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(18,5): error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number'. + Type '(n: X) => string' is not assignable to type '(t: X) => number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(19,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string': - Type '(m: X) => number' is not assignable to type '(t: X) => string': +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(19,5): error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string'. + Type '(m: X) => number' is not assignable to type '(t: X) => string'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(20,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean': - Type '(m: X) => number' is not assignable to type '(t: X) => boolean': +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(20,5): error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean'. + Type '(m: X) => number' is not assignable to type '(t: X) => boolean'. Type 'number' is not assignable to type 'boolean'. @@ -32,27 +32,27 @@ tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithou //Be contextually typed and and bct is not identical, results in errors that union type is not assignable to target var result2: A = true ? a : b; ~~~~~~~ -!!! error TS2322: Type 'A | B' is not assignable to type 'A': -!!! error TS2322: Type 'B' is not assignable to type 'A': -!!! error TS2322: Property 'propertyA' is missing in type 'B'. +!!! error TS2323: Type 'A | B' is not assignable to type 'A'. +!!! error TS2323: Type 'B' is not assignable to type 'A'. +!!! error TS2323: Property 'propertyA' is missing in type 'B'. var result3: B = true ? a : b; ~~~~~~~ -!!! error TS2322: Type 'A | B' is not assignable to type 'B': -!!! error TS2322: Type 'A' is not assignable to type 'B': -!!! error TS2322: Property 'propertyB' is missing in type 'A'. +!!! error TS2323: Type 'A | B' is not assignable to type 'B'. +!!! error TS2323: Type 'A' is not assignable to type 'B'. +!!! error TS2323: Property 'propertyB' is missing in type 'A'. var result4: (t: X) => number = true ? (m) => m.propertyX1 : (n) => n.propertyX2; ~~~~~~~ -!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number': -!!! error TS2322: Type '(n: X) => string' is not assignable to type '(t: X) => number': -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number'. +!!! error TS2323: Type '(n: X) => string' is not assignable to type '(t: X) => number'. +!!! error TS2323: Type 'string' is not assignable to type 'number'. var result5: (t: X) => string = true ? (m) => m.propertyX1 : (n) => n.propertyX2; ~~~~~~~ -!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string': -!!! error TS2322: Type '(m: X) => number' is not assignable to type '(t: X) => string': -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string'. +!!! error TS2323: Type '(m: X) => number' is not assignable to type '(t: X) => string'. +!!! error TS2323: Type 'number' is not assignable to type 'string'. var result6: (t: X) => boolean = true ? (m) => m.propertyX1 : (n) => n.propertyX2; ~~~~~~~ -!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean': -!!! error TS2322: Type '(m: X) => number' is not assignable to type '(t: X) => boolean': -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean'. +!!! error TS2323: Type '(m: X) => number' is not assignable to type '(t: X) => boolean'. +!!! error TS2323: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/conflictingMemberTypesInBases.errors.txt b/tests/baselines/reference/conflictingMemberTypesInBases.errors.txt index dfd87465894..58fdcb4c7ae 100644 --- a/tests/baselines/reference/conflictingMemberTypesInBases.errors.txt +++ b/tests/baselines/reference/conflictingMemberTypesInBases.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/conflictingMemberTypesInBases.ts(12,11): error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D': +tests/cases/compiler/conflictingMemberTypesInBases.ts(12,11): error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D'. Named properties 'm' of types 'B' and 'D' are not identical. @@ -16,7 +16,7 @@ tests/cases/compiler/conflictingMemberTypesInBases.ts(12,11): error TS2320: Inte interface E extends B { } // Error here for extending B and D ~ -!!! error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D': +!!! error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D'. !!! error TS2320: Named properties 'm' of types 'B' and 'D' are not identical. interface E extends D { } // No duplicate error here \ No newline at end of file diff --git a/tests/baselines/reference/constraints0.errors.txt b/tests/baselines/reference/constraints0.errors.txt index ac16118149b..217a7408fbd 100644 --- a/tests/baselines/reference/constraints0.errors.txt +++ b/tests/baselines/reference/constraints0.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/constraints0.ts(14,9): error TS2343: Type 'B' does not satisfy the constraint 'A': +tests/cases/compiler/constraints0.ts(14,9): error TS2344: Type 'B' does not satisfy the constraint 'A'. Property 'a' is missing in type 'B'. @@ -18,7 +18,7 @@ tests/cases/compiler/constraints0.ts(14,9): error TS2343: Type 'B' does not sati var v1: C; // should work var v2: C; // should not work ~~~~ -!!! error TS2343: Type 'B' does not satisfy the constraint 'A': -!!! error TS2343: Property 'a' is missing in type 'B'. +!!! error TS2344: Type 'B' does not satisfy the constraint 'A'. +!!! error TS2344: Property 'a' is missing in type 'B'. var y = v1.x.a; // 'a' should be of type 'number' \ No newline at end of file diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt index 373bd49f92d..51278fc3f44 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance.ts(61,15): error TS2429: Interface 'I2' incorrectly extends interface 'Base2': - Types of property 'a' are incompatible: - Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance.ts(61,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. + Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number'. Type 'string' is not assignable to type 'number'. @@ -67,10 +67,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc // S's interface I2 extends Base2 { ~~ -!!! error TS2429: Interface 'I2' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number': -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number'. +!!! error TS2430: Type 'string' is not assignable to type 'number'. // N's a: new (x: number) => string; // error because base returns non-void; } diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt index 4a2425cf3ac..8d6273804f7 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts(41,19): error TS2429: Interface 'I2' incorrectly extends interface 'A': - Types of property 'a2' are incompatible: - Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts(41,19): error TS2430: Interface 'I2' incorrectly extends interface 'A'. + Types of property 'a2' are incompatible. + Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]'. + Types of parameters 'x' and 'x' are incompatible. Type 'T' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts(50,19): error TS2429: Interface 'I4' incorrectly extends interface 'A': - Types of property 'a8' are incompatible: - Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': - Types of parameters 'y' and 'y' are incompatible: - Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': - Types of parameters 'arg2' and 'arg2' are incompatible: - Type '{ foo: number; }' is not assignable to type 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts(50,19): error TS2430: Interface 'I4' incorrectly extends interface 'A'. + Types of property 'a8' are incompatible. + Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. Type 'number' is not assignable to type 'string'. @@ -57,11 +57,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc interface I2 extends A { ~~ -!!! error TS2429: Interface 'I2' incorrectly extends interface 'A': -!!! error TS2429: Types of property 'a2' are incompatible: -!!! error TS2429: Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]': -!!! error TS2429: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2429: Type 'T' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'a2' are incompatible. +!!! error TS2430: Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]'. +!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type 'number'. a2: new (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic } @@ -72,15 +72,15 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc interface I4 extends A { ~~ -!!! error TS2429: Interface 'I4' incorrectly extends interface 'A': -!!! error TS2429: Types of property 'a8' are incompatible: -!!! error TS2429: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': -!!! error TS2429: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2429: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': -!!! error TS2429: Types of parameters 'arg2' and 'arg2' are incompatible: -!!! error TS2429: Type '{ foo: number; }' is not assignable to type 'Base': -!!! error TS2429: Types of property 'foo' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I4' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'a8' are incompatible. +!!! error TS2430: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. +!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2430: Types of property 'foo' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a8: new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch } diff --git a/tests/baselines/reference/contextualTypeWithTuple.errors.txt b/tests/baselines/reference/contextualTypeWithTuple.errors.txt index bd1aa155661..d093e176455 100644 --- a/tests/baselines/reference/contextualTypeWithTuple.errors.txt +++ b/tests/baselines/reference/contextualTypeWithTuple.errors.txt @@ -1,20 +1,20 @@ -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(3,5): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]': - Types of property 'pop' are incompatible: - Type '() => string | number | boolean' is not assignable to type '() => string | number': - Type 'string | number | boolean' is not assignable to type 'string | number': - Type 'boolean' is not assignable to type 'string | number': +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(3,5): error TS2323: Type '[number, string, boolean]' is not assignable to type '[number, string]'. + Types of property 'pop' are incompatible. + Type '() => string | number | boolean' is not assignable to type '() => string | number'. + Type 'string | number | boolean' is not assignable to type 'string | number'. + Type 'boolean' is not assignable to type 'string | number'. Type 'boolean' is not assignable to type 'number'. tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(8,1): error TS2323: Type '[number, string, boolean]' is not assignable to type '[number, string]'. -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(11,1): error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]': - Types of property '0' are incompatible: - Type '{}' is not assignable to type '{ a: string; }': +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(11,1): error TS2323: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'. + Types of property '0' are incompatible. + Type '{}' is not assignable to type '{ a: string; }'. Property 'a' is missing in type '{}'. -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(12,1): error TS2322: Type '[number, string]' is not assignable to type '[number, string, boolean]': +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(12,1): error TS2323: Type '[number, string]' is not assignable to type '[number, string, boolean]'. Property '2' is missing in type '[number, string]'. -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(13,5): error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]': - Types of property 'pop' are incompatible: - Type '() => string | number' is not assignable to type '() => string': - Type 'string | number' is not assignable to type 'string': +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(13,5): error TS2323: Type '[string, string, number]' is not assignable to type '[string, string]'. + Types of property 'pop' are incompatible. + Type '() => string | number' is not assignable to type '() => string'. + Type 'string | number' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. @@ -23,12 +23,12 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(13,5): error TS23 var numStrTuple: [number, string] = [5, "hello"]; var numStrTuple2: [number, string] = [5, "foo", true]; ~~~~~~~~~~~~ -!!! error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]': -!!! error TS2322: Types of property 'pop' are incompatible: -!!! error TS2322: Type '() => string | number | boolean' is not assignable to type '() => string | number': -!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'string | number': -!!! error TS2322: Type 'boolean' is not assignable to type 'string | number': -!!! error TS2322: Type 'boolean' is not assignable to type 'number'. +!!! error TS2323: Type '[number, string, boolean]' is not assignable to type '[number, string]'. +!!! error TS2323: Types of property 'pop' are incompatible. +!!! error TS2323: Type '() => string | number | boolean' is not assignable to type '() => string | number'. +!!! error TS2323: Type 'string | number | boolean' is not assignable to type 'string | number'. +!!! error TS2323: Type 'boolean' is not assignable to type 'string | number'. +!!! error TS2323: Type 'boolean' is not assignable to type 'number'. var numStrBoolTuple: [number, string, boolean] = [5, "foo", true]; var objNumTuple: [{ a: string }, number] = [{ a: "world" }, 5]; var strTupleTuple: [string, [number, {}]] = ["bar", [5, { x: 1, y: 1 }]]; @@ -40,19 +40,19 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(13,5): error TS23 // error objNumTuple = [ {}, 5]; ~~~~~~~~~~~ -!!! error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]': -!!! error TS2322: Types of property '0' are incompatible: -!!! error TS2322: Type '{}' is not assignable to type '{ a: string; }': -!!! error TS2322: Property 'a' is missing in type '{}'. +!!! error TS2323: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'. +!!! error TS2323: Types of property '0' are incompatible. +!!! error TS2323: Type '{}' is not assignable to type '{ a: string; }'. +!!! error TS2323: Property 'a' is missing in type '{}'. numStrBoolTuple = numStrTuple; ~~~~~~~~~~~~~~~ -!!! error TS2322: Type '[number, string]' is not assignable to type '[number, string, boolean]': -!!! error TS2322: Property '2' is missing in type '[number, string]'. +!!! error TS2323: Type '[number, string]' is not assignable to type '[number, string, boolean]'. +!!! error TS2323: Property '2' is missing in type '[number, string]'. var strStrTuple: [string, string] = ["foo", "bar", 5]; ~~~~~~~~~~~ -!!! error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]': -!!! error TS2322: Types of property 'pop' are incompatible: -!!! error TS2322: Type '() => string | number' is not assignable to type '() => string': -!!! error TS2322: Type 'string | number' is not assignable to type 'string': -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '[string, string, number]' is not assignable to type '[string, string]'. +!!! error TS2323: Types of property 'pop' are incompatible. +!!! error TS2323: Type '() => string | number' is not assignable to type '() => string'. +!!! error TS2323: Type 'string | number' is not assignable to type 'string'. +!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping.errors.txt b/tests/baselines/reference/contextualTyping.errors.txt index ed6e50c1dbd..5e415cf13a1 100644 --- a/tests/baselines/reference/contextualTyping.errors.txt +++ b/tests/baselines/reference/contextualTyping.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/contextualTyping.ts(189,18): error TS2384: Overload signatures must all be ambient or non-ambient. tests/cases/compiler/contextualTyping.ts(197,15): error TS2300: Duplicate identifier 'Point'. tests/cases/compiler/contextualTyping.ts(207,10): error TS2300: Duplicate identifier 'Point'. -tests/cases/compiler/contextualTyping.ts(230,5): error TS2322: Type '{}' is not assignable to type 'B':\n Property 'x' is missing in type '{}'. +tests/cases/compiler/contextualTyping.ts(230,5): error TS2323: Type '{}' is not assignable to type 'B'.\n Property 'x' is missing in type '{}'. ==== tests/cases/compiler/contextualTyping.ts (4 errors) ==== @@ -242,5 +242,5 @@ tests/cases/compiler/contextualTyping.ts(230,5): error TS2322: Type '{}' is not interface B extends A { } var x: B = { }; ~ -!!! error TS2322: Type '{}' is not assignable to type 'B':\n Property 'x' is missing in type '{}'. +!!! error TS2323: Type '{}' is not assignable to type 'B'.\n Property 'x' is missing in type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping11.errors.txt b/tests/baselines/reference/contextualTyping11.errors.txt index dca509faa30..c619258a20a 100644 --- a/tests/baselines/reference/contextualTyping11.errors.txt +++ b/tests/baselines/reference/contextualTyping11.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/contextualTyping11.ts(1,13): error TS2322: Type 'foo[]' is not assignable to type '{ id: number; }[]': - Type 'foo' is not assignable to type '{ id: number; }': +tests/cases/compiler/contextualTyping11.ts(1,13): error TS2323: Type 'foo[]' is not assignable to type '{ id: number; }[]'. + Type 'foo' is not assignable to type '{ id: number; }'. Property 'id' is missing in type 'foo'. ==== tests/cases/compiler/contextualTyping11.ts (1 errors) ==== class foo { public bar:{id:number;}[] = [({})]; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'foo[]' is not assignable to type '{ id: number; }[]': -!!! error TS2322: Type 'foo' is not assignable to type '{ id: number; }': -!!! error TS2322: Property 'id' is missing in type 'foo'. \ No newline at end of file +!!! error TS2323: Type 'foo[]' is not assignable to type '{ id: number; }[]'. +!!! error TS2323: Type 'foo' is not assignable to type '{ id: number; }'. +!!! error TS2323: Property 'id' is missing in type 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping21.errors.txt b/tests/baselines/reference/contextualTyping21.errors.txt index c6ca82d87ac..8b3522066d4 100644 --- a/tests/baselines/reference/contextualTyping21.errors.txt +++ b/tests/baselines/reference/contextualTyping21.errors.txt @@ -1,13 +1,13 @@ -tests/cases/compiler/contextualTyping21.ts(1,36): error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]': - Type 'number | { id: number; }' is not assignable to type '{ id: number; }': - Type 'number' is not assignable to type '{ id: number; }': +tests/cases/compiler/contextualTyping21.ts(1,36): error TS2323: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'. + Type 'number | { id: number; }' is not assignable to type '{ id: number; }'. + Type 'number' is not assignable to type '{ id: number; }'. Property 'id' is missing in type 'Number'. ==== tests/cases/compiler/contextualTyping21.ts (1 errors) ==== var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, 1]; ~~~ -!!! error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]': -!!! error TS2322: Type 'number | { id: number; }' is not assignable to type '{ id: number; }': -!!! error TS2322: Type 'number' is not assignable to type '{ id: number; }': -!!! error TS2322: Property 'id' is missing in type 'Number'. \ No newline at end of file +!!! error TS2323: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'. +!!! error TS2323: Type 'number | { id: number; }' is not assignable to type '{ id: number; }'. +!!! error TS2323: Type 'number' is not assignable to type '{ id: number; }'. +!!! error TS2323: Property 'id' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping24.errors.txt b/tests/baselines/reference/contextualTyping24.errors.txt index 2f7f24f9cac..66161aa329e 100644 --- a/tests/baselines/reference/contextualTyping24.errors.txt +++ b/tests/baselines/reference/contextualTyping24.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/contextualTyping24.ts(1,55): error TS2322: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number': - Types of parameters 'a' and 'a' are incompatible: +tests/cases/compiler/contextualTyping24.ts(1,55): error TS2323: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. + Types of parameters 'a' and 'a' are incompatible. Type 'string' is not assignable to type '{ (): number; (i: number): number; }'. ==== tests/cases/compiler/contextualTyping24.ts (1 errors) ==== var foo:(a:{():number; (i:number):number; })=>number; foo = function(a:string){return 5}; ~~~ -!!! error TS2322: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number': -!!! error TS2322: Types of parameters 'a' and 'a' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type '{ (): number; (i: number): number; }'. \ No newline at end of file +!!! error TS2323: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. +!!! error TS2323: Types of parameters 'a' and 'a' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type '{ (): number; (i: number): number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping30.errors.txt b/tests/baselines/reference/contextualTyping30.errors.txt index f7a9eeead35..eda30769ac8 100644 --- a/tests/baselines/reference/contextualTyping30.errors.txt +++ b/tests/baselines/reference/contextualTyping30.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/contextualTyping30.ts(1,37): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. - Type 'string | number' is not assignable to type 'number': + Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. @@ -7,5 +7,5 @@ tests/cases/compiler/contextualTyping30.ts(1,37): error TS2345: Argument of type function foo(param:number[]){}; foo([1, "a"]); ~~~~~~~~ !!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. -!!! error TS2345: Type 'string | number' is not assignable to type 'number': +!!! error TS2345: Type 'string | number' is not assignable to type 'number'. !!! error TS2345: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping33.errors.txt b/tests/baselines/reference/contextualTyping33.errors.txt index 4aafb6d9645..4ed0787bde3 100644 --- a/tests/baselines/reference/contextualTyping33.errors.txt +++ b/tests/baselines/reference/contextualTyping33.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/contextualTyping33.ts(1,66): error TS2345: Argument of type '((() => number) | (() => string))[]' is not assignable to parameter of type '{ (): number; (i: number): number; }[]'. - Type '(() => number) | (() => string)' is not assignable to type '{ (): number; (i: number): number; }': + Type '(() => number) | (() => string)' is not assignable to type '{ (): number; (i: number): number; }'. Type '() => string' is not assignable to type '{ (): number; (i: number): number; }'. @@ -7,5 +7,5 @@ tests/cases/compiler/contextualTyping33.ts(1,66): error TS2345: Argument of type function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return "foo"}]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '((() => number) | (() => string))[]' is not assignable to parameter of type '{ (): number; (i: number): number; }[]'. -!!! error TS2345: Type '(() => number) | (() => string)' is not assignable to type '{ (): number; (i: number): number; }': +!!! error TS2345: Type '(() => number) | (() => string)' is not assignable to type '{ (): number; (i: number): number; }'. !!! error TS2345: Type '() => string' is not assignable to type '{ (): number; (i: number): number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping39.errors.txt b/tests/baselines/reference/contextualTyping39.errors.txt index bba7954c73a..e43624fbead 100644 --- a/tests/baselines/reference/contextualTyping39.errors.txt +++ b/tests/baselines/reference/contextualTyping39.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/contextualTyping39.ts(1,11): error TS2353: Neither type '() => string' nor type '() => number' is assignable to the other: +tests/cases/compiler/contextualTyping39.ts(1,11): error TS2352: Neither type '() => string' nor type '() => number' is assignable to the other. Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/contextualTyping39.ts (1 errors) ==== var foo = <{ (): number; }> function() { return "err"; }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '() => string' nor type '() => number' is assignable to the other: -!!! error TS2353: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2352: Neither type '() => string' nor type '() => number' is assignable to the other. +!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping41.errors.txt b/tests/baselines/reference/contextualTyping41.errors.txt index 03859c4820e..1ed6da1b782 100644 --- a/tests/baselines/reference/contextualTyping41.errors.txt +++ b/tests/baselines/reference/contextualTyping41.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/contextualTyping41.ts(1,11): error TS2353: Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other: +tests/cases/compiler/contextualTyping41.ts(1,11): error TS2352: Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other. Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/contextualTyping41.ts (1 errors) ==== var foo = <{():number; (i:number):number; }> (function(){return "err";}); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other: -!!! error TS2353: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2352: Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other. +!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping5.errors.txt b/tests/baselines/reference/contextualTyping5.errors.txt index ad89eb5a71b..f2f6cea14b1 100644 --- a/tests/baselines/reference/contextualTyping5.errors.txt +++ b/tests/baselines/reference/contextualTyping5.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/contextualTyping5.ts(1,13): error TS2322: Type '{}' is not assignable to type '{ id: number; }': +tests/cases/compiler/contextualTyping5.ts(1,13): error TS2323: Type '{}' is not assignable to type '{ id: number; }'. Property 'id' is missing in type '{}'. ==== tests/cases/compiler/contextualTyping5.ts (1 errors) ==== class foo { public bar:{id:number;} = { }; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{}' is not assignable to type '{ id: number; }': -!!! error TS2322: Property 'id' is missing in type '{}'. \ No newline at end of file +!!! error TS2323: Type '{}' is not assignable to type '{ id: number; }'. +!!! error TS2323: Property 'id' is missing in type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt b/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt index 92b74829e55..8b14d0aa301 100644 --- a/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt +++ b/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2322: Type '(number | Date)[]' is not assignable to type 'I': - Index signatures are incompatible: - Type 'number | Date' is not assignable to type 'Date': - Type 'number' is not assignable to type 'Date': +tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2323: Type '(number | Date)[]' is not assignable to type 'I'. + Index signatures are incompatible. + Type 'number | Date' is not assignable to type 'Date'. + Type 'number' is not assignable to type 'Date'. Property 'toDateString' is missing in type 'Number'. @@ -12,11 +12,11 @@ tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2322: Typ var x3: I = [new Date(), 1]; ~~ -!!! error TS2322: Type '(number | Date)[]' is not assignable to type 'I': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'number | Date' is not assignable to type 'Date': -!!! error TS2322: Type 'number' is not assignable to type 'Date': -!!! error TS2322: Property 'toDateString' is missing in type 'Number'. +!!! error TS2323: Type '(number | Date)[]' is not assignable to type 'I'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'number | Date' is not assignable to type 'Date'. +!!! error TS2323: Type 'number' is not assignable to type 'Date'. +!!! error TS2323: Property 'toDateString' is missing in type 'Number'. var r2 = x3[1]; r2.getDate(); \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt b/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt index 3bcfb557048..9cd1475b6e8 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS2322: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void': - Type '(b: number) => void' is not assignable to type '(a: A) => void': - Types of parameters 'b' and 'a' are incompatible: - Type 'number' is not assignable to type 'A': +tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS2323: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void'. + Type '(b: number) => void' is not assignable to type '(a: A) => void'. + Types of parameters 'b' and 'a' are incompatible. + Type 'number' is not assignable to type 'A'. Property 'foo' is missing in type 'Number'. @@ -18,9 +18,9 @@ tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS var x2: (a: A) => void = true ? (a: C) => a.foo : (b: number) => { }; ~~ -!!! error TS2322: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void': -!!! error TS2322: Type '(b: number) => void' is not assignable to type '(a: A) => void': -!!! error TS2322: Types of parameters 'b' and 'a' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'A': -!!! error TS2322: Property 'foo' is missing in type 'Number'. +!!! error TS2323: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void'. +!!! error TS2323: Type '(b: number) => void' is not assignable to type '(a: A) => void'. +!!! error TS2323: Types of parameters 'b' and 'a' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'A'. +!!! error TS2323: Property 'foo' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt b/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt index e512f2a4b55..7f4d749a3a0 100644 --- a/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/contextualTypingOfObjectLiterals.ts(4,1): error TS2322: Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }': +tests/cases/compiler/contextualTypingOfObjectLiterals.ts(4,1): error TS2323: Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }'. Index signature is missing in type '{ x: string; }'. tests/cases/compiler/contextualTypingOfObjectLiterals.ts(10,3): error TS2345: Argument of type '{ x: string; }' is not assignable to parameter of type '{ [x: string]: string; }'. @@ -9,8 +9,8 @@ tests/cases/compiler/contextualTypingOfObjectLiterals.ts(10,3): error TS2345: Ar obj1 = {}; // Ok obj1 = obj2; // Error - indexer doesn't match ~~~~ -!!! error TS2322: Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }': -!!! error TS2322: Index signature is missing in type '{ x: string; }'. +!!! error TS2323: Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2323: Index signature is missing in type '{ x: string; }'. function f(x: { [s: string]: string }) { } diff --git a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt index bb061b341d0..b668468eac3 100644 --- a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt +++ b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(2,22): error TS2339: Property 'foo' does not exist on type 'string'. -tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. @@ -10,5 +10,5 @@ tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,10): error TS !!! error TS2339: Property 'foo' does not exist on type 'string'. var r9 = f10('', () => (a => a.foo), 1); // error ~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt index 15a1c7913bb..a1ed83ada1b 100644 --- a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt +++ b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/crashInsourcePropertyIsRelatableToTargetProperty.ts(5,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. -tests/cases/compiler/crashInsourcePropertyIsRelatableToTargetProperty.ts(9,5): error TS2322: Type '(x: "hi", items: string[]) => typeof foo' is not assignable to type 'D': +tests/cases/compiler/crashInsourcePropertyIsRelatableToTargetProperty.ts(9,5): error TS2323: Type '(x: "hi", items: string[]) => typeof foo' is not assignable to type 'D'. Property 'x' is missing in type '(x: "hi", items: string[]) => typeof foo'. @@ -16,6 +16,6 @@ tests/cases/compiler/crashInsourcePropertyIsRelatableToTargetProperty.ts(9,5): e } var a: D = foo("hi", []); ~ -!!! error TS2322: Type '(x: "hi", items: string[]) => typeof foo' is not assignable to type 'D': -!!! error TS2322: Property 'x' is missing in type '(x: "hi", items: string[]) => typeof foo'. +!!! error TS2323: Type '(x: "hi", items: string[]) => typeof foo' is not assignable to type 'D'. +!!! error TS2323: Property 'x' is missing in type '(x: "hi", items: string[]) => typeof foo'. \ No newline at end of file diff --git a/tests/baselines/reference/declareClassInterfaceImplementation.errors.txt b/tests/baselines/reference/declareClassInterfaceImplementation.errors.txt index 10b2d8ec118..d6944e0e033 100644 --- a/tests/baselines/reference/declareClassInterfaceImplementation.errors.txt +++ b/tests/baselines/reference/declareClassInterfaceImplementation.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/declareClassInterfaceImplementation.ts(5,15): error TS2421: Class 'Buffer' incorrectly implements interface 'IBuffer': +tests/cases/compiler/declareClassInterfaceImplementation.ts(5,15): error TS2420: Class 'Buffer' incorrectly implements interface 'IBuffer'. Index signature is missing in type 'Buffer'. @@ -9,8 +9,8 @@ tests/cases/compiler/declareClassInterfaceImplementation.ts(5,15): error TS2421: declare class Buffer implements IBuffer { ~~~~~~ -!!! error TS2421: Class 'Buffer' incorrectly implements interface 'IBuffer': -!!! error TS2421: Index signature is missing in type 'Buffer'. +!!! error TS2420: Class 'Buffer' incorrectly implements interface 'IBuffer'. +!!! error TS2420: Index signature is missing in type 'Buffer'. } \ No newline at end of file diff --git a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt index 12100f8442b..5000ae05cc3 100644 --- a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt +++ b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(2,6): error TS2339: Property 'length' does not exist on type '{}'. tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(5,6): error TS2339: Property 'length' does not exist on type 'Object'. -tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(8,14): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(8,14): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. @@ -18,7 +18,7 @@ tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(8,14): error TS2453: The function concat(x: T, y: T): T { return null; } var result = concat(1, ""); // error ~~~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. var elementCount = result.length; diff --git a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.errors.txt b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.errors.txt index 994dead5904..f8e237a83ce 100644 --- a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.errors.txt +++ b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFunctionOverridesBaseClassAccessor.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFunctionOverridesBaseClassAccessor.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFunctionOverridesBaseClassAccessor.ts(10,7): error TS2416: Class 'Derived' incorrectly extends base class 'Base': - Types of property 'x' are incompatible: +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFunctionOverridesBaseClassAccessor.ts(10,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. + Types of property 'x' are incompatible. Type '() => number' is not assignable to type 'number'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFunctionOverridesBaseClassAccessor.ts(11,5): error TS2426: Class 'Base' defines instance member accessor 'x', but extended class 'Derived' defines it as instance member function. @@ -22,9 +22,9 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFun // error class Derived extends Base { ~~~~~~~ -!!! error TS2416: Class 'Derived' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'x' are incompatible: -!!! error TS2416: Type '() => number' is not assignable to type 'number'. +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type '() => number' is not assignable to type 'number'. x() { ~ !!! error TS2426: Class 'Base' defines instance member accessor 'x', but extended class 'Derived' defines it as instance member function. diff --git a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.errors.txt b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.errors.txt index ce9ec20406c..dd5a75362d1 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.errors.txt +++ b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/derivedClassOverridesPrivateFunction1.ts(8,7): error TS2416: Class 'DerivedClass' incorrectly extends base class 'BaseClass': +tests/cases/compiler/derivedClassOverridesPrivateFunction1.ts(8,7): error TS2415: Class 'DerivedClass' incorrectly extends base class 'BaseClass'. Types have separate declarations of a private property '_init'. @@ -12,8 +12,8 @@ tests/cases/compiler/derivedClassOverridesPrivateFunction1.ts(8,7): error TS2416 } class DerivedClass extends BaseClass { ~~~~~~~~~~~~ -!!! error TS2416: Class 'DerivedClass' incorrectly extends base class 'BaseClass': -!!! error TS2416: Types have separate declarations of a private property '_init'. +!!! error TS2415: Class 'DerivedClass' incorrectly extends base class 'BaseClass'. +!!! error TS2415: Types have separate declarations of a private property '_init'. constructor() { super(); } diff --git a/tests/baselines/reference/derivedClassOverridesPrivates.errors.txt b/tests/baselines/reference/derivedClassOverridesPrivates.errors.txt index 9e83faa9b4a..400d7d0d346 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivates.errors.txt +++ b/tests/baselines/reference/derivedClassOverridesPrivates.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPrivates.ts(5,7): error TS2416: Class 'Derived' incorrectly extends base class 'Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPrivates.ts(5,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. Types have separate declarations of a private property 'x'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPrivates.ts(13,7): error TS2418: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPrivates.ts(13,7): error TS2417: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2'. Types have separate declarations of a private property 'y'. @@ -11,8 +11,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOve class Derived extends Base { ~~~~~~~ -!!! error TS2416: Class 'Derived' incorrectly extends base class 'Base': -!!! error TS2416: Types have separate declarations of a private property 'x'. +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Types have separate declarations of a private property 'x'. private x: { foo: string; bar: string; }; // error } @@ -22,7 +22,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOve class Derived2 extends Base2 { ~~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2': -!!! error TS2418: Types have separate declarations of a private property 'y'. +!!! error TS2417: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2'. +!!! error TS2417: Types have separate declarations of a private property 'y'. private static y: { foo: string; bar: string; }; // error } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.errors.txt b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.errors.txt index 7dddd4d76f8..a9762ce03ec 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.errors.txt +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.errors.txt @@ -1,22 +1,22 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(23,7): error TS2416: Class 'Derived1' incorrectly extends base class 'Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(23,7): error TS2415: Class 'Derived1' incorrectly extends base class 'Base'. Property 'a' is protected in type 'Derived1' but public in type 'Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(28,7): error TS2416: Class 'Derived2' incorrectly extends base class 'Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(28,7): error TS2415: Class 'Derived2' incorrectly extends base class 'Base'. Property 'b' is protected in type 'Derived2' but public in type 'Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(33,7): error TS2416: Class 'Derived3' incorrectly extends base class 'Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(33,7): error TS2415: Class 'Derived3' incorrectly extends base class 'Base'. Property 'c' is protected in type 'Derived3' but public in type 'Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(38,7): error TS2416: Class 'Derived4' incorrectly extends base class 'Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(38,7): error TS2415: Class 'Derived4' incorrectly extends base class 'Base'. Property 'c' is protected in type 'Derived4' but public in type 'Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(43,7): error TS2416: Class 'Derived5' incorrectly extends base class 'Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(43,7): error TS2415: Class 'Derived5' incorrectly extends base class 'Base'. Property 'd' is protected in type 'Derived5' but public in type 'Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(48,7): error TS2418: Class static side 'typeof Derived6' incorrectly extends base class static side 'typeof Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(48,7): error TS2417: Class static side 'typeof Derived6' incorrectly extends base class static side 'typeof Base'. Property 'r' is protected in type 'typeof Derived6' but public in type 'typeof Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(53,7): error TS2418: Class static side 'typeof Derived7' incorrectly extends base class static side 'typeof Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(53,7): error TS2417: Class static side 'typeof Derived7' incorrectly extends base class static side 'typeof Base'. Property 's' is protected in type 'typeof Derived7' but public in type 'typeof Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(58,7): error TS2418: Class static side 'typeof Derived8' incorrectly extends base class static side 'typeof Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(58,7): error TS2417: Class static side 'typeof Derived8' incorrectly extends base class static side 'typeof Base'. Property 't' is protected in type 'typeof Derived8' but public in type 'typeof Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(63,7): error TS2418: Class static side 'typeof Derived9' incorrectly extends base class static side 'typeof Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(63,7): error TS2417: Class static side 'typeof Derived9' incorrectly extends base class static side 'typeof Base'. Property 't' is protected in type 'typeof Derived9' but public in type 'typeof Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(68,7): error TS2418: Class static side 'typeof Derived10' incorrectly extends base class static side 'typeof Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(68,7): error TS2417: Class static side 'typeof Derived10' incorrectly extends base class static side 'typeof Base'. Property 'u' is protected in type 'typeof Derived10' but public in type 'typeof Base'. @@ -45,80 +45,80 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOve // decrease visibility of all public members to protected class Derived1 extends Base { ~~~~~~~~ -!!! error TS2416: Class 'Derived1' incorrectly extends base class 'Base': -!!! error TS2416: Property 'a' is protected in type 'Derived1' but public in type 'Base'. +!!! error TS2415: Class 'Derived1' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'a' is protected in type 'Derived1' but public in type 'Base'. protected a: typeof x; constructor(a: typeof x) { super(a); } } class Derived2 extends Base { ~~~~~~~~ -!!! error TS2416: Class 'Derived2' incorrectly extends base class 'Base': -!!! error TS2416: Property 'b' is protected in type 'Derived2' but public in type 'Base'. +!!! error TS2415: Class 'Derived2' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'b' is protected in type 'Derived2' but public in type 'Base'. protected b(a: typeof x) { } constructor(a: typeof x) { super(a); } } class Derived3 extends Base { ~~~~~~~~ -!!! error TS2416: Class 'Derived3' incorrectly extends base class 'Base': -!!! error TS2416: Property 'c' is protected in type 'Derived3' but public in type 'Base'. +!!! error TS2415: Class 'Derived3' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'c' is protected in type 'Derived3' but public in type 'Base'. protected get c() { return x; } constructor(a: typeof x) { super(a); } } class Derived4 extends Base { ~~~~~~~~ -!!! error TS2416: Class 'Derived4' incorrectly extends base class 'Base': -!!! error TS2416: Property 'c' is protected in type 'Derived4' but public in type 'Base'. +!!! error TS2415: Class 'Derived4' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'c' is protected in type 'Derived4' but public in type 'Base'. protected set c(v: typeof x) { } constructor(a: typeof x) { super(a); } } class Derived5 extends Base { ~~~~~~~~ -!!! error TS2416: Class 'Derived5' incorrectly extends base class 'Base': -!!! error TS2416: Property 'd' is protected in type 'Derived5' but public in type 'Base'. +!!! error TS2415: Class 'Derived5' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'd' is protected in type 'Derived5' but public in type 'Base'. protected d: (a: typeof x) => void ; constructor(a: typeof x) { super(a); } } class Derived6 extends Base { ~~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived6' incorrectly extends base class static side 'typeof Base': -!!! error TS2418: Property 'r' is protected in type 'typeof Derived6' but public in type 'typeof Base'. +!!! error TS2417: Class static side 'typeof Derived6' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 'r' is protected in type 'typeof Derived6' but public in type 'typeof Base'. protected static r: typeof x; constructor(a: typeof x) { super(a); } } class Derived7 extends Base { ~~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived7' incorrectly extends base class static side 'typeof Base': -!!! error TS2418: Property 's' is protected in type 'typeof Derived7' but public in type 'typeof Base'. +!!! error TS2417: Class static side 'typeof Derived7' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 's' is protected in type 'typeof Derived7' but public in type 'typeof Base'. protected static s(a: typeof x) { } constructor(a: typeof x) { super(a); } } class Derived8 extends Base { ~~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived8' incorrectly extends base class static side 'typeof Base': -!!! error TS2418: Property 't' is protected in type 'typeof Derived8' but public in type 'typeof Base'. +!!! error TS2417: Class static side 'typeof Derived8' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 't' is protected in type 'typeof Derived8' but public in type 'typeof Base'. protected static get t() { return x; } constructor(a: typeof x) { super(a); } } class Derived9 extends Base { ~~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived9' incorrectly extends base class static side 'typeof Base': -!!! error TS2418: Property 't' is protected in type 'typeof Derived9' but public in type 'typeof Base'. +!!! error TS2417: Class static side 'typeof Derived9' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 't' is protected in type 'typeof Derived9' but public in type 'typeof Base'. protected static set t(v: typeof x) { } constructor(a: typeof x) { super(a); } } class Derived10 extends Base { ~~~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived10' incorrectly extends base class static side 'typeof Base': -!!! error TS2418: Property 'u' is protected in type 'typeof Derived10' but public in type 'typeof Base'. +!!! error TS2417: Class static side 'typeof Derived10' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 'u' is protected in type 'typeof Derived10' but public in type 'typeof Base'. protected static u: (a: typeof x) => void ; constructor(a: typeof x) { super(a); } } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.errors.txt b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.errors.txt index f22c656f3c7..064e2e8d43c 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.errors.txt +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers4.ts(12,7): error TS2416: Class 'Derived2' incorrectly extends base class 'Derived1': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers4.ts(12,7): error TS2415: Class 'Derived2' incorrectly extends base class 'Derived1'. Property 'a' is protected in type 'Derived2' but public in type 'Derived1'. @@ -16,7 +16,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOve class Derived2 extends Derived1 { ~~~~~~~~ -!!! error TS2416: Class 'Derived2' incorrectly extends base class 'Derived1': -!!! error TS2416: Property 'a' is protected in type 'Derived2' but public in type 'Derived1'. +!!! error TS2415: Class 'Derived2' incorrectly extends base class 'Derived1'. +!!! error TS2415: Property 'a' is protected in type 'Derived2' but public in type 'Derived1'. protected a: typeof x; // Error, parent was public } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity.errors.txt b/tests/baselines/reference/derivedClassTransitivity.errors.txt index 0915f921fe1..cd10113717d 100644 --- a/tests/baselines/reference/derivedClassTransitivity.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C': - Types of property 'foo' are incompatible: - Type '(x?: string) => void' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity.ts(18,1): error TS2323: Type 'E' is not assignable to type 'C'. + Types of property 'foo' are incompatible. + Type '(x?: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. @@ -25,10 +25,10 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra var e: E; c = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'C': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type '(x?: string) => void' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'E' is not assignable to type 'C'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type '(x?: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. var r = c.foo(1); var r2 = e.foo(''); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity2.errors.txt b/tests/baselines/reference/derivedClassTransitivity2.errors.txt index db89f608d16..7141b2fdc52 100644 --- a/tests/baselines/reference/derivedClassTransitivity2.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity2.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C': - Types of property 'foo' are incompatible: - Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void': - Types of parameters 'y' and 'y' are incompatible: +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity2.ts(18,1): error TS2323: Type 'E' is not assignable to type 'C'. + Types of property 'foo' are incompatible. + Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void'. + Types of parameters 'y' and 'y' are incompatible. Type 'string' is not assignable to type 'number'. @@ -25,10 +25,10 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra var e: E; c = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'C': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'E' is not assignable to type 'C'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void'. +!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. var r = c.foo(1, 1); var r2 = e.foo(1, ''); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity3.errors.txt b/tests/baselines/reference/derivedClassTransitivity3.errors.txt index 09b5cbe0dfd..eb3cea00e71 100644 --- a/tests/baselines/reference/derivedClassTransitivity3.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity3.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity3.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C': - Types of property 'foo' are incompatible: - Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void': - Types of parameters 'y' and 'y' are incompatible: +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity3.ts(18,1): error TS2323: Type 'E' is not assignable to type 'C'. + Types of property 'foo' are incompatible. + Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void'. + Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. @@ -25,10 +25,10 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra var e: E; c = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'C': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type 'E' is not assignable to type 'C'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void'. +!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. var r = c.foo('', ''); var r2 = e.foo('', 1); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity4.errors.txt b/tests/baselines/reference/derivedClassTransitivity4.errors.txt index 5950eddf6be..b6f9f9c8028 100644 --- a/tests/baselines/reference/derivedClassTransitivity4.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity4.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity4.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C': - Types of property 'foo' are incompatible: - Type '(x?: string) => void' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity4.ts(18,1): error TS2323: Type 'E' is not assignable to type 'C'. + Types of property 'foo' are incompatible. + Type '(x?: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity4.ts(19,9): error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses. @@ -26,11 +26,11 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra var e: E; c = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'C': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type '(x?: string) => void' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'E' is not assignable to type 'C'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type '(x?: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. var r = c.foo(1); ~~~~~ !!! error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses. diff --git a/tests/baselines/reference/derivedClassWithAny.errors.txt b/tests/baselines/reference/derivedClassWithAny.errors.txt index d7f0665a9e5..42e7f1b38a1 100644 --- a/tests/baselines/reference/derivedClassWithAny.errors.txt +++ b/tests/baselines/reference/derivedClassWithAny.errors.txt @@ -4,8 +4,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(27,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(38,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(44,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(57,1): error TS2322: Type 'E' is not assignable to type 'C': - Types of property 'x' are incompatible: +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(57,1): error TS2323: Type 'E' is not assignable to type 'C'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. @@ -80,8 +80,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit c = d; c = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'C': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'E' is not assignable to type 'C'. +!!! error TS2323: Types of property 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. var r = c.foo(); // e.foo would return string \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.errors.txt b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.errors.txt index aebe32f7fbf..60054fa47dc 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.errors.txt +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingProtectedInstance.ts(13,7): error TS2416: Class 'Derived' incorrectly extends base class 'Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingProtectedInstance.ts(13,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. Property 'x' is private in type 'Derived' but not in type 'Base'. @@ -17,8 +17,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit // error, not a subtype class Derived extends Base { ~~~~~~~ -!!! error TS2416: Class 'Derived' incorrectly extends base class 'Base': -!!! error TS2416: Property 'x' is private in type 'Derived' but not in type 'Base'. +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'x' is private in type 'Derived' but not in type 'Base'. private x: string; private fn(): string { return ''; diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt index f85e3be4b5a..bbe47bb9544 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(18,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(19,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(12,7): error TS2416: Class 'Derived' incorrectly extends base class 'Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(12,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. Property 'x' is private in type 'Derived' but not in type 'Base'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(22,14): error TS2339: Property 'x' does not exist on type 'typeof Base'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(23,18): error TS2339: Property 'x' does not exist on type 'typeof Derived'. @@ -32,8 +32,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit // error, not a subtype class Derived extends Base { ~~~~~~~ -!!! error TS2416: Class 'Derived' incorrectly extends base class 'Base': -!!! error TS2416: Property 'x' is private in type 'Derived' but not in type 'Base'. +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'x' is private in type 'Derived' but not in type 'Base'. private x: string; private fn(): string { return ''; diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.errors.txt b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.errors.txt index a6aa878e54c..2697585cb20 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.errors.txt +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingProtectedStatic.ts(13,7): error TS2418: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingProtectedStatic.ts(13,7): error TS2417: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base'. Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'. @@ -17,8 +17,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit // should be error class Derived extends Base { ~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base': -!!! error TS2418: Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'. +!!! error TS2417: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'. private static x: string; private static fn(): string { return ''; diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt index a792c8ebff0..cfdf1381282 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(8,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(19,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(20,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(13,7): error TS2418: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(13,7): error TS2417: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base'. Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(24,10): error TS2341: Property 'x' is private and only accessible within class 'Derived'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(27,10): error TS2341: Property 'fn' is private and only accessible within class 'Derived'. @@ -29,8 +29,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit // should be error class Derived extends Base { ~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base': -!!! error TS2418: Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'. +!!! error TS2417: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'. private static x: string; private static fn(): string { return ''; diff --git a/tests/baselines/reference/derivedGenericClassWithAny.errors.txt b/tests/baselines/reference/derivedGenericClassWithAny.errors.txt index ef0c9851ad7..91111563a71 100644 --- a/tests/baselines/reference/derivedGenericClassWithAny.errors.txt +++ b/tests/baselines/reference/derivedGenericClassWithAny.errors.txt @@ -4,8 +4,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericC tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(30,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(30,25): error TS2323: Type 'string' is not assignable to type 'T'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(32,16): error TS2323: Type 'string' is not assignable to type 'T'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(41,1): error TS2322: Type 'E' is not assignable to type 'C': - Types of property 'x' are incompatible: +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(41,1): error TS2323: Type 'E' is not assignable to type 'C'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. @@ -64,7 +64,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericC c = d; c = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'C': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'E' is not assignable to type 'C'. +!!! error TS2323: Types of property 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. var r = c.foo(); // e.foo would return string \ No newline at end of file diff --git a/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt b/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt index e1c43f1bb36..ae8fbe2ff5d 100644 --- a/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt +++ b/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/derivedInterfaceCallSignature.ts(11,11): error TS2429: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath': - Types of property 'x' are incompatible: +tests/cases/compiler/derivedInterfaceCallSignature.ts(11,11): error TS2430: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath'. + Types of property 'x' are incompatible. Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'. @@ -16,9 +16,9 @@ tests/cases/compiler/derivedInterfaceCallSignature.ts(11,11): error TS2429: Inte interface D3SvgArea extends D3SvgPath { ~~~~~~~~~ -!!! error TS2429: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath': -!!! error TS2429: Types of property 'x' are incompatible: -!!! error TS2429: Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'. +!!! error TS2430: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'. x(x: (data: any, index?: number) => number): D3SvgArea; y(y: (data: any, index?: number) => number): D3SvgArea; y0(): (data: any, index?: number) => number; diff --git a/tests/baselines/reference/derivedTypeIncompatibleSignatures.errors.txt b/tests/baselines/reference/derivedTypeIncompatibleSignatures.errors.txt index 643979a8ef8..71fe36660c4 100644 --- a/tests/baselines/reference/derivedTypeIncompatibleSignatures.errors.txt +++ b/tests/baselines/reference/derivedTypeIncompatibleSignatures.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/derivedTypeIncompatibleSignatures.ts(21,11): error TS2429: Interface 'F' incorrectly extends interface 'E': - Index signatures are incompatible: +tests/cases/compiler/derivedTypeIncompatibleSignatures.ts(21,11): error TS2430: Interface 'F' incorrectly extends interface 'E'. + Index signatures are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/derivedTypeIncompatibleSignatures.ts(29,11): error TS2429: Interface 'H' incorrectly extends interface 'G': - Index signatures are incompatible: +tests/cases/compiler/derivedTypeIncompatibleSignatures.ts(29,11): error TS2430: Interface 'H' incorrectly extends interface 'G'. + Index signatures are incompatible. Type 'number' is not assignable to type 'string'. @@ -29,9 +29,9 @@ tests/cases/compiler/derivedTypeIncompatibleSignatures.ts(29,11): error TS2429: interface F extends E { ~ -!!! error TS2429: Interface 'F' incorrectly extends interface 'E': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'F' incorrectly extends interface 'E'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. [a: string]: number; // Number is not a subtype of string. Should error. } @@ -41,8 +41,8 @@ tests/cases/compiler/derivedTypeIncompatibleSignatures.ts(29,11): error TS2429: interface H extends G { ~ -!!! error TS2429: Interface 'H' incorrectly extends interface 'G': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'H' incorrectly extends interface 'G'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. [a: number]: number; // Should error for the same reason } \ No newline at end of file diff --git a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt index be90535f14c..241a90f0419 100644 --- a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt +++ b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt @@ -2,15 +2,15 @@ tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,5): error TS1098: Typ tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,6): error TS1005: '(' expected. tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,6): error TS1139: Type parameter declaration expected. tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(4,1): error TS1109: Expression expected. -tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(1,5): error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }': +tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(1,5): error TS2323: Type 'number' is not assignable to type '{ (): any; x: number; }'. Property 'x' is missing in type 'Number'. ==== tests/cases/compiler/dontShowCompilerGeneratedMembers.ts (5 errors) ==== var f: { ~ -!!! error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }': -!!! error TS2322: Property 'x' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ (): any; x: number; }'. +!!! error TS2323: Property 'x' is missing in type 'Number'. x: number; <- ~ diff --git a/tests/baselines/reference/enumAssignability.errors.txt b/tests/baselines/reference/enumAssignability.errors.txt index 018cd119b05..8ea3b5a368c 100644 --- a/tests/baselines/reference/enumAssignability.errors.txt +++ b/tests/baselines/reference/enumAssignability.errors.txt @@ -2,23 +2,23 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(10,1): error TS2323: Type 'E' is not assignable to type 'F'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(29,9): error TS2323: Type 'E' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(30,9): error TS2323: Type 'E' is not assignable to type 'boolean'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(31,9): error TS2322: Type 'E' is not assignable to type 'Date': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(31,9): error TS2323: Type 'E' is not assignable to type 'Date'. Property 'toDateString' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(33,9): error TS2323: Type 'E' is not assignable to type 'void'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(36,9): error TS2323: Type 'E' is not assignable to type '() => {}'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(37,9): error TS2322: Type 'E' is not assignable to type 'Function': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(37,9): error TS2323: Type 'E' is not assignable to type 'Function'. Property 'apply' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(38,9): error TS2323: Type 'E' is not assignable to type '(x: number) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(39,5): error TS2322: Type 'E' is not assignable to type 'C': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(39,5): error TS2323: Type 'E' is not assignable to type 'C'. Property 'foo' is missing in type 'Number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(40,5): error TS2322: Type 'E' is not assignable to type 'I': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(40,5): error TS2323: Type 'E' is not assignable to type 'I'. Property 'foo' is missing in type 'Number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(41,9): error TS2322: Type 'E' is not assignable to type 'number[]': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(41,9): error TS2323: Type 'E' is not assignable to type 'number[]'. Property 'length' is missing in type 'Number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(42,9): error TS2322: Type 'E' is not assignable to type '{ foo: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(42,9): error TS2323: Type 'E' is not assignable to type '{ foo: string; }'. Property 'foo' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(43,9): error TS2323: Type 'E' is not assignable to type '(x: T) => T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(45,9): error TS2322: Type 'E' is not assignable to type 'String': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(45,9): error TS2323: Type 'E' is not assignable to type 'String'. Property 'charAt' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(47,21): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(48,9): error TS2323: Type 'E' is not assignable to type 'T'. @@ -69,8 +69,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi !!! error TS2323: Type 'E' is not assignable to type 'boolean'. var ee: Date = e; ~~ -!!! error TS2322: Type 'E' is not assignable to type 'Date': -!!! error TS2322: Property 'toDateString' is missing in type 'Number'. +!!! error TS2323: Type 'E' is not assignable to type 'Date'. +!!! error TS2323: Property 'toDateString' is missing in type 'Number'. var f: any = e; // ok var g: void = e; ~ @@ -82,35 +82,35 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi !!! error TS2323: Type 'E' is not assignable to type '() => {}'. var k: Function = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'Function': -!!! error TS2322: Property 'apply' is missing in type 'Number'. +!!! error TS2323: Type 'E' is not assignable to type 'Function'. +!!! error TS2323: Property 'apply' is missing in type 'Number'. var l: (x: number) => string = e; ~ !!! error TS2323: Type 'E' is not assignable to type '(x: number) => string'. ac = e; ~~ -!!! error TS2322: Type 'E' is not assignable to type 'C': -!!! error TS2322: Property 'foo' is missing in type 'Number'. +!!! error TS2323: Type 'E' is not assignable to type 'C'. +!!! error TS2323: Property 'foo' is missing in type 'Number'. ai = e; ~~ -!!! error TS2322: Type 'E' is not assignable to type 'I': -!!! error TS2322: Property 'foo' is missing in type 'Number'. +!!! error TS2323: Type 'E' is not assignable to type 'I'. +!!! error TS2323: Property 'foo' is missing in type 'Number'. var m: number[] = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'number[]': -!!! error TS2322: Property 'length' is missing in type 'Number'. +!!! error TS2323: Type 'E' is not assignable to type 'number[]'. +!!! error TS2323: Property 'length' is missing in type 'Number'. var n: { foo: string } = e; ~ -!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }': -!!! error TS2322: Property 'foo' is missing in type 'Number'. +!!! error TS2323: Type 'E' is not assignable to type '{ foo: string; }'. +!!! error TS2323: Property 'foo' is missing in type 'Number'. var o: (x: T) => T = e; ~ !!! error TS2323: Type 'E' is not assignable to type '(x: T) => T'. var p: Number = e; var q: String = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'String': -!!! error TS2322: Property 'charAt' is missing in type 'Number'. +!!! error TS2323: Type 'E' is not assignable to type 'String'. +!!! error TS2323: Property 'charAt' is missing in type 'Number'. function foo(x: T, y: U, z: V) { ~~~~~~~~~~~ diff --git a/tests/baselines/reference/enumAssignmentCompat.errors.txt b/tests/baselines/reference/enumAssignmentCompat.errors.txt index 4048ac104c6..f2a093f2046 100644 --- a/tests/baselines/reference/enumAssignmentCompat.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/enumAssignmentCompat.ts(26,5): error TS2323: Type 'typeof W' is not assignable to type 'number'. -tests/cases/compiler/enumAssignmentCompat.ts(28,5): error TS2322: Type 'W' is not assignable to type 'typeof W': +tests/cases/compiler/enumAssignmentCompat.ts(28,5): error TS2323: Type 'W' is not assignable to type 'typeof W'. Property 'D' is missing in type 'Number'. tests/cases/compiler/enumAssignmentCompat.ts(30,5): error TS2323: Type 'number' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat.ts(32,5): error TS2322: Type 'W' is not assignable to type 'WStatic': +tests/cases/compiler/enumAssignmentCompat.ts(32,5): error TS2323: Type 'W' is not assignable to type 'WStatic'. Property 'a' is missing in type 'Number'. tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2323: Type 'number' is not assignable to type 'WStatic'. @@ -39,8 +39,8 @@ tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2323: Type 'number' var a: number = W.a; var b: typeof W = W.a; // error ~ -!!! error TS2322: Type 'W' is not assignable to type 'typeof W': -!!! error TS2322: Property 'D' is missing in type 'Number'. +!!! error TS2323: Type 'W' is not assignable to type 'typeof W'. +!!! error TS2323: Property 'D' is missing in type 'Number'. var c: typeof W.a = W.a; var d: typeof W = 3; // error ~ @@ -48,8 +48,8 @@ tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2323: Type 'number' var e: typeof W.a = 4; var f: WStatic = W.a; // error ~ -!!! error TS2322: Type 'W' is not assignable to type 'WStatic': -!!! error TS2322: Property 'a' is missing in type 'Number'. +!!! error TS2323: Type 'W' is not assignable to type 'WStatic'. +!!! error TS2323: Property 'a' is missing in type 'Number'. var g: WStatic = 5; // error ~ !!! error TS2323: Type 'number' is not assignable to type 'WStatic'. diff --git a/tests/baselines/reference/enumAssignmentCompat2.errors.txt b/tests/baselines/reference/enumAssignmentCompat2.errors.txt index 52890bcecc7..9b2263455ec 100644 --- a/tests/baselines/reference/enumAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat2.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/enumAssignmentCompat2.ts(25,5): error TS2323: Type 'typeof W' is not assignable to type 'number'. -tests/cases/compiler/enumAssignmentCompat2.ts(27,5): error TS2322: Type 'W' is not assignable to type 'typeof W': +tests/cases/compiler/enumAssignmentCompat2.ts(27,5): error TS2323: Type 'W' is not assignable to type 'typeof W'. Property 'a' is missing in type 'Number'. tests/cases/compiler/enumAssignmentCompat2.ts(29,5): error TS2323: Type 'number' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat2.ts(31,5): error TS2322: Type 'W' is not assignable to type 'WStatic': +tests/cases/compiler/enumAssignmentCompat2.ts(31,5): error TS2323: Type 'W' is not assignable to type 'WStatic'. Property 'a' is missing in type 'Number'. tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2323: Type 'number' is not assignable to type 'WStatic'. @@ -38,8 +38,8 @@ tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2323: Type 'number' var a: number = W.a; var b: typeof W = W.a; // error ~ -!!! error TS2322: Type 'W' is not assignable to type 'typeof W': -!!! error TS2322: Property 'a' is missing in type 'Number'. +!!! error TS2323: Type 'W' is not assignable to type 'typeof W'. +!!! error TS2323: Property 'a' is missing in type 'Number'. var c: typeof W.a = W.a; var d: typeof W = 3; // error ~ @@ -47,8 +47,8 @@ tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2323: Type 'number' var e: typeof W.a = 4; var f: WStatic = W.a; // error ~ -!!! error TS2322: Type 'W' is not assignable to type 'WStatic': -!!! error TS2322: Property 'a' is missing in type 'Number'. +!!! error TS2323: Type 'W' is not assignable to type 'WStatic'. +!!! error TS2323: Property 'a' is missing in type 'Number'. var g: WStatic = 5; // error ~ !!! error TS2323: Type 'number' is not assignable to type 'WStatic'. diff --git a/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt b/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt index c832230f343..757b311f3cd 100644 --- a/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt +++ b/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(1,5): error TS2322: Type '() => void' is not assignable to type '() => boolean': +tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(1,5): error TS2323: Type '() => void' is not assignable to type '() => boolean'. Type 'void' is not assignable to type 'boolean'. tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(2,37): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. @@ -6,8 +6,8 @@ tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(2,37): error TS2355: ==== tests/cases/compiler/errorOnContextuallyTypedReturnType.ts (2 errors) ==== var n1: () => boolean = function () { }; // expect an error here ~~ -!!! error TS2322: Type '() => void' is not assignable to type '() => boolean': -!!! error TS2322: Type 'void' is not assignable to type 'boolean'. +!!! error TS2323: Type '() => void' is not assignable to type '() => boolean'. +!!! error TS2323: Type 'void' is not assignable to type 'boolean'. var n2: () => boolean = function ():boolean { }; // expect an error here ~~~~~~~ !!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt index 5dbce43970f..4222edc2dbd 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt @@ -1,36 +1,36 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(34,5): error TS2323: Type 'string' is not assignable to type 'number'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(35,5): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(36,5): error TS2322: Type 'number' is not assignable to type 'Date': +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(36,5): error TS2323: Type 'number' is not assignable to type 'Date'. Property 'toDateString' is missing in type 'Number'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(38,5): error TS2323: Type 'number' is not assignable to type 'void'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(40,5): error TS2322: Type 'D<{}>' is not assignable to type 'I': +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(40,5): error TS2323: Type 'D<{}>' is not assignable to type 'I'. Property 'id' is missing in type 'D<{}>'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(41,5): error TS2322: Type 'D<{}>' is not assignable to type 'C': +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(41,5): error TS2323: Type 'D<{}>' is not assignable to type 'C'. Property 'id' is missing in type 'D<{}>'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(42,5): error TS2322: Type 'C' is not assignable to type 'D': +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(42,5): error TS2323: Type 'C' is not assignable to type 'D'. Property 'source' is missing in type 'C'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(43,5): error TS2322: Type '{ id: string; }' is not assignable to type 'I': - Types of property 'id' are incompatible: +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(43,5): error TS2323: Type '{ id: string; }' is not assignable to type 'I'. + Types of property 'id' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(44,5): error TS2322: Type 'C' is not assignable to type '{ id: string; }': - Types of property 'id' are incompatible: +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(44,5): error TS2323: Type 'C' is not assignable to type '{ id: string; }'. + Types of property 'id' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(46,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(46,5): error TS2323: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. + Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(47,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(47,5): error TS2323: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. + Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(48,5): error TS2322: Type '(x: string) => string' is not assignable to type '(x: string) => number': +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(48,5): error TS2323: Type '(x: string) => string' is not assignable to type '(x: string) => number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(50,5): error TS2322: Type 'typeof N' is not assignable to type 'typeof M': - Types of property 'A' are incompatible: - Type 'typeof A' is not assignable to type 'typeof A': - Type 'A' is not assignable to type 'A': +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(50,5): error TS2323: Type 'typeof N' is not assignable to type 'typeof M'. + Types of property 'A' are incompatible. + Type 'typeof A' is not assignable to type 'typeof A'. + Type 'A' is not assignable to type 'A'. Property 'name' is missing in type 'A'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(51,5): error TS2322: Type 'A' is not assignable to type 'A': +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(51,5): error TS2323: Type 'A' is not assignable to type 'A'. Property 'name' is missing in type 'A'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(52,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: number) => string': +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(52,5): error TS2323: Type '(x: number) => boolean' is not assignable to type '(x: number) => string'. Type 'boolean' is not assignable to type 'string'. @@ -76,8 +76,8 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd !!! error TS2323: Type 'number' is not assignable to type 'string'. var aDate: Date = 9.9; ~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'Date': -!!! error TS2322: Property 'toDateString' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type 'Date'. +!!! error TS2323: Property 'toDateString' is missing in type 'Number'. var aVoid: void = 9.9; ~~~~~ @@ -85,56 +85,56 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd var anInterface: I = new D(); ~~~~~~~~~~~ -!!! error TS2322: Type 'D<{}>' is not assignable to type 'I': -!!! error TS2322: Property 'id' is missing in type 'D<{}>'. +!!! error TS2323: Type 'D<{}>' is not assignable to type 'I'. +!!! error TS2323: Property 'id' is missing in type 'D<{}>'. var aClass: C = new D(); ~~~~~~ -!!! error TS2322: Type 'D<{}>' is not assignable to type 'C': -!!! error TS2322: Property 'id' is missing in type 'D<{}>'. +!!! error TS2323: Type 'D<{}>' is not assignable to type 'C'. +!!! error TS2323: Property 'id' is missing in type 'D<{}>'. var aGenericClass: D = new C(); ~~~~~~~~~~~~~ -!!! error TS2322: Type 'C' is not assignable to type 'D': -!!! error TS2322: Property 'source' is missing in type 'C'. +!!! error TS2323: Type 'C' is not assignable to type 'D'. +!!! error TS2323: Property 'source' is missing in type 'C'. var anObjectLiteral: I = { id: 'a string' }; ~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ id: string; }' is not assignable to type 'I': -!!! error TS2322: Types of property 'id' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '{ id: string; }' is not assignable to type 'I'. +!!! error TS2323: Types of property 'id' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. var anOtherObjectLiteral: { id: string } = new C(); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'C' is not assignable to type '{ id: string; }': -!!! error TS2322: Types of property 'id' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type 'C' is not assignable to type '{ id: string; }'. +!!! error TS2323: Types of property 'id' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. var aFunction: typeof F = F2; ~~~~~~~~~ -!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. var anOtherFunction: (x: string) => number = F2; ~~~~~~~~~~~~~~~ -!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. var aLambda: typeof F = (x) => 'a string'; ~~~~~~~ -!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: string) => number': -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '(x: string) => string' is not assignable to type '(x: string) => number'. +!!! error TS2323: Type 'string' is not assignable to type 'number'. var aModule: typeof M = N; ~~~~~~~ -!!! error TS2322: Type 'typeof N' is not assignable to type 'typeof M': -!!! error TS2322: Types of property 'A' are incompatible: -!!! error TS2322: Type 'typeof A' is not assignable to type 'typeof A': -!!! error TS2322: Type 'A' is not assignable to type 'A': -!!! error TS2322: Property 'name' is missing in type 'A'. +!!! error TS2323: Type 'typeof N' is not assignable to type 'typeof M'. +!!! error TS2323: Types of property 'A' are incompatible. +!!! error TS2323: Type 'typeof A' is not assignable to type 'typeof A'. +!!! error TS2323: Type 'A' is not assignable to type 'A'. +!!! error TS2323: Property 'name' is missing in type 'A'. var aClassInModule: M.A = new N.A(); ~~~~~~~~~~~~~~ -!!! error TS2322: Type 'A' is not assignable to type 'A': -!!! error TS2322: Property 'name' is missing in type 'A'. +!!! error TS2323: Type 'A' is not assignable to type 'A'. +!!! error TS2323: Property 'name' is missing in type 'A'. var aFunctionInModule: typeof M.F2 = F2; ~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: number) => string': -!!! error TS2322: Type 'boolean' is not assignable to type 'string'. +!!! error TS2323: Type '(x: number) => boolean' is not assignable to type '(x: number) => string'. +!!! error TS2323: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt b/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt index 83fededbcbc..049e91b9b3d 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(7,7): error TS2421: Class 'D' incorrectly implements interface 'C': - Types of property 'bar' are incompatible: - Type '() => string' is not assignable to type '() => number': +tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(7,7): error TS2420: Class 'D' incorrectly implements interface 'C'. + Types of property 'bar' are incompatible. + Type '() => string' is not assignable to type '() => number'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(12,5): error TS2323: Type 'number' is not assignable to type 'string'. tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(16,5): error TS2323: Type 'string' is not assignable to type 'number'. @@ -15,10 +15,10 @@ tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(16,5): error TS2323: } class D extends C implements C { ~ -!!! error TS2421: Class 'D' incorrectly implements interface 'C': -!!! error TS2421: Types of property 'bar' are incompatible: -!!! error TS2421: Type '() => string' is not assignable to type '() => number': -!!! error TS2421: Type 'string' is not assignable to type 'number'. +!!! error TS2420: Class 'D' incorrectly implements interface 'C'. +!!! error TS2420: Types of property 'bar' are incompatible. +!!! error TS2420: Type '() => string' is not assignable to type '() => number'. +!!! error TS2420: Type 'string' is not assignable to type 'number'. baz() { } } diff --git a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt index 70fcb979228..3666c89a0ed 100644 --- a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt +++ b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/fixTypeParameterInSignatureWithRestParameters.ts(2,1): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/compiler/fixTypeParameterInSignatureWithRestParameters.ts(2,1): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. @@ -6,5 +6,5 @@ tests/cases/compiler/fixTypeParameterInSignatureWithRestParameters.ts(2,1): erro function bar(item1: T, item2: T) { } bar(1, ""); // Should be ok ~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index cf23d39c108..f965a4eb9e1 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/functionOverloads40.ts(4,13): error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. - Type '{ a: string; }' is not assignable to type '{ a: boolean; }': - Types of property 'a' are incompatible: + Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. + Types of property 'a' are incompatible. Type 'string' is not assignable to type 'boolean'. @@ -11,7 +11,7 @@ tests/cases/compiler/functionOverloads40.ts(4,13): error TS2345: Argument of typ var x = foo([{a:'bar'}]); ~~~~~~~~~~~ !!! error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. -!!! error TS2345: Type '{ a: string; }' is not assignable to type '{ a: boolean; }': -!!! error TS2345: Types of property 'a' are incompatible: +!!! error TS2345: Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. +!!! error TS2345: Types of property 'a' are incompatible. !!! error TS2345: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads41.errors.txt b/tests/baselines/reference/functionOverloads41.errors.txt index 47b1e031133..77f8149c822 100644 --- a/tests/baselines/reference/functionOverloads41.errors.txt +++ b/tests/baselines/reference/functionOverloads41.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/functionOverloads41.ts(4,13): error TS2345: Argument of type '{}[]' is not assignable to parameter of type '{ a: boolean; }[]'. - Type '{}' is not assignable to type '{ a: boolean; }': + Type '{}' is not assignable to type '{ a: boolean; }'. Property 'a' is missing in type '{}'. @@ -10,6 +10,6 @@ tests/cases/compiler/functionOverloads41.ts(4,13): error TS2345: Argument of typ var x = foo([{}]); ~~~~ !!! error TS2345: Argument of type '{}[]' is not assignable to parameter of type '{ a: boolean; }[]'. -!!! error TS2345: Type '{}' is not assignable to type '{ a: boolean; }': +!!! error TS2345: Type '{}' is not assignable to type '{ a: boolean; }'. !!! error TS2345: Property 'a' is missing in type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt b/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt index f731a2e7bba..dc46ff3ff1f 100644 --- a/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt +++ b/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/functionSignatureAssignmentCompat1.ts(10,5): error TS2322: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc': - Types of parameters 'delimiter' and 'eventEmitter' are incompatible: +tests/cases/compiler/functionSignatureAssignmentCompat1.ts(10,5): error TS2323: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc'. + Types of parameters 'delimiter' and 'eventEmitter' are incompatible. Type 'string' is not assignable to type 'number'. @@ -15,7 +15,7 @@ tests/cases/compiler/functionSignatureAssignmentCompat1.ts(10,5): error TS2322: var c: ParserFunc = parsers.raw; // ok! var d: ParserFunc = parsers.readline; // not ok ~ -!!! error TS2322: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc': -!!! error TS2322: Types of parameters 'delimiter' and 'eventEmitter' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc'. +!!! error TS2323: Types of parameters 'delimiter' and 'eventEmitter' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. var e: ParserFunc = parsers.readline(); // ok \ No newline at end of file diff --git a/tests/baselines/reference/fuzzy.errors.txt b/tests/baselines/reference/fuzzy.errors.txt index 321a03f5470..22e1f48ae0f 100644 --- a/tests/baselines/reference/fuzzy.errors.txt +++ b/tests/baselines/reference/fuzzy.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/fuzzy.ts(13,18): error TS2421: Class 'C' incorrectly implements interface 'I': +tests/cases/compiler/fuzzy.ts(13,18): error TS2420: Class 'C' incorrectly implements interface 'I'. Property 'alsoWorks' is missing in type 'C'. -tests/cases/compiler/fuzzy.ts(21,20): error TS2322: Type '{ anything: number; oneI: C; }' is not assignable to type 'R': - Types of property 'oneI' are incompatible: +tests/cases/compiler/fuzzy.ts(21,20): error TS2323: Type '{ anything: number; oneI: C; }' is not assignable to type 'R'. + Types of property 'oneI' are incompatible. Type 'C' is not assignable to type 'I'. -tests/cases/compiler/fuzzy.ts(25,20): error TS2353: Neither type '{ oneI: C; }' nor type 'R' is assignable to the other: +tests/cases/compiler/fuzzy.ts(25,20): error TS2352: Neither type '{ oneI: C; }' nor type 'R' is assignable to the other. Property 'anything' is missing in type '{ oneI: C; }'. @@ -22,8 +22,8 @@ tests/cases/compiler/fuzzy.ts(25,20): error TS2353: Neither type '{ oneI: C; }' export class C implements I { ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'I': -!!! error TS2421: Property 'alsoWorks' is missing in type 'C'. +!!! error TS2420: Class 'C' incorrectly implements interface 'I'. +!!! error TS2420: Property 'alsoWorks' is missing in type 'C'. constructor(public x:number) { } works():R { @@ -33,16 +33,16 @@ tests/cases/compiler/fuzzy.ts(25,20): error TS2353: Neither type '{ oneI: C; }' doesntWork():R { return { anything:1, oneI:this }; ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ anything: number; oneI: C; }' is not assignable to type 'R': -!!! error TS2322: Types of property 'oneI' are incompatible: -!!! error TS2322: Type 'C' is not assignable to type 'I'. +!!! error TS2323: Type '{ anything: number; oneI: C; }' is not assignable to type 'R'. +!!! error TS2323: Types of property 'oneI' are incompatible. +!!! error TS2323: Type 'C' is not assignable to type 'I'. } worksToo():R { return ({ oneI: this }); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '{ oneI: C; }' nor type 'R' is assignable to the other: -!!! error TS2353: Property 'anything' is missing in type '{ oneI: C; }'. +!!! error TS2352: Neither type '{ oneI: C; }' nor type 'R' is assignable to the other. +!!! error TS2352: Property 'anything' is missing in type '{ oneI: C; }'. } } } diff --git a/tests/baselines/reference/genericArrayAssignment1.errors.txt b/tests/baselines/reference/genericArrayAssignment1.errors.txt index c0ffc6e1901..e555bbcf3f7 100644 --- a/tests/baselines/reference/genericArrayAssignment1.errors.txt +++ b/tests/baselines/reference/genericArrayAssignment1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericArrayAssignment1.ts(4,1): error TS2322: Type 'number[]' is not assignable to type 'string[]': +tests/cases/compiler/genericArrayAssignment1.ts(4,1): error TS2323: Type 'number[]' is not assignable to type 'string[]'. Type 'number' is not assignable to type 'string'. @@ -8,5 +8,5 @@ tests/cases/compiler/genericArrayAssignment1.ts(4,1): error TS2322: Type 'number s = n; ~ -!!! error TS2322: Type 'number[]' is not assignable to type 'string[]': -!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2323: Type 'number[]' is not assignable to type 'string[]'. +!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericArrayExtenstions.errors.txt b/tests/baselines/reference/genericArrayExtenstions.errors.txt index d5ba57ddb55..e3004eb2838 100644 --- a/tests/baselines/reference/genericArrayExtenstions.errors.txt +++ b/tests/baselines/reference/genericArrayExtenstions.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/genericArrayExtenstions.ts(1,22): error TS1148: Cannot compile external modules unless the '--module' flag is provided. -tests/cases/compiler/genericArrayExtenstions.ts(1,22): error TS2421: Class 'ObservableArray' incorrectly implements interface 'T[]': +tests/cases/compiler/genericArrayExtenstions.ts(1,22): error TS2420: Class 'ObservableArray' incorrectly implements interface 'T[]'. Property 'length' is missing in type 'ObservableArray'. @@ -8,8 +8,8 @@ tests/cases/compiler/genericArrayExtenstions.ts(1,22): error TS2421: Class 'Obse ~~~~~~~~~~~~~~~ !!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. ~~~~~~~~~~~~~~~ -!!! error TS2421: Class 'ObservableArray' incorrectly implements interface 'T[]': -!!! error TS2421: Property 'length' is missing in type 'ObservableArray'. +!!! error TS2420: Class 'ObservableArray' incorrectly implements interface 'T[]'. +!!! error TS2420: Property 'length' is missing in type 'ObservableArray'. concat(...items: U[]): T[]; concat(...items: T[]): T[]; } diff --git a/tests/baselines/reference/genericArrayMethods1.errors.txt b/tests/baselines/reference/genericArrayMethods1.errors.txt index 9b037155e33..7341cde82d3 100644 --- a/tests/baselines/reference/genericArrayMethods1.errors.txt +++ b/tests/baselines/reference/genericArrayMethods1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/genericArrayMethods1.ts(1,5): error TS2322: Type 'number[]' is not assignable to type 'string[]': +tests/cases/compiler/genericArrayMethods1.ts(1,5): error TS2323: Type 'number[]' is not assignable to type 'string[]'. Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/genericArrayMethods1.ts (1 errors) ==== var x:string[] = [0,1].slice(0); // this should be an error ~ -!!! error TS2322: Type 'number[]' is not assignable to type 'string[]': -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type 'number[]' is not assignable to type 'string[]'. +!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt index 8fea5ddfa72..0ca20061fef 100644 --- a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt +++ b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt @@ -1,30 +1,30 @@ -tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(12,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I': - Types of property 'x' are incompatible: - Type 'A' is not assignable to type 'Comparable': - Types of property 'compareTo' are incompatible: - Type '(other: number) => number' is not assignable to type '(other: string) => number': - Types of parameters 'other' and 'other' are incompatible: +tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(12,5): error TS2323: Type '{ x: A; }' is not assignable to type 'I'. + Types of property 'x' are incompatible. + Type 'A' is not assignable to type 'Comparable'. + Types of property 'compareTo' are incompatible. + Type '(other: number) => number' is not assignable to type '(other: string) => number'. + Types of parameters 'other' and 'other' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(13,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I': - Types of property 'x' are incompatible: - Type 'A' is not assignable to type 'Comparable': - Types of property 'compareTo' are incompatible: - Type '(other: number) => number' is not assignable to type '(other: string) => number': - Types of parameters 'other' and 'other' are incompatible: +tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(13,5): error TS2323: Type '{ x: A; }' is not assignable to type 'I'. + Types of property 'x' are incompatible. + Type 'A' is not assignable to type 'Comparable'. + Types of property 'compareTo' are incompatible. + Type '(other: number) => number' is not assignable to type '(other: string) => number'. + Types of parameters 'other' and 'other' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(16,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I': - Types of property 'x' are incompatible: - Type 'A' is not assignable to type 'Comparable': - Types of property 'compareTo' are incompatible: - Type '(other: number) => number' is not assignable to type '(other: string) => number': - Types of parameters 'other' and 'other' are incompatible: +tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(16,5): error TS2323: Type '{ x: A; }' is not assignable to type 'I'. + Types of property 'x' are incompatible. + Type 'A' is not assignable to type 'Comparable'. + Types of property 'compareTo' are incompatible. + Type '(other: number) => number' is not assignable to type '(other: string) => number'. + Types of parameters 'other' and 'other' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(17,5): error TS2322: Type 'K' is not assignable to type 'I': - Types of property 'x' are incompatible: - Type 'A' is not assignable to type 'Comparable': - Types of property 'compareTo' are incompatible: - Type '(other: number) => number' is not assignable to type '(other: string) => number': - Types of parameters 'other' and 'other' are incompatible: +tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(17,5): error TS2323: Type 'K' is not assignable to type 'I'. + Types of property 'x' are incompatible. + Type 'A' is not assignable to type 'Comparable'. + Types of property 'compareTo' are incompatible. + Type '(other: number) => number' is not assignable to type '(other: string) => number'. + Types of parameters 'other' and 'other' are incompatible. Type 'number' is not assignable to type 'string'. @@ -42,41 +42,41 @@ tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(17,5): error TS23 var z = { x: new A() }; var a1: I = { x: new A() }; ~~ -!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type 'A' is not assignable to type 'Comparable': -!!! error TS2322: Types of property 'compareTo' are incompatible: -!!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number': -!!! error TS2322: Types of parameters 'other' and 'other' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '{ x: A; }' is not assignable to type 'I'. +!!! error TS2323: Types of property 'x' are incompatible. +!!! error TS2323: Type 'A' is not assignable to type 'Comparable'. +!!! error TS2323: Types of property 'compareTo' are incompatible. +!!! error TS2323: Type '(other: number) => number' is not assignable to type '(other: string) => number'. +!!! error TS2323: Types of parameters 'other' and 'other' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. var a2: I = function (): { x: A } { ~~ -!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type 'A' is not assignable to type 'Comparable': -!!! error TS2322: Types of property 'compareTo' are incompatible: -!!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number': -!!! error TS2322: Types of parameters 'other' and 'other' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '{ x: A; }' is not assignable to type 'I'. +!!! error TS2323: Types of property 'x' are incompatible. +!!! error TS2323: Type 'A' is not assignable to type 'Comparable'. +!!! error TS2323: Types of property 'compareTo' are incompatible. +!!! error TS2323: Type '(other: number) => number' is not assignable to type '(other: string) => number'. +!!! error TS2323: Types of parameters 'other' and 'other' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. var z = { x: new A() }; return z; } (); var a3: I = z; ~~ -!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type 'A' is not assignable to type 'Comparable': -!!! error TS2322: Types of property 'compareTo' are incompatible: -!!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number': -!!! error TS2322: Types of parameters 'other' and 'other' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '{ x: A; }' is not assignable to type 'I'. +!!! error TS2323: Types of property 'x' are incompatible. +!!! error TS2323: Type 'A' is not assignable to type 'Comparable'. +!!! error TS2323: Types of property 'compareTo' are incompatible. +!!! error TS2323: Type '(other: number) => number' is not assignable to type '(other: string) => number'. +!!! error TS2323: Types of parameters 'other' and 'other' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. var a4: I = >z; ~~ -!!! error TS2322: Type 'K' is not assignable to type 'I': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type 'A' is not assignable to type 'Comparable': -!!! error TS2322: Types of property 'compareTo' are incompatible: -!!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number': -!!! error TS2322: Types of parameters 'other' and 'other' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type 'K' is not assignable to type 'I'. +!!! error TS2323: Types of property 'x' are incompatible. +!!! error TS2323: Type 'A' is not assignable to type 'Comparable'. +!!! error TS2323: Types of property 'compareTo' are incompatible. +!!! error TS2323: Type '(other: number) => number' is not assignable to type '(other: string) => number'. +!!! error TS2323: Types of parameters 'other' and 'other' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt index cdd15b7fb21..093c4bed545 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt @@ -1,12 +1,12 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(26,10): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(26,10): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(30,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(30,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(33,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(33,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(34,16): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(34,16): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(35,15): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(35,15): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. @@ -38,27 +38,27 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun var r8 = foo3(1, function (a) { return '' }, 1); // error ~~~~ -!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. var r9 = foo3(1, (a) => '', ''); // string function other(t: T, u: U) { var r10 = foo2(1, (x: T) => ''); // error ~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. var r10 = foo2(1, (x) => ''); // string var r11 = foo3(1, (x: T) => '', ''); // error ~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. var r11b = foo3(1, (x: T) => '', 1); // error ~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. var r12 = foo3(1, function (a) { return '' }, 1); // error ~~~~ -!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt index 7ce5683f335..3a397a66eba 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts(29,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts(29,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts(40,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts(40,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. @@ -35,7 +35,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun var r4 = foo2(1, i2); // error ~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. var r4b = foo2(1, a); // any var r5 = foo2(1, i); // any @@ -49,6 +49,6 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun var r7b = foo3(null, a, ''); // any var r8 = foo3(1, i2, 1); // error ~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. var r9 = foo3('', i2, ''); // string \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt index d5084fbee40..75ae76b1dbc 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(10,14): error TS2345: Argument of type '{ cb: (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: (t: {}) => string; }'. - Types of property 'cb' are incompatible: + Types of property 'cb' are incompatible. Type '(x: T, y: T) => string' is not assignable to type '(t: {}) => string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(11,14): error TS2345: Argument of type '{ cb: (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: (t: string) => string; }'. - Types of property 'cb' are incompatible: + Types of property 'cb' are incompatible. Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. @@ -19,12 +19,12 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun var r2 = foo({ cb: (x: T, y: T) => '' }); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ cb: (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: (t: {}) => string; }'. -!!! error TS2345: Types of property 'cb' are incompatible: +!!! error TS2345: Types of property 'cb' are incompatible. !!! error TS2345: Type '(x: T, y: T) => string' is not assignable to type '(t: {}) => string'. var r3 = foo({ cb: (x: string, y: number) => '' }); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ cb: (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: (t: string) => string; }'. -!!! error TS2345: Types of property 'cb' are incompatible: +!!! error TS2345: Types of property 'cb' are incompatible. !!! error TS2345: Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. function foo2(arg: { cb: (t: T, t2: T) => U }) { diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments.errors.txt b/tests/baselines/reference/genericCallWithGenericSignatureArguments.errors.txt index 12d605166c1..2d5ad21959e 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments.errors.txt +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments.ts(18,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments.ts(18,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '{ x: number; y?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; z?: number; }'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments.ts(19,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments.ts(19,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '{ x: number; z?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y?: number; }'. @@ -24,11 +24,11 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen var r4 = foo((x: typeof a) => a, (x: typeof b) => b); // typeof a => typeof a ~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate '{ x: number; y?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; z?: number; }'. var r5 = foo((x: typeof b) => b, (x: typeof a) => a); // typeof b => typeof b ~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate '{ x: number; z?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y?: number; }'. function other(x: T) { diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt index cea92ef6077..a8ee6ac6ca9 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(10,29): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(10,29): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(15,21): error TS2345: Argument of type 'Date' is not assignable to parameter of type 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(16,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. @@ -23,7 +23,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen var r1: (x: {}) => {} = foo((x: number) => 1, (x: string) => ''); ~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. function other2(x: T) { diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.errors.txt b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.errors.txt index 28f142b804e..574cc5ca50d 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.errors.txt +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts(32,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts(32,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '(y: string) => string' is not a valid type argument because it is not a supertype of candidate '(a: string) => boolean'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts(33,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts(33,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '(n: Object) => number' is not a valid type argument because it is not a supertype of candidate 'number'. @@ -38,9 +38,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen var x: (a: string) => boolean; var r11 = foo2(x, (a1: (y: string) => string) => (n: Object) => 1, (a2: (z: string) => string) => 2); // error ~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate '(y: string) => string' is not a valid type argument because it is not a supertype of candidate '(a: string) => boolean'. var r12 = foo2(x, (a1: (y: string) => boolean) => (n: Object) => 1, (a2: (z: string) => boolean) => 2); // error ~~~~ -!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate '(n: Object) => number' is not a valid type argument because it is not a supertype of candidate 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.errors.txt b/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.errors.txt index eb8bcca96fc..2efcd043d78 100644 --- a/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.errors.txt +++ b/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithNonSymmetricSubtypes.ts(12,9): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithNonSymmetricSubtypes.ts(12,9): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '{ x: number; y?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; z?: number; }'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithNonSymmetricSubtypes.ts(13,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithNonSymmetricSubtypes.ts(13,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '{ x: number; z?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y?: number; }'. @@ -18,11 +18,11 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithNon var r = foo(a, b); // { x: number; y?: number; }; ~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate '{ x: number; y?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; z?: number; }'. var r2 = foo(b, a); // { x: number; z?: number; }; ~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate '{ x: number; z?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y?: number; }'. var x: { x: number; }; diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArgs.errors.txt b/tests/baselines/reference/genericCallWithObjectLiteralArgs.errors.txt index a5702c23915..eb45586442d 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArgs.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectLiteralArgs.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectLiteralArgs.ts(5,9): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectLiteralArgs.ts(5,9): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. @@ -9,7 +9,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj var r = foo({ bar: 1, baz: '' }); // error ~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. var r2 = foo({ bar: 1, baz: 1 }); // T = number var r3 = foo({ bar: foo, baz: foo }); // T = typeof foo diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt index 39e757fc6b4..f389a0a6cae 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt @@ -1,16 +1,16 @@ -tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(3,9): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(3,9): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(4,22): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; y: number; }'. - Types of property 'y' are incompatible: + Types of property 'y' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(5,22): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: string; y: string; }'. - Types of property 'x' are incompatible: + Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(6,22): error TS2345: Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: number; y: number; }'. - Types of property 'x' are incompatible: + Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(7,22): error TS2345: Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: string; y: string; }'. - Types of property 'y' are incompatible: + Types of property 'y' are incompatible. Type 'number' is not assignable to type 'string'. @@ -19,25 +19,25 @@ tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(7,22): error TS23 // these are all errors var x = foo({ x: 3, y: "" }, 4); ~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. var x2 = foo({ x: 3, y: "" }, 4); ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; y: number; }'. -!!! error TS2345: Types of property 'y' are incompatible: +!!! error TS2345: Types of property 'y' are incompatible. !!! error TS2345: Type 'string' is not assignable to type 'number'. var x3 = foo({ x: 3, y: "" }, 4); ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: string; y: string; }'. -!!! error TS2345: Types of property 'x' are incompatible: +!!! error TS2345: Types of property 'x' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. var x4 = foo({ x: "", y: 4 }, ""); ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: number; y: number; }'. -!!! error TS2345: Types of property 'x' are incompatible: +!!! error TS2345: Types of property 'x' are incompatible. !!! error TS2345: Type 'string' is not assignable to type 'number'. var x5 = foo({ x: "", y: 4 }, ""); ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: string; y: string; }'. -!!! error TS2345: Types of property 'y' are incompatible: +!!! error TS2345: Types of property 'y' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgs.errors.txt index 478f1404b1c..97b09a7d43f 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgs.ts(20,9): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgs.ts(20,9): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'C' is not a valid type argument because it is not a supertype of candidate 'D'. @@ -24,6 +24,6 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj var d1 = new X(); var r = foo(c1, d1); // error ~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'C' is not a valid type argument because it is not a supertype of candidate 'D'. var r2 = foo(c1, c1); // ok \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt index b1f00ed2abd..02b38ddeb74 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts(18,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts(18,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'Derived' is not a valid type argument because it is not a supertype of candidate 'Derived2'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts(20,29): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. @@ -23,7 +23,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj var r1 = f({ x: new Derived(), y: new Derived2() }); // error because neither is supertype of the other ~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'Derived' is not a valid type argument because it is not a supertype of candidate 'Derived2'. function f2(a: U) { diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.errors.txt b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.errors.txt index 03ab33e11d6..2a0807bf6b9 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments.ts(36,14): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments.ts(36,14): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'boolean' is not a valid type argument because it is not a supertype of candidate 'number'. @@ -40,7 +40,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOve var r8 = foo6(a); // error ~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'boolean' is not a valid type argument because it is not a supertype of candidate 'number'. var r9 = foo6(b); // new any => string; new(x:any, y?:any) => string diff --git a/tests/baselines/reference/genericCallWithTupleType.errors.txt b/tests/baselines/reference/genericCallWithTupleType.errors.txt index abfe5087131..930d3128452 100644 --- a/tests/baselines/reference/genericCallWithTupleType.errors.txt +++ b/tests/baselines/reference/genericCallWithTupleType.errors.txt @@ -1,18 +1,18 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(12,1): error TS2322: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]': - Types of property 'pop' are incompatible: - Type '() => string | number | boolean' is not assignable to type '() => string | number': - Type 'string | number | boolean' is not assignable to type 'string | number': - Type 'boolean' is not assignable to type 'string | number': +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(12,1): error TS2323: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]'. + Types of property 'pop' are incompatible. + Type '() => string | number | boolean' is not assignable to type '() => string | number'. + Type 'string | number | boolean' is not assignable to type 'string | number'. + Type 'boolean' is not assignable to type 'string | number'. Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,1): error TS2322: Type '{ a: string; }' is not assignable to type 'string | number': +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,1): error TS2323: Type '{ a: string; }' is not assignable to type 'string | number'. Type '{ a: string; }' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,1): error TS2322: Type '[number, string]' is not assignable to type '[string, number]': - Types of property '0' are incompatible: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,1): error TS2323: Type '[number, string]' is not assignable to type '[string, number]'. + Types of property '0' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(23,1): error TS2322: Type '[{}, {}]' is not assignable to type '[string, number]': - Types of property '0' are incompatible: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(23,1): error TS2323: Type '[{}, {}]' is not assignable to type '[string, number]'. + Types of property '0' are incompatible. Type '{}' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(24,1): error TS2322: Type '[{}]' is not assignable to type '[{}, {}]': +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(24,1): error TS2323: Type '[{}]' is not assignable to type '[{}, {}]'. Property '1' is missing in type '[{}]'. @@ -30,17 +30,17 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup var e2 = i1.tuple1[1]; // number i1.tuple1 = ["foo", 5, false, true]; ~~~~~~~~~ -!!! error TS2322: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]': -!!! error TS2322: Types of property 'pop' are incompatible: -!!! error TS2322: Type '() => string | number | boolean' is not assignable to type '() => string | number': -!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'string | number': -!!! error TS2322: Type 'boolean' is not assignable to type 'string | number': -!!! error TS2322: Type 'boolean' is not assignable to type 'number'. +!!! error TS2323: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]'. +!!! error TS2323: Types of property 'pop' are incompatible. +!!! error TS2323: Type '() => string | number | boolean' is not assignable to type '() => string | number'. +!!! error TS2323: Type 'string | number | boolean' is not assignable to type 'string | number'. +!!! error TS2323: Type 'boolean' is not assignable to type 'string | number'. +!!! error TS2323: Type 'boolean' is not assignable to type 'number'. var e3 = i1.tuple1[2]; // {} i1.tuple1[3] = { a: "string" }; ~~~~~~~~~~~~ -!!! error TS2322: Type '{ a: string; }' is not assignable to type 'string | number': -!!! error TS2322: Type '{ a: string; }' is not assignable to type 'number'. +!!! error TS2323: Type '{ a: string; }' is not assignable to type 'string | number'. +!!! error TS2323: Type '{ a: string; }' is not assignable to type 'number'. var e4 = i1.tuple1[3]; // {} i2.tuple1 = ["foo", 5]; i2.tuple1 = ["foo", "bar"]; @@ -50,16 +50,16 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup // error i1.tuple1 = [5, "foo"]; ~~~~~~~~~ -!!! error TS2322: Type '[number, string]' is not assignable to type '[string, number]': -!!! error TS2322: Types of property '0' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '[number, string]' is not assignable to type '[string, number]'. +!!! error TS2323: Types of property '0' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. i1.tuple1 = [{}, {}]; ~~~~~~~~~ -!!! error TS2322: Type '[{}, {}]' is not assignable to type '[string, number]': -!!! error TS2322: Types of property '0' are incompatible: -!!! error TS2322: Type '{}' is not assignable to type 'string'. +!!! error TS2323: Type '[{}, {}]' is not assignable to type '[string, number]'. +!!! error TS2323: Types of property '0' are incompatible. +!!! error TS2323: Type '{}' is not assignable to type 'string'. i2.tuple1 = [{}]; ~~~~~~~~~ -!!! error TS2322: Type '[{}]' is not assignable to type '[{}, {}]': -!!! error TS2322: Property '1' is missing in type '[{}]'. +!!! error TS2323: Type '[{}]' is not assignable to type '[{}, {}]'. +!!! error TS2323: Property '1' is missing in type '[{}]'. \ No newline at end of file diff --git a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt index 40d0b19fd7c..149a20e92a5 100644 --- a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt +++ b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(57,19): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(57,19): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. -tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(60,19): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(60,19): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. -tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(61,20): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(61,20): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. -tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(62,19): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(62,19): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. @@ -67,21 +67,21 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFu function other(t: T, u: U) { var r10 = c.foo2(1, (x: T) => ''); // error ~~~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. var r10 = c.foo2(1, (x) => ''); // string var r11 = c3.foo3(1, (x: T) => '', ''); // error ~~~~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. var r11b = c3.foo3(1, (x: T) => '', 1); // error ~~~~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. var r12 = c3.foo3(1, function (a) { return '' }, 1); // error ~~~~~~~ -!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. } } \ No newline at end of file diff --git a/tests/baselines/reference/genericCloneReturnTypes.errors.txt b/tests/baselines/reference/genericCloneReturnTypes.errors.txt index 37de816704c..626f53bddea 100644 --- a/tests/baselines/reference/genericCloneReturnTypes.errors.txt +++ b/tests/baselines/reference/genericCloneReturnTypes.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericCloneReturnTypes.ts(25,1): error TS2322: Type 'Bar' is not assignable to type 'Bar': +tests/cases/compiler/genericCloneReturnTypes.ts(25,1): error TS2323: Type 'Bar' is not assignable to type 'Bar'. Type 'string' is not assignable to type 'number'. @@ -29,5 +29,5 @@ tests/cases/compiler/genericCloneReturnTypes.ts(25,1): error TS2322: Type 'Bar' is not assignable to type 'Bar': -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2323: Type 'Bar' is not assignable to type 'Bar'. +!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCloneReturnTypes2.errors.txt b/tests/baselines/reference/genericCloneReturnTypes2.errors.txt index 0d8131871fe..c531ea31ccc 100644 --- a/tests/baselines/reference/genericCloneReturnTypes2.errors.txt +++ b/tests/baselines/reference/genericCloneReturnTypes2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericCloneReturnTypes2.ts(15,5): error TS2322: Type 'MyList' is not assignable to type 'MyList': +tests/cases/compiler/genericCloneReturnTypes2.ts(15,5): error TS2323: Type 'MyList' is not assignable to type 'MyList'. Type 'string' is not assignable to type 'number'. @@ -19,5 +19,5 @@ tests/cases/compiler/genericCloneReturnTypes2.ts(15,5): error TS2322: Type 'MyLi var c: MyList = a.clone(); // bug was there was an error on this line var d: MyList = a.clone(); // error ~ -!!! error TS2322: Type 'MyList' is not assignable to type 'MyList': -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2323: Type 'MyList' is not assignable to type 'MyList'. +!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericConstraint2.errors.txt b/tests/baselines/reference/genericConstraint2.errors.txt index 482173ff075..3ab29b585d8 100644 --- a/tests/baselines/reference/genericConstraint2.errors.txt +++ b/tests/baselines/reference/genericConstraint2.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/genericConstraint2.ts(5,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/genericConstraint2.ts(11,7): error TS2421: Class 'ComparableString' incorrectly implements interface 'Comparable': +tests/cases/compiler/genericConstraint2.ts(11,7): error TS2420: Class 'ComparableString' incorrectly implements interface 'Comparable'. Property 'comparer' is missing in type 'ComparableString'. tests/cases/compiler/genericConstraint2.ts(21,17): error TS2344: Type 'ComparableString' does not satisfy the constraint 'Comparable'. @@ -19,8 +19,8 @@ tests/cases/compiler/genericConstraint2.ts(21,17): error TS2344: Type 'Comparabl class ComparableString implements Comparable{ ~~~~~~~~~~~~~~~~ -!!! error TS2421: Class 'ComparableString' incorrectly implements interface 'Comparable': -!!! error TS2421: Property 'comparer' is missing in type 'ComparableString'. +!!! error TS2420: Class 'ComparableString' incorrectly implements interface 'Comparable'. +!!! error TS2420: Property 'comparer' is missing in type 'ComparableString'. constructor(public currentValue: string) { } localeCompare(other) { diff --git a/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt b/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt index 4602e5eb494..ade053d9344 100644 --- a/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt +++ b/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/genericConstraintSatisfaction1.ts(6,5): error TS2345: Argument of type '{ s: number; }' is not assignable to parameter of type '{ s: string; }'. - Types of property 's' are incompatible: + Types of property 's' are incompatible. Type 'number' is not assignable to type 'string'. @@ -12,6 +12,6 @@ tests/cases/compiler/genericConstraintSatisfaction1.ts(6,5): error TS2345: Argum x.f({s: 1}) ~~~~~~ !!! error TS2345: Argument of type '{ s: number; }' is not assignable to parameter of type '{ s: string; }'. -!!! error TS2345: Types of property 's' are incompatible: +!!! error TS2345: Types of property 's' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt index e08cc405426..51aac95daad 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/genericDerivedTypeWithSpecializedBase.ts(11,1): error TS2322: Type 'B' is not assignable to type 'A': - Types of property 'x' are incompatible: +tests/cases/compiler/genericDerivedTypeWithSpecializedBase.ts(11,1): error TS2323: Type 'B' is not assignable to type 'A'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. @@ -16,7 +16,7 @@ tests/cases/compiler/genericDerivedTypeWithSpecializedBase.ts(11,1): error TS232 var y: B; x = y; // error ~ -!!! error TS2322: Type 'B' is not assignable to type 'A': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'B' is not assignable to type 'A'. +!!! error TS2323: Types of property 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt index bcb406447a4..798557ef72d 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts(11,1): error TS2322: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>': - Types of property 'x' are incompatible: - Type 'string' is not assignable to type '{ length: number; foo: number; }': +tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts(11,1): error TS2323: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>'. + Types of property 'x' are incompatible. + Type 'string' is not assignable to type '{ length: number; foo: number; }'. Property 'foo' is missing in type 'String'. @@ -17,8 +17,8 @@ tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts(11,1): error TS23 var y: B; x = y; // error ~ -!!! error TS2322: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type '{ length: number; foo: number; }': -!!! error TS2322: Property 'foo' is missing in type 'String'. +!!! error TS2323: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>'. +!!! error TS2323: Types of property 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type '{ length: number; foo: number; }'. +!!! error TS2323: Property 'foo' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/genericRestArgs.errors.txt b/tests/baselines/reference/genericRestArgs.errors.txt index 2cbaba80221..8a977452958 100644 --- a/tests/baselines/reference/genericRestArgs.errors.txt +++ b/tests/baselines/reference/genericRestArgs.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/genericRestArgs.ts(2,12): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/compiler/genericRestArgs.ts(2,12): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/compiler/genericRestArgs.ts(5,34): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -tests/cases/compiler/genericRestArgs.ts(10,12): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/compiler/genericRestArgs.ts(10,12): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/compiler/genericRestArgs.ts(12,30): error TS2345: Argument of type 'number' is not assignable to parameter of type 'any[]'. @@ -10,7 +10,7 @@ tests/cases/compiler/genericRestArgs.ts(12,30): error TS2345: Argument of type ' function makeArrayG(...items: T[]): T[] { return items; } var a1Ga = makeArrayG(1, ""); // no error ~~~~~~~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. var a1Gb = makeArrayG(1, ""); var a1Gc = makeArrayG(1, ""); @@ -23,7 +23,7 @@ tests/cases/compiler/genericRestArgs.ts(12,30): error TS2345: Argument of type ' } var a2Ga = makeArrayGOpt(1, ""); ~~~~~~~~~~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. var a2Gb = makeArrayG(1, ""); var a2Gc = makeArrayG(1, ""); // error diff --git a/tests/baselines/reference/genericSpecializations3.errors.txt b/tests/baselines/reference/genericSpecializations3.errors.txt index 0011be255f1..e8e8804c0cc 100644 --- a/tests/baselines/reference/genericSpecializations3.errors.txt +++ b/tests/baselines/reference/genericSpecializations3.errors.txt @@ -1,17 +1,17 @@ -tests/cases/compiler/genericSpecializations3.ts(8,7): error TS2421: Class 'IntFooBad' incorrectly implements interface 'IFoo': - Types of property 'foo' are incompatible: - Type '(x: string) => string' is not assignable to type '(x: number) => number': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/compiler/genericSpecializations3.ts(8,7): error TS2420: Class 'IntFooBad' incorrectly implements interface 'IFoo'. + Types of property 'foo' are incompatible. + Type '(x: string) => string' is not assignable to type '(x: number) => number'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/genericSpecializations3.ts(28,1): error TS2322: Type 'StringFoo2' is not assignable to type 'IntFoo': - Types of property 'foo' are incompatible: - Type '(x: string) => string' is not assignable to type '(x: number) => number': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/compiler/genericSpecializations3.ts(28,1): error TS2323: Type 'StringFoo2' is not assignable to type 'IntFoo'. + Types of property 'foo' are incompatible. + Type '(x: string) => string' is not assignable to type '(x: number) => number'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2322: Type 'IntFoo' is not assignable to type 'StringFoo2': - Types of property 'foo' are incompatible: - Type '(x: number) => number' is not assignable to type '(x: string) => string': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2323: Type 'IntFoo' is not assignable to type 'StringFoo2'. + Types of property 'foo' are incompatible. + Type '(x: number) => number' is not assignable to type '(x: string) => string'. + Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. @@ -25,11 +25,11 @@ tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2322: Type 'IntFo class IntFooBad implements IFoo { // error ~~~~~~~~~ -!!! error TS2421: Class 'IntFooBad' incorrectly implements interface 'IFoo': -!!! error TS2421: Types of property 'foo' are incompatible: -!!! error TS2421: Type '(x: string) => string' is not assignable to type '(x: number) => number': -!!! error TS2421: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2421: Type 'string' is not assignable to type 'number'. +!!! error TS2420: Class 'IntFooBad' incorrectly implements interface 'IFoo'. +!!! error TS2420: Types of property 'foo' are incompatible. +!!! error TS2420: Type '(x: string) => string' is not assignable to type '(x: number) => number'. +!!! error TS2420: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2420: Type 'string' is not assignable to type 'number'. foo(x: string): string { return null; } } @@ -51,18 +51,18 @@ tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2322: Type 'IntFo intFoo = stringFoo2; // error ~~~~~~ -!!! error TS2322: Type 'StringFoo2' is not assignable to type 'IntFoo': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => number': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'StringFoo2' is not assignable to type 'IntFoo'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type '(x: string) => string' is not assignable to type '(x: number) => number'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. stringFoo2 = intFoo; // error ~~~~~~~~~~ -!!! error TS2322: Type 'IntFoo' is not assignable to type 'StringFoo2': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type '(x: number) => number' is not assignable to type '(x: string) => string': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type 'IntFoo' is not assignable to type 'StringFoo2'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type '(x: number) => number' is not assignable to type '(x: string) => string'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. class StringFoo3 implements IFoo { // error diff --git a/tests/baselines/reference/genericTypeAssertions1.errors.txt b/tests/baselines/reference/genericTypeAssertions1.errors.txt index 9e0492a8474..26a0d7d11aa 100644 --- a/tests/baselines/reference/genericTypeAssertions1.errors.txt +++ b/tests/baselines/reference/genericTypeAssertions1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/genericTypeAssertions1.ts(3,5): error TS2322: Type 'A' is not assignable to type 'A': +tests/cases/compiler/genericTypeAssertions1.ts(3,5): error TS2323: Type 'A' is not assignable to type 'A'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/genericTypeAssertions1.ts(4,5): error TS2322: Type 'A>' is not assignable to type 'A': +tests/cases/compiler/genericTypeAssertions1.ts(4,5): error TS2323: Type 'A>' is not assignable to type 'A'. Type 'A' is not assignable to type 'number'. -tests/cases/compiler/genericTypeAssertions1.ts(4,21): error TS2353: Neither type 'A' nor type 'A>' is assignable to the other: - Type 'number' is not assignable to type 'A': +tests/cases/compiler/genericTypeAssertions1.ts(4,21): error TS2352: Neither type 'A' nor type 'A>' is assignable to the other. + Type 'number' is not assignable to type 'A'. Property 'foo' is missing in type 'Number'. @@ -12,13 +12,13 @@ tests/cases/compiler/genericTypeAssertions1.ts(4,21): error TS2353: Neither type var foo = new A(); var r: A = >new A(); // error ~ -!!! error TS2322: Type 'A' is not assignable to type 'A': -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type 'A' is not assignable to type 'A'. +!!! error TS2323: Type 'number' is not assignable to type 'string'. var r2: A = >>foo; // error ~~ -!!! error TS2322: Type 'A>' is not assignable to type 'A': -!!! error TS2322: Type 'A' is not assignable to type 'number'. +!!! error TS2323: Type 'A>' is not assignable to type 'A'. +!!! error TS2323: Type 'A' is not assignable to type 'number'. ~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type 'A' nor type 'A>' is assignable to the other: -!!! error TS2353: Type 'number' is not assignable to type 'A': -!!! error TS2353: Property 'foo' is missing in type 'Number'. \ No newline at end of file +!!! error TS2352: Neither type 'A' nor type 'A>' is assignable to the other. +!!! error TS2352: Type 'number' is not assignable to type 'A'. +!!! error TS2352: Property 'foo' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeAssertions2.errors.txt b/tests/baselines/reference/genericTypeAssertions2.errors.txt index 887e66a532f..e2f4fab7b7b 100644 --- a/tests/baselines/reference/genericTypeAssertions2.errors.txt +++ b/tests/baselines/reference/genericTypeAssertions2.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/genericTypeAssertions2.ts(10,5): error TS2322: Type 'B' is not assignable to type 'A': - Types of property 'foo' are incompatible: - Type '(x: string) => void' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/compiler/genericTypeAssertions2.ts(10,5): error TS2323: Type 'B' is not assignable to type 'A'. + Types of property 'foo' are incompatible. + Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/genericTypeAssertions2.ts(11,5): error TS2322: Type 'A' is not assignable to type 'B': +tests/cases/compiler/genericTypeAssertions2.ts(11,5): error TS2323: Type 'A' is not assignable to type 'B'. Property 'bar' is missing in type 'A'. -tests/cases/compiler/genericTypeAssertions2.ts(13,21): error TS2353: Neither type 'undefined[]' nor type 'A' is assignable to the other: +tests/cases/compiler/genericTypeAssertions2.ts(13,21): error TS2352: Neither type 'undefined[]' nor type 'A' is assignable to the other. Property 'foo' is missing in type 'undefined[]'. @@ -21,17 +21,17 @@ tests/cases/compiler/genericTypeAssertions2.ts(13,21): error TS2353: Neither typ var r: A = >new B(); var r2: A = >new B(); // error ~~ -!!! error TS2322: Type 'B' is not assignable to type 'A': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'B' is not assignable to type 'A'. +!!! error TS2323: Types of property 'foo' are incompatible. +!!! error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. var r3: B = >new B(); // error ~~ -!!! error TS2322: Type 'A' is not assignable to type 'B': -!!! error TS2322: Property 'bar' is missing in type 'A'. +!!! error TS2323: Type 'A' is not assignable to type 'B'. +!!! error TS2323: Property 'bar' is missing in type 'A'. var r4: A = >new A(); var r5: A = >[]; // error ~~~~~~~~~~~~~ -!!! error TS2353: Neither type 'undefined[]' nor type 'A' is assignable to the other: -!!! error TS2353: Property 'foo' is missing in type 'undefined[]'. \ No newline at end of file +!!! error TS2352: Neither type 'undefined[]' nor type 'A' is assignable to the other. +!!! error TS2352: Property 'foo' is missing in type 'undefined[]'. \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt index a1efb4a4e87..13ab681e4e5 100644 --- a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt +++ b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt @@ -1,16 +1,16 @@ -tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(4,7): error TS2421: Class 'X' incorrectly implements interface 'I': - Types of property 'f' are incompatible: - Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void': - Types of parameters 'a' and 'a' are incompatible: - Type 'T' is not assignable to type '{ a: number; }': - Types of property 'a' are incompatible: +tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(4,7): error TS2420: Class 'X' incorrectly implements interface 'I'. + Types of property 'f' are incompatible. + Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void'. + Types of parameters 'a' and 'a' are incompatible. + Type 'T' is not assignable to type '{ a: number; }'. + Types of property 'a' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(8,5): error TS2322: Type 'X<{ a: string; }>' is not assignable to type 'I': - Types of property 'f' are incompatible: - Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void': - Types of parameters 'a' and 'a' are incompatible: - Type '{ a: string; }' is not assignable to type '{ a: number; }': - Types of property 'a' are incompatible: +tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(8,5): error TS2323: Type 'X<{ a: string; }>' is not assignable to type 'I'. + Types of property 'f' are incompatible. + Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void'. + Types of parameters 'a' and 'a' are incompatible. + Type '{ a: string; }' is not assignable to type '{ a: number; }'. + Types of property 'a' are incompatible. Type 'string' is not assignable to type 'number'. @@ -20,23 +20,23 @@ tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(8,5): error TS2322 } class X implements I { ~ -!!! error TS2421: Class 'X' incorrectly implements interface 'I': -!!! error TS2421: Types of property 'f' are incompatible: -!!! error TS2421: Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void': -!!! error TS2421: Types of parameters 'a' and 'a' are incompatible: -!!! error TS2421: Type 'T' is not assignable to type '{ a: number; }': -!!! error TS2421: Types of property 'a' are incompatible: -!!! error TS2421: Type 'string' is not assignable to type 'number'. +!!! error TS2420: Class 'X' incorrectly implements interface 'I'. +!!! error TS2420: Types of property 'f' are incompatible. +!!! error TS2420: Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void'. +!!! error TS2420: Types of parameters 'a' and 'a' are incompatible. +!!! error TS2420: Type 'T' is not assignable to type '{ a: number; }'. +!!! error TS2420: Types of property 'a' are incompatible. +!!! error TS2420: Type 'string' is not assignable to type 'number'. f(a: T): void { } } var x = new X<{ a: string }>(); var i: I = x; // Should not be allowed -- type of 'f' is incompatible with 'I' ~ -!!! error TS2322: Type 'X<{ a: string; }>' is not assignable to type 'I': -!!! error TS2322: Types of property 'f' are incompatible: -!!! error TS2322: Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void': -!!! error TS2322: Types of parameters 'a' and 'a' are incompatible: -!!! error TS2322: Type '{ a: string; }' is not assignable to type '{ a: number; }': -!!! error TS2322: Types of property 'a' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'X<{ a: string; }>' is not assignable to type 'I'. +!!! error TS2323: Types of property 'f' are incompatible. +!!! error TS2323: Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void'. +!!! error TS2323: Types of parameters 'a' and 'a' are incompatible. +!!! error TS2323: Type '{ a: string; }' is not assignable to type '{ a: number; }'. +!!! error TS2323: Types of property 'a' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/generics1.errors.txt b/tests/baselines/reference/generics1.errors.txt index 4d378d0b7d6..81d250a2ef4 100644 --- a/tests/baselines/reference/generics1.errors.txt +++ b/tests/baselines/reference/generics1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/generics1.ts(10,9): error TS2343: Type 'A' does not satisfy the constraint 'B': +tests/cases/compiler/generics1.ts(10,9): error TS2344: Type 'A' does not satisfy the constraint 'B'. Property 'b' is missing in type 'A'. tests/cases/compiler/generics1.ts(13,9): error TS2314: Generic type 'G' requires 2 type argument(s). tests/cases/compiler/generics1.ts(14,9): error TS2314: Generic type 'G' requires 2 type argument(s). @@ -16,8 +16,8 @@ tests/cases/compiler/generics1.ts(14,9): error TS2314: Generic type 'G' re var v2: G<{ a: string }, C>; // Ok, equivalent to G var v3: G; // Error, A not valid argument for U ~~~~~~~ -!!! error TS2343: Type 'A' does not satisfy the constraint 'B': -!!! error TS2343: Property 'b' is missing in type 'A'. +!!! error TS2344: Type 'A' does not satisfy the constraint 'B'. +!!! error TS2344: Property 'b' is missing in type 'A'. var v4: G, C>; // Ok var v5: G; // Error, any does not satisfy constraint B var v6: G; // Error, wrong number of arguments diff --git a/tests/baselines/reference/generics2.errors.txt b/tests/baselines/reference/generics2.errors.txt index dfe58f07f23..a0380eee753 100644 --- a/tests/baselines/reference/generics2.errors.txt +++ b/tests/baselines/reference/generics2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/generics2.ts(17,9): error TS2343: Type 'A' does not satisfy the constraint 'B': +tests/cases/compiler/generics2.ts(17,9): error TS2344: Type 'A' does not satisfy the constraint 'B'. Property 'b' is missing in type 'A'. tests/cases/compiler/generics2.ts(20,9): error TS2314: Generic type 'G' requires 2 type argument(s). tests/cases/compiler/generics2.ts(21,9): error TS2314: Generic type 'G' requires 2 type argument(s). @@ -23,8 +23,8 @@ tests/cases/compiler/generics2.ts(21,9): error TS2314: Generic type 'G' re var v2: G<{ a: string }, C>; // Ok, equivalent to G var v3: G; // Error, A not valid argument for U ~~~~~~~ -!!! error TS2343: Type 'A' does not satisfy the constraint 'B': -!!! error TS2343: Property 'b' is missing in type 'A'. +!!! error TS2344: Type 'A' does not satisfy the constraint 'B'. +!!! error TS2344: Property 'b' is missing in type 'A'. var v4: G, C>; // Ok var v5: G; // Error, any does not satisfy constraint B var v6: G; // Error, wrong number of arguments diff --git a/tests/baselines/reference/generics4.errors.txt b/tests/baselines/reference/generics4.errors.txt index dcf210a53cf..5824ce7958a 100644 --- a/tests/baselines/reference/generics4.errors.txt +++ b/tests/baselines/reference/generics4.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/generics4.ts(7,1): error TS2322: Type 'C' is not assignable to type 'C': - Type 'Y' is not assignable to type 'X': - Types of property 'f' are incompatible: - Type '() => boolean' is not assignable to type '() => string': +tests/cases/compiler/generics4.ts(7,1): error TS2323: Type 'C' is not assignable to type 'C'. + Type 'Y' is not assignable to type 'X'. + Types of property 'f' are incompatible. + Type '() => boolean' is not assignable to type '() => string'. Type 'boolean' is not assignable to type 'string'. @@ -14,8 +14,8 @@ tests/cases/compiler/generics4.ts(7,1): error TS2322: Type 'C' is not assigna a = b; // Not ok - return types of "f" are different ~ -!!! error TS2322: Type 'C' is not assignable to type 'C': -!!! error TS2322: Type 'Y' is not assignable to type 'X': -!!! error TS2322: Types of property 'f' are incompatible: -!!! error TS2322: Type '() => boolean' is not assignable to type '() => string': -!!! error TS2322: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2323: Type 'C' is not assignable to type 'C'. +!!! error TS2323: Type 'Y' is not assignable to type 'X'. +!!! error TS2323: Types of property 'f' are incompatible. +!!! error TS2323: Type '() => boolean' is not assignable to type '() => string'. +!!! error TS2323: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/generics5.errors.txt b/tests/baselines/reference/generics5.errors.txt index fa279b92a5d..17aeea63df2 100644 --- a/tests/baselines/reference/generics5.errors.txt +++ b/tests/baselines/reference/generics5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/generics5.ts(10,9): error TS2343: Type 'A' does not satisfy the constraint 'B': +tests/cases/compiler/generics5.ts(10,9): error TS2344: Type 'A' does not satisfy the constraint 'B'. Property 'b' is missing in type 'A'. @@ -14,7 +14,7 @@ tests/cases/compiler/generics5.ts(10,9): error TS2343: Type 'A' does not satisfy var v3: G; // Error, A not valid argument for U ~~~~~~~ -!!! error TS2343: Type 'A' does not satisfy the constraint 'B': -!!! error TS2343: Property 'b' is missing in type 'A'. +!!! error TS2344: Type 'A' does not satisfy the constraint 'B'. +!!! error TS2344: Property 'b' is missing in type 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt index b4843deb9c2..1c9d42c9abc 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt +++ b/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/getAndSetNotIdenticalType2.ts(5,9): error TS1056: Accessors tests/cases/compiler/getAndSetNotIdenticalType2.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/getAndSetNotIdenticalType2.ts(5,5): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/compiler/getAndSetNotIdenticalType2.ts(8,5): error TS2380: 'get' and 'set' accessor must have the same type. -tests/cases/compiler/getAndSetNotIdenticalType2.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A': +tests/cases/compiler/getAndSetNotIdenticalType2.ts(9,9): error TS2323: Type 'A' is not assignable to type 'A'. Type 'string' is not assignable to type 'T'. @@ -27,8 +27,8 @@ tests/cases/compiler/getAndSetNotIdenticalType2.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A': -!!! error TS2322: Type 'string' is not assignable to type 'T'. +!!! error TS2323: Type 'A' is not assignable to type 'A'. +!!! error TS2323: Type 'string' is not assignable to type 'T'. } ~~~~~ !!! error TS2380: 'get' and 'set' accessor must have the same type. diff --git a/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt index 637c140a1f3..7590f50815d 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt +++ b/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/getAndSetNotIdenticalType3.ts(5,9): error TS1056: Accessors tests/cases/compiler/getAndSetNotIdenticalType3.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/getAndSetNotIdenticalType3.ts(5,5): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/compiler/getAndSetNotIdenticalType3.ts(8,5): error TS2380: 'get' and 'set' accessor must have the same type. -tests/cases/compiler/getAndSetNotIdenticalType3.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A': +tests/cases/compiler/getAndSetNotIdenticalType3.ts(9,9): error TS2323: Type 'A' is not assignable to type 'A'. Type 'string' is not assignable to type 'number'. @@ -27,8 +27,8 @@ tests/cases/compiler/getAndSetNotIdenticalType3.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A': -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'A' is not assignable to type 'A'. +!!! error TS2323: Type 'string' is not assignable to type 'number'. } ~~~~~ !!! error TS2380: 'get' and 'set' accessor must have the same type. diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt index 15f8f21b8f3..e5c2be7a598 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,19): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'string[]'. - Type 'string | number' is not assignable to type 'string': + Type 'string | number' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. @@ -15,7 +15,7 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,19): error TS2345: Argu this.test([1, 2, "hi", 5]); // Error ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'string[]'. -!!! error TS2345: Type 'string | number' is not assignable to type 'string': +!!! error TS2345: Type 'string | number' is not assignable to type 'string'. !!! error TS2345: Type 'number' is not assignable to type 'string'. } } \ No newline at end of file diff --git a/tests/baselines/reference/i3.errors.txt b/tests/baselines/reference/i3.errors.txt index 1a03e690a2f..39a62340d53 100644 --- a/tests/baselines/reference/i3.errors.txt +++ b/tests/baselines/reference/i3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/i3.ts(6,1): error TS2322: Type 'I3' is not assignable to type '{ one: number; }': +tests/cases/compiler/i3.ts(6,1): error TS2323: Type 'I3' is not assignable to type '{ one: number; }'. Property 'one' is optional in type 'I3' but required in type '{ one: number; }'. @@ -10,5 +10,5 @@ tests/cases/compiler/i3.ts(6,1): error TS2322: Type 'I3' is not assignable to ty i = x; x = i; ~ -!!! error TS2322: Type 'I3' is not assignable to type '{ one: number; }': -!!! error TS2322: Property 'one' is optional in type 'I3' but required in type '{ one: number; }'. \ No newline at end of file +!!! error TS2323: Type 'I3' is not assignable to type '{ one: number; }'. +!!! error TS2323: Property 'one' is optional in type 'I3' but required in type '{ one: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/implementClausePrecedingExtends.errors.txt b/tests/baselines/reference/implementClausePrecedingExtends.errors.txt index 43baa8c8be7..0ded03b0808 100644 --- a/tests/baselines/reference/implementClausePrecedingExtends.errors.txt +++ b/tests/baselines/reference/implementClausePrecedingExtends.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/implementClausePrecedingExtends.ts(2,22): error TS1005: '{' expected. tests/cases/compiler/implementClausePrecedingExtends.ts(2,32): error TS1005: ';' expected. -tests/cases/compiler/implementClausePrecedingExtends.ts(2,7): error TS2421: Class 'D' incorrectly implements interface 'C': +tests/cases/compiler/implementClausePrecedingExtends.ts(2,7): error TS2420: Class 'D' incorrectly implements interface 'C'. Property 'foo' is missing in type 'D'. @@ -12,5 +12,5 @@ tests/cases/compiler/implementClausePrecedingExtends.ts(2,7): error TS2421: Clas ~ !!! error TS1005: ';' expected. ~ -!!! error TS2421: Class 'D' incorrectly implements interface 'C': -!!! error TS2421: Property 'foo' is missing in type 'D'. \ No newline at end of file +!!! error TS2420: Class 'D' incorrectly implements interface 'C'. +!!! error TS2420: Property 'foo' is missing in type 'D'. \ No newline at end of file diff --git a/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt b/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt index 4c2803b76ac..7a128b87764 100644 --- a/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt +++ b/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/implementGenericWithMismatchedTypes.ts(7,7): error TS2421: Class 'C' incorrectly implements interface 'IFoo': - Types of property 'foo' are incompatible: - Type '(x: string) => number' is not assignable to type '(x: T) => T': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/compiler/implementGenericWithMismatchedTypes.ts(7,7): error TS2420: Class 'C' incorrectly implements interface 'IFoo'. + Types of property 'foo' are incompatible. + Type '(x: string) => number' is not assignable to type '(x: T) => T'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'T'. -tests/cases/compiler/implementGenericWithMismatchedTypes.ts(16,7): error TS2421: Class 'C2' incorrectly implements interface 'IFoo2': - Types of property 'foo' are incompatible: - Type '(x: Tstring) => number' is not assignable to type '(x: T) => T': +tests/cases/compiler/implementGenericWithMismatchedTypes.ts(16,7): error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'. + Types of property 'foo' are incompatible. + Type '(x: Tstring) => number' is not assignable to type '(x: T) => T'. Type 'number' is not assignable to type 'T'. @@ -18,11 +18,11 @@ tests/cases/compiler/implementGenericWithMismatchedTypes.ts(16,7): error TS2421: } class C implements IFoo { // error ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'IFoo': -!!! error TS2421: Types of property 'foo' are incompatible: -!!! error TS2421: Type '(x: string) => number' is not assignable to type '(x: T) => T': -!!! error TS2421: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2421: Type 'string' is not assignable to type 'T'. +!!! error TS2420: Class 'C' incorrectly implements interface 'IFoo'. +!!! error TS2420: Types of property 'foo' are incompatible. +!!! error TS2420: Type '(x: string) => number' is not assignable to type '(x: T) => T'. +!!! error TS2420: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2420: Type 'string' is not assignable to type 'T'. foo(x: string): number { return null; } @@ -33,10 +33,10 @@ tests/cases/compiler/implementGenericWithMismatchedTypes.ts(16,7): error TS2421: } class C2 implements IFoo2 { // error ~~ -!!! error TS2421: Class 'C2' incorrectly implements interface 'IFoo2': -!!! error TS2421: Types of property 'foo' are incompatible: -!!! error TS2421: Type '(x: Tstring) => number' is not assignable to type '(x: T) => T': -!!! error TS2421: Type 'number' is not assignable to type 'T'. +!!! error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'. +!!! error TS2420: Types of property 'foo' are incompatible. +!!! error TS2420: Type '(x: Tstring) => number' is not assignable to type '(x: T) => T'. +!!! error TS2420: Type 'number' is not assignable to type 'T'. foo(x: Tstring): number { return null; } diff --git a/tests/baselines/reference/implementPublicPropertyAsPrivate.errors.txt b/tests/baselines/reference/implementPublicPropertyAsPrivate.errors.txt index c445403c3fa..75d9fdcce34 100644 --- a/tests/baselines/reference/implementPublicPropertyAsPrivate.errors.txt +++ b/tests/baselines/reference/implementPublicPropertyAsPrivate.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/implementPublicPropertyAsPrivate.ts(4,7): error TS2421: Class 'C' incorrectly implements interface 'I': +tests/cases/compiler/implementPublicPropertyAsPrivate.ts(4,7): error TS2420: Class 'C' incorrectly implements interface 'I'. Property 'x' is private in type 'C' but not in type 'I'. @@ -8,7 +8,7 @@ tests/cases/compiler/implementPublicPropertyAsPrivate.ts(4,7): error TS2421: Cla } class C implements I { ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'I': -!!! error TS2421: Property 'x' is private in type 'C' but not in type 'I'. +!!! error TS2420: Class 'C' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is private in type 'C' but not in type 'I'. private x = 0; // should raise error at class decl } \ No newline at end of file diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.errors.txt b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.errors.txt index ab12cb9708b..a38c477f111 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.errors.txt +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(9,7): error TS2421: Class 'Bar' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(9,7): error TS2420: Class 'Bar' incorrectly implements interface 'I'. Property 'y' is missing in type 'Bar'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(12,7): error TS2421: Class 'Bar2' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(12,7): error TS2420: Class 'Bar2' incorrectly implements interface 'I'. Property 'x' is missing in type 'Bar2'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(16,7): error TS2421: Class 'Bar3' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(16,7): error TS2420: Class 'Bar3' incorrectly implements interface 'I'. Property 'x' is private in type 'I' but not in type 'Bar3'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(21,7): error TS2421: Class 'Bar4' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(21,7): error TS2420: Class 'Bar4' incorrectly implements interface 'I'. Types have separate declarations of a private property 'x'. @@ -19,29 +19,29 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte class Bar implements I { // error ~~~ -!!! error TS2421: Class 'Bar' incorrectly implements interface 'I': -!!! error TS2421: Property 'y' is missing in type 'Bar'. +!!! error TS2420: Class 'Bar' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar'. } class Bar2 implements I { // error ~~~~ -!!! error TS2421: Class 'Bar2' incorrectly implements interface 'I': -!!! error TS2421: Property 'x' is missing in type 'Bar2'. +!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is missing in type 'Bar2'. y: number; } class Bar3 implements I { // error ~~~~ -!!! error TS2421: Class 'Bar3' incorrectly implements interface 'I': -!!! error TS2421: Property 'x' is private in type 'I' but not in type 'Bar3'. +!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is private in type 'I' but not in type 'Bar3'. x: string; y: number; } class Bar4 implements I { // error ~~~~ -!!! error TS2421: Class 'Bar4' incorrectly implements interface 'I': -!!! error TS2421: Types have separate declarations of a private property 'x'. +!!! error TS2420: Class 'Bar4' incorrectly implements interface 'I'. +!!! error TS2420: Types have separate declarations of a private property 'x'. private x: string; y: number; } \ No newline at end of file diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt index 53fc5c54bee..c6c0be3896c 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt @@ -1,30 +1,30 @@ -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(13,7): error TS2416: Class 'Bar2' incorrectly extends base class 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(13,7): error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. Property 'x' is private in type 'Foo' but not in type 'Bar2'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(13,7): error TS2421: Class 'Bar2' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(13,7): error TS2420: Class 'Bar2' incorrectly implements interface 'I'. Property 'x' is private in type 'I' but not in type 'Bar2'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(18,7): error TS2416: Class 'Bar3' incorrectly extends base class 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(18,7): error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. Types have separate declarations of a private property 'x'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(18,7): error TS2421: Class 'Bar3' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(18,7): error TS2420: Class 'Bar3' incorrectly implements interface 'I'. Types have separate declarations of a private property 'x'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(42,11): error TS2416: Class 'Bar2' incorrectly extends base class 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(42,11): error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. Property 'x' is private in type 'Foo' but not in type 'Bar2'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(42,11): error TS2421: Class 'Bar2' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(42,11): error TS2420: Class 'Bar2' incorrectly implements interface 'I'. Property 'z' is missing in type 'Bar2'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(47,11): error TS2416: Class 'Bar3' incorrectly extends base class 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(47,11): error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. Types have separate declarations of a private property 'x'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(47,11): error TS2421: Class 'Bar3' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(47,11): error TS2420: Class 'Bar3' incorrectly implements interface 'I'. Property 'z' is missing in type 'Bar3'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(67,11): error TS2421: Class 'Bar' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(67,11): error TS2420: Class 'Bar' incorrectly implements interface 'I'. Property 'y' is missing in type 'Bar'. tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(73,14): error TS2341: Property 'x' is private and only accessible within class 'Foo'. tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(74,16): error TS2339: Property 'y' does not exist on type 'Bar'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(76,11): error TS2416: Class 'Bar2' incorrectly extends base class 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(76,11): error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. Property 'x' is private in type 'Foo' but not in type 'Bar2'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(76,11): error TS2421: Class 'Bar2' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(76,11): error TS2420: Class 'Bar2' incorrectly implements interface 'I'. Property 'y' is missing in type 'Bar2'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(81,11): error TS2416: Class 'Bar3' incorrectly extends base class 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(81,11): error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. Types have separate declarations of a private property 'x'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(81,11): error TS2421: Class 'Bar3' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(81,11): error TS2420: Class 'Bar3' incorrectly implements interface 'I'. Property 'y' is missing in type 'Bar3'. @@ -43,22 +43,22 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte class Bar2 extends Foo implements I { // error ~~~~ -!!! error TS2416: Class 'Bar2' incorrectly extends base class 'Foo': -!!! error TS2416: Property 'x' is private in type 'Foo' but not in type 'Bar2'. +!!! error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. +!!! error TS2415: Property 'x' is private in type 'Foo' but not in type 'Bar2'. ~~~~ -!!! error TS2421: Class 'Bar2' incorrectly implements interface 'I': -!!! error TS2421: Property 'x' is private in type 'I' but not in type 'Bar2'. +!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is private in type 'I' but not in type 'Bar2'. x: string; y: number; } class Bar3 extends Foo implements I { // error ~~~~ -!!! error TS2416: Class 'Bar3' incorrectly extends base class 'Foo': -!!! error TS2416: Types have separate declarations of a private property 'x'. +!!! error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. +!!! error TS2415: Types have separate declarations of a private property 'x'. ~~~~ -!!! error TS2421: Class 'Bar3' incorrectly implements interface 'I': -!!! error TS2421: Types have separate declarations of a private property 'x'. +!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'. +!!! error TS2420: Types have separate declarations of a private property 'x'. private x: string; y: number; } @@ -84,22 +84,22 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte class Bar2 extends Foo implements I { // error ~~~~ -!!! error TS2416: Class 'Bar2' incorrectly extends base class 'Foo': -!!! error TS2416: Property 'x' is private in type 'Foo' but not in type 'Bar2'. +!!! error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. +!!! error TS2415: Property 'x' is private in type 'Foo' but not in type 'Bar2'. ~~~~ -!!! error TS2421: Class 'Bar2' incorrectly implements interface 'I': -!!! error TS2421: Property 'z' is missing in type 'Bar2'. +!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'. +!!! error TS2420: Property 'z' is missing in type 'Bar2'. x: string; y: number; } class Bar3 extends Foo implements I { // error ~~~~ -!!! error TS2416: Class 'Bar3' incorrectly extends base class 'Foo': -!!! error TS2416: Types have separate declarations of a private property 'x'. +!!! error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. +!!! error TS2415: Types have separate declarations of a private property 'x'. ~~~~ -!!! error TS2421: Class 'Bar3' incorrectly implements interface 'I': -!!! error TS2421: Property 'z' is missing in type 'Bar3'. +!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'. +!!! error TS2420: Property 'z' is missing in type 'Bar3'. private x: string; y: number; } @@ -121,8 +121,8 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte class Bar extends Foo implements I { // error ~~~ -!!! error TS2421: Class 'Bar' incorrectly implements interface 'I': -!!! error TS2421: Property 'y' is missing in type 'Bar'. +!!! error TS2420: Class 'Bar' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar'. z: number; } @@ -137,22 +137,22 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte class Bar2 extends Foo implements I { // error ~~~~ -!!! error TS2416: Class 'Bar2' incorrectly extends base class 'Foo': -!!! error TS2416: Property 'x' is private in type 'Foo' but not in type 'Bar2'. +!!! error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. +!!! error TS2415: Property 'x' is private in type 'Foo' but not in type 'Bar2'. ~~~~ -!!! error TS2421: Class 'Bar2' incorrectly implements interface 'I': -!!! error TS2421: Property 'y' is missing in type 'Bar2'. +!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar2'. x: string; z: number; } class Bar3 extends Foo implements I { // error ~~~~ -!!! error TS2416: Class 'Bar3' incorrectly extends base class 'Foo': -!!! error TS2416: Types have separate declarations of a private property 'x'. +!!! error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. +!!! error TS2415: Types have separate declarations of a private property 'x'. ~~~~ -!!! error TS2421: Class 'Bar3' incorrectly implements interface 'I': -!!! error TS2421: Property 'y' is missing in type 'Bar3'. +!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar3'. private x: string; z: number; } diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.errors.txt b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.errors.txt index fc7cbbed97a..3835408ab05 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.errors.txt +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(9,7): error TS2421: Class 'Bar' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(9,7): error TS2420: Class 'Bar' incorrectly implements interface 'I'. Property 'y' is missing in type 'Bar'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(12,7): error TS2421: Class 'Bar2' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(12,7): error TS2420: Class 'Bar2' incorrectly implements interface 'I'. Property 'x' is missing in type 'Bar2'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(16,7): error TS2421: Class 'Bar3' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(16,7): error TS2420: Class 'Bar3' incorrectly implements interface 'I'. Property 'x' is protected but type 'Bar3' is not a class derived from 'Foo'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(21,7): error TS2421: Class 'Bar4' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(21,7): error TS2420: Class 'Bar4' incorrectly implements interface 'I'. Property 'x' is protected but type 'Bar4' is not a class derived from 'Foo'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(26,7): error TS2421: Class 'Bar5' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(26,7): error TS2420: Class 'Bar5' incorrectly implements interface 'I'. Property 'y' is missing in type 'Bar5'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(29,7): error TS2421: Class 'Bar6' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(29,7): error TS2420: Class 'Bar6' incorrectly implements interface 'I'. Property 'y' is protected in type 'Bar6' but public in type 'I'. @@ -23,43 +23,43 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte class Bar implements I { // error ~~~ -!!! error TS2421: Class 'Bar' incorrectly implements interface 'I': -!!! error TS2421: Property 'y' is missing in type 'Bar'. +!!! error TS2420: Class 'Bar' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar'. } class Bar2 implements I { // error ~~~~ -!!! error TS2421: Class 'Bar2' incorrectly implements interface 'I': -!!! error TS2421: Property 'x' is missing in type 'Bar2'. +!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is missing in type 'Bar2'. y: number; } class Bar3 implements I { // error ~~~~ -!!! error TS2421: Class 'Bar3' incorrectly implements interface 'I': -!!! error TS2421: Property 'x' is protected but type 'Bar3' is not a class derived from 'Foo'. +!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is protected but type 'Bar3' is not a class derived from 'Foo'. x: string; y: number; } class Bar4 implements I { // error ~~~~ -!!! error TS2421: Class 'Bar4' incorrectly implements interface 'I': -!!! error TS2421: Property 'x' is protected but type 'Bar4' is not a class derived from 'Foo'. +!!! error TS2420: Class 'Bar4' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is protected but type 'Bar4' is not a class derived from 'Foo'. protected x: string; y: number; } class Bar5 extends Foo implements I { // error ~~~~ -!!! error TS2421: Class 'Bar5' incorrectly implements interface 'I': -!!! error TS2421: Property 'y' is missing in type 'Bar5'. +!!! error TS2420: Class 'Bar5' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar5'. } class Bar6 extends Foo implements I { // error ~~~~ -!!! error TS2421: Class 'Bar6' incorrectly implements interface 'I': -!!! error TS2421: Property 'y' is protected in type 'Bar6' but public in type 'I'. +!!! error TS2420: Class 'Bar6' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is protected in type 'Bar6' but public in type 'I'. protected y: number; } diff --git a/tests/baselines/reference/incompatibleGenericTypes.errors.txt b/tests/baselines/reference/incompatibleGenericTypes.errors.txt index 13aa9ea2e25..04c00f4fa20 100644 --- a/tests/baselines/reference/incompatibleGenericTypes.errors.txt +++ b/tests/baselines/reference/incompatibleGenericTypes.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/incompatibleGenericTypes.ts(10,5): error TS2322: Type 'I1' is not assignable to type 'I1': +tests/cases/compiler/incompatibleGenericTypes.ts(10,5): error TS2323: Type 'I1' is not assignable to type 'I1'. Type 'boolean' is not assignable to type 'number'. @@ -14,5 +14,5 @@ tests/cases/compiler/incompatibleGenericTypes.ts(10,5): error TS2322: Type 'I1 = v1; ~~ -!!! error TS2322: Type 'I1' is not assignable to type 'I1': -!!! error TS2322: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2323: Type 'I1' is not assignable to type 'I1'. +!!! error TS2323: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index 6f7fd89d79e..9b66a6e8c64 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -1,23 +1,23 @@ -tests/cases/compiler/incompatibleTypes.ts(5,7): error TS2421: Class 'C1' incorrectly implements interface 'IFoo1': - Types of property 'p1' are incompatible: - Type '() => string' is not assignable to type '() => number': +tests/cases/compiler/incompatibleTypes.ts(5,7): error TS2420: Class 'C1' incorrectly implements interface 'IFoo1'. + Types of property 'p1' are incompatible. + Type '() => string' is not assignable to type '() => number'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/incompatibleTypes.ts(15,7): error TS2421: Class 'C2' incorrectly implements interface 'IFoo2': - Types of property 'p1' are incompatible: - Type '(n: number) => number' is not assignable to type '(s: string) => number': - Types of parameters 'n' and 's' are incompatible: +tests/cases/compiler/incompatibleTypes.ts(15,7): error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'. + Types of property 'p1' are incompatible. + Type '(n: number) => number' is not assignable to type '(s: string) => number'. + Types of parameters 'n' and 's' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/incompatibleTypes.ts(25,7): error TS2421: Class 'C3' incorrectly implements interface 'IFoo3': - Types of property 'p1' are incompatible: +tests/cases/compiler/incompatibleTypes.ts(25,7): error TS2420: Class 'C3' incorrectly implements interface 'IFoo3'. + Types of property 'p1' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/incompatibleTypes.ts(33,7): error TS2421: Class 'C4' incorrectly implements interface 'IFoo4': - Types of property 'p1' are incompatible: - Type '{ c: { b: string; }; d: string; }' is not assignable to type '{ a: { a: string; }; b: string; }': +tests/cases/compiler/incompatibleTypes.ts(33,7): error TS2420: Class 'C4' incorrectly implements interface 'IFoo4'. + Types of property 'p1' are incompatible. + Type '{ c: { b: string; }; d: string; }' is not assignable to type '{ a: { a: string; }; b: string; }'. Property 'a' is missing in type '{ c: { b: string; }; d: string; }'. tests/cases/compiler/incompatibleTypes.ts(42,5): error TS2345: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. tests/cases/compiler/incompatibleTypes.ts(49,5): error TS2345: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. Property 'c' is missing in type '{ e: number; f: number; }'. -tests/cases/compiler/incompatibleTypes.ts(66,5): error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }': +tests/cases/compiler/incompatibleTypes.ts(66,5): error TS2323: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. Property 'a' is missing in type '{ e: number; f: number; }'. tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2323: Type 'number' is not assignable to type '() => string'. tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2323: Type '(a: any) => number' is not assignable to type '() => any'. @@ -30,10 +30,10 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2323: Type '(a: any) => class C1 implements IFoo1 { // incompatible on the return type ~~ -!!! error TS2421: Class 'C1' incorrectly implements interface 'IFoo1': -!!! error TS2421: Types of property 'p1' are incompatible: -!!! error TS2421: Type '() => string' is not assignable to type '() => number': -!!! error TS2421: Type 'string' is not assignable to type 'number'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'IFoo1'. +!!! error TS2420: Types of property 'p1' are incompatible. +!!! error TS2420: Type '() => string' is not assignable to type '() => number'. +!!! error TS2420: Type 'string' is not assignable to type 'number'. public p1() { return "s"; } @@ -45,11 +45,11 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2323: Type '(a: any) => class C2 implements IFoo2 { // incompatible on the param type ~~ -!!! error TS2421: Class 'C2' incorrectly implements interface 'IFoo2': -!!! error TS2421: Types of property 'p1' are incompatible: -!!! error TS2421: Type '(n: number) => number' is not assignable to type '(s: string) => number': -!!! error TS2421: Types of parameters 'n' and 's' are incompatible: -!!! error TS2421: Type 'number' is not assignable to type 'string'. +!!! error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'. +!!! error TS2420: Types of property 'p1' are incompatible. +!!! error TS2420: Type '(n: number) => number' is not assignable to type '(s: string) => number'. +!!! error TS2420: Types of parameters 'n' and 's' are incompatible. +!!! error TS2420: Type 'number' is not assignable to type 'string'. public p1(n:number) { return 0; } @@ -61,9 +61,9 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2323: Type '(a: any) => class C3 implements IFoo3 { // incompatible on the property type ~~ -!!! error TS2421: Class 'C3' incorrectly implements interface 'IFoo3': -!!! error TS2421: Types of property 'p1' are incompatible: -!!! error TS2421: Type 'number' is not assignable to type 'string'. +!!! error TS2420: Class 'C3' incorrectly implements interface 'IFoo3'. +!!! error TS2420: Types of property 'p1' are incompatible. +!!! error TS2420: Type 'number' is not assignable to type 'string'. public p1: number; } @@ -73,10 +73,10 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2323: Type '(a: any) => class C4 implements IFoo4 { // incompatible on the property type ~~ -!!! error TS2421: Class 'C4' incorrectly implements interface 'IFoo4': -!!! error TS2421: Types of property 'p1' are incompatible: -!!! error TS2421: Type '{ c: { b: string; }; d: string; }' is not assignable to type '{ a: { a: string; }; b: string; }': -!!! error TS2421: Property 'a' is missing in type '{ c: { b: string; }; d: string; }'. +!!! error TS2420: Class 'C4' incorrectly implements interface 'IFoo4'. +!!! error TS2420: Types of property 'p1' are incompatible. +!!! error TS2420: Type '{ c: { b: string; }; d: string; }' is not assignable to type '{ a: { a: string; }; b: string; }'. +!!! error TS2420: Property 'a' is missing in type '{ c: { b: string; }; d: string; }'. public p1: { c: { b: string; }; d: string; }; } @@ -116,8 +116,8 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2323: Type '(a: any) => var o1: { a: { a: string; }; b: string; } = { e: 0, f: 0 }; ~~ -!!! error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }': -!!! error TS2322: Property 'a' is missing in type '{ e: number; f: number; }'. +!!! error TS2323: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. +!!! error TS2323: Property 'a' is missing in type '{ e: number; f: number; }'. var a1 = [{ e: 0, f: 0 }, { e: 0, f: 0 }, { e: 0, g: 0 }]; diff --git a/tests/baselines/reference/indexer2.errors.txt b/tests/baselines/reference/indexer2.errors.txt index 9587bb6bb75..28020a570ed 100644 --- a/tests/baselines/reference/indexer2.errors.txt +++ b/tests/baselines/reference/indexer2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/indexer2.ts(6,25): error TS2353: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other: - Types of property 'hasOwnProperty' are incompatible: - Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean': - Types of parameters 'v' and 'objectId' are incompatible: +tests/cases/compiler/indexer2.ts(6,25): error TS2352: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other. + Types of property 'hasOwnProperty' are incompatible. + Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean'. + Types of parameters 'v' and 'objectId' are incompatible. Type 'string' is not assignable to type 'number'. @@ -13,8 +13,8 @@ tests/cases/compiler/indexer2.ts(6,25): error TS2353: Neither type '{ [x: number } var directChildrenMap = {}; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other: -!!! error TS2353: Types of property 'hasOwnProperty' are incompatible: -!!! error TS2353: Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean': -!!! error TS2353: Types of parameters 'v' and 'objectId' are incompatible: -!!! error TS2353: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2352: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other. +!!! error TS2352: Types of property 'hasOwnProperty' are incompatible. +!!! error TS2352: Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean'. +!!! error TS2352: Types of parameters 'v' and 'objectId' are incompatible. +!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/indexer2A.errors.txt b/tests/baselines/reference/indexer2A.errors.txt index 548ed5e565b..f2314c5b49b 100644 --- a/tests/baselines/reference/indexer2A.errors.txt +++ b/tests/baselines/reference/indexer2A.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/indexer2A.ts(4,5): error TS2391: Function implementation is missing or not immediately following the declaration. -tests/cases/compiler/indexer2A.ts(7,25): error TS2353: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other: - Types of property 'hasOwnProperty' are incompatible: - Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean': - Types of parameters 'v' and 'objectId' are incompatible: +tests/cases/compiler/indexer2A.ts(7,25): error TS2352: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other. + Types of property 'hasOwnProperty' are incompatible. + Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean'. + Types of parameters 'v' and 'objectId' are incompatible. Type 'string' is not assignable to type 'number'. @@ -17,8 +17,8 @@ tests/cases/compiler/indexer2A.ts(7,25): error TS2353: Neither type '{ [x: numbe } var directChildrenMap = {}; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other: -!!! error TS2353: Types of property 'hasOwnProperty' are incompatible: -!!! error TS2353: Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean': -!!! error TS2353: Types of parameters 'v' and 'objectId' are incompatible: -!!! error TS2353: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2352: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other. +!!! error TS2352: Types of property 'hasOwnProperty' are incompatible. +!!! error TS2352: Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean'. +!!! error TS2352: Types of parameters 'v' and 'objectId' are incompatible. +!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/indexerAssignability.errors.txt b/tests/baselines/reference/indexerAssignability.errors.txt index 062ddbc3c43..8f7f1c11d6c 100644 --- a/tests/baselines/reference/indexerAssignability.errors.txt +++ b/tests/baselines/reference/indexerAssignability.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/indexerAssignability.ts(5,1): error TS2322: Type '{ [x: number]: string; }' is not assignable to type '{ [x: string]: string; }': +tests/cases/compiler/indexerAssignability.ts(5,1): error TS2323: Type '{ [x: number]: string; }' is not assignable to type '{ [x: string]: string; }'. Index signature is missing in type '{ [x: number]: string; }'. -tests/cases/compiler/indexerAssignability.ts(6,1): error TS2322: Type '{}' is not assignable to type '{ [x: string]: string; }': +tests/cases/compiler/indexerAssignability.ts(6,1): error TS2323: Type '{}' is not assignable to type '{ [x: string]: string; }'. Index signature is missing in type '{}'. -tests/cases/compiler/indexerAssignability.ts(8,1): error TS2322: Type '{}' is not assignable to type '{ [x: number]: string; }': +tests/cases/compiler/indexerAssignability.ts(8,1): error TS2323: Type '{}' is not assignable to type '{ [x: number]: string; }'. Index signature is missing in type '{}'. @@ -13,16 +13,16 @@ tests/cases/compiler/indexerAssignability.ts(8,1): error TS2322: Type '{}' is no a = b; ~ -!!! error TS2322: Type '{ [x: number]: string; }' is not assignable to type '{ [x: string]: string; }': -!!! error TS2322: Index signature is missing in type '{ [x: number]: string; }'. +!!! error TS2323: Type '{ [x: number]: string; }' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2323: Index signature is missing in type '{ [x: number]: string; }'. a = c; ~ -!!! error TS2322: Type '{}' is not assignable to type '{ [x: string]: string; }': -!!! error TS2322: Index signature is missing in type '{}'. +!!! error TS2323: Type '{}' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2323: Index signature is missing in type '{}'. b = a; b = c; ~ -!!! error TS2322: Type '{}' is not assignable to type '{ [x: number]: string; }': -!!! error TS2322: Index signature is missing in type '{}'. +!!! error TS2323: Type '{}' is not assignable to type '{ [x: number]: string; }'. +!!! error TS2323: Index signature is missing in type '{}'. c = a; c = b; \ No newline at end of file diff --git a/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt b/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt index 908681ddf7a..adbc31af210 100644 --- a/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt +++ b/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts(16,1): error TS2322: Type 'OwnerList' is not assignable to type 'List': - Types of property 'data' are incompatible: +tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts(16,1): error TS2323: Type 'OwnerList' is not assignable to type 'List'. + Types of property 'data' are incompatible. Type 'List' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts(21,5): error TS2322: Type 'OwnerList' is not assignable to type 'List': - Types of property 'data' are incompatible: +tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts(21,5): error TS2323: Type 'OwnerList' is not assignable to type 'List'. + Types of property 'data' are incompatible. Type 'List' is not assignable to type 'T'. @@ -24,18 +24,18 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansion var ownerList: OwnerList; list = ownerList; ~~~~ -!!! error TS2322: Type 'OwnerList' is not assignable to type 'List': -!!! error TS2322: Types of property 'data' are incompatible: -!!! error TS2322: Type 'List' is not assignable to type 'string'. +!!! error TS2323: Type 'OwnerList' is not assignable to type 'List'. +!!! error TS2323: Types of property 'data' are incompatible. +!!! error TS2323: Type 'List' is not assignable to type 'string'. function other(x: T) { var list: List; var ownerList: OwnerList; list = ownerList; ~~~~ -!!! error TS2322: Type 'OwnerList' is not assignable to type 'List': -!!! error TS2322: Types of property 'data' are incompatible: -!!! error TS2322: Type 'List' is not assignable to type 'T'. +!!! error TS2323: Type 'OwnerList' is not assignable to type 'List'. +!!! error TS2323: Types of property 'data' are incompatible. +!!! error TS2323: Type 'List' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.errors.txt b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.errors.txt index 71a9f74e77a..555349cc251 100644 --- a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.errors.txt +++ b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/inheritSameNamePrivatePropertiesFromDifferentOrigins.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +tests/cases/compiler/inheritSameNamePrivatePropertiesFromDifferentOrigins.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. Named properties 'x' of types 'C' and 'C2' are not identical. @@ -13,7 +13,7 @@ tests/cases/compiler/inheritSameNamePrivatePropertiesFromDifferentOrigins.ts(9,1 interface A extends C, C2 { // error ~ -!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. !!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical. y: string; } \ No newline at end of file diff --git a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.errors.txt b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.errors.txt index 8de311e230a..3f9c4a3bae0 100644 --- a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.errors.txt +++ b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/inheritSameNamePropertiesWithDifferentOptionality.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +tests/cases/compiler/inheritSameNamePropertiesWithDifferentOptionality.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. Named properties 'x' of types 'C' and 'C2' are not identical. @@ -13,7 +13,7 @@ tests/cases/compiler/inheritSameNamePropertiesWithDifferentOptionality.ts(9,11): interface A extends C, C2 { // error ~ -!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. !!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical. y: string; } \ No newline at end of file diff --git a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.errors.txt b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.errors.txt index a6671492277..9864b4a4792 100644 --- a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.errors.txt +++ b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/inheritSameNamePropertiesWithDifferentVisibility.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +tests/cases/compiler/inheritSameNamePropertiesWithDifferentVisibility.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. Named properties 'x' of types 'C' and 'C2' are not identical. @@ -13,7 +13,7 @@ tests/cases/compiler/inheritSameNamePropertiesWithDifferentVisibility.ts(9,11): interface A extends C, C2 { // error ~ -!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. !!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical. y: string; } \ No newline at end of file diff --git a/tests/baselines/reference/inheritance.errors.txt b/tests/baselines/reference/inheritance.errors.txt index 4811357b6d5..c667e8b001e 100644 --- a/tests/baselines/reference/inheritance.errors.txt +++ b/tests/baselines/reference/inheritance.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/inheritance.ts(30,7): error TS2416: Class 'Baad' incorrectly extends base class 'Good': - Types of property 'g' are incompatible: +tests/cases/compiler/inheritance.ts(30,7): error TS2415: Class 'Baad' incorrectly extends base class 'Good'. + Types of property 'g' are incompatible. Type '(n: number) => number' is not assignable to type '() => number'. tests/cases/compiler/inheritance.ts(31,12): error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. @@ -36,9 +36,9 @@ tests/cases/compiler/inheritance.ts(31,12): error TS2425: Class 'Good' defines i class Baad extends Good { ~~~~ -!!! error TS2416: Class 'Baad' incorrectly extends base class 'Good': -!!! error TS2416: Types of property 'g' are incompatible: -!!! error TS2416: Type '(n: number) => number' is not assignable to type '() => number'. +!!! error TS2415: Class 'Baad' incorrectly extends base class 'Good'. +!!! error TS2415: Types of property 'g' are incompatible. +!!! error TS2415: Type '(n: number) => number' is not assignable to type '() => number'. public f(): number { return 0; } ~ !!! error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. diff --git a/tests/baselines/reference/inheritance1.errors.txt b/tests/baselines/reference/inheritance1.errors.txt index 0d2f6a72bfd..65cba48d34e 100644 --- a/tests/baselines/reference/inheritance1.errors.txt +++ b/tests/baselines/reference/inheritance1.errors.txt @@ -1,24 +1,24 @@ -tests/cases/compiler/inheritance1.ts(14,7): error TS2421: Class 'ImageBase' incorrectly implements interface 'SelectableControl': +tests/cases/compiler/inheritance1.ts(14,7): error TS2420: Class 'ImageBase' incorrectly implements interface 'SelectableControl'. Property 'select' is missing in type 'ImageBase'. -tests/cases/compiler/inheritance1.ts(18,7): error TS2421: Class 'Locations' incorrectly implements interface 'SelectableControl': +tests/cases/compiler/inheritance1.ts(18,7): error TS2420: Class 'Locations' incorrectly implements interface 'SelectableControl'. Property 'state' is missing in type 'Locations'. -tests/cases/compiler/inheritance1.ts(31,1): error TS2322: Type 'Control' is not assignable to type 'Button': +tests/cases/compiler/inheritance1.ts(31,1): error TS2323: Type 'Control' is not assignable to type 'Button'. Property 'select' is missing in type 'Control'. -tests/cases/compiler/inheritance1.ts(37,1): error TS2322: Type 'Control' is not assignable to type 'TextBox': +tests/cases/compiler/inheritance1.ts(37,1): error TS2323: Type 'Control' is not assignable to type 'TextBox'. Property 'select' is missing in type 'Control'. tests/cases/compiler/inheritance1.ts(40,1): error TS2323: Type 'ImageBase' is not assignable to type 'SelectableControl'. -tests/cases/compiler/inheritance1.ts(46,1): error TS2322: Type 'Image1' is not assignable to type 'SelectableControl': +tests/cases/compiler/inheritance1.ts(46,1): error TS2323: Type 'Image1' is not assignable to type 'SelectableControl'. Property 'select' is missing in type 'Image1'. tests/cases/compiler/inheritance1.ts(52,1): error TS2323: Type 'Locations' is not assignable to type 'SelectableControl'. -tests/cases/compiler/inheritance1.ts(53,1): error TS2322: Type 'Locations' is not assignable to type 'Control': +tests/cases/compiler/inheritance1.ts(53,1): error TS2323: Type 'Locations' is not assignable to type 'Control'. Property 'state' is missing in type 'Locations'. -tests/cases/compiler/inheritance1.ts(55,1): error TS2322: Type 'Control' is not assignable to type 'Locations': +tests/cases/compiler/inheritance1.ts(55,1): error TS2323: Type 'Control' is not assignable to type 'Locations'. Property 'select' is missing in type 'Control'. -tests/cases/compiler/inheritance1.ts(58,1): error TS2322: Type 'Locations1' is not assignable to type 'SelectableControl': +tests/cases/compiler/inheritance1.ts(58,1): error TS2323: Type 'Locations1' is not assignable to type 'SelectableControl'. Property 'state' is missing in type 'Locations1'. -tests/cases/compiler/inheritance1.ts(59,1): error TS2322: Type 'Locations1' is not assignable to type 'Control': +tests/cases/compiler/inheritance1.ts(59,1): error TS2323: Type 'Locations1' is not assignable to type 'Control'. Property 'state' is missing in type 'Locations1'. -tests/cases/compiler/inheritance1.ts(61,1): error TS2322: Type 'Control' is not assignable to type 'Locations1': +tests/cases/compiler/inheritance1.ts(61,1): error TS2323: Type 'Control' is not assignable to type 'Locations1'. Property 'select' is missing in type 'Control'. @@ -38,15 +38,15 @@ tests/cases/compiler/inheritance1.ts(61,1): error TS2322: Type 'Control' is not } class ImageBase extends Control implements SelectableControl{ ~~~~~~~~~ -!!! error TS2421: Class 'ImageBase' incorrectly implements interface 'SelectableControl': -!!! error TS2421: Property 'select' is missing in type 'ImageBase'. +!!! error TS2420: Class 'ImageBase' incorrectly implements interface 'SelectableControl'. +!!! error TS2420: Property 'select' is missing in type 'ImageBase'. } class Image1 extends Control { } class Locations implements SelectableControl { ~~~~~~~~~ -!!! error TS2421: Class 'Locations' incorrectly implements interface 'SelectableControl': -!!! error TS2421: Property 'state' is missing in type 'Locations'. +!!! error TS2420: Class 'Locations' incorrectly implements interface 'SelectableControl'. +!!! error TS2420: Property 'state' is missing in type 'Locations'. select() { } } class Locations1 { @@ -61,8 +61,8 @@ tests/cases/compiler/inheritance1.ts(61,1): error TS2322: Type 'Control' is not b = sc; b = c; ~ -!!! error TS2322: Type 'Control' is not assignable to type 'Button': -!!! error TS2322: Property 'select' is missing in type 'Control'. +!!! error TS2323: Type 'Control' is not assignable to type 'Button'. +!!! error TS2323: Property 'select' is missing in type 'Control'. var t: TextBox; sc = t; @@ -70,8 +70,8 @@ tests/cases/compiler/inheritance1.ts(61,1): error TS2322: Type 'Control' is not t = sc; t = c; ~ -!!! error TS2322: Type 'Control' is not assignable to type 'TextBox': -!!! error TS2322: Property 'select' is missing in type 'Control'. +!!! error TS2323: Type 'Control' is not assignable to type 'TextBox'. +!!! error TS2323: Property 'select' is missing in type 'Control'. var i: ImageBase; sc = i; @@ -84,8 +84,8 @@ tests/cases/compiler/inheritance1.ts(61,1): error TS2322: Type 'Control' is not var i1: Image1; sc = i1; ~~ -!!! error TS2322: Type 'Image1' is not assignable to type 'SelectableControl': -!!! error TS2322: Property 'select' is missing in type 'Image1'. +!!! error TS2323: Type 'Image1' is not assignable to type 'SelectableControl'. +!!! error TS2323: Property 'select' is missing in type 'Image1'. c = i1; i1 = sc; i1 = c; @@ -96,25 +96,25 @@ tests/cases/compiler/inheritance1.ts(61,1): error TS2322: Type 'Control' is not !!! error TS2323: Type 'Locations' is not assignable to type 'SelectableControl'. c = l; ~ -!!! error TS2322: Type 'Locations' is not assignable to type 'Control': -!!! error TS2322: Property 'state' is missing in type 'Locations'. +!!! error TS2323: Type 'Locations' is not assignable to type 'Control'. +!!! error TS2323: Property 'state' is missing in type 'Locations'. l = sc; l = c; ~ -!!! error TS2322: Type 'Control' is not assignable to type 'Locations': -!!! error TS2322: Property 'select' is missing in type 'Control'. +!!! error TS2323: Type 'Control' is not assignable to type 'Locations'. +!!! error TS2323: Property 'select' is missing in type 'Control'. var l1: Locations1; sc = l1; ~~ -!!! error TS2322: Type 'Locations1' is not assignable to type 'SelectableControl': -!!! error TS2322: Property 'state' is missing in type 'Locations1'. +!!! error TS2323: Type 'Locations1' is not assignable to type 'SelectableControl'. +!!! error TS2323: Property 'state' is missing in type 'Locations1'. c = l1; ~ -!!! error TS2322: Type 'Locations1' is not assignable to type 'Control': -!!! error TS2322: Property 'state' is missing in type 'Locations1'. +!!! error TS2323: Type 'Locations1' is not assignable to type 'Control'. +!!! error TS2323: Property 'state' is missing in type 'Locations1'. l1 = sc; l1 = c; ~~ -!!! error TS2322: Type 'Control' is not assignable to type 'Locations1': -!!! error TS2322: Property 'select' is missing in type 'Control'. \ No newline at end of file +!!! error TS2323: Type 'Control' is not assignable to type 'Locations1'. +!!! error TS2323: Property 'select' is missing in type 'Control'. \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.errors.txt b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.errors.txt index 8bcef0e5a14..84a04107008 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.errors.txt +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/inheritanceGrandParentPrivateMemberCollision.ts(7,7): error TS2416: Class 'C' incorrectly extends base class 'B': +tests/cases/compiler/inheritanceGrandParentPrivateMemberCollision.ts(7,7): error TS2415: Class 'C' incorrectly extends base class 'B'. Types have separate declarations of a private property 'myMethod'. @@ -11,8 +11,8 @@ tests/cases/compiler/inheritanceGrandParentPrivateMemberCollision.ts(7,7): error class C extends B { ~ -!!! error TS2416: Class 'C' incorrectly extends base class 'B': -!!! error TS2416: Types have separate declarations of a private property 'myMethod'. +!!! error TS2415: Class 'C' incorrectly extends base class 'B'. +!!! error TS2415: Types have separate declarations of a private property 'myMethod'. private myMethod() { } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.errors.txt b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.errors.txt index 7676029fb8b..7486fbc6e8f 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.errors.txt +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.ts(7,7): error TS2416: Class 'C' incorrectly extends base class 'B': +tests/cases/compiler/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.ts(7,7): error TS2415: Class 'C' incorrectly extends base class 'B'. Property 'myMethod' is private in type 'B' but not in type 'C'. @@ -11,8 +11,8 @@ tests/cases/compiler/inheritanceGrandParentPrivateMemberCollisionWithPublicMembe class C extends B { ~ -!!! error TS2416: Class 'C' incorrectly extends base class 'B': -!!! error TS2416: Property 'myMethod' is private in type 'B' but not in type 'C'. +!!! error TS2415: Class 'C' incorrectly extends base class 'B'. +!!! error TS2415: Property 'myMethod' is private in type 'B' but not in type 'C'. public myMethod() { } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.errors.txt b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.errors.txt index c5d41868fab..1ef0d8c0cdb 100644 --- a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.errors.txt +++ b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.ts(7,7): error TS2416: Class 'C' incorrectly extends base class 'B': +tests/cases/compiler/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.ts(7,7): error TS2415: Class 'C' incorrectly extends base class 'B'. Property 'myMethod' is private in type 'C' but not in type 'B'. @@ -11,8 +11,8 @@ tests/cases/compiler/inheritanceGrandParentPublicMemberCollisionWithPrivateMembe class C extends B { ~ -!!! error TS2416: Class 'C' incorrectly extends base class 'B': -!!! error TS2416: Property 'myMethod' is private in type 'C' but not in type 'B'. +!!! error TS2415: Class 'C' incorrectly extends base class 'B'. +!!! error TS2415: Property 'myMethod' is private in type 'C' but not in type 'B'. private myMethod() { } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt index 243bcecb57d..54f5fcc2a34 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(11,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(7,7): error TS2416: Class 'b' incorrectly extends base class 'a': - Types of property 'x' are incompatible: +tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(7,7): error TS2415: Class 'b' incorrectly extends base class 'a'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type '() => string'. tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(8,9): error TS2423: Class 'a' defines instance member function 'x', but extended class 'b' defines it as instance member accessor. @@ -15,9 +15,9 @@ tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(8,9): error TS class b extends a { ~ -!!! error TS2416: Class 'b' incorrectly extends base class 'a': -!!! error TS2416: Types of property 'x' are incompatible: -!!! error TS2416: Type 'string' is not assignable to type '() => string'. +!!! error TS2415: Class 'b' incorrectly extends base class 'a'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type '() => string'. get x() { ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt index 3208de26bd4..283e7ce3f18 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts(10,7): error TS2416: Class 'b' incorrectly extends base class 'a': - Types of property 'x' are incompatible: +tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts(10,7): error TS2415: Class 'b' incorrectly extends base class 'a'. + Types of property 'x' are incompatible. Type '() => string' is not assignable to type 'string'. tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts(11,5): error TS2426: Class 'a' defines instance member accessor 'x', but extended class 'b' defines it as instance member function. @@ -22,9 +22,9 @@ tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts(11,5): error TS2 class b extends a { ~ -!!! error TS2416: Class 'b' incorrectly extends base class 'a': -!!! error TS2416: Types of property 'x' are incompatible: -!!! error TS2416: Type '() => string' is not assignable to type 'string'. +!!! error TS2415: Class 'b' incorrectly extends base class 'a'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type '() => string' is not assignable to type 'string'. x() { ~ !!! error TS2426: Class 'a' defines instance member accessor 'x', but extended class 'b' defines it as instance member function. diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt index eb8b181c1fd..026c2b51ac9 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(7,7): error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': - Types of property 'x' are incompatible: +tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(7,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type '() => string'. @@ -14,9 +14,9 @@ tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(7,7): error TS class b extends a { ~ -!!! error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': -!!! error TS2418: Types of property 'x' are incompatible: -!!! error TS2418: Type 'string' is not assignable to type '() => string'. +!!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. +!!! error TS2417: Types of property 'x' are incompatible. +!!! error TS2417: Type 'string' is not assignable to type '() => string'. static get x() { ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.errors.txt index 46e079217b8..cfe05da8ea4 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.errors.txt +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/inheritanceStaticFuncOverridingAccessor.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inheritanceStaticFuncOverridingAccessor.ts(5,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/inheritanceStaticFuncOverridingAccessor.ts(10,7): error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': - Types of property 'x' are incompatible: +tests/cases/compiler/inheritanceStaticFuncOverridingAccessor.ts(10,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. + Types of property 'x' are incompatible. Type '() => string' is not assignable to type 'string'. @@ -21,9 +21,9 @@ tests/cases/compiler/inheritanceStaticFuncOverridingAccessor.ts(10,7): error TS2 class b extends a { ~ -!!! error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': -!!! error TS2418: Types of property 'x' are incompatible: -!!! error TS2418: Type '() => string' is not assignable to type 'string'. +!!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. +!!! error TS2417: Types of property 'x' are incompatible. +!!! error TS2417: Type '() => string' is not assignable to type 'string'. static x() { return "20"; } diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.errors.txt b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.errors.txt index 3ecc7a44522..61edfe7fc64 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.errors.txt +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/inheritanceStaticFuncOverridingProperty.ts(5,7): error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': - Types of property 'x' are incompatible: +tests/cases/compiler/inheritanceStaticFuncOverridingProperty.ts(5,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. + Types of property 'x' are incompatible. Type '() => string' is not assignable to type 'string'. @@ -10,9 +10,9 @@ tests/cases/compiler/inheritanceStaticFuncOverridingProperty.ts(5,7): error TS24 class b extends a { ~ -!!! error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': -!!! error TS2418: Types of property 'x' are incompatible: -!!! error TS2418: Type '() => string' is not assignable to type 'string'. +!!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. +!!! error TS2417: Types of property 'x' are incompatible. +!!! error TS2417: Type '() => string' is not assignable to type 'string'. static x() { return "20"; } diff --git a/tests/baselines/reference/inheritanceStaticMembersIncompatible.errors.txt b/tests/baselines/reference/inheritanceStaticMembersIncompatible.errors.txt index 01c276be81c..49dfd2de513 100644 --- a/tests/baselines/reference/inheritanceStaticMembersIncompatible.errors.txt +++ b/tests/baselines/reference/inheritanceStaticMembersIncompatible.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/inheritanceStaticMembersIncompatible.ts(5,7): error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': - Types of property 'x' are incompatible: +tests/cases/compiler/inheritanceStaticMembersIncompatible.ts(5,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. + Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. @@ -10,8 +10,8 @@ tests/cases/compiler/inheritanceStaticMembersIncompatible.ts(5,7): error TS2418: class b extends a { ~ -!!! error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': -!!! error TS2418: Types of property 'x' are incompatible: -!!! error TS2418: Type 'number' is not assignable to type 'string'. +!!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. +!!! error TS2417: Types of property 'x' are incompatible. +!!! error TS2417: Type 'number' is not assignable to type 'string'. static x: number; } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt index f2137aab6f0..22748fda783 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/inheritanceStaticPropertyOverridingMethod.ts(7,7): error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': - Types of property 'x' are incompatible: +tests/cases/compiler/inheritanceStaticPropertyOverridingMethod.ts(7,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type '() => string'. @@ -12,8 +12,8 @@ tests/cases/compiler/inheritanceStaticPropertyOverridingMethod.ts(7,7): error TS class b extends a { ~ -!!! error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': -!!! error TS2418: Types of property 'x' are incompatible: -!!! error TS2418: Type 'string' is not assignable to type '() => string'. +!!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. +!!! error TS2417: Types of property 'x' are incompatible. +!!! error TS2417: Type 'string' is not assignable to type '() => string'. static x: string; } \ No newline at end of file diff --git a/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt b/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt index 31816482cb5..0b7e00d95ce 100644 --- a/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt +++ b/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/inheritedModuleMembersForClodule.ts(7,7): error TS2418: Class static side 'typeof D' incorrectly extends base class static side 'typeof C': - Types of property 'foo' are incompatible: - Type '() => number' is not assignable to type '() => string': +tests/cases/compiler/inheritedModuleMembersForClodule.ts(7,7): error TS2417: Class static side 'typeof D' incorrectly extends base class static side 'typeof C'. + Types of property 'foo' are incompatible. + Type '() => number' is not assignable to type '() => string'. Type 'number' is not assignable to type 'string'. @@ -13,10 +13,10 @@ tests/cases/compiler/inheritedModuleMembersForClodule.ts(7,7): error TS2418: Cla class D extends C { ~ -!!! error TS2418: Class static side 'typeof D' incorrectly extends base class static side 'typeof C': -!!! error TS2418: Types of property 'foo' are incompatible: -!!! error TS2418: Type '() => number' is not assignable to type '() => string': -!!! error TS2418: Type 'number' is not assignable to type 'string'. +!!! error TS2417: Class static side 'typeof D' incorrectly extends base class static side 'typeof C'. +!!! error TS2417: Types of property 'foo' are incompatible. +!!! error TS2417: Type '() => number' is not assignable to type '() => string'. +!!! error TS2417: Type 'number' is not assignable to type 'string'. } module D { diff --git a/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.errors.txt b/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.errors.txt index a7861a136ca..b99efb5e157 100644 --- a/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.errors.txt +++ b/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes.ts(13,11): error TS2429: Interface 'E' incorrectly extends interface 'D': - Index signatures are incompatible: +tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes.ts(13,11): error TS2430: Interface 'E' incorrectly extends interface 'D'. + Index signatures are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes.ts(28,11): error TS2429: Interface 'E2' incorrectly extends interface 'D2': - Index signatures are incompatible: +tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes.ts(28,11): error TS2430: Interface 'E2' incorrectly extends interface 'D2'. + Index signatures are incompatible. Type 'number' is not assignable to type 'string'. @@ -21,9 +21,9 @@ tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes.ts(28,11): er } interface E extends A, D { } // error ~ -!!! error TS2429: Interface 'E' incorrectly extends interface 'D': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'E' incorrectly extends interface 'D'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. // Same tests for number indexer @@ -40,6 +40,6 @@ tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes.ts(28,11): er } interface E2 extends A2, D2 { } // error ~~ -!!! error TS2429: Interface 'E2' incorrectly extends interface 'D2': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2430: Interface 'E2' incorrectly extends interface 'D2'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt index 06d2d76a6e1..4a52cbeecfc 100644 --- a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt +++ b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/instanceMemberAssignsToClassPrototype.ts(7,9): error TS2322: Type '() => void' is not assignable to type '(x: number) => number': +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/instanceMemberAssignsToClassPrototype.ts(7,9): error TS2323: Type '() => void' is not assignable to type '(x: number) => number'. Type 'void' is not assignable to type 'number'. @@ -11,8 +11,8 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclara bar(x: number): number { C.prototype.bar = () => { } // error ~~~~~~~~~~~~~~~ -!!! error TS2322: Type '() => void' is not assignable to type '(x: number) => number': -!!! error TS2322: Type 'void' is not assignable to type 'number'. +!!! error TS2323: Type '() => void' is not assignable to type '(x: number) => number'. +!!! error TS2323: Type 'void' is not assignable to type 'number'. C.prototype.bar = (x) => x; // ok C.prototype.bar = (x: number) => 1; // ok return 1; diff --git a/tests/baselines/reference/instanceSubtypeCheck2.errors.txt b/tests/baselines/reference/instanceSubtypeCheck2.errors.txt index dab3c0279bc..ba93c2ef127 100644 --- a/tests/baselines/reference/instanceSubtypeCheck2.errors.txt +++ b/tests/baselines/reference/instanceSubtypeCheck2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/instanceSubtypeCheck2.ts(5,7): error TS2416: Class 'C2' incorrectly extends base class 'C1': - Types of property 'x' are incompatible: - Type 'string' is not assignable to type 'C2': +tests/cases/compiler/instanceSubtypeCheck2.ts(5,7): error TS2415: Class 'C2' incorrectly extends base class 'C1'. + Types of property 'x' are incompatible. + Type 'string' is not assignable to type 'C2'. Property 'x' is missing in type 'String'. @@ -11,9 +11,9 @@ tests/cases/compiler/instanceSubtypeCheck2.ts(5,7): error TS2416: Class 'C2' class C2 extends C1 { ~~ -!!! error TS2416: Class 'C2' incorrectly extends base class 'C1': -!!! error TS2416: Types of property 'x' are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'C2': -!!! error TS2416: Property 'x' is missing in type 'String'. +!!! error TS2415: Class 'C2' incorrectly extends base class 'C1'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'C2'. +!!! error TS2415: Property 'x' is missing in type 'String'. x: string } \ No newline at end of file diff --git a/tests/baselines/reference/intTypeCheck.errors.txt b/tests/baselines/reference/intTypeCheck.errors.txt index 6fdf7ea2aa8..01235160e2f 100644 --- a/tests/baselines/reference/intTypeCheck.errors.txt +++ b/tests/baselines/reference/intTypeCheck.errors.txt @@ -13,14 +13,14 @@ tests/cases/compiler/intTypeCheck.ts(174,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(188,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(202,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(83,5): error TS2386: Overload signatures must all be optional or required. -tests/cases/compiler/intTypeCheck.ts(97,5): error TS2322: Type 'Object' is not assignable to type 'i1': +tests/cases/compiler/intTypeCheck.ts(97,5): error TS2323: Type 'Object' is not assignable to type 'i1'. Property 'p' is missing in type 'Object'. tests/cases/compiler/intTypeCheck.ts(98,16): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(99,5): error TS2322: Type 'Base' is not assignable to type 'i1': +tests/cases/compiler/intTypeCheck.ts(99,5): error TS2323: Type 'Base' is not assignable to type 'i1'. Property 'p' is missing in type 'Base'. -tests/cases/compiler/intTypeCheck.ts(101,5): error TS2322: Type '() => void' is not assignable to type 'i1': +tests/cases/compiler/intTypeCheck.ts(101,5): error TS2323: Type '() => void' is not assignable to type 'i1'. Property 'p' is missing in type '() => void'. -tests/cases/compiler/intTypeCheck.ts(104,5): error TS2322: Type 'boolean' is not assignable to type 'i1': +tests/cases/compiler/intTypeCheck.ts(104,5): error TS2323: Type 'boolean' is not assignable to type 'i1'. Property 'p' is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(104,21): error TS2304: Cannot find name 'i1'. tests/cases/compiler/intTypeCheck.ts(105,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -38,27 +38,27 @@ tests/cases/compiler/intTypeCheck.ts(129,5): error TS2323: Type '() => void' is tests/cases/compiler/intTypeCheck.ts(132,5): error TS2323: Type 'boolean' is not assignable to type 'i3'. tests/cases/compiler/intTypeCheck.ts(132,22): error TS2304: Cannot find name 'i3'. tests/cases/compiler/intTypeCheck.ts(133,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(139,5): error TS2322: Type 'Object' is not assignable to type 'i4': +tests/cases/compiler/intTypeCheck.ts(139,5): error TS2323: Type 'Object' is not assignable to type 'i4'. Index signature is missing in type 'Object'. tests/cases/compiler/intTypeCheck.ts(140,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(141,5): error TS2322: Type 'Base' is not assignable to type 'i4': +tests/cases/compiler/intTypeCheck.ts(141,5): error TS2323: Type 'Base' is not assignable to type 'i4'. Index signature is missing in type 'Base'. -tests/cases/compiler/intTypeCheck.ts(143,5): error TS2322: Type '() => void' is not assignable to type 'i4': +tests/cases/compiler/intTypeCheck.ts(143,5): error TS2323: Type '() => void' is not assignable to type 'i4'. Index signature is missing in type '() => void'. -tests/cases/compiler/intTypeCheck.ts(146,5): error TS2322: Type 'boolean' is not assignable to type 'i4': +tests/cases/compiler/intTypeCheck.ts(146,5): error TS2323: Type 'boolean' is not assignable to type 'i4'. Index signature is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(146,22): error TS2304: Cannot find name 'i4'. tests/cases/compiler/intTypeCheck.ts(147,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(152,5): error TS2322: Type '{}' is not assignable to type 'i5': +tests/cases/compiler/intTypeCheck.ts(152,5): error TS2323: Type '{}' is not assignable to type 'i5'. Property 'p' is missing in type '{}'. -tests/cases/compiler/intTypeCheck.ts(153,5): error TS2322: Type 'Object' is not assignable to type 'i5': +tests/cases/compiler/intTypeCheck.ts(153,5): error TS2323: Type 'Object' is not assignable to type 'i5'. Property 'p' is missing in type 'Object'. tests/cases/compiler/intTypeCheck.ts(154,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(155,5): error TS2322: Type 'Base' is not assignable to type 'i5': +tests/cases/compiler/intTypeCheck.ts(155,5): error TS2323: Type 'Base' is not assignable to type 'i5'. Property 'p' is missing in type 'Base'. -tests/cases/compiler/intTypeCheck.ts(157,5): error TS2322: Type '() => void' is not assignable to type 'i5': +tests/cases/compiler/intTypeCheck.ts(157,5): error TS2323: Type '() => void' is not assignable to type 'i5'. Property 'p' is missing in type '() => void'. -tests/cases/compiler/intTypeCheck.ts(160,5): error TS2322: Type 'boolean' is not assignable to type 'i5': +tests/cases/compiler/intTypeCheck.ts(160,5): error TS2323: Type 'boolean' is not assignable to type 'i5'. Property 'p' is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(160,22): error TS2304: Cannot find name 'i5'. tests/cases/compiler/intTypeCheck.ts(161,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -66,7 +66,7 @@ tests/cases/compiler/intTypeCheck.ts(166,5): error TS2323: Type '{}' is not assi tests/cases/compiler/intTypeCheck.ts(167,5): error TS2323: Type 'Object' is not assignable to type 'i6'. tests/cases/compiler/intTypeCheck.ts(168,17): error TS2350: Only a void function can be called with the 'new' keyword. tests/cases/compiler/intTypeCheck.ts(169,5): error TS2323: Type 'Base' is not assignable to type 'i6'. -tests/cases/compiler/intTypeCheck.ts(171,5): error TS2322: Type '() => void' is not assignable to type 'i6': +tests/cases/compiler/intTypeCheck.ts(171,5): error TS2323: Type '() => void' is not assignable to type 'i6'. Type 'void' is not assignable to type 'number'. tests/cases/compiler/intTypeCheck.ts(174,5): error TS2323: Type 'boolean' is not assignable to type 'i6'. tests/cases/compiler/intTypeCheck.ts(174,22): error TS2304: Cannot find name 'i6'. @@ -78,14 +78,14 @@ tests/cases/compiler/intTypeCheck.ts(185,5): error TS2323: Type '() => void' is tests/cases/compiler/intTypeCheck.ts(188,5): error TS2323: Type 'boolean' is not assignable to type 'i7'. tests/cases/compiler/intTypeCheck.ts(188,22): error TS2304: Cannot find name 'i7'. tests/cases/compiler/intTypeCheck.ts(189,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(195,5): error TS2322: Type 'Object' is not assignable to type 'i8': +tests/cases/compiler/intTypeCheck.ts(195,5): error TS2323: Type 'Object' is not assignable to type 'i8'. Index signature is missing in type 'Object'. tests/cases/compiler/intTypeCheck.ts(196,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(197,5): error TS2322: Type 'Base' is not assignable to type 'i8': +tests/cases/compiler/intTypeCheck.ts(197,5): error TS2323: Type 'Base' is not assignable to type 'i8'. Index signature is missing in type 'Base'. -tests/cases/compiler/intTypeCheck.ts(199,5): error TS2322: Type '() => void' is not assignable to type 'i8': +tests/cases/compiler/intTypeCheck.ts(199,5): error TS2323: Type '() => void' is not assignable to type 'i8'. Index signature is missing in type '() => void'. -tests/cases/compiler/intTypeCheck.ts(202,5): error TS2322: Type 'boolean' is not assignable to type 'i8': +tests/cases/compiler/intTypeCheck.ts(202,5): error TS2323: Type 'boolean' is not assignable to type 'i8'. Index signature is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(202,22): error TS2304: Cannot find name 'i8'. tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -204,28 +204,28 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit }; var obj2: i1 = new Object(); ~~~~ -!!! error TS2322: Type 'Object' is not assignable to type 'i1': -!!! error TS2322: Property 'p' is missing in type 'Object'. +!!! error TS2323: Type 'Object' is not assignable to type 'i1'. +!!! error TS2323: Property 'p' is missing in type 'Object'. var obj3: i1 = new obj0; ~~~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj4: i1 = new Base; ~~~~ -!!! error TS2322: Type 'Base' is not assignable to type 'i1': -!!! error TS2322: Property 'p' is missing in type 'Base'. +!!! error TS2323: Type 'Base' is not assignable to type 'i1'. +!!! error TS2323: Property 'p' is missing in type 'Base'. var obj5: i1 = null; var obj6: i1 = function () { }; ~~~~ -!!! error TS2322: Type '() => void' is not assignable to type 'i1': -!!! error TS2322: Property 'p' is missing in type '() => void'. +!!! error TS2323: Type '() => void' is not assignable to type 'i1'. +!!! error TS2323: Property 'p' is missing in type '() => void'. //var obj7: i1 = function foo() { }; var obj8: i1 = anyVar; var obj9: i1 = new anyVar; ~ !!! error TS1109: Expression expected. ~~~~ -!!! error TS2322: Type 'boolean' is not assignable to type 'i1': -!!! error TS2322: Property 'p' is missing in type 'Boolean'. +!!! error TS2323: Type 'boolean' is not assignable to type 'i1'. +!!! error TS2323: Property 'p' is missing in type 'Boolean'. ~~ !!! error TS2304: Cannot find name 'i1'. var obj10: i1 = new {}; @@ -298,28 +298,28 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj34: i4 = {}; var obj35: i4 = new Object(); ~~~~~ -!!! error TS2322: Type 'Object' is not assignable to type 'i4': -!!! error TS2322: Index signature is missing in type 'Object'. +!!! error TS2323: Type 'Object' is not assignable to type 'i4'. +!!! error TS2323: Index signature is missing in type 'Object'. var obj36: i4 = new obj33; ~~~~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj37: i4 = new Base; ~~~~~ -!!! error TS2322: Type 'Base' is not assignable to type 'i4': -!!! error TS2322: Index signature is missing in type 'Base'. +!!! error TS2323: Type 'Base' is not assignable to type 'i4'. +!!! error TS2323: Index signature is missing in type 'Base'. var obj38: i4 = null; var obj39: i4 = function () { }; ~~~~~ -!!! error TS2322: Type '() => void' is not assignable to type 'i4': -!!! error TS2322: Index signature is missing in type '() => void'. +!!! error TS2323: Type '() => void' is not assignable to type 'i4'. +!!! error TS2323: Index signature is missing in type '() => void'. //var obj40: i4 = function foo() { }; var obj41: i4 = anyVar; var obj42: i4 = new anyVar; ~ !!! error TS1109: Expression expected. ~~~~~ -!!! error TS2322: Type 'boolean' is not assignable to type 'i4': -!!! error TS2322: Index signature is missing in type 'Boolean'. +!!! error TS2323: Type 'boolean' is not assignable to type 'i4'. +!!! error TS2323: Index signature is missing in type 'Boolean'. ~~ !!! error TS2304: Cannot find name 'i4'. var obj43: i4 = new {}; @@ -331,32 +331,32 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj44: i5; var obj45: i5 = {}; ~~~~~ -!!! error TS2322: Type '{}' is not assignable to type 'i5': -!!! error TS2322: Property 'p' is missing in type '{}'. +!!! error TS2323: Type '{}' is not assignable to type 'i5'. +!!! error TS2323: Property 'p' is missing in type '{}'. var obj46: i5 = new Object(); ~~~~~ -!!! error TS2322: Type 'Object' is not assignable to type 'i5': -!!! error TS2322: Property 'p' is missing in type 'Object'. +!!! error TS2323: Type 'Object' is not assignable to type 'i5'. +!!! error TS2323: Property 'p' is missing in type 'Object'. var obj47: i5 = new obj44; ~~~~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj48: i5 = new Base; ~~~~~ -!!! error TS2322: Type 'Base' is not assignable to type 'i5': -!!! error TS2322: Property 'p' is missing in type 'Base'. +!!! error TS2323: Type 'Base' is not assignable to type 'i5'. +!!! error TS2323: Property 'p' is missing in type 'Base'. var obj49: i5 = null; var obj50: i5 = function () { }; ~~~~~ -!!! error TS2322: Type '() => void' is not assignable to type 'i5': -!!! error TS2322: Property 'p' is missing in type '() => void'. +!!! error TS2323: Type '() => void' is not assignable to type 'i5'. +!!! error TS2323: Property 'p' is missing in type '() => void'. //var obj51: i5 = function foo() { }; var obj52: i5 = anyVar; var obj53: i5 = new anyVar; ~ !!! error TS1109: Expression expected. ~~~~~ -!!! error TS2322: Type 'boolean' is not assignable to type 'i5': -!!! error TS2322: Property 'p' is missing in type 'Boolean'. +!!! error TS2323: Type 'boolean' is not assignable to type 'i5'. +!!! error TS2323: Property 'p' is missing in type 'Boolean'. ~~ !!! error TS2304: Cannot find name 'i5'. var obj54: i5 = new {}; @@ -381,8 +381,8 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj60: i6 = null; var obj61: i6 = function () { }; ~~~~~ -!!! error TS2322: Type '() => void' is not assignable to type 'i6': -!!! error TS2322: Type 'void' is not assignable to type 'number'. +!!! error TS2323: Type '() => void' is not assignable to type 'i6'. +!!! error TS2323: Type 'void' is not assignable to type 'number'. //var obj62: i6 = function foo() { }; var obj63: i6 = anyVar; var obj64: i6 = new anyVar; @@ -432,28 +432,28 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj78: i8 = {}; var obj79: i8 = new Object(); ~~~~~ -!!! error TS2322: Type 'Object' is not assignable to type 'i8': -!!! error TS2322: Index signature is missing in type 'Object'. +!!! error TS2323: Type 'Object' is not assignable to type 'i8'. +!!! error TS2323: Index signature is missing in type 'Object'. var obj80: i8 = new obj77; ~~~~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj81: i8 = new Base; ~~~~~ -!!! error TS2322: Type 'Base' is not assignable to type 'i8': -!!! error TS2322: Index signature is missing in type 'Base'. +!!! error TS2323: Type 'Base' is not assignable to type 'i8'. +!!! error TS2323: Index signature is missing in type 'Base'. var obj82: i8 = null; var obj83: i8 = function () { }; ~~~~~ -!!! error TS2322: Type '() => void' is not assignable to type 'i8': -!!! error TS2322: Index signature is missing in type '() => void'. +!!! error TS2323: Type '() => void' is not assignable to type 'i8'. +!!! error TS2323: Index signature is missing in type '() => void'. //var obj84: i8 = function foo() { }; var obj85: i8 = anyVar; var obj86: i8 = new anyVar; ~ !!! error TS1109: Expression expected. ~~~~~ -!!! error TS2322: Type 'boolean' is not assignable to type 'i8': -!!! error TS2322: Index signature is missing in type 'Boolean'. +!!! error TS2323: Type 'boolean' is not assignable to type 'i8'. +!!! error TS2323: Index signature is missing in type 'Boolean'. ~~ !!! error TS2304: Cannot find name 'i8'. var obj87: i8 = new {}; diff --git a/tests/baselines/reference/interfaceAssignmentCompat.errors.txt b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt index bd5a7a46f91..04ae7ea89e4 100644 --- a/tests/baselines/reference/interfaceAssignmentCompat.errors.txt +++ b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/interfaceAssignmentCompat.ts(32,18): error TS2345: Argument of type '(a: IFrenchEye, b: IFrenchEye) => number' is not assignable to parameter of type '(a: IEye, b: IEye) => number'. tests/cases/compiler/interfaceAssignmentCompat.ts(37,29): error TS2339: Property '_map' does not exist on type 'typeof Color'. -tests/cases/compiler/interfaceAssignmentCompat.ts(42,13): error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye': +tests/cases/compiler/interfaceAssignmentCompat.ts(42,13): error TS2323: Type 'IEye' is not assignable to type 'IFrenchEye'. Property 'coleur' is missing in type 'IEye'. -tests/cases/compiler/interfaceAssignmentCompat.ts(44,9): error TS2322: Type 'IEye[]' is not assignable to type 'IFrenchEye[]': +tests/cases/compiler/interfaceAssignmentCompat.ts(44,9): error TS2323: Type 'IEye[]' is not assignable to type 'IFrenchEye[]'. Type 'IEye' is not assignable to type 'IFrenchEye'. @@ -54,13 +54,13 @@ tests/cases/compiler/interfaceAssignmentCompat.ts(44,9): error TS2322: Type 'IEy for (var j=z.length=1;j>=0;j--) { eeks[j]=z[j]; // nope: element assignment ~~~~~~~ -!!! error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye': -!!! error TS2322: Property 'coleur' is missing in type 'IEye'. +!!! error TS2323: Type 'IEye' is not assignable to type 'IFrenchEye'. +!!! error TS2323: Property 'coleur' is missing in type 'IEye'. } eeks=z; // nope: array assignment ~~~~ -!!! error TS2322: Type 'IEye[]' is not assignable to type 'IFrenchEye[]': -!!! error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye'. +!!! error TS2323: Type 'IEye[]' is not assignable to type 'IFrenchEye[]'. +!!! error TS2323: Type 'IEye' is not assignable to type 'IFrenchEye'. return result; } } diff --git a/tests/baselines/reference/interfaceDeclaration1.errors.txt b/tests/baselines/reference/interfaceDeclaration1.errors.txt index 3d7fcb86784..1e8cc0c1e68 100644 --- a/tests/baselines/reference/interfaceDeclaration1.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration1.errors.txt @@ -3,10 +3,10 @@ tests/cases/compiler/interfaceDeclaration1.ts(3,5): error TS2300: Duplicate iden tests/cases/compiler/interfaceDeclaration1.ts(7,5): error TS2300: Duplicate identifier 'item'. tests/cases/compiler/interfaceDeclaration1.ts(8,5): error TS2300: Duplicate identifier 'item'. tests/cases/compiler/interfaceDeclaration1.ts(22,11): error TS2310: Type 'I5' recursively references itself as a base type. -tests/cases/compiler/interfaceDeclaration1.ts(35,7): error TS2421: Class 'C1' incorrectly implements interface 'I3': +tests/cases/compiler/interfaceDeclaration1.ts(35,7): error TS2420: Class 'C1' incorrectly implements interface 'I3'. Property 'prototype' is missing in type 'C1'. tests/cases/compiler/interfaceDeclaration1.ts(41,11): error TS2310: Type 'i8' recursively references itself as a base type. -tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i12' cannot simultaneously extend types 'i10' and 'i11': +tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i12' cannot simultaneously extend types 'i10' and 'i11'. Named properties 'foo' of types 'i10' and 'i11' are not identical. @@ -57,8 +57,8 @@ tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i class C1 implements I3 { ~~ -!!! error TS2421: Class 'C1' incorrectly implements interface 'I3': -!!! error TS2421: Property 'prototype' is missing in type 'C1'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I3'. +!!! error TS2420: Property 'prototype' is missing in type 'C1'. constructor() { var prototype: number = 3; } @@ -79,6 +79,6 @@ tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i interface i12 extends i10, i11 { } ~~~ -!!! error TS2320: Interface 'i12' cannot simultaneously extend types 'i10' and 'i11': +!!! error TS2320: Interface 'i12' cannot simultaneously extend types 'i10' and 'i11'. !!! error TS2320: Named properties 'foo' of types 'i10' and 'i11' are not identical. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceDeclaration3.errors.txt b/tests/baselines/reference/interfaceDeclaration3.errors.txt index d58a77b2e12..a9bd1d42647 100644 --- a/tests/baselines/reference/interfaceDeclaration3.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration3.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/interfaceDeclaration3.ts(6,11): error TS2421: Class 'C1' incorrectly implements interface 'I1': - Types of property 'item' are incompatible: +tests/cases/compiler/interfaceDeclaration3.ts(6,11): error TS2420: Class 'C1' incorrectly implements interface 'I1'. + Types of property 'item' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/interfaceDeclaration3.ts(31,11): error TS2421: Class 'C1' incorrectly implements interface 'I1': - Types of property 'item' are incompatible: +tests/cases/compiler/interfaceDeclaration3.ts(31,11): error TS2420: Class 'C1' incorrectly implements interface 'I1'. + Types of property 'item' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/interfaceDeclaration3.ts(54,11): error TS2429: Interface 'I2' incorrectly extends interface 'I1': - Types of property 'item' are incompatible: +tests/cases/compiler/interfaceDeclaration3.ts(54,11): error TS2430: Interface 'I2' incorrectly extends interface 'I1'. + Types of property 'item' are incompatible. Type 'string' is not assignable to type 'number'. @@ -17,9 +17,9 @@ tests/cases/compiler/interfaceDeclaration3.ts(54,11): error TS2429: Interface 'I interface I2 { item:number; } class C1 implements I1 { ~~ -!!! error TS2421: Class 'C1' incorrectly implements interface 'I1': -!!! error TS2421: Types of property 'item' are incompatible: -!!! error TS2421: Type 'number' is not assignable to type 'string'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I1'. +!!! error TS2420: Types of property 'item' are incompatible. +!!! error TS2420: Type 'number' is not assignable to type 'string'. public item:number; } class C2 implements I1 { @@ -46,9 +46,9 @@ tests/cases/compiler/interfaceDeclaration3.ts(54,11): error TS2429: Interface 'I } class C1 implements I1 { ~~ -!!! error TS2421: Class 'C1' incorrectly implements interface 'I1': -!!! error TS2421: Types of property 'item' are incompatible: -!!! error TS2421: Type 'number' is not assignable to type 'string'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I1'. +!!! error TS2420: Types of property 'item' are incompatible. +!!! error TS2420: Type 'number' is not assignable to type 'string'. public item:number; } class C2 implements I1 { @@ -73,7 +73,7 @@ tests/cases/compiler/interfaceDeclaration3.ts(54,11): error TS2429: Interface 'I interface I2 extends I1 { item:string; } ~~ -!!! error TS2429: Interface 'I2' incorrectly extends interface 'I1': -!!! error TS2429: Types of property 'item' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'I1'. +!!! error TS2430: Types of property 'item' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceDeclaration4.errors.txt b/tests/baselines/reference/interfaceDeclaration4.errors.txt index 7092cda3dc2..520c0c2cadf 100644 --- a/tests/baselines/reference/interfaceDeclaration4.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration4.errors.txt @@ -1,11 +1,11 @@ tests/cases/compiler/interfaceDeclaration4.ts(39,14): error TS1005: '{' expected. tests/cases/compiler/interfaceDeclaration4.ts(39,18): error TS1005: ';' expected. -tests/cases/compiler/interfaceDeclaration4.ts(18,11): error TS2429: Interface 'I3' incorrectly extends interface 'I1': - Types of property 'item' are incompatible: +tests/cases/compiler/interfaceDeclaration4.ts(18,11): error TS2430: Interface 'I3' incorrectly extends interface 'I1'. + Types of property 'item' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/interfaceDeclaration4.ts(27,7): error TS2421: Class 'C2' incorrectly implements interface 'I4': +tests/cases/compiler/interfaceDeclaration4.ts(27,7): error TS2420: Class 'C2' incorrectly implements interface 'I4'. Property 'item' is missing in type 'C2'. -tests/cases/compiler/interfaceDeclaration4.ts(36,7): error TS2421: Class 'C3' incorrectly implements interface 'I1': +tests/cases/compiler/interfaceDeclaration4.ts(36,7): error TS2420: Class 'C3' incorrectly implements interface 'I1'. Property 'item' is missing in type 'C3'. tests/cases/compiler/interfaceDeclaration4.ts(39,15): error TS2304: Cannot find name 'I1'. @@ -30,9 +30,9 @@ tests/cases/compiler/interfaceDeclaration4.ts(39,15): error TS2304: Cannot find // Negative Case interface I3 extends Foo.I1 { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'I1': -!!! error TS2429: Types of property 'item' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'I1'. +!!! error TS2430: Types of property 'item' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. item:number; } @@ -43,8 +43,8 @@ tests/cases/compiler/interfaceDeclaration4.ts(39,15): error TS2304: Cannot find // Err - not implemented item class C2 implements I4 { ~~ -!!! error TS2421: Class 'C2' incorrectly implements interface 'I4': -!!! error TS2421: Property 'item' is missing in type 'C2'. +!!! error TS2420: Class 'C2' incorrectly implements interface 'I4'. +!!! error TS2420: Property 'item' is missing in type 'C2'. public token: string; } @@ -55,8 +55,8 @@ tests/cases/compiler/interfaceDeclaration4.ts(39,15): error TS2304: Cannot find class C3 implements Foo.I1 { } ~~ -!!! error TS2421: Class 'C3' incorrectly implements interface 'I1': -!!! error TS2421: Property 'item' is missing in type 'C3'. +!!! error TS2420: Class 'C3' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'item' is missing in type 'C3'. // Negative case interface Foo.I1 { } diff --git a/tests/baselines/reference/interfaceDeclaration6.errors.txt b/tests/baselines/reference/interfaceDeclaration6.errors.txt index 9cf0606d8bf..ab5ac03a31d 100644 --- a/tests/baselines/reference/interfaceDeclaration6.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration6.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/interfaceDeclaration6.ts(3,11): error TS2429: Interface 'i3' incorrectly extends interface 'i1': - Types of property 'foo' are incompatible: +tests/cases/compiler/interfaceDeclaration6.ts(3,11): error TS2430: Interface 'i3' incorrectly extends interface 'i1'. + Types of property 'foo' are incompatible. Type 'string' is not assignable to type 'number'. @@ -8,9 +8,9 @@ tests/cases/compiler/interfaceDeclaration6.ts(3,11): error TS2429: Interface 'i3 interface i2 extends i1 { foo: number; }; interface i3 extends i1 { foo: string; }; ~~ -!!! error TS2429: Interface 'i3' incorrectly extends interface 'i1': -!!! error TS2429: Types of property 'foo' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'i3' incorrectly extends interface 'i1'. +!!! error TS2430: Types of property 'foo' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. interface i4 { bar():any; bar():any; diff --git a/tests/baselines/reference/interfaceExtendingClassWithPrivates.errors.txt b/tests/baselines/reference/interfaceExtendingClassWithPrivates.errors.txt index 93d8b7cfa57..d80df216c79 100644 --- a/tests/baselines/reference/interfaceExtendingClassWithPrivates.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClassWithPrivates.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates.ts(5,11): error TS2429: Interface 'I' incorrectly extends interface 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates.ts(5,11): error TS2430: Interface 'I' incorrectly extends interface 'Foo'. Property 'x' is private in type 'Foo' but not in type 'I'. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates.ts(15,10): error TS2341: Property 'x' is private and only accessible within class 'Foo'. @@ -10,8 +10,8 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending interface I extends Foo { // error ~ -!!! error TS2429: Interface 'I' incorrectly extends interface 'Foo': -!!! error TS2429: Property 'x' is private in type 'Foo' but not in type 'I'. +!!! error TS2430: Interface 'I' incorrectly extends interface 'Foo'. +!!! error TS2430: Property 'x' is private in type 'Foo' but not in type 'I'. x: string; } diff --git a/tests/baselines/reference/interfaceExtendingClassWithPrivates2.errors.txt b/tests/baselines/reference/interfaceExtendingClassWithPrivates2.errors.txt index f17a1ef3485..c9be8471e8c 100644 --- a/tests/baselines/reference/interfaceExtendingClassWithPrivates2.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClassWithPrivates2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar': +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'. Named properties 'x' of types 'Foo' and 'Bar' are not identical. -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2429: Interface 'I4' incorrectly extends interface 'Bar': +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Bar'. Property 'x' is private in type 'Bar' but not in type 'I4'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2429: Interface 'I4' incorrectly extends interface 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Foo'. Property 'x' is private in type 'Foo' but not in type 'I4'. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(26,10): error TS2341: Property 'x' is private and only accessible within class 'Foo'. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(27,10): error TS2341: Property 'y' is private and only accessible within class 'Baz'. @@ -19,17 +19,17 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending interface I3 extends Foo, Bar { // error ~~ -!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar': +!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'. !!! error TS2320: Named properties 'x' of types 'Foo' and 'Bar' are not identical. } interface I4 extends Foo, Bar { // error ~~ -!!! error TS2429: Interface 'I4' incorrectly extends interface 'Bar': -!!! error TS2429: Property 'x' is private in type 'Bar' but not in type 'I4'. +!!! error TS2430: Interface 'I4' incorrectly extends interface 'Bar'. +!!! error TS2430: Property 'x' is private in type 'Bar' but not in type 'I4'. ~~ -!!! error TS2429: Interface 'I4' incorrectly extends interface 'Foo': -!!! error TS2429: Property 'x' is private in type 'Foo' but not in type 'I4'. +!!! error TS2430: Interface 'I4' incorrectly extends interface 'Foo'. +!!! error TS2430: Property 'x' is private in type 'Foo' but not in type 'I4'. x: string; } diff --git a/tests/baselines/reference/interfaceExtendingClassWithProtecteds.errors.txt b/tests/baselines/reference/interfaceExtendingClassWithProtecteds.errors.txt index 1cbc921e1ac..05651c92976 100644 --- a/tests/baselines/reference/interfaceExtendingClassWithProtecteds.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClassWithProtecteds.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds.ts(5,11): error TS2429: Interface 'I' incorrectly extends interface 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds.ts(5,11): error TS2430: Interface 'I' incorrectly extends interface 'Foo'. Property 'x' is protected but type 'I' is not a class derived from 'Foo'. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds.ts(15,10): error TS2445: Property 'x' is protected and only accessible within class 'Foo' and its subclasses. @@ -10,8 +10,8 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending interface I extends Foo { // error ~ -!!! error TS2429: Interface 'I' incorrectly extends interface 'Foo': -!!! error TS2429: Property 'x' is protected but type 'I' is not a class derived from 'Foo'. +!!! error TS2430: Interface 'I' incorrectly extends interface 'Foo'. +!!! error TS2430: Property 'x' is protected but type 'I' is not a class derived from 'Foo'. x: string; } diff --git a/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.errors.txt b/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.errors.txt index 4e5b6364010..a63dfd6efca 100644 --- a/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar': +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'. Named properties 'x' of types 'Foo' and 'Bar' are not identical. -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2429: Interface 'I4' incorrectly extends interface 'Bar': +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Bar'. Property 'x' is protected but type 'I4' is not a class derived from 'Bar'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2429: Interface 'I4' incorrectly extends interface 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Foo'. Property 'x' is protected but type 'I4' is not a class derived from 'Foo'. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(26,10): error TS2445: Property 'x' is protected and only accessible within class 'Foo' and its subclasses. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(27,10): error TS2445: Property 'y' is protected and only accessible within class 'Baz' and its subclasses. @@ -19,17 +19,17 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending interface I3 extends Foo, Bar { // error ~~ -!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar': +!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'. !!! error TS2320: Named properties 'x' of types 'Foo' and 'Bar' are not identical. } interface I4 extends Foo, Bar { // error ~~ -!!! error TS2429: Interface 'I4' incorrectly extends interface 'Bar': -!!! error TS2429: Property 'x' is protected but type 'I4' is not a class derived from 'Bar'. +!!! error TS2430: Interface 'I4' incorrectly extends interface 'Bar'. +!!! error TS2430: Property 'x' is protected but type 'I4' is not a class derived from 'Bar'. ~~ -!!! error TS2429: Interface 'I4' incorrectly extends interface 'Foo': -!!! error TS2429: Property 'x' is protected but type 'I4' is not a class derived from 'Foo'. +!!! error TS2430: Interface 'I4' incorrectly extends interface 'Foo'. +!!! error TS2430: Property 'x' is protected but type 'I4' is not a class derived from 'Foo'. x: string; } diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt index 919bdaea17d..daa91c8822b 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(21,1): error TS2322: Type 'C' is not assignable to type 'I': +tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(21,1): error TS2323: Type 'C' is not assignable to type 'I'. Property 'other' is missing in type 'C'. -tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(24,1): error TS2322: Type 'I' is not assignable to type 'D': +tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(24,1): error TS2323: Type 'I' is not assignable to type 'D'. Property 'bar' is missing in type 'I'. -tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(27,1): error TS2322: Type 'C' is not assignable to type 'D': +tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(27,1): error TS2323: Type 'C' is not assignable to type 'D'. Property 'other' is missing in type 'C'. @@ -29,17 +29,17 @@ tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(27,1): error TS2322: T c = i; i = c; // error ~ -!!! error TS2322: Type 'C' is not assignable to type 'I': -!!! error TS2322: Property 'other' is missing in type 'C'. +!!! error TS2323: Type 'C' is not assignable to type 'I'. +!!! error TS2323: Property 'other' is missing in type 'C'. i = d; d = i; // error ~ -!!! error TS2322: Type 'I' is not assignable to type 'D': -!!! error TS2322: Property 'bar' is missing in type 'I'. +!!! error TS2323: Type 'I' is not assignable to type 'D'. +!!! error TS2323: Property 'bar' is missing in type 'I'. c = d; d = c; // error ~ -!!! error TS2322: Type 'C' is not assignable to type 'D': -!!! error TS2322: Property 'other' is missing in type 'C'. \ No newline at end of file +!!! error TS2323: Type 'C' is not assignable to type 'D'. +!!! error TS2323: Property 'other' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.errors.txt b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.errors.txt index a965d7003bb..035fe89cd35 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.errors.txt +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(10,7): error TS2416: Class 'D' incorrectly extends base class 'C': +tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(10,7): error TS2415: Class 'D' incorrectly extends base class 'C'. Types have separate declarations of a private property 'x'. -tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(10,7): error TS2421: Class 'D' incorrectly implements interface 'I': +tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(10,7): error TS2420: Class 'D' incorrectly implements interface 'I'. Types have separate declarations of a private property 'x'. -tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2416: Class 'D2' incorrectly extends base class 'C': +tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2415: Class 'D2' incorrectly extends base class 'C'. Types have separate declarations of a private property 'x'. -tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2421: Class 'D2' incorrectly implements interface 'I': +tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2420: Class 'D2' incorrectly implements interface 'I'. Types have separate declarations of a private property 'x'. @@ -20,11 +20,11 @@ tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2421: C class D extends C implements I { // error ~ -!!! error TS2416: Class 'D' incorrectly extends base class 'C': -!!! error TS2416: Types have separate declarations of a private property 'x'. +!!! error TS2415: Class 'D' incorrectly extends base class 'C'. +!!! error TS2415: Types have separate declarations of a private property 'x'. ~ -!!! error TS2421: Class 'D' incorrectly implements interface 'I': -!!! error TS2421: Types have separate declarations of a private property 'x'. +!!! error TS2420: Class 'D' incorrectly implements interface 'I'. +!!! error TS2420: Types have separate declarations of a private property 'x'. public foo(x: any) { return x; } private x = 2; private y = 3; @@ -34,11 +34,11 @@ tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2421: C class D2 extends C implements I { // error ~~ -!!! error TS2416: Class 'D2' incorrectly extends base class 'C': -!!! error TS2416: Types have separate declarations of a private property 'x'. +!!! error TS2415: Class 'D2' incorrectly extends base class 'C'. +!!! error TS2415: Types have separate declarations of a private property 'x'. ~~ -!!! error TS2421: Class 'D2' incorrectly implements interface 'I': -!!! error TS2421: Types have separate declarations of a private property 'x'. +!!! error TS2420: Class 'D2' incorrectly implements interface 'I'. +!!! error TS2420: Types have separate declarations of a private property 'x'. public foo(x: any) { return x; } private x = ""; other(x: any) { return x; } diff --git a/tests/baselines/reference/interfaceImplementation1.errors.txt b/tests/baselines/reference/interfaceImplementation1.errors.txt index 59a81e66957..5a6b870b55a 100644 --- a/tests/baselines/reference/interfaceImplementation1.errors.txt +++ b/tests/baselines/reference/interfaceImplementation1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2421: Class 'C1' incorrectly implements interface 'I1': +tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2420: Class 'C1' incorrectly implements interface 'I1'. Property 'iObj' is private in type 'C1' but not in type 'I1'. -tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2421: Class 'C1' incorrectly implements interface 'I2': +tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2420: Class 'C1' incorrectly implements interface 'I2'. Property 'iFn' is private in type 'C1' but not in type 'I2'. tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2323: Type '() => C2' is not assignable to type 'I4'. @@ -19,11 +19,11 @@ tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2323: Type '() = class C1 implements I1,I2 { ~~ -!!! error TS2421: Class 'C1' incorrectly implements interface 'I1': -!!! error TS2421: Property 'iObj' is private in type 'C1' but not in type 'I1'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'iObj' is private in type 'C1' but not in type 'I1'. ~~ -!!! error TS2421: Class 'C1' incorrectly implements interface 'I2': -!!! error TS2421: Property 'iFn' is private in type 'C1' but not in type 'I2'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I2'. +!!! error TS2420: Property 'iFn' is private in type 'C1' but not in type 'I2'. private iFn(); private iFn(n?:number, s?:string) { } private iAny:any; diff --git a/tests/baselines/reference/interfaceImplementation2.errors.txt b/tests/baselines/reference/interfaceImplementation2.errors.txt index d723549d8be..eedc3a4f746 100644 --- a/tests/baselines/reference/interfaceImplementation2.errors.txt +++ b/tests/baselines/reference/interfaceImplementation2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/interfaceImplementation2.ts(8,7): error TS2421: Class 'C3' incorrectly implements interface 'I1': +tests/cases/compiler/interfaceImplementation2.ts(8,7): error TS2420: Class 'C3' incorrectly implements interface 'I1'. Property 'iFn' is missing in type 'C3'. @@ -12,8 +12,8 @@ tests/cases/compiler/interfaceImplementation2.ts(8,7): error TS2421: Class 'C3' class C3 implements I1 { ~~ -!!! error TS2421: Class 'C3' incorrectly implements interface 'I1': -!!! error TS2421: Property 'iFn' is missing in type 'C3'. +!!! error TS2420: Class 'C3' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'iFn' is missing in type 'C3'. public iObj:{ }; public iNum:number; public iAny:any; diff --git a/tests/baselines/reference/interfaceImplementation3.errors.txt b/tests/baselines/reference/interfaceImplementation3.errors.txt index 1e5073ac2ee..06baf5d5915 100644 --- a/tests/baselines/reference/interfaceImplementation3.errors.txt +++ b/tests/baselines/reference/interfaceImplementation3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/interfaceImplementation3.ts(8,7): error TS2421: Class 'C4' incorrectly implements interface 'I1': +tests/cases/compiler/interfaceImplementation3.ts(8,7): error TS2420: Class 'C4' incorrectly implements interface 'I1'. Property 'iAny' is missing in type 'C4'. @@ -12,8 +12,8 @@ tests/cases/compiler/interfaceImplementation3.ts(8,7): error TS2421: Class 'C4' class C4 implements I1 { ~~ -!!! error TS2421: Class 'C4' incorrectly implements interface 'I1': -!!! error TS2421: Property 'iAny' is missing in type 'C4'. +!!! error TS2420: Class 'C4' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'iAny' is missing in type 'C4'. public iObj:{ }; public iNum:number; public iFn() { } diff --git a/tests/baselines/reference/interfaceImplementation4.errors.txt b/tests/baselines/reference/interfaceImplementation4.errors.txt index 8a08026b0bb..f50aa4ade97 100644 --- a/tests/baselines/reference/interfaceImplementation4.errors.txt +++ b/tests/baselines/reference/interfaceImplementation4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/interfaceImplementation4.ts(8,7): error TS2421: Class 'C5' incorrectly implements interface 'I1': +tests/cases/compiler/interfaceImplementation4.ts(8,7): error TS2420: Class 'C5' incorrectly implements interface 'I1'. Property 'iObj' is missing in type 'C5'. @@ -12,8 +12,8 @@ tests/cases/compiler/interfaceImplementation4.ts(8,7): error TS2421: Class 'C5' class C5 implements I1 { ~~ -!!! error TS2421: Class 'C5' incorrectly implements interface 'I1': -!!! error TS2421: Property 'iObj' is missing in type 'C5'. +!!! error TS2420: Class 'C5' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'iObj' is missing in type 'C5'. public iNum:number; public iAny:any; public iFn() { } diff --git a/tests/baselines/reference/interfaceImplementation6.errors.txt b/tests/baselines/reference/interfaceImplementation6.errors.txt index 0965a1c6019..c4c0dcba8ae 100644 --- a/tests/baselines/reference/interfaceImplementation6.errors.txt +++ b/tests/baselines/reference/interfaceImplementation6.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/interfaceImplementation6.ts(9,7): error TS2421: Class 'C2' incorrectly implements interface 'I1': +tests/cases/compiler/interfaceImplementation6.ts(9,7): error TS2420: Class 'C2' incorrectly implements interface 'I1'. Property 'item' is private in type 'C2' but not in type 'I1'. -tests/cases/compiler/interfaceImplementation6.ts(13,7): error TS2421: Class 'C3' incorrectly implements interface 'I1': +tests/cases/compiler/interfaceImplementation6.ts(13,7): error TS2420: Class 'C3' incorrectly implements interface 'I1'. Property 'item' is missing in type 'C3'. @@ -15,15 +15,15 @@ tests/cases/compiler/interfaceImplementation6.ts(13,7): error TS2421: Class 'C3' class C2 implements I1 { ~~ -!!! error TS2421: Class 'C2' incorrectly implements interface 'I1': -!!! error TS2421: Property 'item' is private in type 'C2' but not in type 'I1'. +!!! error TS2420: Class 'C2' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'item' is private in type 'C2' but not in type 'I1'. private item:number; } class C3 implements I1 { ~~ -!!! error TS2421: Class 'C3' incorrectly implements interface 'I1': -!!! error TS2421: Property 'item' is missing in type 'C3'. +!!! error TS2420: Class 'C3' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'item' is missing in type 'C3'. constructor() { var item: number; } diff --git a/tests/baselines/reference/interfaceImplementation7.errors.txt b/tests/baselines/reference/interfaceImplementation7.errors.txt index 9e04892215d..ff1118e5c69 100644 --- a/tests/baselines/reference/interfaceImplementation7.errors.txt +++ b/tests/baselines/reference/interfaceImplementation7.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/interfaceImplementation7.ts(4,11): error TS2320: Interface 'i3' cannot simultaneously extend types 'i1' and 'i2': +tests/cases/compiler/interfaceImplementation7.ts(4,11): error TS2320: Interface 'i3' cannot simultaneously extend types 'i1' and 'i2'. Named properties 'name' of types 'i1' and 'i2' are not identical. -tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2421: Class 'C1' incorrectly implements interface 'i4': - Types of property 'name' are incompatible: - Type '() => string' is not assignable to type '() => { s: string; n: number; }': - Type 'string' is not assignable to type '{ s: string; n: number; }': +tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2420: Class 'C1' incorrectly implements interface 'i4'. + Types of property 'name' are incompatible. + Type '() => string' is not assignable to type '() => { s: string; n: number; }'. + Type 'string' is not assignable to type '{ s: string; n: number; }'. Property 's' is missing in type 'String'. @@ -13,17 +13,17 @@ tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2421: Class 'C1' interface i3 extends i1, i2 { } ~~ -!!! error TS2320: Interface 'i3' cannot simultaneously extend types 'i1' and 'i2': +!!! error TS2320: Interface 'i3' cannot simultaneously extend types 'i1' and 'i2'. !!! error TS2320: Named properties 'name' of types 'i1' and 'i2' are not identical. interface i4 extends i1, i2 { name(): { s: string; n: number; }; } class C1 implements i4 { ~~ -!!! error TS2421: Class 'C1' incorrectly implements interface 'i4': -!!! error TS2421: Types of property 'name' are incompatible: -!!! error TS2421: Type '() => string' is not assignable to type '() => { s: string; n: number; }': -!!! error TS2421: Type 'string' is not assignable to type '{ s: string; n: number; }': -!!! error TS2421: Property 's' is missing in type 'String'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'i4'. +!!! error TS2420: Types of property 'name' are incompatible. +!!! error TS2420: Type '() => string' is not assignable to type '() => { s: string; n: number; }'. +!!! error TS2420: Type 'string' is not assignable to type '{ s: string; n: number; }'. +!!! error TS2420: Property 's' is missing in type 'String'. public name(): string { return ""; } } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceImplementation8.errors.txt b/tests/baselines/reference/interfaceImplementation8.errors.txt index 4d0d06042a1..6b4b8f4a4fa 100644 --- a/tests/baselines/reference/interfaceImplementation8.errors.txt +++ b/tests/baselines/reference/interfaceImplementation8.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/interfaceImplementation8.ts(12,7): error TS2421: Class 'C2' incorrectly implements interface 'i1': +tests/cases/compiler/interfaceImplementation8.ts(12,7): error TS2420: Class 'C2' incorrectly implements interface 'i1'. Property 'name' is private in type 'C2' but not in type 'i1'. -tests/cases/compiler/interfaceImplementation8.ts(21,7): error TS2421: Class 'C5' incorrectly implements interface 'i1': +tests/cases/compiler/interfaceImplementation8.ts(21,7): error TS2420: Class 'C5' incorrectly implements interface 'i1'. Property 'name' is private in type 'C5' but not in type 'i1'. -tests/cases/compiler/interfaceImplementation8.ts(22,7): error TS2421: Class 'C6' incorrectly implements interface 'i1': +tests/cases/compiler/interfaceImplementation8.ts(22,7): error TS2420: Class 'C6' incorrectly implements interface 'i1'. Property 'name' is private in type 'C6' but not in type 'i1'. @@ -20,8 +20,8 @@ tests/cases/compiler/interfaceImplementation8.ts(22,7): error TS2421: Class 'C6' class C2 implements i1 { ~~ -!!! error TS2421: Class 'C2' incorrectly implements interface 'i1': -!!! error TS2421: Property 'name' is private in type 'C2' but not in type 'i1'. +!!! error TS2420: Class 'C2' incorrectly implements interface 'i1'. +!!! error TS2420: Property 'name' is private in type 'C2' but not in type 'i1'. private name:string; } @@ -32,12 +32,12 @@ tests/cases/compiler/interfaceImplementation8.ts(22,7): error TS2421: Class 'C6' class C4 extends C1 implements i1{ } class C5 extends C2 implements i1{ } ~~ -!!! error TS2421: Class 'C5' incorrectly implements interface 'i1': -!!! error TS2421: Property 'name' is private in type 'C5' but not in type 'i1'. +!!! error TS2420: Class 'C5' incorrectly implements interface 'i1'. +!!! error TS2420: Property 'name' is private in type 'C5' but not in type 'i1'. class C6 extends C3 implements i1{ } ~~ -!!! error TS2421: Class 'C6' incorrectly implements interface 'i1': -!!! error TS2421: Property 'name' is private in type 'C6' but not in type 'i1'. +!!! error TS2420: Class 'C6' incorrectly implements interface 'i1'. +!!! error TS2420: Property 'name' is private in type 'C6' but not in type 'i1'. /* 2 diff --git a/tests/baselines/reference/interfaceInheritance.errors.txt b/tests/baselines/reference/interfaceInheritance.errors.txt index e192d0fa2e9..b598ba4a985 100644 --- a/tests/baselines/reference/interfaceInheritance.errors.txt +++ b/tests/baselines/reference/interfaceInheritance.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/interfaceInheritance.ts(22,7): error TS2421: Class 'C1' incorrectly implements interface 'I2': +tests/cases/compiler/interfaceInheritance.ts(22,7): error TS2420: Class 'C1' incorrectly implements interface 'I2'. Property 'i1P1' is missing in type 'C1'. -tests/cases/compiler/interfaceInheritance.ts(30,1): error TS2322: Type 'I3' is not assignable to type 'I2': +tests/cases/compiler/interfaceInheritance.ts(30,1): error TS2323: Type 'I3' is not assignable to type 'I2'. Property 'i1P1' is missing in type 'I3'. -tests/cases/compiler/interfaceInheritance.ts(37,1): error TS2322: Type 'I5' is not assignable to type 'I4': - Types of property 'one' are incompatible: +tests/cases/compiler/interfaceInheritance.ts(37,1): error TS2323: Type 'I5' is not assignable to type 'I4'. + Types of property 'one' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/interfaceInheritance.ts(38,1): error TS2322: Type 'I4' is not assignable to type 'I5': - Types of property 'one' are incompatible: +tests/cases/compiler/interfaceInheritance.ts(38,1): error TS2323: Type 'I4' is not assignable to type 'I5'. + Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string'. @@ -34,8 +34,8 @@ tests/cases/compiler/interfaceInheritance.ts(38,1): error TS2322: Type 'I4' is n class C1 implements I2 { // should be an error - it doesn't implement the members of I1 ~~ -!!! error TS2421: Class 'C1' incorrectly implements interface 'I2': -!!! error TS2421: Property 'i1P1' is missing in type 'C1'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I2'. +!!! error TS2420: Property 'i1P1' is missing in type 'C1'. public i2P1: string; } @@ -45,8 +45,8 @@ tests/cases/compiler/interfaceInheritance.ts(38,1): error TS2322: Type 'I4' is n i1 = i2; i2 = i3; // should be an error - i3 does not implement the members of i1 ~~ -!!! error TS2322: Type 'I3' is not assignable to type 'I2': -!!! error TS2322: Property 'i1P1' is missing in type 'I3'. +!!! error TS2323: Type 'I3' is not assignable to type 'I2'. +!!! error TS2323: Property 'i1P1' is missing in type 'I3'. var c1: C1; @@ -55,13 +55,13 @@ tests/cases/compiler/interfaceInheritance.ts(38,1): error TS2322: Type 'I4' is n i4 = i5; // should be an error ~~ -!!! error TS2322: Type 'I5' is not assignable to type 'I4': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'I5' is not assignable to type 'I4'. +!!! error TS2323: Types of property 'one' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. i5 = i4; // should be an error ~~ -!!! error TS2322: Type 'I4' is not assignable to type 'I5': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type 'I4' is not assignable to type 'I5'. +!!! error TS2323: Types of property 'one' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceMemberValidation.errors.txt b/tests/baselines/reference/interfaceMemberValidation.errors.txt index ed8b119bbdd..3b2b1d1874c 100644 --- a/tests/baselines/reference/interfaceMemberValidation.errors.txt +++ b/tests/baselines/reference/interfaceMemberValidation.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/interfaceMemberValidation.ts(2,11): error TS2429: Interface 'i2' incorrectly extends interface 'i1': - Types of property 'name' are incompatible: +tests/cases/compiler/interfaceMemberValidation.ts(2,11): error TS2430: Interface 'i2' incorrectly extends interface 'i1'. + Types of property 'name' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/compiler/interfaceMemberValidation.ts(5,2): error TS2411: Property 'bar' of type '{ (): any; (): any; }' is not assignable to string index type 'number'. tests/cases/compiler/interfaceMemberValidation.ts(10,2): error TS2374: Duplicate string index signature. @@ -9,9 +9,9 @@ tests/cases/compiler/interfaceMemberValidation.ts(10,2): error TS2374: Duplicate interface i1 { name: string; } interface i2 extends i1 { name: number; yo: string; } ~~ -!!! error TS2429: Interface 'i2' incorrectly extends interface 'i1': -!!! error TS2429: Types of property 'name' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'i2' incorrectly extends interface 'i1'. +!!! error TS2430: Types of property 'name' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. interface foo { bar():any; diff --git a/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt b/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt index 82d4a755d2a..a7df9c15e59 100644 --- a/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt +++ b/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/interfacePropertiesWithSameName2.ts(10,11): error TS2320: Interface 'MoverShaker' cannot simultaneously extend types 'Mover' and 'Shaker': +tests/cases/compiler/interfacePropertiesWithSameName2.ts(10,11): error TS2320: Interface 'MoverShaker' cannot simultaneously extend types 'Mover' and 'Shaker'. Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical. -tests/cases/compiler/interfacePropertiesWithSameName2.ts(26,11): error TS2320: Interface 'MoverShaker2' cannot simultaneously extend types 'Mover' and 'Shaker': +tests/cases/compiler/interfacePropertiesWithSameName2.ts(26,11): error TS2320: Interface 'MoverShaker2' cannot simultaneously extend types 'Mover' and 'Shaker'. Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical. @@ -16,7 +16,7 @@ tests/cases/compiler/interfacePropertiesWithSameName2.ts(26,11): error TS2320: I interface MoverShaker extends Mover, Shaker { ~~~~~~~~~~~ -!!! error TS2320: Interface 'MoverShaker' cannot simultaneously extend types 'Mover' and 'Shaker': +!!! error TS2320: Interface 'MoverShaker' cannot simultaneously extend types 'Mover' and 'Shaker'. !!! error TS2320: Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical. } @@ -35,7 +35,7 @@ tests/cases/compiler/interfacePropertiesWithSameName2.ts(26,11): error TS2320: I interface MoverShaker2 extends MoversAndShakers.Mover, MoversAndShakers.Shaker { } // error ~~~~~~~~~~~~ -!!! error TS2320: Interface 'MoverShaker2' cannot simultaneously extend types 'Mover' and 'Shaker': +!!! error TS2320: Interface 'MoverShaker2' cannot simultaneously extend types 'Mover' and 'Shaker'. !!! error TS2320: Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical. interface MoverShaker3 extends MoversAndShakers.Mover, MoversAndShakers.Shaker { diff --git a/tests/baselines/reference/interfacePropertiesWithSameName3.errors.txt b/tests/baselines/reference/interfacePropertiesWithSameName3.errors.txt index 136a2460b5e..b7dfdffc79e 100644 --- a/tests/baselines/reference/interfacePropertiesWithSameName3.errors.txt +++ b/tests/baselines/reference/interfacePropertiesWithSameName3.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/interfacePropertiesWithSameName3.ts(3,11): error TS2320: Interface 'F' cannot simultaneously extend types 'E' and 'D': +tests/cases/compiler/interfacePropertiesWithSameName3.ts(3,11): error TS2320: Interface 'F' cannot simultaneously extend types 'E' and 'D'. Named properties 'a' of types 'E' and 'D' are not identical. -tests/cases/compiler/interfacePropertiesWithSameName3.ts(7,11): error TS2320: Interface 'F2' cannot simultaneously extend types 'E2' and 'D2': +tests/cases/compiler/interfacePropertiesWithSameName3.ts(7,11): error TS2320: Interface 'F2' cannot simultaneously extend types 'E2' and 'D2'. Named properties 'a' of types 'E2' and 'D2' are not identical. @@ -9,13 +9,13 @@ tests/cases/compiler/interfacePropertiesWithSameName3.ts(7,11): error TS2320: In interface E { a: string; } interface F extends E, D { } // error ~ -!!! error TS2320: Interface 'F' cannot simultaneously extend types 'E' and 'D': +!!! error TS2320: Interface 'F' cannot simultaneously extend types 'E' and 'D'. !!! error TS2320: Named properties 'a' of types 'E' and 'D' are not identical. class D2 { a: number; } class E2 { a: string; } interface F2 extends E2, D2 { } // error ~~ -!!! error TS2320: Interface 'F2' cannot simultaneously extend types 'E2' and 'D2': +!!! error TS2320: Interface 'F2' cannot simultaneously extend types 'E2' and 'D2'. !!! error TS2320: Named properties 'a' of types 'E2' and 'D2' are not identical. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceThatHidesBaseProperty2.errors.txt b/tests/baselines/reference/interfaceThatHidesBaseProperty2.errors.txt index dafff4336ba..f66e13c0d9d 100644 --- a/tests/baselines/reference/interfaceThatHidesBaseProperty2.errors.txt +++ b/tests/baselines/reference/interfaceThatHidesBaseProperty2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatHidesBaseProperty2.ts(5,11): error TS2429: Interface 'Derived' incorrectly extends interface 'Base': - Types of property 'x' are incompatible: - Type '{ a: string; }' is not assignable to type '{ a: number; }': - Types of property 'a' are incompatible: +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatHidesBaseProperty2.ts(5,11): error TS2430: Interface 'Derived' incorrectly extends interface 'Base'. + Types of property 'x' are incompatible. + Type '{ a: string; }' is not assignable to type '{ a: number; }'. + Types of property 'a' are incompatible. Type 'string' is not assignable to type 'number'. @@ -12,11 +12,11 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatHidesBaseP interface Derived extends Base { // error ~~~~~~~ -!!! error TS2429: Interface 'Derived' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'x' are incompatible: -!!! error TS2429: Type '{ a: string; }' is not assignable to type '{ a: number; }': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'Derived' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '{ a: string; }' is not assignable to type '{ a: number; }'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. x: { a: string; }; diff --git a/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt b/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt index 85351b191ec..1562e16df4d 100644 --- a/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt +++ b/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt @@ -1,27 +1,27 @@ -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(21,11): error TS2429: Interface 'Derived2' incorrectly extends interface 'Base2': - Types of property 'x' are incompatible: - Type '{ a: string; b: number; }' is not assignable to type '{ b: string; }': - Types of property 'b' are incompatible: +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(21,11): error TS2430: Interface 'Derived2' incorrectly extends interface 'Base2'. + Types of property 'x' are incompatible. + Type '{ a: string; b: number; }' is not assignable to type '{ b: string; }'. + Types of property 'b' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(52,15): error TS2320: Interface 'Derived3' cannot simultaneously extend types 'Base1' and 'Base2': +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(52,15): error TS2320: Interface 'Derived3' cannot simultaneously extend types 'Base1' and 'Base2'. Named properties 'x' of types 'Base1' and 'Base2' are not identical. -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(54,15): error TS2429: Interface 'Derived4' incorrectly extends interface 'Base1': - Types of property 'x' are incompatible: - Type '{ a: T; b: T; }' is not assignable to type '{ a: number; }': - Types of property 'a' are incompatible: +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(54,15): error TS2430: Interface 'Derived4' incorrectly extends interface 'Base1'. + Types of property 'x' are incompatible. + Type '{ a: T; b: T; }' is not assignable to type '{ a: number; }'. + Types of property 'a' are incompatible. Type 'T' is not assignable to type 'number'. -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(54,15): error TS2429: Interface 'Derived4' incorrectly extends interface 'Base2': - Types of property 'x' are incompatible: - Type '{ a: T; b: T; }' is not assignable to type '{ b: number; }': - Types of property 'b' are incompatible: +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(54,15): error TS2430: Interface 'Derived4' incorrectly extends interface 'Base2'. + Types of property 'x' are incompatible. + Type '{ a: T; b: T; }' is not assignable to type '{ b: number; }'. + Types of property 'b' are incompatible. Type 'T' is not assignable to type 'number'. -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(60,15): error TS2429: Interface 'Derived5' incorrectly extends interface 'Base1': - Types of property 'x' are incompatible: - Type 'T' is not assignable to type '{ a: T; }': +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(60,15): error TS2430: Interface 'Derived5' incorrectly extends interface 'Base1'. + Types of property 'x' are incompatible. + Type 'T' is not assignable to type '{ a: T; }'. Property 'a' is missing in type '{}'. -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(60,15): error TS2429: Interface 'Derived5' incorrectly extends interface 'Base2': - Types of property 'x' are incompatible: - Type 'T' is not assignable to type '{ b: T; }': +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(60,15): error TS2430: Interface 'Derived5' incorrectly extends interface 'Base2'. + Types of property 'x' are incompatible. + Type 'T' is not assignable to type '{ b: T; }'. Property 'b' is missing in type '{}'. @@ -48,11 +48,11 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBa interface Derived2 extends Base1, Base2 { // error ~~~~~~~~ -!!! error TS2429: Interface 'Derived2' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'x' are incompatible: -!!! error TS2429: Type '{ a: string; b: number; }' is not assignable to type '{ b: string; }': -!!! error TS2429: Types of property 'b' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'Derived2' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '{ a: string; b: number; }' is not assignable to type '{ b: string; }'. +!!! error TS2430: Types of property 'b' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. x: { a: string; b: number; } @@ -85,22 +85,22 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBa interface Derived3 extends Base1, Base2 { } // error ~~~~~~~~ -!!! error TS2320: Interface 'Derived3' cannot simultaneously extend types 'Base1' and 'Base2': +!!! error TS2320: Interface 'Derived3' cannot simultaneously extend types 'Base1' and 'Base2'. !!! error TS2320: Named properties 'x' of types 'Base1' and 'Base2' are not identical. interface Derived4 extends Base1, Base2 { // error ~~~~~~~~ -!!! error TS2429: Interface 'Derived4' incorrectly extends interface 'Base1': -!!! error TS2429: Types of property 'x' are incompatible: -!!! error TS2429: Type '{ a: T; b: T; }' is not assignable to type '{ a: number; }': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'T' is not assignable to type 'number'. +!!! error TS2430: Interface 'Derived4' incorrectly extends interface 'Base1'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '{ a: T; b: T; }' is not assignable to type '{ a: number; }'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type 'number'. ~~~~~~~~ -!!! error TS2429: Interface 'Derived4' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'x' are incompatible: -!!! error TS2429: Type '{ a: T; b: T; }' is not assignable to type '{ b: number; }': -!!! error TS2429: Types of property 'b' are incompatible: -!!! error TS2429: Type 'T' is not assignable to type 'number'. +!!! error TS2430: Interface 'Derived4' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '{ a: T; b: T; }' is not assignable to type '{ b: number; }'. +!!! error TS2430: Types of property 'b' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type 'number'. x: { a: T; b: T; } @@ -108,15 +108,15 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBa interface Derived5 extends Base1, Base2 { // error ~~~~~~~~ -!!! error TS2429: Interface 'Derived5' incorrectly extends interface 'Base1': -!!! error TS2429: Types of property 'x' are incompatible: -!!! error TS2429: Type 'T' is not assignable to type '{ a: T; }': -!!! error TS2429: Property 'a' is missing in type '{}'. +!!! error TS2430: Interface 'Derived5' incorrectly extends interface 'Base1'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type '{ a: T; }'. +!!! error TS2430: Property 'a' is missing in type '{}'. ~~~~~~~~ -!!! error TS2429: Interface 'Derived5' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'x' are incompatible: -!!! error TS2429: Type 'T' is not assignable to type '{ b: T; }': -!!! error TS2429: Property 'b' is missing in type '{}'. +!!! error TS2430: Interface 'Derived5' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type '{ b: T; }'. +!!! error TS2430: Property 'b' is missing in type '{}'. x: T; } } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithMultipleBaseTypes2.errors.txt b/tests/baselines/reference/interfaceWithMultipleBaseTypes2.errors.txt index 9d60afede0a..b3459233923 100644 --- a/tests/baselines/reference/interfaceWithMultipleBaseTypes2.errors.txt +++ b/tests/baselines/reference/interfaceWithMultipleBaseTypes2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes2.ts(17,11): error TS2429: Interface 'Derived2' incorrectly extends interface 'Base': - Types of property 'x' are incompatible: - Type '{ a: number; b: string; }' is not assignable to type '{ a?: string; b: string; }': - Types of property 'a' are incompatible: +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes2.ts(17,11): error TS2430: Interface 'Derived2' incorrectly extends interface 'Base'. + Types of property 'x' are incompatible. + Type '{ a: number; b: string; }' is not assignable to type '{ a?: string; b: string; }'. + Types of property 'a' are incompatible. Type 'number' is not assignable to type 'string'. @@ -24,11 +24,11 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBa interface Derived2 extends Base, Base2 { // error ~~~~~~~~ -!!! error TS2429: Interface 'Derived2' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'x' are incompatible: -!!! error TS2429: Type '{ a: number; b: string; }' is not assignable to type '{ a?: string; b: string; }': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'Derived2' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '{ a: number; b: string; }' is not assignable to type '{ a?: string; b: string; }'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. x: { a: number; b: string } } diff --git a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.errors.txt b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.errors.txt index 60c917d0fbc..79cbd0e6b4e 100644 --- a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.errors.txt +++ b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType.ts(5,11): error TS2429: Interface 'Foo' incorrectly extends interface 'Base': +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType.ts(5,11): error TS2430: Interface 'Foo' incorrectly extends interface 'Base'. Property 'x' is private in type 'Base' but not in type 'Foo'. -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType.ts(13,11): error TS2429: Interface 'Foo2' incorrectly extends interface 'Base2': +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType.ts(13,11): error TS2430: Interface 'Foo2' incorrectly extends interface 'Base2'. Property 'x' is private in type 'Base2' but not in type 'Foo2'. @@ -11,8 +11,8 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyTh interface Foo extends Base { // error ~~~ -!!! error TS2429: Interface 'Foo' incorrectly extends interface 'Base': -!!! error TS2429: Property 'x' is private in type 'Base' but not in type 'Foo'. +!!! error TS2430: Interface 'Foo' incorrectly extends interface 'Base'. +!!! error TS2430: Property 'x' is private in type 'Base' but not in type 'Foo'. x: number; } @@ -22,7 +22,7 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyTh interface Foo2 extends Base2 { // error ~~~~ -!!! error TS2429: Interface 'Foo2' incorrectly extends interface 'Base2': -!!! error TS2429: Property 'x' is private in type 'Base2' but not in type 'Foo2'. +!!! error TS2430: Interface 'Foo2' incorrectly extends interface 'Base2'. +!!! error TS2430: Property 'x' is private in type 'Base2' but not in type 'Foo2'. x: number; } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.errors.txt b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.errors.txt index 4ee4bf8709f..3a31d7dfcbd 100644 --- a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.errors.txt +++ b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType2.ts(5,11): error TS2429: Interface 'Foo' incorrectly extends interface 'Base': +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType2.ts(5,11): error TS2430: Interface 'Foo' incorrectly extends interface 'Base'. Property 'x' is private in type 'Base' but not in type 'Foo'. -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType2.ts(13,11): error TS2429: Interface 'Foo2' incorrectly extends interface 'Base2': +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType2.ts(13,11): error TS2430: Interface 'Foo2' incorrectly extends interface 'Base2'. Property 'x' is private in type 'Base2' but not in type 'Foo2'. @@ -11,8 +11,8 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyTh interface Foo extends Base { // error ~~~ -!!! error TS2429: Interface 'Foo' incorrectly extends interface 'Base': -!!! error TS2429: Property 'x' is private in type 'Base' but not in type 'Foo'. +!!! error TS2430: Interface 'Foo' incorrectly extends interface 'Base'. +!!! error TS2430: Property 'x' is private in type 'Base' but not in type 'Foo'. x(): any; } @@ -22,7 +22,7 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyTh interface Foo2 extends Base2 { // error ~~~~ -!!! error TS2429: Interface 'Foo2' incorrectly extends interface 'Base2': -!!! error TS2429: Property 'x' is private in type 'Base2' but not in type 'Foo2'. +!!! error TS2430: Interface 'Foo2' incorrectly extends interface 'Base2'. +!!! error TS2430: Property 'x' is private in type 'Base2' but not in type 'Foo2'. x(): any; } \ No newline at end of file diff --git a/tests/baselines/reference/invalidBooleanAssignments.errors.txt b/tests/baselines/reference/invalidBooleanAssignments.errors.txt index d7642fa4ace..2a725e0f71d 100644 --- a/tests/baselines/reference/invalidBooleanAssignments.errors.txt +++ b/tests/baselines/reference/invalidBooleanAssignments.errors.txt @@ -2,9 +2,9 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(3, tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(4,5): error TS2323: Type 'boolean' is not assignable to type 'string'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(5,5): error TS2323: Type 'boolean' is not assignable to type 'void'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(9,5): error TS2323: Type 'boolean' is not assignable to type 'E'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(12,5): error TS2322: Type 'boolean' is not assignable to type 'C': +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(12,5): error TS2323: Type 'boolean' is not assignable to type 'C'. Property 'foo' is missing in type 'Boolean'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(15,5): error TS2322: Type 'boolean' is not assignable to type 'I': +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(15,5): error TS2323: Type 'boolean' is not assignable to type 'I'. Property 'bar' is missing in type 'Boolean'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(17,5): error TS2323: Type 'boolean' is not assignable to type '() => string'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(21,1): error TS2364: Invalid left-hand side of assignment expression. @@ -34,14 +34,14 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26 class C { foo: string } var f: C = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'C': -!!! error TS2322: Property 'foo' is missing in type 'Boolean'. +!!! error TS2323: Type 'boolean' is not assignable to type 'C'. +!!! error TS2323: Property 'foo' is missing in type 'Boolean'. interface I { bar: string } var g: I = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'I': -!!! error TS2322: Property 'bar' is missing in type 'Boolean'. +!!! error TS2323: Type 'boolean' is not assignable to type 'I'. +!!! error TS2323: Property 'bar' is missing in type 'Boolean'. var h: { (): string } = x; ~ diff --git a/tests/baselines/reference/invalidNumberAssignments.errors.txt b/tests/baselines/reference/invalidNumberAssignments.errors.txt index 641e02683e6..b2f8123c911 100644 --- a/tests/baselines/reference/invalidNumberAssignments.errors.txt +++ b/tests/baselines/reference/invalidNumberAssignments.errors.txt @@ -1,13 +1,13 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(3,5): error TS2323: Type 'number' is not assignable to type 'boolean'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(4,5): error TS2323: Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(5,5): error TS2323: Type 'number' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(9,5): error TS2322: Type 'number' is not assignable to type 'C': +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(9,5): error TS2323: Type 'number' is not assignable to type 'C'. Property 'foo' is missing in type 'Number'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(12,5): error TS2322: Type 'number' is not assignable to type 'I': +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(12,5): error TS2323: Type 'number' is not assignable to type 'I'. Property 'bar' is missing in type 'Number'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }': +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(14,5): error TS2323: Type 'number' is not assignable to type '{ baz: string; }'. Property 'baz' is missing in type 'Number'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }': +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(15,5): error TS2323: Type 'number' is not assignable to type '{ 0: number; }'. Property '0' is missing in type 'Number'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(21,5): error TS2323: Type 'number' is not assignable to type 'T'. @@ -31,23 +31,23 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1 class C { foo: string; } var e: C = x; ~ -!!! error TS2322: Type 'number' is not assignable to type 'C': -!!! error TS2322: Property 'foo' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type 'C'. +!!! error TS2323: Property 'foo' is missing in type 'Number'. interface I { bar: string; } var f: I = x; ~ -!!! error TS2322: Type 'number' is not assignable to type 'I': -!!! error TS2322: Property 'bar' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type 'I'. +!!! error TS2323: Property 'bar' is missing in type 'Number'. var g: { baz: string } = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }': -!!! error TS2322: Property 'baz' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ baz: string; }'. +!!! error TS2323: Property 'baz' is missing in type 'Number'. var g2: { 0: number } = 1; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }': -!!! error TS2322: Property '0' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ 0: number; }'. +!!! error TS2323: Property '0' is missing in type 'Number'. module M { export var x = 1; } M = x; diff --git a/tests/baselines/reference/invalidReturnStatements.errors.txt b/tests/baselines/reference/invalidReturnStatements.errors.txt index ed15e4543aa..c32f266c0e7 100644 --- a/tests/baselines/reference/invalidReturnStatements.errors.txt +++ b/tests/baselines/reference/invalidReturnStatements.errors.txt @@ -2,9 +2,9 @@ tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(2 tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(3,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(4,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(5,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. -tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(16,29): error TS2322: Type '{ id: number; }' is not assignable to type 'D': +tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(16,29): error TS2323: Type '{ id: number; }' is not assignable to type 'D'. Property 'name' is missing in type '{ id: number; }'. -tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(18,29): error TS2322: Type 'C' is not assignable to type 'D': +tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(18,29): error TS2323: Type 'C' is not assignable to type 'D'. Property 'name' is missing in type 'C'. @@ -34,12 +34,12 @@ tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(1 } function fn10(): D { return { id: 12 }; } ~~~~~~~~~~ -!!! error TS2322: Type '{ id: number; }' is not assignable to type 'D': -!!! error TS2322: Property 'name' is missing in type '{ id: number; }'. +!!! error TS2323: Type '{ id: number; }' is not assignable to type 'D'. +!!! error TS2323: Property 'name' is missing in type '{ id: number; }'. function fn11(): D { return new C(); } ~~~~~~~ -!!! error TS2322: Type 'C' is not assignable to type 'D': -!!! error TS2322: Property 'name' is missing in type 'C'. +!!! error TS2323: Type 'C' is not assignable to type 'D'. +!!! error TS2323: Property 'name' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidStringAssignments.errors.txt b/tests/baselines/reference/invalidStringAssignments.errors.txt index eca680b23cd..7e73f9b634b 100644 --- a/tests/baselines/reference/invalidStringAssignments.errors.txt +++ b/tests/baselines/reference/invalidStringAssignments.errors.txt @@ -1,13 +1,13 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(3,5): error TS2323: Type 'string' is not assignable to type 'boolean'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(4,5): error TS2323: Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(5,5): error TS2323: Type 'string' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(9,5): error TS2322: Type 'string' is not assignable to type 'C': +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(9,5): error TS2323: Type 'string' is not assignable to type 'C'. Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(12,5): error TS2322: Type 'string' is not assignable to type 'I': +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(12,5): error TS2323: Type 'string' is not assignable to type 'I'. Property 'bar' is missing in type 'String'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }': +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(14,5): error TS2323: Type 'number' is not assignable to type '{ baz: string; }'. Property 'baz' is missing in type 'Number'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }': +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(15,5): error TS2323: Type 'number' is not assignable to type '{ 0: number; }'. Property '0' is missing in type 'Number'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(21,5): error TS2323: Type 'string' is not assignable to type 'T'. @@ -32,23 +32,23 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5 class C { foo: string; } var e: C = x; ~ -!!! error TS2322: Type 'string' is not assignable to type 'C': -!!! error TS2322: Property 'foo' is missing in type 'String'. +!!! error TS2323: Type 'string' is not assignable to type 'C'. +!!! error TS2323: Property 'foo' is missing in type 'String'. interface I { bar: string; } var f: I = x; ~ -!!! error TS2322: Type 'string' is not assignable to type 'I': -!!! error TS2322: Property 'bar' is missing in type 'String'. +!!! error TS2323: Type 'string' is not assignable to type 'I'. +!!! error TS2323: Property 'bar' is missing in type 'String'. var g: { baz: string } = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }': -!!! error TS2322: Property 'baz' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ baz: string; }'. +!!! error TS2323: Property 'baz' is missing in type 'Number'. var g2: { 0: number } = 1; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }': -!!! error TS2322: Property '0' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ 0: number; }'. +!!! error TS2323: Property '0' is missing in type 'Number'. module M { export var x = 1; } M = x; diff --git a/tests/baselines/reference/invalidVoidAssignments.errors.txt b/tests/baselines/reference/invalidVoidAssignments.errors.txt index 4ec170717b9..5dc20a63f3a 100644 --- a/tests/baselines/reference/invalidVoidAssignments.errors.txt +++ b/tests/baselines/reference/invalidVoidAssignments.errors.txt @@ -3,9 +3,9 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(4,5): er tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(5,5): error TS2323: Type 'void' is not assignable to type 'number'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(9,5): error TS2323: Type 'void' is not assignable to type 'C'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(12,5): error TS2323: Type 'void' is not assignable to type 'I'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }': +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(14,5): error TS2323: Type 'number' is not assignable to type '{ baz: string; }'. Property 'baz' is missing in type 'Number'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }': +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(15,5): error TS2323: Type 'number' is not assignable to type '{ 0: number; }'. Property '0' is missing in type 'Number'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(21,5): error TS2323: Type 'void' is not assignable to type 'T'. @@ -41,12 +41,12 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): e var g: { baz: string } = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }': -!!! error TS2322: Property 'baz' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ baz: string; }'. +!!! error TS2323: Property 'baz' is missing in type 'Number'. var g2: { 0: number } = 1; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }': -!!! error TS2322: Property '0' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ 0: number; }'. +!!! error TS2323: Property '0' is missing in type 'Number'. module M { export var x = 1; } M = x; diff --git a/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt b/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt index 39e5cfaa834..0e5e9e540be 100644 --- a/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt +++ b/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/lastPropertyInLiteralWins.ts(8,5): error TS2300: Duplicate identifier 'thunk'. tests/cases/compiler/lastPropertyInLiteralWins.ts(9,5): error TS2300: Duplicate identifier 'thunk'. tests/cases/compiler/lastPropertyInLiteralWins.ts(12,6): error TS2345: Argument of type '{ thunk: (num: number) => void; }' is not assignable to parameter of type 'Thing'. - Types of property 'thunk' are incompatible: - Type '(num: number) => void' is not assignable to type '(str: string) => void': - Types of parameters 'num' and 'str' are incompatible: + Types of property 'thunk' are incompatible. + Type '(num: number) => void' is not assignable to type '(str: string) => void'. + Types of parameters 'num' and 'str' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/compiler/lastPropertyInLiteralWins.ts(13,5): error TS2300: Duplicate identifier 'thunk'. tests/cases/compiler/lastPropertyInLiteralWins.ts(14,5): error TS2300: Duplicate identifier 'thunk'. @@ -38,8 +38,8 @@ tests/cases/compiler/lastPropertyInLiteralWins.ts(14,5): error TS2300: Duplicate }); ~ !!! error TS2345: Argument of type '{ thunk: (num: number) => void; }' is not assignable to parameter of type 'Thing'. -!!! error TS2345: Types of property 'thunk' are incompatible: -!!! error TS2345: Type '(num: number) => void' is not assignable to type '(str: string) => void': -!!! error TS2345: Types of parameters 'num' and 'str' are incompatible: +!!! error TS2345: Types of property 'thunk' are incompatible. +!!! error TS2345: Type '(num: number) => void' is not assignable to type '(str: string) => void'. +!!! error TS2345: Types of parameters 'num' and 'str' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.errors.txt b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.errors.txt index f1ee1f383bf..92d4cb17e72 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(13,7): error TS2421: Class 'D' incorrectly implements interface 'A': +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(13,7): error TS2420: Class 'D' incorrectly implements interface 'A'. Types have separate declarations of a private property 'x'. -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(19,7): error TS2421: Class 'E' incorrectly implements interface 'A': +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(19,7): error TS2420: Class 'E' incorrectly implements interface 'A'. Property 'x' is private in type 'A' but not in type 'E'. tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(26,9): error TS2341: Property 'x' is private and only accessible within class 'C'. @@ -20,8 +20,8 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri class D implements A { // error ~ -!!! error TS2421: Class 'D' incorrectly implements interface 'A': -!!! error TS2421: Types have separate declarations of a private property 'x'. +!!! error TS2420: Class 'D' incorrectly implements interface 'A'. +!!! error TS2420: Types have separate declarations of a private property 'x'. private x: number; y: string; z: string; @@ -29,8 +29,8 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri class E implements A { // error ~ -!!! error TS2421: Class 'E' incorrectly implements interface 'A': -!!! error TS2421: Property 'x' is private in type 'A' but not in type 'E'. +!!! error TS2420: Class 'E' incorrectly implements interface 'A'. +!!! error TS2420: Property 'x' is private in type 'A' but not in type 'E'. x: number; y: string; z: string; diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.errors.txt b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.errors.txt index 0ca3b4c3aa2..8fc1f0fe819 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(17,7): error TS2421: Class 'D' incorrectly implements interface 'A': +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(17,7): error TS2420: Class 'D' incorrectly implements interface 'A'. Types have separate declarations of a private property 'w'. -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(23,7): error TS2416: Class 'E' incorrectly extends base class 'C2': +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(23,7): error TS2415: Class 'E' incorrectly extends base class 'C2'. Property 'w' is private in type 'C2' but not in type 'E'. -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(23,7): error TS2421: Class 'E' incorrectly implements interface 'A': +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(23,7): error TS2420: Class 'E' incorrectly implements interface 'A'. Property 'x' is missing in type 'E'. tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(30,9): error TS2341: Property 'x' is private and only accessible within class 'C'. tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(31,10): error TS2341: Property 'w' is private and only accessible within class 'C2'. @@ -27,8 +27,8 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri class D extends C implements A { // error ~ -!!! error TS2421: Class 'D' incorrectly implements interface 'A': -!!! error TS2421: Types have separate declarations of a private property 'w'. +!!! error TS2420: Class 'D' incorrectly implements interface 'A'. +!!! error TS2420: Types have separate declarations of a private property 'w'. private w: number; y: string; z: string; @@ -36,11 +36,11 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri class E extends C2 implements A { // error ~ -!!! error TS2416: Class 'E' incorrectly extends base class 'C2': -!!! error TS2416: Property 'w' is private in type 'C2' but not in type 'E'. +!!! error TS2415: Class 'E' incorrectly extends base class 'C2'. +!!! error TS2415: Property 'w' is private in type 'C2' but not in type 'E'. ~ -!!! error TS2421: Class 'E' incorrectly implements interface 'A': -!!! error TS2421: Property 'x' is missing in type 'E'. +!!! error TS2420: Class 'E' incorrectly implements interface 'A'. +!!! error TS2420: Property 'x' is missing in type 'E'. w: number; y: string; z: string; diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt index 0fadcfde588..4c49e6beb0c 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates3.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates3.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. Named properties 'x' of types 'C' and 'C2' are not identical. -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates3.ts(31,15): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates3.ts(31,15): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. Named properties 'x' of types 'C' and 'C2' are not identical. @@ -15,7 +15,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri interface A extends C { // error ~ -!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. !!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical. y: string; } @@ -40,7 +40,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri interface A extends C { // error, privates conflict ~ -!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. !!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical. y: string; } diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases4.errors.txt b/tests/baselines/reference/mergedInterfacesWithMultipleBases4.errors.txt index 3687a0b79e8..1e11dc792f1 100644 --- a/tests/baselines/reference/mergedInterfacesWithMultipleBases4.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases4.ts(19,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C': +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases4.ts(19,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C'. Named properties 'a' of types 'C' and 'C' are not identical. @@ -23,7 +23,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultip interface A extends C, C3 { // error ~ -!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C': +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C'. !!! error TS2320: Named properties 'a' of types 'C' and 'C' are not identical. y: T; } diff --git a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt index cc93b716d2e..2fb7bd1bfbb 100644 --- a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt +++ b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(10,30): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. - Type 'string | number' is not assignable to type 'number': + Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(11,11): error TS2346: Supplied parameters do not match any signature of call target. @@ -17,7 +17,7 @@ tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(11,11): e var r7 = map([1, ""], (x) => x.toString()); // error ~~~~~~~ !!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. -!!! error TS2345: Type 'string | number' is not assignable to type 'number': +!!! error TS2345: Type 'string | number' is not assignable to type 'number'. !!! error TS2345: Type 'string' is not assignable to type 'number'. var r7b = map([1, ""], (x) => x.toString()); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/multiLineErrors.errors.txt b/tests/baselines/reference/multiLineErrors.errors.txt index 1f28f758c38..f0f5070269b 100644 --- a/tests/baselines/reference/multiLineErrors.errors.txt +++ b/tests/baselines/reference/multiLineErrors.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/multiLineErrors.ts(3,22): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. -tests/cases/compiler/multiLineErrors.ts(21,1): error TS2322: Type 'A2' is not assignable to type 'A1': - Types of property 'x' are incompatible: - Type '{ y: string; }' is not assignable to type '{ y: number; }': - Types of property 'y' are incompatible: +tests/cases/compiler/multiLineErrors.ts(21,1): error TS2323: Type 'A2' is not assignable to type 'A1'. + Types of property 'x' are incompatible. + Type '{ y: string; }' is not assignable to type '{ y: number; }'. + Types of property 'y' are incompatible. Type 'string' is not assignable to type 'number'. @@ -34,9 +34,9 @@ tests/cases/compiler/multiLineErrors.ts(21,1): error TS2322: Type 'A2' is not as var t2: A2; t1 = t2; ~~ -!!! error TS2322: Type 'A2' is not assignable to type 'A1': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type '{ y: string; }' is not assignable to type '{ y: number; }': -!!! error TS2322: Types of property 'y' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'A2' is not assignable to type 'A1'. +!!! error TS2323: Types of property 'x' are incompatible. +!!! error TS2323: Type '{ y: string; }' is not assignable to type '{ y: number; }'. +!!! error TS2323: Types of property 'y' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.errors.txt b/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.errors.txt index d815861d7fb..633f544a67b 100644 --- a/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.errors.txt +++ b/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/multipleBaseInterfaesWithIncompatibleProperties.ts(6,11): error TS2320: Interface 'C' cannot simultaneously extend types 'A' and 'A': +tests/cases/compiler/multipleBaseInterfaesWithIncompatibleProperties.ts(6,11): error TS2320: Interface 'C' cannot simultaneously extend types 'A' and 'A'. Named properties 'x' of types 'A' and 'A' are not identical. @@ -10,6 +10,6 @@ tests/cases/compiler/multipleBaseInterfaesWithIncompatibleProperties.ts(6,11): e interface C extends A, A { } ~ -!!! error TS2320: Interface 'C' cannot simultaneously extend types 'A' and 'A': +!!! error TS2320: Interface 'C' cannot simultaneously extend types 'A' and 'A'. !!! error TS2320: Named properties 'x' of types 'A' and 'A' are not identical. \ No newline at end of file diff --git a/tests/baselines/reference/multipleInheritance.errors.txt b/tests/baselines/reference/multipleInheritance.errors.txt index b482e0a125e..b15a6978ef5 100644 --- a/tests/baselines/reference/multipleInheritance.errors.txt +++ b/tests/baselines/reference/multipleInheritance.errors.txt @@ -2,8 +2,8 @@ tests/cases/compiler/multipleInheritance.ts(9,19): error TS1005: '{' expected. tests/cases/compiler/multipleInheritance.ts(9,24): error TS1005: ';' expected. tests/cases/compiler/multipleInheritance.ts(18,19): error TS1005: '{' expected. tests/cases/compiler/multipleInheritance.ts(18,24): error TS1005: ';' expected. -tests/cases/compiler/multipleInheritance.ts(34,7): error TS2416: Class 'Baad' incorrectly extends base class 'Good': - Types of property 'g' are incompatible: +tests/cases/compiler/multipleInheritance.ts(34,7): error TS2415: Class 'Baad' incorrectly extends base class 'Good'. + Types of property 'g' are incompatible. Type '(n: number) => number' is not assignable to type '() => number'. tests/cases/compiler/multipleInheritance.ts(35,12): error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. @@ -52,9 +52,9 @@ tests/cases/compiler/multipleInheritance.ts(35,12): error TS2425: Class 'Good' d class Baad extends Good { ~~~~ -!!! error TS2416: Class 'Baad' incorrectly extends base class 'Good': -!!! error TS2416: Types of property 'g' are incompatible: -!!! error TS2416: Type '(n: number) => number' is not assignable to type '() => number'. +!!! error TS2415: Class 'Baad' incorrectly extends base class 'Good'. +!!! error TS2415: Types of property 'g' are incompatible. +!!! error TS2415: Type '(n: number) => number' is not assignable to type '() => number'. public f(): number { return 0; } ~ !!! error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. diff --git a/tests/baselines/reference/noImplicitAnyInCastExpression.errors.txt b/tests/baselines/reference/noImplicitAnyInCastExpression.errors.txt index ac52b2365ee..66a7773ab49 100644 --- a/tests/baselines/reference/noImplicitAnyInCastExpression.errors.txt +++ b/tests/baselines/reference/noImplicitAnyInCastExpression.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/noImplicitAnyInCastExpression.ts(16,2): error TS2353: Neither type '{ c: null; }' nor type 'IFoo' is assignable to the other: +tests/cases/compiler/noImplicitAnyInCastExpression.ts(16,2): error TS2352: Neither type '{ c: null; }' nor type 'IFoo' is assignable to the other. Property 'a' is missing in type '{ c: null; }'. @@ -20,5 +20,5 @@ tests/cases/compiler/noImplicitAnyInCastExpression.ts(16,2): error TS2353: Neith // Neither types is assignable to each other ({ c: null }); ~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '{ c: null; }' nor type 'IFoo' is assignable to the other: -!!! error TS2353: Property 'a' is missing in type '{ c: null; }'. \ No newline at end of file +!!! error TS2352: Neither type '{ c: null; }' nor type 'IFoo' is assignable to the other. +!!! error TS2352: Property 'a' is missing in type '{ c: null; }'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt index 9965709713d..6e3a7cf50c8 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt @@ -7,9 +7,9 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(21,5): error TS2412: Property '3.0' of type 'MyNumber' is not assignable to numeric index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(50,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(68,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }': - Index signatures are incompatible: - Type 'string | number' is not assignable to type 'string': +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2323: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }'. + Index signatures are incompatible. + Type 'string | number' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(88,9): error TS2304: Cannot find name 'Myn'. @@ -108,10 +108,10 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo // error var b: { [x: number]: string; } = { ~ -!!! error TS2322: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'string | number' is not assignable to type 'string': -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'string | number' is not assignable to type 'string'. +!!! error TS2323: Type 'number' is not assignable to type 'string'. a: '', b: 1, c: () => { }, diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt index 327a09d8813..adda2ec61d5 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(16,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(25,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(34,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(39,5): error TS2322: Type '{ [x: number]: number | A; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }': - Index signatures are incompatible: - Type 'number | A' is not assignable to type 'A': +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(39,5): error TS2323: Type '{ [x: number]: number | A; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }'. + Index signatures are incompatible. + Type 'number | A' is not assignable to type 'A'. Type 'number' is not assignable to type 'A'. @@ -54,10 +54,10 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo // error var b: { [x: number]: A } = { ~ -!!! error TS2322: Type '{ [x: number]: number | A; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'number | A' is not assignable to type 'A': -!!! error TS2322: Type 'number' is not assignable to type 'A'. +!!! error TS2323: Type '{ [x: number]: number | A; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'number | A' is not assignable to type 'A'. +!!! error TS2323: Type 'number' is not assignable to type 'A'. 1.0: new A(), 2.0: new B(), "2.5": new B(), diff --git a/tests/baselines/reference/numericIndexerConstraint1.errors.txt b/tests/baselines/reference/numericIndexerConstraint1.errors.txt index cd800042c4b..15ab0d557b0 100644 --- a/tests/baselines/reference/numericIndexerConstraint1.errors.txt +++ b/tests/baselines/reference/numericIndexerConstraint1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/numericIndexerConstraint1.ts(3,5): error TS2322: Type 'number' is not assignable to type 'Foo': +tests/cases/compiler/numericIndexerConstraint1.ts(3,5): error TS2323: Type 'number' is not assignable to type 'Foo'. Property 'foo' is missing in type 'Number'. @@ -7,6 +7,6 @@ tests/cases/compiler/numericIndexerConstraint1.ts(3,5): error TS2322: Type 'numb var x: { [index: string]: number; }; var result: Foo = x["one"]; // error ~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'Foo': -!!! error TS2322: Property 'foo' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type 'Foo'. +!!! error TS2323: Property 'foo' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstraint2.errors.txt b/tests/baselines/reference/numericIndexerConstraint2.errors.txt index b31688ca349..cb65a5bffcc 100644 --- a/tests/baselines/reference/numericIndexerConstraint2.errors.txt +++ b/tests/baselines/reference/numericIndexerConstraint2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/numericIndexerConstraint2.ts(4,1): error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: Foo; }': +tests/cases/compiler/numericIndexerConstraint2.ts(4,1): error TS2323: Type '{ one: number; }' is not assignable to type '{ [x: string]: Foo; }'. Index signature is missing in type '{ one: number; }'. @@ -8,5 +8,5 @@ tests/cases/compiler/numericIndexerConstraint2.ts(4,1): error TS2322: Type '{ on var a: { one: number; }; x = a; ~ -!!! error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: Foo; }': -!!! error TS2322: Index signature is missing in type '{ one: number; }'. \ No newline at end of file +!!! error TS2323: Type '{ one: number; }' is not assignable to type '{ [x: string]: Foo; }'. +!!! error TS2323: Index signature is missing in type '{ one: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstraint5.errors.txt b/tests/baselines/reference/numericIndexerConstraint5.errors.txt index 4cccdf0d30b..5bccc56ce0d 100644 --- a/tests/baselines/reference/numericIndexerConstraint5.errors.txt +++ b/tests/baselines/reference/numericIndexerConstraint5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/numericIndexerConstraint5.ts(2,5): error TS2322: Type '{ 0: Date; name: string; }' is not assignable to type '{ [x: number]: string; }': +tests/cases/compiler/numericIndexerConstraint5.ts(2,5): error TS2323: Type '{ 0: Date; name: string; }' is not assignable to type '{ [x: number]: string; }'. Index signature is missing in type '{ 0: Date; name: string; }'. @@ -6,5 +6,5 @@ tests/cases/compiler/numericIndexerConstraint5.ts(2,5): error TS2322: Type '{ 0: var x = { name: "x", 0: new Date() }; var z: { [name: number]: string } = x; ~ -!!! error TS2322: Type '{ 0: Date; name: string; }' is not assignable to type '{ [x: number]: string; }': -!!! error TS2322: Index signature is missing in type '{ 0: Date; name: string; }'. \ No newline at end of file +!!! error TS2323: Type '{ 0: Date; name: string; }' is not assignable to type '{ [x: number]: string; }'. +!!! error TS2323: Index signature is missing in type '{ 0: Date; name: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt b/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt index 25f51e89882..9fa3e39919a 100644 --- a/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt +++ b/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/objectLitStructuralTypeMismatch.ts(2,5): error TS2322: Type '{ b: number; }' is not assignable to type '{ a: number; }': +tests/cases/compiler/objectLitStructuralTypeMismatch.ts(2,5): error TS2323: Type '{ b: number; }' is not assignable to type '{ a: number; }'. Property 'a' is missing in type '{ b: number; }'. @@ -6,5 +6,5 @@ tests/cases/compiler/objectLitStructuralTypeMismatch.ts(2,5): error TS2322: Type // Shouldn't compile var x: { a: number; } = { b: 5 }; ~ -!!! error TS2322: Type '{ b: number; }' is not assignable to type '{ a: number; }': -!!! error TS2322: Property 'a' is missing in type '{ b: number; }'. \ No newline at end of file +!!! error TS2323: Type '{ b: number; }' is not assignable to type '{ a: number; }'. +!!! error TS2323: Property 'a' is missing in type '{ b: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt b/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt index 761cd24c1a0..0d064af3935 100644 --- a/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt +++ b/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/objectLitTargetTypeCallSite.ts(5,9): error TS2345: Argument of type '{ a: boolean; b: string; }' is not assignable to parameter of type '{ a: number; b: string; }'. - Types of property 'a' are incompatible: + Types of property 'a' are incompatible. Type 'boolean' is not assignable to type 'number'. @@ -11,5 +11,5 @@ tests/cases/compiler/objectLitTargetTypeCallSite.ts(5,9): error TS2345: Argument process({a:true,b:"y"}); ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ a: boolean; b: string; }' is not assignable to parameter of type '{ a: number; b: string; }'. -!!! error TS2345: Types of property 'a' are incompatible: +!!! error TS2345: Types of property 'a' are incompatible. !!! error TS2345: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt b/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt index 18aa2c63160..7cd580a219b 100644 --- a/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2322: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }': - Index signatures are incompatible: - Type 'A' is not assignable to type 'B': +tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2323: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }'. + Index signatures are incompatible. + Type 'A' is not assignable to type 'B'. Property 'y' is missing in type 'A'. @@ -19,8 +19,8 @@ tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2322: Type '{ var o1: { [s: string]: A;[n: number]: B; } = { x: b, 0: a }; // both indexers are A ~~ -!!! error TS2322: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'A' is not assignable to type 'B': -!!! error TS2322: Property 'y' is missing in type 'A'. +!!! error TS2323: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'A' is not assignable to type 'B'. +!!! error TS2323: Property 'y' is missing in type 'A'. o1 = { x: c, 0: a }; // string indexer is any, number indexer is A \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt b/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt index 00f724ee0a7..b3b1c6ec6f0 100644 --- a/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt +++ b/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/objectLiteralWithNumericPropertyName.ts(4,5): error TS2322: Type '{ 0: number; }' is not assignable to type 'A': - Types of property '0' are incompatible: +tests/cases/compiler/objectLiteralWithNumericPropertyName.ts(4,5): error TS2323: Type '{ 0: number; }' is not assignable to type 'A'. + Types of property '0' are incompatible. Type 'number' is not assignable to type 'string'. @@ -9,9 +9,9 @@ tests/cases/compiler/objectLiteralWithNumericPropertyName.ts(4,5): error TS2322: } var x: A = { ~ -!!! error TS2322: Type '{ 0: number; }' is not assignable to type 'A': -!!! error TS2322: Types of property '0' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '{ 0: number; }' is not assignable to type 'A'. +!!! error TS2323: Types of property '0' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. 0: 3 }; \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt index 42395ccf0b5..3568899773e 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(7,1): error TS2322: Type 'I' is not assignable to type 'Object': - Types of property 'toString' are incompatible: - Type '() => void' is not assignable to type '() => string': +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(7,1): error TS2323: Type 'I' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => void' is not assignable to type '() => string'. Type 'void' is not assignable to type 'string'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(14,1): error TS2322: Type 'C' is not assignable to type 'Object': - Types of property 'toString' are incompatible: - Type '() => void' is not assignable to type '() => string': +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(14,1): error TS2323: Type 'C' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => void' is not assignable to type '() => string'. Type 'void' is not assignable to type 'string'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(20,1): error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object': - Types of property 'toString' are incompatible: - Type '() => void' is not assignable to type '() => string': +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(20,1): error TS2323: Type '{ toString: () => void; }' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => void' is not assignable to type '() => string'. Type 'void' is not assignable to type 'string'. @@ -21,10 +21,10 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC var o: Object; o = i; // error ~ -!!! error TS2322: Type 'I' is not assignable to type 'Object': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type '() => void' is not assignable to type '() => string': -!!! error TS2322: Type 'void' is not assignable to type 'string'. +!!! error TS2323: Type 'I' is not assignable to type 'Object'. +!!! error TS2323: Types of property 'toString' are incompatible. +!!! error TS2323: Type '() => void' is not assignable to type '() => string'. +!!! error TS2323: Type 'void' is not assignable to type 'string'. i = o; // ok class C { @@ -33,10 +33,10 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC var c: C; o = c; // error ~ -!!! error TS2322: Type 'C' is not assignable to type 'Object': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type '() => void' is not assignable to type '() => string': -!!! error TS2322: Type 'void' is not assignable to type 'string'. +!!! error TS2323: Type 'C' is not assignable to type 'Object'. +!!! error TS2323: Types of property 'toString' are incompatible. +!!! error TS2323: Type '() => void' is not assignable to type '() => string'. +!!! error TS2323: Type 'void' is not assignable to type 'string'. c = o; // ok var a = { @@ -44,8 +44,8 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC } o = a; // error ~ -!!! error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type '() => void' is not assignable to type '() => string': -!!! error TS2322: Type 'void' is not assignable to type 'string'. +!!! error TS2323: Type '{ toString: () => void; }' is not assignable to type 'Object'. +!!! error TS2323: Types of property 'toString' are incompatible. +!!! error TS2323: Type '() => void' is not assignable to type '() => string'. +!!! error TS2323: Type 'void' is not assignable to type 'string'. a = o; // ok \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt index 4a64f34aa5e..3eed6774826 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt @@ -1,22 +1,22 @@ -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(7,1): error TS2322: Type 'I' is not assignable to type 'Object': - Types of property 'toString' are incompatible: - Type '() => number' is not assignable to type '() => string': +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(7,1): error TS2323: Type 'I' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => number' is not assignable to type '() => string'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I': - Types of property 'toString' are incompatible: - Type '() => string' is not assignable to type '() => number': +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(8,1): error TS2323: Type 'Object' is not assignable to type 'I'. + Types of property 'toString' are incompatible. + Type '() => string' is not assignable to type '() => number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(14,1): error TS2322: Type 'C' is not assignable to type 'Object': - Types of property 'toString' are incompatible: - Type '() => number' is not assignable to type '() => string': +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(14,1): error TS2323: Type 'C' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => number' is not assignable to type '() => string'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(15,1): error TS2322: Type 'Object' is not assignable to type 'C': - Types of property 'toString' are incompatible: - Type '() => string' is not assignable to type '() => number': +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(15,1): error TS2323: Type 'Object' is not assignable to type 'C'. + Types of property 'toString' are incompatible. + Type '() => string' is not assignable to type '() => number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(20,1): error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object': - Types of property 'toString' are incompatible: - Type '() => void' is not assignable to type '() => string': +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(20,1): error TS2323: Type '{ toString: () => void; }' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => void' is not assignable to type '() => string'. Type 'void' is not assignable to type 'string'. @@ -29,16 +29,16 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC var o: Object; o = i; // error ~ -!!! error TS2322: Type 'I' is not assignable to type 'Object': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type '() => number' is not assignable to type '() => string': -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type 'I' is not assignable to type 'Object'. +!!! error TS2323: Types of property 'toString' are incompatible. +!!! error TS2323: Type '() => number' is not assignable to type '() => string'. +!!! error TS2323: Type 'number' is not assignable to type 'string'. i = o; // error ~ -!!! error TS2322: Type 'Object' is not assignable to type 'I': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type '() => string' is not assignable to type '() => number': -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'Object' is not assignable to type 'I'. +!!! error TS2323: Types of property 'toString' are incompatible. +!!! error TS2323: Type '() => string' is not assignable to type '() => number'. +!!! error TS2323: Type 'string' is not assignable to type 'number'. class C { toString(): number { return 1; } @@ -46,24 +46,24 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC var c: C; o = c; // error ~ -!!! error TS2322: Type 'C' is not assignable to type 'Object': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type '() => number' is not assignable to type '() => string': -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type 'C' is not assignable to type 'Object'. +!!! error TS2323: Types of property 'toString' are incompatible. +!!! error TS2323: Type '() => number' is not assignable to type '() => string'. +!!! error TS2323: Type 'number' is not assignable to type 'string'. c = o; // error ~ -!!! error TS2322: Type 'Object' is not assignable to type 'C': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type '() => string' is not assignable to type '() => number': -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'Object' is not assignable to type 'C'. +!!! error TS2323: Types of property 'toString' are incompatible. +!!! error TS2323: Type '() => string' is not assignable to type '() => number'. +!!! error TS2323: Type 'string' is not assignable to type 'number'. var a = { toString: () => { } } o = a; // error ~ -!!! error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type '() => void' is not assignable to type '() => string': -!!! error TS2322: Type 'void' is not assignable to type 'string'. +!!! error TS2323: Type '{ toString: () => void; }' is not assignable to type 'Object'. +!!! error TS2323: Types of property 'toString' are incompatible. +!!! error TS2323: Type '() => void' is not assignable to type '() => string'. +!!! error TS2323: Type 'void' is not assignable to type 'string'. a = o; // ok \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt index 6a6fe5965fc..11698f0a51c 100644 --- a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty.ts(13,1): error TS2322: Type 'List' is not assignable to type 'List': +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty.ts(13,1): error TS2323: Type 'List' is not assignable to type 'List'. Type 'string' is not assignable to type 'number'. @@ -17,5 +17,5 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRec list1 = list2; // ok list1 = list3; // error ~~~~~ -!!! error TS2322: Type 'List' is not assignable to type 'List': -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2323: Type 'List' is not assignable to type 'List'. +!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt index bcabfeaa183..53a32b6aad5 100644 --- a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty2.ts(13,1): error TS2322: Type 'List' is not assignable to type 'List': +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty2.ts(13,1): error TS2323: Type 'List' is not assignable to type 'List'. Type 'string' is not assignable to type 'number'. @@ -17,5 +17,5 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRec list1 = list2; // ok list1 = list3; // error ~~~~~ -!!! error TS2322: Type 'List' is not assignable to type 'List': -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2323: Type 'List' is not assignable to type 'List'. +!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt b/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt index 9dc658d1850..20951b6571e 100644 --- a/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(20,1): error TS2322: Type 'MyList' is not assignable to type 'List': - Types of property 'data' are incompatible: +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(20,1): error TS2323: Type 'MyList' is not assignable to type 'List'. + Types of property 'data' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(22,1): error TS2322: Type 'MyList' is not assignable to type 'List': - Types of property 'data' are incompatible: +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(22,1): error TS2323: Type 'MyList' is not assignable to type 'List'. + Types of property 'data' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(30,5): error TS2323: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(31,5): error TS2323: Type 'T' is not assignable to type 'U'. @@ -35,15 +35,15 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRec list1 = myList1; // error, not nominally equal list1 = myList2; // error, type mismatch ~~~~~ -!!! error TS2322: Type 'MyList' is not assignable to type 'List': -!!! error TS2322: Types of property 'data' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type 'MyList' is not assignable to type 'List'. +!!! error TS2323: Types of property 'data' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. list2 = myList1; // error, not nominally equal ~~~~~ -!!! error TS2322: Type 'MyList' is not assignable to type 'List': -!!! error TS2322: Types of property 'data' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type 'MyList' is not assignable to type 'List'. +!!! error TS2323: Types of property 'data' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. list2 = myList2; // error, type mismatch var rList1 = new List>(); diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates3.errors.txt b/tests/baselines/reference/objectTypesIdentityWithPrivates3.errors.txt index c950b935130..9cbaa730022 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates3.errors.txt +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates3.ts(25,1): error TS2353: Neither type 'C3' nor type 'C4' is assignable to the other: +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates3.ts(25,1): error TS2352: Neither type 'C3' nor type 'C4' is assignable to the other. Property 'y' is missing in type 'C3'. @@ -29,5 +29,5 @@ tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectType var c3: C3; c3; // Should fail (private x originates in the same declaration, but different types) ~~~~~~ -!!! error TS2353: Neither type 'C3' nor type 'C4' is assignable to the other: -!!! error TS2353: Property 'y' is missing in type 'C3'. \ No newline at end of file +!!! error TS2352: Neither type 'C3' nor type 'C4' is assignable to the other. +!!! error TS2352: Property 'y' is missing in type 'C3'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt b/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt index a930e9f7657..c1c687f345a 100644 --- a/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt +++ b/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/optionalFunctionArgAssignability.ts(7,1): error TS2322: Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise': - Types of parameters 'onFulFill' and 'onFulfill' are incompatible: - Type '(value: number) => any' is not assignable to type '(value: string) => any': - Types of parameters 'value' and 'value' are incompatible: +tests/cases/compiler/optionalFunctionArgAssignability.ts(7,1): error TS2323: Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise'. + Types of parameters 'onFulFill' and 'onFulfill' are incompatible. + Type '(value: number) => any' is not assignable to type '(value: string) => any'. + Types of parameters 'value' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. @@ -14,9 +14,9 @@ tests/cases/compiler/optionalFunctionArgAssignability.ts(7,1): error TS2322: Typ var b = function then(onFulFill?: (value: number) => U, onReject?: (reason: any) => U): Promise { return null }; a = b; // error because number is not assignable to string ~ -!!! error TS2322: Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise': -!!! error TS2322: Types of parameters 'onFulFill' and 'onFulfill' are incompatible: -!!! error TS2322: Type '(value: number) => any' is not assignable to type '(value: string) => any': -!!! error TS2322: Types of parameters 'value' and 'value' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise'. +!!! error TS2323: Types of parameters 'onFulFill' and 'onFulfill' are incompatible. +!!! error TS2323: Type '(value: number) => any' is not assignable to type '(value: string) => any'. +!!! error TS2323: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt b/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt index f6e9cd01761..a3c76815e30 100644 --- a/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt +++ b/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/optionalParamAssignmentCompat.ts(10,5): error TS2322: Type '(p1?: string) => I1' is not assignable to type 'I1': - Types of parameters 'p1' and 'p1' are incompatible: +tests/cases/compiler/optionalParamAssignmentCompat.ts(10,5): error TS2323: Type '(p1?: string) => I1' is not assignable to type 'I1'. + Types of parameters 'p1' and 'p1' are incompatible. Type 'string' is not assignable to type 'number'. @@ -15,7 +15,7 @@ tests/cases/compiler/optionalParamAssignmentCompat.ts(10,5): error TS2322: Type var c: I1 = i2.p1; // should be ok var d: I1 = i2.m1; // should error ~ -!!! error TS2322: Type '(p1?: string) => I1' is not assignable to type 'I1': -!!! error TS2322: Types of parameters 'p1' and 'p1' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '(p1?: string) => I1' is not assignable to type 'I1'. +!!! error TS2323: Types of parameters 'p1' and 'p1' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamTypeComparison.errors.txt b/tests/baselines/reference/optionalParamTypeComparison.errors.txt index 29ecc73509f..c3fe7cc5d5d 100644 --- a/tests/baselines/reference/optionalParamTypeComparison.errors.txt +++ b/tests/baselines/reference/optionalParamTypeComparison.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/optionalParamTypeComparison.ts(4,1): error TS2322: Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void': - Types of parameters 'b' and 'n' are incompatible: +tests/cases/compiler/optionalParamTypeComparison.ts(4,1): error TS2323: Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void'. + Types of parameters 'b' and 'n' are incompatible. Type 'boolean' is not assignable to type 'number'. -tests/cases/compiler/optionalParamTypeComparison.ts(5,1): error TS2322: Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void': - Types of parameters 'n' and 'b' are incompatible: +tests/cases/compiler/optionalParamTypeComparison.ts(5,1): error TS2323: Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void'. + Types of parameters 'n' and 'b' are incompatible. Type 'number' is not assignable to type 'boolean'. @@ -12,11 +12,11 @@ tests/cases/compiler/optionalParamTypeComparison.ts(5,1): error TS2322: Type '(s f = g; ~ -!!! error TS2322: Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void': -!!! error TS2322: Types of parameters 'b' and 'n' are incompatible: -!!! error TS2322: Type 'boolean' is not assignable to type 'number'. +!!! error TS2323: Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void'. +!!! error TS2323: Types of parameters 'b' and 'n' are incompatible. +!!! error TS2323: Type 'boolean' is not assignable to type 'number'. g = f; ~ -!!! error TS2322: Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void': -!!! error TS2322: Types of parameters 'n' and 'b' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2323: Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void'. +!!! error TS2323: Types of parameters 'n' and 'b' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalPropertiesInClasses.errors.txt b/tests/baselines/reference/optionalPropertiesInClasses.errors.txt index d1193270c0c..7e27dea4df9 100644 --- a/tests/baselines/reference/optionalPropertiesInClasses.errors.txt +++ b/tests/baselines/reference/optionalPropertiesInClasses.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/optionalPropertiesInClasses.ts(10,7): error TS2421: Class 'C2' incorrectly implements interface 'ifoo': +tests/cases/compiler/optionalPropertiesInClasses.ts(10,7): error TS2420: Class 'C2' incorrectly implements interface 'ifoo'. Property 'y' is missing in type 'C2'. @@ -14,8 +14,8 @@ tests/cases/compiler/optionalPropertiesInClasses.ts(10,7): error TS2421: Class ' class C2 implements ifoo { // ERROR - still need 'y' ~~ -!!! error TS2421: Class 'C2' incorrectly implements interface 'ifoo': -!!! error TS2421: Property 'y' is missing in type 'C2'. +!!! error TS2420: Class 'C2' incorrectly implements interface 'ifoo'. +!!! error TS2420: Property 'y' is missing in type 'C2'. public x:number; } diff --git a/tests/baselines/reference/optionalPropertiesTest.errors.txt b/tests/baselines/reference/optionalPropertiesTest.errors.txt index 74b8dd7a73a..1059d05abea 100644 --- a/tests/baselines/reference/optionalPropertiesTest.errors.txt +++ b/tests/baselines/reference/optionalPropertiesTest.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/optionalPropertiesTest.ts(14,1): error TS2322: Type '{ name: string; }' is not assignable to type 'IFoo': +tests/cases/compiler/optionalPropertiesTest.ts(14,1): error TS2323: Type '{ name: string; }' is not assignable to type 'IFoo'. Property 'id' is missing in type '{ name: string; }'. -tests/cases/compiler/optionalPropertiesTest.ts(25,5): error TS2322: Type '{}' is not assignable to type 'i1': +tests/cases/compiler/optionalPropertiesTest.ts(25,5): error TS2323: Type '{}' is not assignable to type 'i1'. Property 'M' is missing in type '{}'. -tests/cases/compiler/optionalPropertiesTest.ts(26,5): error TS2322: Type '{}' is not assignable to type 'i3': +tests/cases/compiler/optionalPropertiesTest.ts(26,5): error TS2323: Type '{}' is not assignable to type 'i3'. Property 'M' is missing in type '{}'. -tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2322: Type 'i2' is not assignable to type 'i1': +tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2323: Type 'i2' is not assignable to type 'i1'. Property 'M' is optional in type 'i2' but required in type 'i1'. @@ -24,8 +24,8 @@ tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2322: Type 'i2' is foo = { id: 1234, name: "test" }; // Ok foo = { name: "test" }; // Error, id missing ~~~ -!!! error TS2322: Type '{ name: string; }' is not assignable to type 'IFoo': -!!! error TS2322: Property 'id' is missing in type '{ name: string; }'. +!!! error TS2323: Type '{ name: string; }' is not assignable to type 'IFoo'. +!!! error TS2323: Property 'id' is missing in type '{ name: string; }'. foo = {id: 1234, print:()=>{}} // Ok var s = foo.name || "default"; @@ -38,12 +38,12 @@ tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2322: Type 'i2' is var test1: i1 = {}; ~~~~~ -!!! error TS2322: Type '{}' is not assignable to type 'i1': -!!! error TS2322: Property 'M' is missing in type '{}'. +!!! error TS2323: Type '{}' is not assignable to type 'i1'. +!!! error TS2323: Property 'M' is missing in type '{}'. var test2: i3 = {}; ~~~~~ -!!! error TS2322: Type '{}' is not assignable to type 'i3': -!!! error TS2322: Property 'M' is missing in type '{}'. +!!! error TS2323: Type '{}' is not assignable to type 'i3'. +!!! error TS2323: Property 'M' is missing in type '{}'. var test3: i2 = {}; var test4: i4 = {}; var test5: i1 = { M: function () { } }; @@ -59,5 +59,5 @@ tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2322: Type 'i2' is var test10_2: i2; test10_1 = test10_2; ~~~~~~~~ -!!! error TS2322: Type 'i2' is not assignable to type 'i1': -!!! error TS2322: Property 'M' is optional in type 'i2' but required in type 'i1'. \ No newline at end of file +!!! error TS2323: Type 'i2' is not assignable to type 'i1'. +!!! error TS2323: Property 'M' is optional in type 'i2' but required in type 'i1'. \ No newline at end of file diff --git a/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt b/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt index cb2635c4a3b..241bbb5729d 100644 --- a/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt +++ b/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/overEagerReturnTypeSpecialization.ts(8,5): error TS2322: Type 'I1' is not assignable to type 'I1': +tests/cases/compiler/overEagerReturnTypeSpecialization.ts(8,5): error TS2323: Type 'I1' is not assignable to type 'I1'. Type 'number' is not assignable to type 'string'. @@ -12,8 +12,8 @@ tests/cases/compiler/overEagerReturnTypeSpecialization.ts(8,5): error TS2322: Ty declare var v1: I1; var r1: I1 = v1.func(num => num.toString()) // Correctly returns an I1 ~~ -!!! error TS2322: Type 'I1' is not assignable to type 'I1': -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type 'I1' is not assignable to type 'I1'. +!!! error TS2323: Type 'number' is not assignable to type 'string'. .func(str => str.length); // should error var r2: I1 = v1.func(num => num.toString()) // Correctly returns an I1 diff --git a/tests/baselines/reference/overloadOnConstInheritance2.errors.txt b/tests/baselines/reference/overloadOnConstInheritance2.errors.txt index f50dcd04a1d..159af64a13a 100644 --- a/tests/baselines/reference/overloadOnConstInheritance2.errors.txt +++ b/tests/baselines/reference/overloadOnConstInheritance2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/overloadOnConstInheritance2.ts(5,11): error TS2429: Interface 'Deriver' incorrectly extends interface 'Base': - Types of property 'addEventListener' are incompatible: +tests/cases/compiler/overloadOnConstInheritance2.ts(5,11): error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. + Types of property 'addEventListener' are incompatible. Type '(x: 'bar') => string' is not assignable to type '{ (x: string): any; (x: 'foo'): string; }'. tests/cases/compiler/overloadOnConstInheritance2.ts(6,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. @@ -11,9 +11,9 @@ tests/cases/compiler/overloadOnConstInheritance2.ts(6,5): error TS2382: Speciali } interface Deriver extends Base { ~~~~~~~ -!!! error TS2429: Interface 'Deriver' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'addEventListener' are incompatible: -!!! error TS2429: Type '(x: 'bar') => string' is not assignable to type '{ (x: string): any; (x: 'foo'): string; }'. +!!! error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'addEventListener' are incompatible. +!!! error TS2430: Type '(x: 'bar') => string' is not assignable to type '{ (x: string): any; (x: 'foo'): string; }'. addEventListener(x: 'bar'): string; // shouldn't need to redeclare the string overload ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. diff --git a/tests/baselines/reference/overloadOnConstInheritance3.errors.txt b/tests/baselines/reference/overloadOnConstInheritance3.errors.txt index 4ddb7d3669a..e0fff7b1ec7 100644 --- a/tests/baselines/reference/overloadOnConstInheritance3.errors.txt +++ b/tests/baselines/reference/overloadOnConstInheritance3.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/overloadOnConstInheritance3.ts(4,11): error TS2429: Interface 'Deriver' incorrectly extends interface 'Base': - Types of property 'addEventListener' are incompatible: +tests/cases/compiler/overloadOnConstInheritance3.ts(4,11): error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. + Types of property 'addEventListener' are incompatible. Type '{ (x: 'bar'): string; (x: 'foo'): string; }' is not assignable to type '(x: string) => any'. tests/cases/compiler/overloadOnConstInheritance3.ts(6,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. tests/cases/compiler/overloadOnConstInheritance3.ts(7,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. @@ -11,9 +11,9 @@ tests/cases/compiler/overloadOnConstInheritance3.ts(7,5): error TS2382: Speciali } interface Deriver extends Base { ~~~~~~~ -!!! error TS2429: Interface 'Deriver' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'addEventListener' are incompatible: -!!! error TS2429: Type '{ (x: 'bar'): string; (x: 'foo'): string; }' is not assignable to type '(x: string) => any'. +!!! error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'addEventListener' are incompatible. +!!! error TS2430: Type '{ (x: 'bar'): string; (x: 'foo'): string; }' is not assignable to type '(x: string) => any'. // shouldn't need to redeclare the string overload addEventListener(x: 'bar'): string; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index 6e9be0cc516..9f51c0fa10b 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -1,12 +1,12 @@ tests/cases/compiler/overloadResolutionTest1.ts(8,16): error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. - Type '{ a: string; }' is not assignable to type '{ a: boolean; }': - Types of property 'a' are incompatible: + Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. + Types of property 'a' are incompatible. Type 'string' is not assignable to type 'boolean'. tests/cases/compiler/overloadResolutionTest1.ts(19,15): error TS2345: Argument of type '{ a: string; }' is not assignable to parameter of type '{ a: boolean; }'. - Types of property 'a' are incompatible: + Types of property 'a' are incompatible. Type 'string' is not assignable to type 'boolean'. tests/cases/compiler/overloadResolutionTest1.ts(25,14): error TS2345: Argument of type '{ a: boolean; }' is not assignable to parameter of type '{ a: string; }'. - Types of property 'a' are incompatible: + Types of property 'a' are incompatible. Type 'boolean' is not assignable to type 'string'. @@ -21,8 +21,8 @@ tests/cases/compiler/overloadResolutionTest1.ts(25,14): error TS2345: Argument o var x111 = foo([{a:"s"}]); // error - does not match any signature ~~~~~~~~~ !!! error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. -!!! error TS2345: Type '{ a: string; }' is not assignable to type '{ a: boolean; }': -!!! error TS2345: Types of property 'a' are incompatible: +!!! error TS2345: Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. +!!! error TS2345: Types of property 'a' are incompatible. !!! error TS2345: Type 'string' is not assignable to type 'boolean'. var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string @@ -37,7 +37,7 @@ tests/cases/compiler/overloadResolutionTest1.ts(25,14): error TS2345: Argument o var x4 = foo2({a:"s"}); // error ~~~~~~~ !!! error TS2345: Argument of type '{ a: string; }' is not assignable to parameter of type '{ a: boolean; }'. -!!! error TS2345: Types of property 'a' are incompatible: +!!! error TS2345: Types of property 'a' are incompatible. !!! error TS2345: Type 'string' is not assignable to type 'boolean'. @@ -47,5 +47,5 @@ tests/cases/compiler/overloadResolutionTest1.ts(25,14): error TS2345: Argument o var x = foo4({a:true}); // error ~~~~~~~~ !!! error TS2345: Argument of type '{ a: boolean; }' is not assignable to parameter of type '{ a: string; }'. -!!! error TS2345: Types of property 'a' are incompatible: +!!! error TS2345: Types of property 'a' are incompatible. !!! error TS2345: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadingOnConstants1.errors.txt b/tests/baselines/reference/overloadingOnConstants1.errors.txt index bc277dc0795..e52a2a10e5b 100644 --- a/tests/baselines/reference/overloadingOnConstants1.errors.txt +++ b/tests/baselines/reference/overloadingOnConstants1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/overloadingOnConstants1.ts(22,5): error TS2322: Type 'Base' is not assignable to type 'Derived1': +tests/cases/compiler/overloadingOnConstants1.ts(22,5): error TS2323: Type 'Base' is not assignable to type 'Derived1'. Property 'bar' is missing in type 'Base'. -tests/cases/compiler/overloadingOnConstants1.ts(23,5): error TS2322: Type 'Derived1' is not assignable to type 'Derived3': +tests/cases/compiler/overloadingOnConstants1.ts(23,5): error TS2323: Type 'Derived1' is not assignable to type 'Derived3'. Property 'biz' is missing in type 'Derived1'. -tests/cases/compiler/overloadingOnConstants1.ts(24,5): error TS2322: Type 'Derived2' is not assignable to type 'Derived1': +tests/cases/compiler/overloadingOnConstants1.ts(24,5): error TS2323: Type 'Derived2' is not assignable to type 'Derived1'. Property 'bar' is missing in type 'Derived2'. -tests/cases/compiler/overloadingOnConstants1.ts(25,5): error TS2322: Type 'Derived3' is not assignable to type 'Derived1': +tests/cases/compiler/overloadingOnConstants1.ts(25,5): error TS2323: Type 'Derived3' is not assignable to type 'Derived1'. Property 'bar' is missing in type 'Derived3'. @@ -32,17 +32,17 @@ tests/cases/compiler/overloadingOnConstants1.ts(25,5): error TS2322: Type 'Deriv // these are errors var htmlElement2: Derived1 = d2.createElement("yo") ~~~~~~~~~~~~ -!!! error TS2322: Type 'Base' is not assignable to type 'Derived1': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2323: Type 'Base' is not assignable to type 'Derived1'. +!!! error TS2323: Property 'bar' is missing in type 'Base'. var htmlCanvasElement2: Derived3 = d2.createElement("canvas"); ~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'Derived1' is not assignable to type 'Derived3': -!!! error TS2322: Property 'biz' is missing in type 'Derived1'. +!!! error TS2323: Type 'Derived1' is not assignable to type 'Derived3'. +!!! error TS2323: Property 'biz' is missing in type 'Derived1'. var htmlDivElement2: Derived1 = d2.createElement("div"); ~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived1': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived1'. +!!! error TS2323: Property 'bar' is missing in type 'Derived2'. var htmlSpanElement2: Derived1 = d2.createElement("span"); ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'Derived3' is not assignable to type 'Derived1': -!!! error TS2322: Property 'bar' is missing in type 'Derived3'. \ No newline at end of file +!!! error TS2323: Type 'Derived3' is not assignable to type 'Derived1'. +!!! error TS2323: Property 'bar' is missing in type 'Derived3'. \ No newline at end of file diff --git a/tests/baselines/reference/overridingPrivateStaticMembers.errors.txt b/tests/baselines/reference/overridingPrivateStaticMembers.errors.txt index 6d51014f005..c63856a9ee1 100644 --- a/tests/baselines/reference/overridingPrivateStaticMembers.errors.txt +++ b/tests/baselines/reference/overridingPrivateStaticMembers.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/overridingPrivateStaticMembers.ts(5,7): error TS2418: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2': +tests/cases/compiler/overridingPrivateStaticMembers.ts(5,7): error TS2417: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2'. Types have separate declarations of a private property 'y'. @@ -9,7 +9,7 @@ tests/cases/compiler/overridingPrivateStaticMembers.ts(5,7): error TS2418: Class class Derived2 extends Base2 { ~~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2': -!!! error TS2418: Types have separate declarations of a private property 'y'. +!!! error TS2417: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2'. +!!! error TS2417: Types have separate declarations of a private property 'y'. private static y: { foo: string; bar: string; }; } \ No newline at end of file diff --git a/tests/baselines/reference/parseTypes.errors.txt b/tests/baselines/reference/parseTypes.errors.txt index 96d004c5b01..ccaf7be59bf 100644 --- a/tests/baselines/reference/parseTypes.errors.txt +++ b/tests/baselines/reference/parseTypes.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/parseTypes.ts(9,1): error TS2323: Type '(s: string) => void' is not assignable to type '() => number'. tests/cases/compiler/parseTypes.ts(10,1): error TS2323: Type '(s: string) => void' is not assignable to type '() => number'. -tests/cases/compiler/parseTypes.ts(11,1): error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }': +tests/cases/compiler/parseTypes.ts(11,1): error TS2323: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. Index signature is missing in type '(s: string) => void'. tests/cases/compiler/parseTypes.ts(12,1): error TS2323: Type '(s: string) => void' is not assignable to type 'new () => number'. @@ -22,8 +22,8 @@ tests/cases/compiler/parseTypes.ts(12,1): error TS2323: Type '(s: string) => voi !!! error TS2323: Type '(s: string) => void' is not assignable to type '() => number'. w=g; ~ -!!! error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }': -!!! error TS2322: Index signature is missing in type '(s: string) => void'. +!!! error TS2323: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. +!!! error TS2323: Index signature is missing in type '(s: string) => void'. z=g; ~ !!! error TS2323: Type '(s: string) => void' is not assignable to type 'new () => number'. diff --git a/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt b/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt index 6779ebb9c07..940083ca93a 100644 --- a/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt +++ b/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(16,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(16,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'boolean' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(25,1): error TS2304: Cannot find name 'runTestCase'. @@ -21,7 +21,7 @@ tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(25,1): error T var _float = -(4/3); var a = new Array(false,undefined,null,"0",obj,-1.3333333333333, "str",-0,true,+0, one, 1,0, false, _float, -(4/3)); ~~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'boolean' is not a valid type argument because it is not a supertype of candidate 'string'. if (a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3) a.indexOf(0) === 7 && // a[7] = +0, 0===+0 diff --git a/tests/baselines/reference/parserObjectCreation1.errors.txt b/tests/baselines/reference/parserObjectCreation1.errors.txt index 211a3620b19..876f49c5bed 100644 --- a/tests/baselines/reference/parserObjectCreation1.errors.txt +++ b/tests/baselines/reference/parserObjectCreation1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/Generics/parserObjectCreation1.ts(1,5): error TS2322: Type 'number[][]' is not assignable to type 'number[]': +tests/cases/conformance/parser/ecmascript5/Generics/parserObjectCreation1.ts(1,5): error TS2323: Type 'number[][]' is not assignable to type 'number[]'. Type 'number[]' is not assignable to type 'number'. ==== tests/cases/conformance/parser/ecmascript5/Generics/parserObjectCreation1.ts (1 errors) ==== var autoToken: number[] = new Array(1); ~~~~~~~~~ -!!! error TS2322: Type 'number[][]' is not assignable to type 'number[]': -!!! error TS2322: Type 'number[]' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2323: Type 'number[][]' is not assignable to type 'number[]'. +!!! error TS2323: Type 'number[]' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/privateInterfaceProperties.errors.txt b/tests/baselines/reference/privateInterfaceProperties.errors.txt index faff968379f..2c363ad40cc 100644 --- a/tests/baselines/reference/privateInterfaceProperties.errors.txt +++ b/tests/baselines/reference/privateInterfaceProperties.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/privateInterfaceProperties.ts(4,7): error TS2421: Class 'c1' incorrectly implements interface 'i1': +tests/cases/compiler/privateInterfaceProperties.ts(4,7): error TS2420: Class 'c1' incorrectly implements interface 'i1'. Property 'name' is private in type 'c1' but not in type 'i1'. @@ -8,8 +8,8 @@ tests/cases/compiler/privateInterfaceProperties.ts(4,7): error TS2421: Class 'c1 // should be an error class c1 implements i1 { private name:string; } ~~ -!!! error TS2421: Class 'c1' incorrectly implements interface 'i1': -!!! error TS2421: Property 'name' is private in type 'c1' but not in type 'i1'. +!!! error TS2420: Class 'c1' incorrectly implements interface 'i1'. +!!! error TS2420: Property 'name' is private in type 'c1' but not in type 'i1'. // should be ok class c2 implements i1 { public name:string; } diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index 855614eb76e..9104d924e66 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -20,19 +20,19 @@ tests/cases/compiler/promisePermutations.ts(120,19): error TS2345: Argument of t tests/cases/compiler/promisePermutations.ts(121,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations.ts(122,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations.ts(126,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(129,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: - Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +tests/cases/compiler/promisePermutations.ts(129,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations.ts(132,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations.ts(133,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations.ts(134,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(137,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: - Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +tests/cases/compiler/promisePermutations.ts(137,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(144,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: - Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +tests/cases/compiler/promisePermutations.ts(144,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(152,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/compiler/promisePermutations.ts(152,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. tests/cases/compiler/promisePermutations.ts(156,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations.ts(158,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. @@ -215,8 +215,8 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok ~~~~~~~ -!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: -!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Type 'string' is not assignable to type 'number'. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; @@ -233,8 +233,8 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~ -!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: -!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Type 'string' is not assignable to type 'number'. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok @@ -244,8 +244,8 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok ~~~~~~~~ -!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: -!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Type 'string' is not assignable to type 'number'. var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s10 = testFunction10P(x => x); @@ -256,7 +256,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error ~~~~~~~~ -!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index 5338df82121..3c316115a27 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -20,19 +20,19 @@ tests/cases/compiler/promisePermutations2.ts(119,19): error TS2345: Argument of tests/cases/compiler/promisePermutations2.ts(120,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations2.ts(121,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(125,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(128,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: - Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +tests/cases/compiler/promisePermutations2.ts(128,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations2.ts(131,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(132,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations2.ts(133,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(136,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: - Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +tests/cases/compiler/promisePermutations2.ts(136,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations2.ts(143,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: - Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +tests/cases/compiler/promisePermutations2.ts(143,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations2.ts(151,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/compiler/promisePermutations2.ts(151,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. tests/cases/compiler/promisePermutations2.ts(155,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(157,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. @@ -214,8 +214,8 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~ -!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: -!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Type 'string' is not assignable to type 'number'. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; @@ -232,8 +232,8 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~ -!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: -!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Type 'string' is not assignable to type 'number'. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok @@ -243,8 +243,8 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~~ -!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: -!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Type 'string' is not assignable to type 'number'. var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s10 = testFunction10P(x => x); @@ -255,7 +255,7 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error ~~~~~~~~ -!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 58e37629cf5..f8edf83c694 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -21,19 +21,19 @@ tests/cases/compiler/promisePermutations3.ts(119,19): error TS2345: Argument of tests/cases/compiler/promisePermutations3.ts(120,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations3.ts(121,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations3.ts(125,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(128,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: - Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +tests/cases/compiler/promisePermutations3.ts(128,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations3.ts(131,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations3.ts(132,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations3.ts(133,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(136,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: - Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +tests/cases/compiler/promisePermutations3.ts(136,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(143,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: - Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +tests/cases/compiler/promisePermutations3.ts(143,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(151,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/compiler/promisePermutations3.ts(151,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. tests/cases/compiler/promisePermutations3.ts(155,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations3.ts(157,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. @@ -218,8 +218,8 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~ -!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: -!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Type 'string' is not assignable to type 'number'. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; @@ -236,8 +236,8 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~ -!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: -!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Type 'string' is not assignable to type 'number'. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok @@ -247,8 +247,8 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~~ -!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: -!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise': +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Type 'string' is not assignable to type 'number'. var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s10 = testFunction10P(x => x); @@ -259,7 +259,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error ~~~~~~~~ -!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok diff --git a/tests/baselines/reference/propertyParameterWithQuestionMark.errors.txt b/tests/baselines/reference/propertyParameterWithQuestionMark.errors.txt index e68922ccf36..681d2c5ea9a 100644 --- a/tests/baselines/reference/propertyParameterWithQuestionMark.errors.txt +++ b/tests/baselines/reference/propertyParameterWithQuestionMark.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/propertyParameterWithQuestionMark.ts(6,5): error TS2322: Type '{}' is not assignable to type 'C': +tests/cases/compiler/propertyParameterWithQuestionMark.ts(6,5): error TS2323: Type '{}' is not assignable to type 'C'. Property 'x' is missing in type '{}'. -tests/cases/compiler/propertyParameterWithQuestionMark.ts(8,1): error TS2322: Type '{ x?: any; }' is not assignable to type 'C': +tests/cases/compiler/propertyParameterWithQuestionMark.ts(8,1): error TS2323: Type '{ x?: any; }' is not assignable to type 'C'. Property 'x' is optional in type '{ x?: any; }' but required in type 'C'. @@ -12,11 +12,11 @@ tests/cases/compiler/propertyParameterWithQuestionMark.ts(8,1): error TS2322: Ty // x should not be an optional property var v: C = {}; // Should fail ~ -!!! error TS2322: Type '{}' is not assignable to type 'C': -!!! error TS2322: Property 'x' is missing in type '{}'. +!!! error TS2323: Type '{}' is not assignable to type 'C'. +!!! error TS2323: Property 'x' is missing in type '{}'. var v2: { x? } v = v2; // Should fail ~ -!!! error TS2322: Type '{ x?: any; }' is not assignable to type 'C': -!!! error TS2322: Property 'x' is optional in type '{ x?: any; }' but required in type 'C'. +!!! error TS2323: Type '{ x?: any; }' is not assignable to type 'C'. +!!! error TS2323: Property 'x' is optional in type '{ x?: any; }' but required in type 'C'. var v3: { x } = new C; // Should succeed \ No newline at end of file diff --git a/tests/baselines/reference/protectedMembers.errors.txt b/tests/baselines/reference/protectedMembers.errors.txt index ce9529a7f67..cab3a682400 100644 --- a/tests/baselines/reference/protectedMembers.errors.txt +++ b/tests/baselines/reference/protectedMembers.errors.txt @@ -9,11 +9,11 @@ tests/cases/compiler/protectedMembers.ts(48,1): error TS2445: Property 'sx' is p tests/cases/compiler/protectedMembers.ts(49,1): error TS2445: Property 'sf' is protected and only accessible within class 'C2' and its subclasses. tests/cases/compiler/protectedMembers.ts(68,9): error TS2446: Property 'x' is protected and only accessible through an instance of class 'C'. tests/cases/compiler/protectedMembers.ts(69,9): error TS2446: Property 'x' is protected and only accessible through an instance of class 'C'. -tests/cases/compiler/protectedMembers.ts(98,1): error TS2322: Type 'B1' is not assignable to type 'A1': +tests/cases/compiler/protectedMembers.ts(98,1): error TS2323: Type 'B1' is not assignable to type 'A1'. Property 'x' is protected but type 'B1' is not a class derived from 'A1'. -tests/cases/compiler/protectedMembers.ts(99,1): error TS2322: Type 'A1' is not assignable to type 'B1': +tests/cases/compiler/protectedMembers.ts(99,1): error TS2323: Type 'A1' is not assignable to type 'B1'. Property 'x' is protected in type 'A1' but public in type 'B1'. -tests/cases/compiler/protectedMembers.ts(112,7): error TS2416: Class 'B3' incorrectly extends base class 'A3': +tests/cases/compiler/protectedMembers.ts(112,7): error TS2415: Class 'B3' incorrectly extends base class 'A3'. Property 'x' is protected in type 'B3' but public in type 'A3'. @@ -139,12 +139,12 @@ tests/cases/compiler/protectedMembers.ts(112,7): error TS2416: Class 'B3' incorr var b1: B1; a1 = b1; // Error, B1 doesn't derive from A1 ~~ -!!! error TS2322: Type 'B1' is not assignable to type 'A1': -!!! error TS2322: Property 'x' is protected but type 'B1' is not a class derived from 'A1'. +!!! error TS2323: Type 'B1' is not assignable to type 'A1'. +!!! error TS2323: Property 'x' is protected but type 'B1' is not a class derived from 'A1'. b1 = a1; // Error, x is protected in A1 but public in B1 ~~ -!!! error TS2322: Type 'A1' is not assignable to type 'B1': -!!! error TS2322: Property 'x' is protected in type 'A1' but public in type 'B1'. +!!! error TS2323: Type 'A1' is not assignable to type 'B1'. +!!! error TS2323: Property 'x' is protected in type 'A1' but public in type 'B1'. class A2 { protected x; @@ -159,8 +159,8 @@ tests/cases/compiler/protectedMembers.ts(112,7): error TS2416: Class 'B3' incorr // Error x is protected in B3 but public in A3 class B3 extends A3 { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A3': -!!! error TS2416: Property 'x' is protected in type 'B3' but public in type 'A3'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A3'. +!!! error TS2415: Property 'x' is protected in type 'B3' but public in type 'A3'. protected x; } diff --git a/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.errors.txt b/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.errors.txt index b5404823218..3083338f573 100644 --- a/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.errors.txt +++ b/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/publicMemberImplementedAsPrivateInDerivedClass.ts(4,7): error TS2421: Class 'Foo' incorrectly implements interface 'Qux': +tests/cases/compiler/publicMemberImplementedAsPrivateInDerivedClass.ts(4,7): error TS2420: Class 'Foo' incorrectly implements interface 'Qux'. Property 'Bar' is private in type 'Foo' but not in type 'Qux'. @@ -8,8 +8,8 @@ tests/cases/compiler/publicMemberImplementedAsPrivateInDerivedClass.ts(4,7): err } class Foo implements Qux { ~~~ -!!! error TS2421: Class 'Foo' incorrectly implements interface 'Qux': -!!! error TS2421: Property 'Bar' is private in type 'Foo' but not in type 'Qux'. +!!! error TS2420: Class 'Foo' incorrectly implements interface 'Qux'. +!!! error TS2420: Property 'Bar' is private in type 'Foo' but not in type 'Qux'. private Bar: number; } \ No newline at end of file diff --git a/tests/baselines/reference/qualify.errors.txt b/tests/baselines/reference/qualify.errors.txt index 2ae8ea57b25..761dbab6b1b 100644 --- a/tests/baselines/reference/qualify.errors.txt +++ b/tests/baselines/reference/qualify.errors.txt @@ -1,16 +1,16 @@ -tests/cases/compiler/qualify.ts(21,13): error TS2322: Type 'number' is not assignable to type 'I': +tests/cases/compiler/qualify.ts(21,13): error TS2323: Type 'number' is not assignable to type 'I'. Property 'p' is missing in type 'Number'. -tests/cases/compiler/qualify.ts(30,13): error TS2322: Type 'number' is not assignable to type 'I2': +tests/cases/compiler/qualify.ts(30,13): error TS2323: Type 'number' is not assignable to type 'I2'. Property 'q' is missing in type 'Number'. -tests/cases/compiler/qualify.ts(45,13): error TS2322: Type 'I4' is not assignable to type 'I3': +tests/cases/compiler/qualify.ts(45,13): error TS2323: Type 'I4' is not assignable to type 'I3'. Property 'zeep' is missing in type 'I4'. -tests/cases/compiler/qualify.ts(46,13): error TS2322: Type 'I4' is not assignable to type 'I3[]': +tests/cases/compiler/qualify.ts(46,13): error TS2323: Type 'I4' is not assignable to type 'I3[]'. Property 'length' is missing in type 'I4'. tests/cases/compiler/qualify.ts(47,13): error TS2323: Type 'I4' is not assignable to type '() => I3'. tests/cases/compiler/qualify.ts(48,13): error TS2323: Type 'I4' is not assignable to type '(k: I3) => void'. -tests/cases/compiler/qualify.ts(49,13): error TS2322: Type 'I4' is not assignable to type '{ k: I3; }': +tests/cases/compiler/qualify.ts(49,13): error TS2323: Type 'I4' is not assignable to type '{ k: I3; }'. Property 'k' is missing in type 'I4'. -tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable to type 'I': +tests/cases/compiler/qualify.ts(58,5): error TS2323: Type 'I' is not assignable to type 'I'. Property 'p' is missing in type 'I'. @@ -37,8 +37,8 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable export module U { var z:I=3; ~ -!!! error TS2322: Type 'number' is not assignable to type 'I': -!!! error TS2322: Property 'p' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type 'I'. +!!! error TS2323: Property 'p' is missing in type 'Number'. export interface I2 { q; } @@ -49,8 +49,8 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable export module U2 { var z:T.U.I2=3; ~ -!!! error TS2322: Type 'number' is not assignable to type 'I2': -!!! error TS2322: Property 'q' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type 'I2'. +!!! error TS2323: Property 'q' is missing in type 'Number'. } } @@ -67,12 +67,12 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable var v1:I4; var v2:K1.I3=v1; ~~ -!!! error TS2322: Type 'I4' is not assignable to type 'I3': -!!! error TS2322: Property 'zeep' is missing in type 'I4'. +!!! error TS2323: Type 'I4' is not assignable to type 'I3'. +!!! error TS2323: Property 'zeep' is missing in type 'I4'. var v3:K1.I3[]=v1; ~~ -!!! error TS2322: Type 'I4' is not assignable to type 'I3[]': -!!! error TS2322: Property 'length' is missing in type 'I4'. +!!! error TS2323: Type 'I4' is not assignable to type 'I3[]'. +!!! error TS2323: Property 'length' is missing in type 'I4'. var v4:()=>K1.I3=v1; ~~ !!! error TS2323: Type 'I4' is not assignable to type '() => I3'. @@ -81,8 +81,8 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable !!! error TS2323: Type 'I4' is not assignable to type '(k: I3) => void'. var v6:{k:K1.I3;}=v1; ~~ -!!! error TS2322: Type 'I4' is not assignable to type '{ k: I3; }': -!!! error TS2322: Property 'k' is missing in type 'I4'. +!!! error TS2323: Type 'I4' is not assignable to type '{ k: I3; }'. +!!! error TS2323: Property 'k' is missing in type 'I4'. } } @@ -93,7 +93,7 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable var y:I; var x:T.I=y; ~ -!!! error TS2322: Type 'I' is not assignable to type 'I': -!!! error TS2322: Property 'p' is missing in type 'I'. +!!! error TS2323: Type 'I' is not assignable to type 'I'. +!!! error TS2323: Property 'p' is missing in type 'I'. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index cb26efe3472..c287a713e2b 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/recursiveFunctionTypes.ts(1,35): error TS2323: Type 'number' is not assignable to type '() => typeof fn'. tests/cases/compiler/recursiveFunctionTypes.ts(3,5): error TS2323: Type '() => typeof fn' is not assignable to type 'number'. -tests/cases/compiler/recursiveFunctionTypes.ts(4,5): error TS2322: Type '() => typeof fn' is not assignable to type '() => number': +tests/cases/compiler/recursiveFunctionTypes.ts(4,5): error TS2323: Type '() => typeof fn' is not assignable to type '() => number'. Type '() => typeof fn' is not assignable to type 'number'. tests/cases/compiler/recursiveFunctionTypes.ts(11,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. tests/cases/compiler/recursiveFunctionTypes.ts(12,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. @@ -24,8 +24,8 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of !!! error TS2323: Type '() => typeof fn' is not assignable to type 'number'. var y: () => number = fn; // ok ~ -!!! error TS2322: Type '() => typeof fn' is not assignable to type '() => number': -!!! error TS2322: Type '() => typeof fn' is not assignable to type 'number'. +!!! error TS2323: Type '() => typeof fn' is not assignable to type '() => number'. +!!! error TS2323: Type '() => typeof fn' is not assignable to type 'number'. var f: () => typeof g; var g: () => typeof f; diff --git a/tests/baselines/reference/recursiveInheritance3.errors.txt b/tests/baselines/reference/recursiveInheritance3.errors.txt index 494aa26a201..6ec3935ece4 100644 --- a/tests/baselines/reference/recursiveInheritance3.errors.txt +++ b/tests/baselines/reference/recursiveInheritance3.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/recursiveInheritance3.ts(1,7): error TS2421: Class 'C' incorrectly implements interface 'I': +tests/cases/compiler/recursiveInheritance3.ts(1,7): error TS2420: Class 'C' incorrectly implements interface 'I'. Property 'other' is missing in type 'C'. ==== tests/cases/compiler/recursiveInheritance3.ts (1 errors) ==== class C implements I { ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'I': -!!! error TS2421: Property 'other' is missing in type 'C'. +!!! error TS2420: Class 'C' incorrectly implements interface 'I'. +!!! error TS2420: Property 'other' is missing in type 'C'. public foo(x: any) { return x; } private x = 1; } diff --git a/tests/baselines/reference/redefineArray.errors.txt b/tests/baselines/reference/redefineArray.errors.txt index 063c5b67480..86c8c8aee33 100644 --- a/tests/baselines/reference/redefineArray.errors.txt +++ b/tests/baselines/reference/redefineArray.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/redefineArray.ts(1,1): error TS2322: Type '(n: number, s: string) => number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }': +tests/cases/compiler/redefineArray.ts(1,1): error TS2323: Type '(n: number, s: string) => number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. Property 'isArray' is missing in type '(n: number, s: string) => number'. ==== tests/cases/compiler/redefineArray.ts (1 errors) ==== Array = function (n:number, s:string) {return n;}; ~~~~~ -!!! error TS2322: Type '(n: number, s: string) => number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }': -!!! error TS2322: Property 'isArray' is missing in type '(n: number, s: string) => number'. \ No newline at end of file +!!! error TS2323: Type '(n: number, s: string) => number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. +!!! error TS2323: Property 'isArray' is missing in type '(n: number, s: string) => number'. \ No newline at end of file diff --git a/tests/baselines/reference/restArgAssignmentCompat.errors.txt b/tests/baselines/reference/restArgAssignmentCompat.errors.txt index 3a02ecf63ab..a7397ffc157 100644 --- a/tests/baselines/reference/restArgAssignmentCompat.errors.txt +++ b/tests/baselines/reference/restArgAssignmentCompat.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/restArgAssignmentCompat.ts(7,1): error TS2322: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void': - Types of parameters 'x' and 'x' are incompatible: - Type 'number' is not assignable to type 'number[]': +tests/cases/compiler/restArgAssignmentCompat.ts(7,1): error TS2323: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number' is not assignable to type 'number[]'. Property 'length' is missing in type 'Number'. @@ -13,9 +13,9 @@ tests/cases/compiler/restArgAssignmentCompat.ts(7,1): error TS2322: Type '(...x: var n = g; n = f; ~ -!!! error TS2322: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'number[]': -!!! error TS2322: Property 'length' is missing in type 'Number'. +!!! error TS2323: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void'. +!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'number[]'. +!!! error TS2323: Property 'length' is missing in type 'Number'. n([4], 'foo'); \ No newline at end of file diff --git a/tests/baselines/reference/scopeTests.errors.txt b/tests/baselines/reference/scopeTests.errors.txt index 59749eaf396..ce24301efc2 100644 --- a/tests/baselines/reference/scopeTests.errors.txt +++ b/tests/baselines/reference/scopeTests.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/scopeTests.ts(2,7): error TS2416: Class 'D' incorrectly extends base class 'C': +tests/cases/compiler/scopeTests.ts(2,7): error TS2415: Class 'D' incorrectly extends base class 'C'. Property 'v' is private in type 'C' but not in type 'D'. @@ -6,8 +6,8 @@ tests/cases/compiler/scopeTests.ts(2,7): error TS2416: Class 'D' incorrectly ext class C { private v; public p; static s; } class D extends C { ~ -!!! error TS2416: Class 'D' incorrectly extends base class 'C': -!!! error TS2416: Property 'v' is private in type 'C' but not in type 'D'. +!!! error TS2415: Class 'D' incorrectly extends base class 'C'. +!!! error TS2415: Property 'v' is private in type 'C' but not in type 'D'. public v: number; public p: number constructor() { diff --git a/tests/baselines/reference/shadowPrivateMembers.errors.txt b/tests/baselines/reference/shadowPrivateMembers.errors.txt index 94dd577c1c4..2196224b7c4 100644 --- a/tests/baselines/reference/shadowPrivateMembers.errors.txt +++ b/tests/baselines/reference/shadowPrivateMembers.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/shadowPrivateMembers.ts(2,7): error TS2416: Class 'derived' incorrectly extends base class 'base': +tests/cases/compiler/shadowPrivateMembers.ts(2,7): error TS2415: Class 'derived' incorrectly extends base class 'base'. Types have separate declarations of a private property 'n'. @@ -6,6 +6,6 @@ tests/cases/compiler/shadowPrivateMembers.ts(2,7): error TS2416: Class 'derived' class base { private n() {} } class derived extends base { private n() {} } ~~~~~~~ -!!! error TS2416: Class 'derived' incorrectly extends base class 'base': -!!! error TS2416: Types have separate declarations of a private property 'n'. +!!! error TS2415: Class 'derived' incorrectly extends base class 'base'. +!!! error TS2415: Types have separate declarations of a private property 'n'. \ No newline at end of file diff --git a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt index dc3446cb368..4bb3baf2f84 100644 --- a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt +++ b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/staticMemberAssignsToConstructorFunctionMembers.ts(7,9): error TS2322: Type '() => void' is not assignable to type '(x: number) => number': +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/staticMemberAssignsToConstructorFunctionMembers.ts(7,9): error TS2323: Type '() => void' is not assignable to type '(x: number) => number'. Type 'void' is not assignable to type 'number'. @@ -11,8 +11,8 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclara static bar(x: number): number { C.bar = () => { } // error ~~~~~ -!!! error TS2322: Type '() => void' is not assignable to type '(x: number) => number': -!!! error TS2322: Type 'void' is not assignable to type 'number'. +!!! error TS2323: Type '() => void' is not assignable to type '(x: number) => number'. +!!! error TS2323: Type 'void' is not assignable to type 'number'. C.bar = (x) => x; // ok C.bar = (x: number) => 1; // ok return 1; diff --git a/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt b/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt index bb2ba1747a4..6e855cdfeb2 100644 --- a/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt +++ b/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(12,1): error TS2322: Type 'C' is not assignable to type 'A': +tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(12,1): error TS2323: Type 'C' is not assignable to type 'A'. Property 'name' is missing in type 'C'. -tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(13,1): error TS2322: Type 'typeof B' is not assignable to type 'A': +tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(13,1): error TS2323: Type 'typeof B' is not assignable to type 'A'. Property 'name' is missing in type 'typeof B'. -tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(16,5): error TS2322: Type 'C' is not assignable to type 'B': +tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(16,5): error TS2323: Type 'C' is not assignable to type 'B'. Property 'name' is missing in type 'C'. -tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(17,1): error TS2322: Type 'typeof B' is not assignable to type 'B': +tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(17,1): error TS2323: Type 'typeof B' is not assignable to type 'B'. Property 'name' is missing in type 'typeof B'. @@ -22,22 +22,22 @@ tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment. var a: A = new B(); a = new C(); // error name is missing ~ -!!! error TS2322: Type 'C' is not assignable to type 'A': -!!! error TS2322: Property 'name' is missing in type 'C'. +!!! error TS2323: Type 'C' is not assignable to type 'A'. +!!! error TS2323: Property 'name' is missing in type 'C'. a = B; // error name is missing ~ -!!! error TS2322: Type 'typeof B' is not assignable to type 'A': -!!! error TS2322: Property 'name' is missing in type 'typeof B'. +!!! error TS2323: Type 'typeof B' is not assignable to type 'A'. +!!! error TS2323: Property 'name' is missing in type 'typeof B'. a = C; var b: B = new C(); // error name is missing ~ -!!! error TS2322: Type 'C' is not assignable to type 'B': -!!! error TS2322: Property 'name' is missing in type 'C'. +!!! error TS2323: Type 'C' is not assignable to type 'B'. +!!! error TS2323: Property 'name' is missing in type 'C'. b = B; // error name is missing ~ -!!! error TS2322: Type 'typeof B' is not assignable to type 'B': -!!! error TS2322: Property 'name' is missing in type 'typeof B'. +!!! error TS2323: Type 'typeof B' is not assignable to type 'B'. +!!! error TS2323: Property 'name' is missing in type 'typeof B'. b = C; b = a; diff --git a/tests/baselines/reference/stringIndexerAssignments1.errors.txt b/tests/baselines/reference/stringIndexerAssignments1.errors.txt index 63e8430b7f4..b4ca39eaa2f 100644 --- a/tests/baselines/reference/stringIndexerAssignments1.errors.txt +++ b/tests/baselines/reference/stringIndexerAssignments1.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/stringIndexerAssignments1.ts(4,1): error TS2322: Type '{ one: string; }' is not assignable to type '{ [x: string]: string; one: string; }': +tests/cases/compiler/stringIndexerAssignments1.ts(4,1): error TS2323: Type '{ one: string; }' is not assignable to type '{ [x: string]: string; one: string; }'. Index signature is missing in type '{ one: string; }'. -tests/cases/compiler/stringIndexerAssignments1.ts(5,1): error TS2322: Type '{ one: number; two: string; }' is not assignable to type '{ [x: string]: string; one: string; }': - Types of property 'one' are incompatible: +tests/cases/compiler/stringIndexerAssignments1.ts(5,1): error TS2323: Type '{ one: number; two: string; }' is not assignable to type '{ [x: string]: string; one: string; }'. + Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string'. @@ -11,11 +11,11 @@ tests/cases/compiler/stringIndexerAssignments1.ts(5,1): error TS2322: Type '{ on var b: { one: number; two: string; }; x = a; ~ -!!! error TS2322: Type '{ one: string; }' is not assignable to type '{ [x: string]: string; one: string; }': -!!! error TS2322: Index signature is missing in type '{ one: string; }'. +!!! error TS2323: Type '{ one: string; }' is not assignable to type '{ [x: string]: string; one: string; }'. +!!! error TS2323: Index signature is missing in type '{ one: string; }'. x = b; // error ~ -!!! error TS2322: Type '{ one: number; two: string; }' is not assignable to type '{ [x: string]: string; one: string; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '{ one: number; two: string; }' is not assignable to type '{ [x: string]: string; one: string; }'. +!!! error TS2323: Types of property 'one' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/stringIndexerAssignments2.errors.txt b/tests/baselines/reference/stringIndexerAssignments2.errors.txt index 73e108f824f..73472081d9a 100644 --- a/tests/baselines/reference/stringIndexerAssignments2.errors.txt +++ b/tests/baselines/reference/stringIndexerAssignments2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/stringIndexerAssignments2.ts(19,1): error TS2322: Type 'C2' is not assignable to type 'C1': +tests/cases/compiler/stringIndexerAssignments2.ts(19,1): error TS2323: Type 'C2' is not assignable to type 'C1'. Index signature is missing in type 'C2'. -tests/cases/compiler/stringIndexerAssignments2.ts(20,1): error TS2322: Type 'C3' is not assignable to type 'C1': - Types of property 'one' are incompatible: +tests/cases/compiler/stringIndexerAssignments2.ts(20,1): error TS2323: Type 'C3' is not assignable to type 'C1'. + Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string'. @@ -26,10 +26,10 @@ tests/cases/compiler/stringIndexerAssignments2.ts(20,1): error TS2322: Type 'C3' x = a; ~ -!!! error TS2322: Type 'C2' is not assignable to type 'C1': -!!! error TS2322: Index signature is missing in type 'C2'. +!!! error TS2323: Type 'C2' is not assignable to type 'C1'. +!!! error TS2323: Index signature is missing in type 'C2'. x = b; ~ -!!! error TS2322: Type 'C3' is not assignable to type 'C1': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2323: Type 'C3' is not assignable to type 'C1'. +!!! error TS2323: Types of property 'one' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt index 8039cdf01f0..cc9d56cff57 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt @@ -24,9 +24,9 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(71,5): error TS2411: Property 'foo' of type '() => string' is not assignable to string index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(73,5): error TS2411: Property '"4.0"' of type 'number' is not assignable to string index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(74,5): error TS2411: Property 'f' of type 'MyString' is not assignable to string index type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ [x: string]: string | number | MyString | (() => void); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo: () => string; }' is not assignable to type '{ [x: string]: string; }': - Index signatures are incompatible: - Type 'string | number | MyString | (() => void)' is not assignable to type 'string': +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2323: Type '{ [x: string]: string | number | MyString | (() => void); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo: () => string; }' is not assignable to type '{ [x: string]: string; }'. + Index signatures are incompatible. + Type 'string | number | MyString | (() => void)' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. @@ -160,10 +160,10 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon // error var b: { [x: string]: string; } = { ~ -!!! error TS2322: Type '{ [x: string]: string | number | MyString | (() => void); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo: () => string; }' is not assignable to type '{ [x: string]: string; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'string | number | MyString | (() => void)' is not assignable to type 'string': -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '{ [x: string]: string | number | MyString | (() => void); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo: () => string; }' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'string | number | MyString | (() => void)' is not assignable to type 'string'. +!!! error TS2323: Type 'number' is not assignable to type 'string'. a: '', b: 1, c: () => { }, diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt index 4ac335c2465..4e3a0152b56 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt @@ -4,9 +4,9 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(24,5): error TS2411: Property 'd' of type 'string' is not assignable to string index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(31,5): error TS2411: Property 'c' of type 'number' is not assignable to string index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(32,5): error TS2411: Property 'd' of type 'string' is not assignable to string index type 'A'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(36,5): error TS2322: Type '{ [x: string]: typeof A; a: typeof A; b: typeof B; }' is not assignable to type '{ [x: string]: A; }': - Index signatures are incompatible: - Type 'typeof A' is not assignable to type 'A': +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(36,5): error TS2323: Type '{ [x: string]: typeof A; a: typeof A; b: typeof B; }' is not assignable to type '{ [x: string]: A; }'. + Index signatures are incompatible. + Type 'typeof A' is not assignable to type 'A'. Property 'foo' is missing in type 'typeof A'. @@ -60,10 +60,10 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon // error var b: { [x: string]: A } = { ~ -!!! error TS2322: Type '{ [x: string]: typeof A; a: typeof A; b: typeof B; }' is not assignable to type '{ [x: string]: A; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'typeof A' is not assignable to type 'A': -!!! error TS2322: Property 'foo' is missing in type 'typeof A'. +!!! error TS2323: Type '{ [x: string]: typeof A; a: typeof A; b: typeof B; }' is not assignable to type '{ [x: string]: A; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'typeof A' is not assignable to type 'A'. +!!! error TS2323: Property 'foo' is missing in type 'typeof A'. a: A, b: B } \ No newline at end of file diff --git a/tests/baselines/reference/subtypesOfTypeParameter.errors.txt b/tests/baselines/reference/subtypesOfTypeParameter.errors.txt index bdb3c9a056f..042d8227b78 100644 --- a/tests/baselines/reference/subtypesOfTypeParameter.errors.txt +++ b/tests/baselines/reference/subtypesOfTypeParameter.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameter.ts(7,7): error TS2416: Class 'D1' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameter.ts(7,7): error TS2415: Class 'D1' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameter.ts(95,21): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. @@ -13,9 +13,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D1 extends C3 { ~~ -!!! error TS2416: Class 'D1' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'T'. +!!! error TS2415: Class 'D1' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'T'. foo: U; // error } diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.errors.txt b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.errors.txt index 1cf24d3c809..eeedf58ab73 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.errors.txt +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.errors.txt @@ -1,111 +1,111 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(7,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(12,7): error TS2416: Class 'D2' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(12,7): error TS2415: Class 'D2' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(12,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(14,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(17,7): error TS2416: Class 'D3' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(17,7): error TS2415: Class 'D3' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(17,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(19,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(22,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(31,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(31,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(36,7): error TS2416: Class 'D6' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(36,7): error TS2415: Class 'D6' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(36,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(36,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(38,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(41,7): error TS2416: Class 'D7' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(41,7): error TS2415: Class 'D7' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(41,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(41,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(43,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(48,7): error TS2416: Class 'D8' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(48,7): error TS2415: Class 'D8' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(48,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(48,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(50,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(53,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(53,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(58,7): error TS2416: Class 'D10' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(58,7): error TS2415: Class 'D10' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(58,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(58,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(60,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(65,7): error TS2416: Class 'D11' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(65,7): error TS2415: Class 'D11' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(65,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(65,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(67,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(70,7): error TS2416: Class 'D12' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(70,7): error TS2415: Class 'D12' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(70,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(70,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(72,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(75,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(75,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(83,7): error TS2416: Class 'D14' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(83,7): error TS2415: Class 'D14' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'Date'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(83,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(83,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(85,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'Date'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(88,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(88,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(93,7): error TS2416: Class 'D16' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(93,7): error TS2415: Class 'D16' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(93,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(93,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(95,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(98,7): error TS2416: Class 'D17' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(98,7): error TS2415: Class 'D17' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(98,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(98,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(100,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(105,7): error TS2416: Class 'D18' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(105,7): error TS2415: Class 'D18' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'Date'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(105,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(105,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(107,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'Date'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(110,7): error TS2416: Class 'D19' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(110,7): error TS2415: Class 'D19' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(110,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(110,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(112,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(115,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(115,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(120,7): error TS2416: Class 'D21' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(120,7): error TS2415: Class 'D21' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(120,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(120,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(122,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(127,7): error TS2416: Class 'D22' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(127,7): error TS2415: Class 'D22' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'Date'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(127,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(127,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(129,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'Date'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(132,7): error TS2416: Class 'D23' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(132,7): error TS2415: Class 'D23' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(132,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(132,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(134,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(137,7): error TS2416: Class 'D24' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(137,7): error TS2415: Class 'D24' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(137,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(137,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. @@ -114,20 +114,20 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(142,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(149,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(149,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(154,7): error TS2416: Class 'D27' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(154,7): error TS2415: Class 'D27' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'Date' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(154,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(154,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(156,5): error TS2411: Property 'foo' of type 'Date' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(159,7): error TS2416: Class 'D28' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(159,7): error TS2415: Class 'D28' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'Date' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(159,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(159,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(161,5): error TS2411: Property 'foo' of type 'Date' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(164,7): error TS2416: Class 'D29' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(164,7): error TS2415: Class 'D29' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'Date' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(164,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(164,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. @@ -150,9 +150,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D2 extends C3 { ~~ -!!! error TS2416: Class 'D2' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'U'. +!!! error TS2415: Class 'D2' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'U'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: U; @@ -163,9 +163,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D3 extends C3 { ~~ -!!! error TS2416: Class 'D3' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'T'. +!!! error TS2415: Class 'D3' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'T'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: T; @@ -196,9 +196,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D6 extends C3 { ~~ -!!! error TS2416: Class 'D6' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'U'. +!!! error TS2415: Class 'D6' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'U'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -211,9 +211,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D7 extends C3 { ~~ -!!! error TS2416: Class 'D7' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'V'. +!!! error TS2415: Class 'D7' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'V'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -228,9 +228,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf // only a subtype of V and itself class D8 extends C3 { ~~ -!!! error TS2416: Class 'D8' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'T'. +!!! error TS2415: Class 'D8' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'T'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -252,9 +252,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D10 extends C3 { ~~~ -!!! error TS2416: Class 'D10' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'V'. +!!! error TS2415: Class 'D10' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'V'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -269,9 +269,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf // only a subtype of itself class D11 extends C3 { ~~~ -!!! error TS2416: Class 'D11' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'T'. +!!! error TS2415: Class 'D11' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'T'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -284,9 +284,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D12 extends C3 { ~~~ -!!! error TS2416: Class 'D12' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'U'. +!!! error TS2415: Class 'D12' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'U'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -311,9 +311,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf // should all work class D14 extends C3 { ~~~ -!!! error TS2416: Class 'D14' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'Date'. +!!! error TS2415: Class 'D14' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'Date'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -335,9 +335,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D16 extends C3 { ~~~ -!!! error TS2416: Class 'D16' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'U'. +!!! error TS2415: Class 'D16' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'U'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -350,9 +350,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D17 extends C3 { ~~~ -!!! error TS2416: Class 'D17' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'V'. +!!! error TS2415: Class 'D17' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'V'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -367,9 +367,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf // only a subtype of V, Date and itself class D18 extends C3 { ~~~ -!!! error TS2416: Class 'D18' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'Date'. +!!! error TS2415: Class 'D18' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'Date'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -382,9 +382,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D19 extends C3 { ~~~ -!!! error TS2416: Class 'D19' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'T'. +!!! error TS2415: Class 'D19' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'T'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -406,9 +406,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D21 extends C3 { ~~~ -!!! error TS2416: Class 'D21' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'V'. +!!! error TS2415: Class 'D21' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'V'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -423,9 +423,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf // only a subtype of itself and Date class D22 extends C3 { ~~~ -!!! error TS2416: Class 'D22' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'Date'. +!!! error TS2415: Class 'D22' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'Date'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -438,9 +438,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D23 extends C3 { ~~~ -!!! error TS2416: Class 'D23' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'T'. +!!! error TS2415: Class 'D23' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'T'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -453,9 +453,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D24 extends C3 { ~~~ -!!! error TS2416: Class 'D24' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'U'. +!!! error TS2415: Class 'D24' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'U'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -488,9 +488,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D27 extends C3 { ~~~ -!!! error TS2416: Class 'D27' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'Date' is not assignable to type 'T'. +!!! error TS2415: Class 'D27' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'Date' is not assignable to type 'T'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -503,9 +503,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D28 extends C3 { ~~~ -!!! error TS2416: Class 'D28' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'Date' is not assignable to type 'U'. +!!! error TS2415: Class 'D28' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'Date' is not assignable to type 'U'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -518,9 +518,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D29 extends C3 { ~~~ -!!! error TS2416: Class 'D29' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'Date' is not assignable to type 'V'. +!!! error TS2415: Class 'D29' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'Date' is not assignable to type 'V'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.errors.txt b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.errors.txt index 872cb8ef965..a9b025ccc77 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.errors.txt +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.errors.txt @@ -1,22 +1,22 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(45,7): error TS2416: Class 'D3' incorrectly extends base class 'B1': - Types of property 'foo' are incompatible: - Type 'V' is not assignable to type 'Foo': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(45,7): error TS2415: Class 'D3' incorrectly extends base class 'B1'. + Types of property 'foo' are incompatible. + Type 'V' is not assignable to type 'Foo'. Property 'foo' is missing in type '{}'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(47,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'Foo'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(55,7): error TS2416: Class 'D5' incorrectly extends base class 'B1': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(55,7): error TS2415: Class 'D5' incorrectly extends base class 'B1'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(57,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(60,7): error TS2416: Class 'D6' incorrectly extends base class 'B1': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(60,7): error TS2415: Class 'D6' incorrectly extends base class 'B1'. + Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(62,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(65,7): error TS2416: Class 'D7' incorrectly extends base class 'B1': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(65,7): error TS2415: Class 'D7' incorrectly extends base class 'B1'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(67,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(75,7): error TS2416: Class 'D9' incorrectly extends base class 'B1': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(75,7): error TS2415: Class 'D9' incorrectly extends base class 'B1'. + Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(77,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'U'. @@ -68,10 +68,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D3 extends B1 { ~~ -!!! error TS2416: Class 'D3' incorrectly extends base class 'B1': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'Foo': -!!! error TS2416: Property 'foo' is missing in type '{}'. +!!! error TS2415: Class 'D3' incorrectly extends base class 'B1'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'Foo'. +!!! error TS2415: Property 'foo' is missing in type '{}'. [x: string]: Foo; foo: V; // error ~~~~~~~ @@ -85,9 +85,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D5 extends B1 { ~~ -!!! error TS2416: Class 'D5' incorrectly extends base class 'B1': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'T'. +!!! error TS2415: Class 'D5' incorrectly extends base class 'B1'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'T'. [x: string]: T; foo: U; // error ~~~~~~~ @@ -96,9 +96,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D6 extends B1 { ~~ -!!! error TS2416: Class 'D6' incorrectly extends base class 'B1': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'T'. +!!! error TS2415: Class 'D6' incorrectly extends base class 'B1'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'T'. [x: string]: T; foo: V; // error ~~~~~~~ @@ -107,9 +107,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D7 extends B1 { ~~ -!!! error TS2416: Class 'D7' incorrectly extends base class 'B1': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'U'. +!!! error TS2415: Class 'D7' incorrectly extends base class 'B1'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'U'. [x: string]: U; foo: T; // error ~~~~~~~ @@ -123,9 +123,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D9 extends B1 { ~~ -!!! error TS2416: Class 'D9' incorrectly extends base class 'B1': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'U'. +!!! error TS2415: Class 'D9' incorrectly extends base class 'B1'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'U'. [x: string]: U; foo: V; // error ~~~~~~~ diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.errors.txt b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.errors.txt index f4b1d7ef041..867b622cf1a 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.errors.txt +++ b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.errors.txt @@ -4,22 +4,22 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(61,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(61,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(61,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(66,11): error TS2416: Class 'D2' incorrectly extends base class 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(66,11): error TS2415: Class 'D2' incorrectly extends base class 'Base'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(66,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(66,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(66,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(68,9): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(71,11): error TS2416: Class 'D3' incorrectly extends base class 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(71,11): error TS2415: Class 'D3' incorrectly extends base class 'Base'. + Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(71,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(71,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(71,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(73,9): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(76,11): error TS2416: Class 'D4' incorrectly extends base class 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(76,11): error TS2415: Class 'D4' incorrectly extends base class 'Base'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(76,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(76,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. @@ -28,22 +28,22 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(81,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(81,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(81,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(86,11): error TS2416: Class 'D6' incorrectly extends base class 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(86,11): error TS2415: Class 'D6' incorrectly extends base class 'Base'. + Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(86,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(86,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(86,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(88,9): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(91,11): error TS2416: Class 'D7' incorrectly extends base class 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(91,11): error TS2415: Class 'D7' incorrectly extends base class 'Base'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(91,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(91,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(91,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(93,9): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(96,11): error TS2416: Class 'D8' incorrectly extends base class 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(96,11): error TS2415: Class 'D8' incorrectly extends base class 'Base'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(96,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(96,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. @@ -167,9 +167,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D2, U extends Foo, V extends Foo> extends Base { ~~ -!!! error TS2416: Class 'D2' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'T'. +!!! error TS2415: Class 'D2' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'T'. ~~~~~~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~~~~~~ @@ -184,9 +184,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D3, U extends Foo, V extends Foo> extends Base { ~~ -!!! error TS2416: Class 'D3' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'T'. +!!! error TS2415: Class 'D3' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'T'. ~~~~~~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~~~~~~ @@ -201,9 +201,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D4, U extends Foo, V extends Foo> extends Base { ~~ -!!! error TS2416: Class 'D4' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'U'. +!!! error TS2415: Class 'D4' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'U'. ~~~~~~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~~~~~~ @@ -229,9 +229,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D6, U extends Foo, V extends Foo> extends Base { ~~ -!!! error TS2416: Class 'D6' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'U'. +!!! error TS2415: Class 'D6' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'U'. ~~~~~~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~~~~~~ @@ -246,9 +246,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D7, U extends Foo, V extends Foo> extends Base { ~~ -!!! error TS2416: Class 'D7' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'V'. +!!! error TS2415: Class 'D7' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'V'. ~~~~~~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~~~~~~ @@ -263,9 +263,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D8, U extends Foo, V extends Foo> extends Base { ~~ -!!! error TS2416: Class 'D8' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'V'. +!!! error TS2415: Class 'D8' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'V'. ~~~~~~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt index 918d219cec5..b5d23da2241 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts(19,11): error TS2429: Interface 'I3' incorrectly extends interface 'Base': - Types of property 'a' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts(19,11): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. + Types of property 'a' are incompatible. Type '(x: number) => number' is not assignable to type '() => number'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts(49,11): error TS2429: Interface 'I10' incorrectly extends interface 'Base': - Types of property 'a3' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts(49,11): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. + Types of property 'a3' are incompatible. Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. @@ -27,9 +27,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3 extends Base { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type '(x: number) => number' is not assignable to type '() => number'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type '(x: number) => number' is not assignable to type '() => number'. a: (x: number) => number; // error, too many required params } @@ -61,9 +61,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10 extends Base { ~~~ -!!! error TS2429: Interface 'I10' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. +!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. a3: (x: number, y: number) => number; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithCallSignaturesWithRestParameters.errors.txt b/tests/baselines/reference/subtypingWithCallSignaturesWithRestParameters.errors.txt index 4392862d189..f4a141ff390 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesWithRestParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesWithRestParameters.errors.txt @@ -1,57 +1,57 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(18,11): error TS2429: Interface 'I1C' incorrectly extends interface 'Base': - Types of property 'a' are incompatible: - Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number': - Types of parameters 'args' and 'args' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(18,11): error TS2430: Interface 'I1C' incorrectly extends interface 'Base'. + Types of property 'a' are incompatible. + Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. + Types of parameters 'args' and 'args' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(34,11): error TS2429: Interface 'I3B' incorrectly extends interface 'Base': - Types of property 'a' are incompatible: - Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number': - Types of parameters 'x' and 'args' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(34,11): error TS2430: Interface 'I3B' incorrectly extends interface 'Base'. + Types of property 'a' are incompatible. + Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. + Types of parameters 'x' and 'args' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(60,11): error TS2429: Interface 'I6C' incorrectly extends interface 'Base': - Types of property 'a2' are incompatible: - Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number': - Types of parameters 'args' and 'z' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(60,11): error TS2430: Interface 'I6C' incorrectly extends interface 'Base'. + Types of property 'a2' are incompatible. + Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. + Types of parameters 'args' and 'z' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(90,11): error TS2429: Interface 'I10B' incorrectly extends interface 'Base': - Types of property 'a3' are incompatible: - Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': - Types of parameters 'y' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(90,11): error TS2430: Interface 'I10B' incorrectly extends interface 'Base'. + Types of property 'a3' are incompatible. + Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(94,11): error TS2429: Interface 'I10C' incorrectly extends interface 'Base': - Types of property 'a3' are incompatible: - Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': - Types of parameters 'z' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(94,11): error TS2430: Interface 'I10C' incorrectly extends interface 'Base'. + Types of property 'a3' are incompatible. + Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Types of parameters 'z' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(98,11): error TS2429: Interface 'I10D' incorrectly extends interface 'Base': - Types of property 'a3' are incompatible: - Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(98,11): error TS2430: Interface 'I10D' incorrectly extends interface 'Base'. + Types of property 'a3' are incompatible. + Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(102,11): error TS2429: Interface 'I10E' incorrectly extends interface 'Base': - Types of property 'a3' are incompatible: - Type '(x: number, ...z: string[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': - Types of parameters 'z' and 'z' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(102,11): error TS2430: Interface 'I10E' incorrectly extends interface 'Base'. + Types of property 'a3' are incompatible. + Type '(x: number, ...z: string[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Types of parameters 'z' and 'z' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(110,11): error TS2429: Interface 'I12' incorrectly extends interface 'Base': - Types of property 'a4' are incompatible: - Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': - Types of parameters 'y' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(110,11): error TS2430: Interface 'I12' incorrectly extends interface 'Base'. + Types of property 'a4' are incompatible. + Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. + Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(118,11): error TS2429: Interface 'I14' incorrectly extends interface 'Base': - Types of property 'a4' are incompatible: - Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': - Types of parameters 'y' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(118,11): error TS2430: Interface 'I14' incorrectly extends interface 'Base'. + Types of property 'a4' are incompatible. + Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. + Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(126,11): error TS2429: Interface 'I16' incorrectly extends interface 'Base': - Types of property 'a4' are incompatible: - Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': - Types of parameters 'args' and 'z' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(126,11): error TS2430: Interface 'I16' incorrectly extends interface 'Base'. + Types of property 'a4' are incompatible. + Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. + Types of parameters 'args' and 'z' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(130,11): error TS2429: Interface 'I17' incorrectly extends interface 'Base': - Types of property 'a4' are incompatible: - Type '(...args: number[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': - Types of parameters 'args' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(130,11): error TS2430: Interface 'I17' incorrectly extends interface 'Base'. + Types of property 'a4' are incompatible. + Type '(...args: number[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. + Types of parameters 'args' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. @@ -75,11 +75,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I1C extends Base { ~~~ -!!! error TS2429: Interface 'I1C' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number': -!!! error TS2429: Types of parameters 'args' and 'args' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I1C' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. +!!! error TS2430: Types of parameters 'args' and 'args' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a: (...args: string[]) => number; // error, type mismatch } @@ -97,11 +97,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3B extends Base { ~~~ -!!! error TS2429: Interface 'I3B' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number': -!!! error TS2429: Types of parameters 'x' and 'args' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I3B' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. +!!! error TS2430: Types of parameters 'x' and 'args' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a: (x?: string) => number; // error, incompatible type } @@ -129,11 +129,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I6C extends Base { ~~~ -!!! error TS2429: Interface 'I6C' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a2' are incompatible: -!!! error TS2429: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'args' and 'z' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I6C' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a2' are incompatible. +!!! error TS2430: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'args' and 'z' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a2: (x: number, ...args: string[]) => number; // error } @@ -165,41 +165,41 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10B extends Base { ~~~~ -!!! error TS2429: Interface 'I10B' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I10B' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a3: (x: number, y?: number, z?: number) => number; // error } interface I10C extends Base { ~~~~ -!!! error TS2429: Interface 'I10C' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'z' and 'y' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I10C' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'z' and 'y' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a3: (x: number, ...z: number[]) => number; // error } interface I10D extends Base { ~~~~ -!!! error TS2429: Interface 'I10D' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I10D' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a3: (x: string, y?: string, z?: string) => number; // error, incompatible types } interface I10E extends Base { ~~~~ -!!! error TS2429: Interface 'I10E' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type '(x: number, ...z: string[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'z' and 'z' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I10E' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type '(x: number, ...z: string[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'z' and 'z' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a3: (x: number, ...z: string[]) => number; // error } @@ -209,11 +209,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I12 extends Base { ~~~ -!!! error TS2429: Interface 'I12' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a4' are incompatible: -!!! error TS2429: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I12' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a4' are incompatible. +!!! error TS2430: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a4: (x?: number, y?: number) => number; // error, type mismatch } @@ -223,11 +223,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I14 extends Base { ~~~ -!!! error TS2429: Interface 'I14' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a4' are incompatible: -!!! error TS2429: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I14' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a4' are incompatible. +!!! error TS2430: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a4: (x: number, y?: number) => number; // error, second param has type mismatch } @@ -237,21 +237,21 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I16 extends Base { ~~~ -!!! error TS2429: Interface 'I16' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a4' are incompatible: -!!! error TS2429: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'args' and 'z' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I16' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a4' are incompatible. +!!! error TS2430: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'args' and 'z' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a4: (x: number, ...args: string[]) => number; // error, rest param has type mismatch } interface I17 extends Base { ~~~ -!!! error TS2429: Interface 'I17' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a4' are incompatible: -!!! error TS2429: Type '(...args: number[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'args' and 'y' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I17' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a4' are incompatible. +!!! error TS2430: Type '(...args: number[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'args' and 'y' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a4: (...args: number[]) => number; // error } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt b/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt index b42e93b0f3b..d3c399477d6 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithSpecializedSignatures.ts(70,15): error TS2429: Interface 'I2' incorrectly extends interface 'Base2': - Types of property 'a' are incompatible: - Type '(x: string) => string' is not assignable to type '{ (x: 'a'): number; (x: string): number; }': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithSpecializedSignatures.ts(70,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. + Type '(x: string) => string' is not assignable to type '{ (x: 'a'): number; (x: string): number; }'. Type 'string' is not assignable to type 'number'. @@ -76,10 +76,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW // S's interface I2 extends Base2 { ~~ -!!! error TS2429: Interface 'I2' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type '(x: string) => string' is not assignable to type '{ (x: 'a'): number; (x: string): number; }': -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type '(x: string) => string' is not assignable to type '{ (x: 'a'): number; (x: string): number; }'. +!!! error TS2430: Type 'string' is not assignable to type 'number'. // N's a: (x: string) => string; // error because base returns non-void; } diff --git a/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt index 916813a4306..e041b1cdce0 100644 --- a/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts(19,11): error TS2429: Interface 'I3' incorrectly extends interface 'Base': - Types of property 'a' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts(19,11): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. + Types of property 'a' are incompatible. Type 'new (x: number) => number' is not assignable to type 'new () => number'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts(49,11): error TS2429: Interface 'I10' incorrectly extends interface 'Base': - Types of property 'a3' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts(49,11): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. + Types of property 'a3' are incompatible. Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. @@ -27,9 +27,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3 extends Base { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'new (x: number) => number' is not assignable to type 'new () => number'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'new (x: number) => number' is not assignable to type 'new () => number'. a: new (x: number) => number; // error, too many required params } @@ -61,9 +61,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10 extends Base { ~~~ -!!! error TS2429: Interface 'I10' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. +!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. a3: new (x: number, y: number) => number; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt b/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt index c0ae6d2b9f2..03cc6de0ca4 100644 --- a/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt +++ b/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithSpecializedSignatures.ts(70,15): error TS2429: Interface 'I2' incorrectly extends interface 'Base2': - Types of property 'a' are incompatible: - Type 'new (x: string) => string' is not assignable to type '{ new (x: 'a'): number; new (x: string): number; }': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithSpecializedSignatures.ts(70,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. + Type 'new (x: string) => string' is not assignable to type '{ new (x: 'a'): number; new (x: string): number; }'. Type 'string' is not assignable to type 'number'. @@ -76,10 +76,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW // S's interface I2 extends Base2 { ~~ -!!! error TS2429: Interface 'I2' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'new (x: string) => string' is not assignable to type '{ new (x: 'a'): number; new (x: string): number; }': -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'new (x: string) => string' is not assignable to type '{ new (x: 'a'): number; new (x: string): number; }'. +!!! error TS2430: Type 'string' is not assignable to type 'number'. // N's a: new (x: string) => string; // error because base returns non-void; } diff --git a/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt index 31582f29bdc..e8f50236cba 100644 --- a/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -1,20 +1,20 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(20,15): error TS2429: Interface 'I3' incorrectly extends interface 'Base': - Types of property 'a' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(20,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. + Types of property 'a' are incompatible. Type '(x: T) => T' is not assignable to type '() => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(50,15): error TS2429: Interface 'I10' incorrectly extends interface 'Base': - Types of property 'a3' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(50,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. + Types of property 'a3' are incompatible. Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(108,15): error TS2429: Interface 'I3' incorrectly extends interface 'Base2': - Types of property 'a' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(108,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. Type '(x: T) => T' is not assignable to type '() => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(138,15): error TS2429: Interface 'I10' incorrectly extends interface 'Base2': - Types of property 'a3' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(138,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. + Types of property 'a3' are incompatible. Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(196,15): error TS2429: Interface 'I3' incorrectly extends interface 'Base2': - Types of property 'a' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(196,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. Type '(x: T) => T' is not assignable to type '() => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(226,15): error TS2429: Interface 'I10' incorrectly extends interface 'Base2': - Types of property 'a3' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(226,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. + Types of property 'a3' are incompatible. Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. @@ -40,9 +40,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3 extends Base { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type '(x: T) => T' is not assignable to type '() => T'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type '(x: T) => T' is not assignable to type '() => T'. a: (x: T) => T; // error, too many required params } @@ -74,9 +74,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10 extends Base { ~~~ -!!! error TS2429: Interface 'I10' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. +!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. a3: (x: T, y: T) => T; // error, too many required params } @@ -136,9 +136,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3 extends Base2 { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type '(x: T) => T' is not assignable to type '() => T'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type '(x: T) => T' is not assignable to type '() => T'. a: (x: T) => T; } @@ -170,9 +170,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10 extends Base2 { ~~~ -!!! error TS2429: Interface 'I10' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. +!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. a3: (x: T, y: T) => T; } @@ -232,9 +232,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3 extends Base2 { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type '(x: T) => T' is not assignable to type '() => T'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type '(x: T) => T' is not assignable to type '() => T'. a: (x: T) => T; // error, not identical and contextual signature instatiation can't make inference from T to T } @@ -266,9 +266,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10 extends Base2 { ~~~ -!!! error TS2429: Interface 'I10' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. +!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. a3: (x: T, y: T) => T; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt index 2759801416a..27066058238 100644 --- a/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt @@ -1,20 +1,20 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(20,15): error TS2429: Interface 'I3' incorrectly extends interface 'Base': - Types of property 'a' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(20,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. + Types of property 'a' are incompatible. Type 'new (x: T) => T' is not assignable to type 'new () => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(50,15): error TS2429: Interface 'I10' incorrectly extends interface 'Base': - Types of property 'a3' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(50,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. + Types of property 'a3' are incompatible. Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(108,15): error TS2429: Interface 'I3' incorrectly extends interface 'Base2': - Types of property 'a' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(108,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. Type 'new (x: T) => T' is not assignable to type 'new () => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(138,15): error TS2429: Interface 'I10' incorrectly extends interface 'Base2': - Types of property 'a3' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(138,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. + Types of property 'a3' are incompatible. Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(196,15): error TS2429: Interface 'I3' incorrectly extends interface 'Base2': - Types of property 'a' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(196,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. Type 'new (x: T) => T' is not assignable to type 'new () => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(226,15): error TS2429: Interface 'I10' incorrectly extends interface 'Base2': - Types of property 'a3' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(226,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. + Types of property 'a3' are incompatible. Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. @@ -40,9 +40,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3 extends Base { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'new (x: T) => T' is not assignable to type 'new () => T'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new () => T'. a: new (x: T) => T; // error, too many required params } @@ -74,9 +74,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10 extends Base { ~~~ -!!! error TS2429: Interface 'I10' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. +!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. a3: new (x: T, y: T) => T; // error, too many required params } @@ -136,9 +136,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3 extends Base2 { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'new (x: T) => T' is not assignable to type 'new () => T'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new () => T'. a: new (x: T) => T; } @@ -170,9 +170,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10 extends Base2 { ~~~ -!!! error TS2429: Interface 'I10' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. +!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. a3: new (x: T, y: T) => T; } @@ -232,9 +232,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3 extends Base2 { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'new (x: T) => T' is not assignable to type 'new () => T'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new () => T'. a: new (x: T) => T; // error, not identical and contextual signature instatiation can't make inference from T to T } @@ -266,9 +266,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10 extends Base2 { ~~~ -!!! error TS2429: Interface 'I10' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. +!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. a3: new (x: T, y: T) => T; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithNumericIndexer.errors.txt b/tests/baselines/reference/subtypingWithNumericIndexer.errors.txt index f56a8c31fa4..e5ff0d47ca3 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer.errors.txt +++ b/tests/baselines/reference/subtypingWithNumericIndexer.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer.ts(32,11): error TS2416: Class 'B3' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer.ts(32,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer.ts(36,11): error TS2416: Class 'B4' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer.ts(36,11): error TS2415: Class 'B4' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. @@ -40,17 +40,17 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Derived' is not assignable to type 'T'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Derived' is not assignable to type 'T'. [x: number]: Derived; // error, BUG? } class B4 extends A { ~~ -!!! error TS2416: Class 'B4' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2415: Class 'B4' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Derived2' is not assignable to type 'T'. [x: number]: Derived2; // error, BUG? } } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithNumericIndexer2.errors.txt b/tests/baselines/reference/subtypingWithNumericIndexer2.errors.txt index d8a33c93c81..1c428ae99af 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer2.errors.txt +++ b/tests/baselines/reference/subtypingWithNumericIndexer2.errors.txt @@ -1,17 +1,17 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(11,11): error TS2429: Interface 'B' incorrectly extends interface 'A': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(11,11): error TS2430: Interface 'B' incorrectly extends interface 'A'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(24,25): error TS2343: Type 'Base' does not satisfy the constraint 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(24,25): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(32,15): error TS2429: Interface 'B3' incorrectly extends interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(32,15): error TS2430: Interface 'B3' incorrectly extends interface 'A'. + Index signatures are incompatible. Type 'Base' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(36,15): error TS2429: Interface 'B4' incorrectly extends interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(36,15): error TS2430: Interface 'B4' incorrectly extends interface 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(40,15): error TS2429: Interface 'B5' incorrectly extends interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(40,15): error TS2430: Interface 'B5' incorrectly extends interface 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. @@ -28,10 +28,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B extends A { ~ -!!! error TS2429: Interface 'B' incorrectly extends interface 'A': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'Derived': -!!! error TS2429: Property 'bar' is missing in type 'Base'. +!!! error TS2430: Interface 'B' incorrectly extends interface 'A'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2430: Property 'bar' is missing in type 'Base'. [x: number]: Base; // error } @@ -46,8 +46,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B extends A { ~~~~~~~ -!!! error TS2343: Type 'Base' does not satisfy the constraint 'Derived': -!!! error TS2343: Property 'bar' is missing in type 'Base'. +!!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. +!!! error TS2344: Property 'bar' is missing in type 'Base'. [x: number]: Derived; // error } @@ -57,25 +57,25 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B3 extends A { ~~ -!!! error TS2429: Interface 'B3' incorrectly extends interface 'A': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'T'. +!!! error TS2430: Interface 'B3' incorrectly extends interface 'A'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'T'. [x: number]: Base; // error } interface B4 extends A { ~~ -!!! error TS2429: Interface 'B4' incorrectly extends interface 'A': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'Derived' is not assignable to type 'T'. +!!! error TS2430: Interface 'B4' incorrectly extends interface 'A'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'Derived' is not assignable to type 'T'. [x: number]: Derived; // error } interface B5 extends A { ~~ -!!! error TS2429: Interface 'B5' incorrectly extends interface 'A': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2430: Interface 'B5' incorrectly extends interface 'A'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'Derived2' is not assignable to type 'T'. [x: number]: Derived2; // error } } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithNumericIndexer3.errors.txt b/tests/baselines/reference/subtypingWithNumericIndexer3.errors.txt index 2b20970cc7f..e386fc69a3f 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer3.errors.txt +++ b/tests/baselines/reference/subtypingWithNumericIndexer3.errors.txt @@ -1,17 +1,17 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(11,7): error TS2416: Class 'B' incorrectly extends base class 'A': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(11,7): error TS2415: Class 'B' incorrectly extends base class 'A'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(24,21): error TS2343: Type 'Base' does not satisfy the constraint 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(24,21): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(32,11): error TS2416: Class 'B3' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(32,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Base' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(36,11): error TS2416: Class 'B4' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(36,11): error TS2415: Class 'B4' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(40,11): error TS2416: Class 'B5' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(40,11): error TS2415: Class 'B5' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. @@ -28,10 +28,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Base' is not assignable to type 'Derived': -!!! error TS2416: Property 'bar' is missing in type 'Base'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2415: Property 'bar' is missing in type 'Base'. [x: number]: Base; // error } @@ -46,8 +46,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~~~~~~~ -!!! error TS2343: Type 'Base' does not satisfy the constraint 'Derived': -!!! error TS2343: Property 'bar' is missing in type 'Base'. +!!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. +!!! error TS2344: Property 'bar' is missing in type 'Base'. [x: number]: Derived; // error } @@ -57,25 +57,25 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Base' is not assignable to type 'T'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Base' is not assignable to type 'T'. [x: number]: Base; // error } class B4 extends A { ~~ -!!! error TS2416: Class 'B4' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Derived' is not assignable to type 'T'. +!!! error TS2415: Class 'B4' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Derived' is not assignable to type 'T'. [x: number]: Derived; // error } class B5 extends A { ~~ -!!! error TS2416: Class 'B5' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2415: Class 'B5' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Derived2' is not assignable to type 'T'. [x: number]: Derived2; // error } } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt b/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt index cbc5236edec..f3c9cc25a10 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt +++ b/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt @@ -1,15 +1,15 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(11,7): error TS2416: Class 'B' incorrectly extends base class 'A': - Index signatures are incompatible: - Type 'string' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(11,7): error TS2415: Class 'B' incorrectly extends base class 'A'. + Index signatures are incompatible. + Type 'string' is not assignable to type 'Derived'. Property 'bar' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(20,11): error TS2416: Class 'B' incorrectly extends base class 'A': - Index signatures are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(20,11): error TS2415: Class 'B' incorrectly extends base class 'A'. + Index signatures are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(20,21): error TS2343: Type 'Base' does not satisfy the constraint 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(20,21): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(24,11): error TS2416: Class 'B3' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(24,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'string' is not assignable to type 'T'. @@ -26,10 +26,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Derived': -!!! error TS2416: Property 'bar' is missing in type 'String'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Derived'. +!!! error TS2415: Property 'bar' is missing in type 'String'. [x: number]: string; // error } @@ -40,21 +40,21 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Base': -!!! error TS2416: Property 'foo' is missing in type 'String'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Base'. +!!! error TS2415: Property 'foo' is missing in type 'String'. ~~~~~~~ -!!! error TS2343: Type 'Base' does not satisfy the constraint 'Derived': -!!! error TS2343: Property 'bar' is missing in type 'Base'. +!!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. +!!! error TS2344: Property 'bar' is missing in type 'Base'. [x: number]: string; // error } class B3 extends A { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'T'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'T'. [x: number]: string; // error } } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithNumericIndexer5.errors.txt b/tests/baselines/reference/subtypingWithNumericIndexer5.errors.txt index 818a9591309..be4afeafcde 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer5.errors.txt +++ b/tests/baselines/reference/subtypingWithNumericIndexer5.errors.txt @@ -1,15 +1,15 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(11,7): error TS2421: Class 'B' incorrectly implements interface 'A': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(11,7): error TS2420: Class 'B' incorrectly implements interface 'A'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(32,11): error TS2421: Class 'B3' incorrectly implements interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(32,11): error TS2420: Class 'B3' incorrectly implements interface 'A'. + Index signatures are incompatible. Type 'Base' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(36,11): error TS2421: Class 'B4' incorrectly implements interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(36,11): error TS2420: Class 'B4' incorrectly implements interface 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(40,11): error TS2421: Class 'B5' incorrectly implements interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(40,11): error TS2420: Class 'B5' incorrectly implements interface 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. @@ -26,10 +26,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B implements A { ~ -!!! error TS2421: Class 'B' incorrectly implements interface 'A': -!!! error TS2421: Index signatures are incompatible: -!!! error TS2421: Type 'Base' is not assignable to type 'Derived': -!!! error TS2421: Property 'bar' is missing in type 'Base'. +!!! error TS2420: Class 'B' incorrectly implements interface 'A'. +!!! error TS2420: Index signatures are incompatible. +!!! error TS2420: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2420: Property 'bar' is missing in type 'Base'. [x: string]: Base; // error } @@ -52,25 +52,25 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 implements A { ~~ -!!! error TS2421: Class 'B3' incorrectly implements interface 'A': -!!! error TS2421: Index signatures are incompatible: -!!! error TS2421: Type 'Base' is not assignable to type 'T'. +!!! error TS2420: Class 'B3' incorrectly implements interface 'A'. +!!! error TS2420: Index signatures are incompatible. +!!! error TS2420: Type 'Base' is not assignable to type 'T'. [x: string]: Base; // error } class B4 implements A { ~~ -!!! error TS2421: Class 'B4' incorrectly implements interface 'A': -!!! error TS2421: Index signatures are incompatible: -!!! error TS2421: Type 'Derived' is not assignable to type 'T'. +!!! error TS2420: Class 'B4' incorrectly implements interface 'A'. +!!! error TS2420: Index signatures are incompatible. +!!! error TS2420: Type 'Derived' is not assignable to type 'T'. [x: string]: Derived; // error } class B5 implements A { ~~ -!!! error TS2421: Class 'B5' incorrectly implements interface 'A': -!!! error TS2421: Index signatures are incompatible: -!!! error TS2421: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2420: Class 'B5' incorrectly implements interface 'A'. +!!! error TS2420: Index signatures are incompatible. +!!! error TS2420: Type 'Derived2' is not assignable to type 'T'. [x: string]: Derived2; // error } } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithObjectMembers.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers.errors.txt index fa1d3c43fa4..e54ece580ca 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers.errors.txt @@ -1,26 +1,26 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(12,7): error TS2416: Class 'B' incorrectly extends base class 'A': - Types of property 'bar' are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(12,7): error TS2415: Class 'B' incorrectly extends base class 'A'. + Types of property 'bar' are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(22,7): error TS2416: Class 'B2' incorrectly extends base class 'A2': - Types of property '2.0' are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(22,7): error TS2415: Class 'B2' incorrectly extends base class 'A2'. + Types of property '2.0' are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(32,7): error TS2416: Class 'B3' incorrectly extends base class 'A3': - Types of property ''2.0'' are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(32,7): error TS2415: Class 'B3' incorrectly extends base class 'A3'. + Types of property ''2.0'' are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(43,11): error TS2416: Class 'B' incorrectly extends base class 'A': - Types of property 'bar' are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(43,11): error TS2415: Class 'B' incorrectly extends base class 'A'. + Types of property 'bar' are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(53,11): error TS2416: Class 'B2' incorrectly extends base class 'A2': - Types of property '2.0' are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(53,11): error TS2415: Class 'B2' incorrectly extends base class 'A2'. + Types of property '2.0' are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(63,11): error TS2416: Class 'B3' incorrectly extends base class 'A3': - Types of property ''2.0'' are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(63,11): error TS2415: Class 'B3' incorrectly extends base class 'A3'. + Types of property ''2.0'' are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. @@ -38,10 +38,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Types of property 'bar' are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Base': -!!! error TS2416: Property 'foo' is missing in type 'String'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Types of property 'bar' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Base'. +!!! error TS2415: Property 'foo' is missing in type 'String'. foo: Derived; // ok bar: string; // error } @@ -53,10 +53,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B2 extends A2 { ~~ -!!! error TS2416: Class 'B2' incorrectly extends base class 'A2': -!!! error TS2416: Types of property '2.0' are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Base': -!!! error TS2416: Property 'foo' is missing in type 'String'. +!!! error TS2415: Class 'B2' incorrectly extends base class 'A2'. +!!! error TS2415: Types of property '2.0' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Base'. +!!! error TS2415: Property 'foo' is missing in type 'String'. 1: Derived; // ok 2: string; // error } @@ -68,10 +68,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A3 { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A3': -!!! error TS2416: Types of property ''2.0'' are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Base': -!!! error TS2416: Property 'foo' is missing in type 'String'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A3'. +!!! error TS2415: Types of property ''2.0'' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Base'. +!!! error TS2415: Property 'foo' is missing in type 'String'. '1': Derived; // ok '2.0': string; // error } @@ -84,10 +84,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Types of property 'bar' are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Base': -!!! error TS2416: Property 'foo' is missing in type 'String'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Types of property 'bar' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Base'. +!!! error TS2415: Property 'foo' is missing in type 'String'. foo: Derived2; // ok bar: string; // error } @@ -99,10 +99,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B2 extends A2 { ~~ -!!! error TS2416: Class 'B2' incorrectly extends base class 'A2': -!!! error TS2416: Types of property '2.0' are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Base': -!!! error TS2416: Property 'foo' is missing in type 'String'. +!!! error TS2415: Class 'B2' incorrectly extends base class 'A2'. +!!! error TS2415: Types of property '2.0' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Base'. +!!! error TS2415: Property 'foo' is missing in type 'String'. 1: Derived2; // ok 2: string; // error } @@ -114,10 +114,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A3 { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A3': -!!! error TS2416: Types of property ''2.0'' are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Base': -!!! error TS2416: Property 'foo' is missing in type 'String'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A3'. +!!! error TS2415: Types of property ''2.0'' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Base'. +!!! error TS2415: Property 'foo' is missing in type 'String'. '1': Derived2; // ok '2.0': string; // error } diff --git a/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt index 73421a09015..0ba28f2fcd0 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt @@ -1,26 +1,26 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(17,15): error TS2429: Interface 'B' incorrectly extends interface 'A': - Types of property 'bar' are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(17,15): error TS2430: Interface 'B' incorrectly extends interface 'A'. + Types of property 'bar' are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(27,15): error TS2429: Interface 'B2' incorrectly extends interface 'A2': - Types of property '2.0' are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(27,15): error TS2430: Interface 'B2' incorrectly extends interface 'A2'. + Types of property '2.0' are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(37,15): error TS2429: Interface 'B3' incorrectly extends interface 'A3': - Types of property ''2.0'' are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(37,15): error TS2430: Interface 'B3' incorrectly extends interface 'A3'. + Types of property ''2.0'' are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(50,15): error TS2429: Interface 'B' incorrectly extends interface 'A': - Types of property 'bar' are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(50,15): error TS2430: Interface 'B' incorrectly extends interface 'A'. + Types of property 'bar' are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(60,15): error TS2429: Interface 'B2' incorrectly extends interface 'A2': - Types of property '2.0' are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(60,15): error TS2430: Interface 'B2' incorrectly extends interface 'A2'. + Types of property '2.0' are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(70,15): error TS2429: Interface 'B3' incorrectly extends interface 'A3': - Types of property ''2.0'' are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(70,15): error TS2430: Interface 'B3' incorrectly extends interface 'A3'. + Types of property ''2.0'' are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. @@ -43,10 +43,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B extends A { ~ -!!! error TS2429: Interface 'B' incorrectly extends interface 'A': -!!! error TS2429: Types of property 'bar' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'Base': -!!! error TS2429: Property 'foo' is missing in type 'String'. +!!! error TS2430: Interface 'B' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'bar' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'Base'. +!!! error TS2430: Property 'foo' is missing in type 'String'. foo: Derived; // ok bar: string; // error } @@ -58,10 +58,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B2 extends A2 { ~~ -!!! error TS2429: Interface 'B2' incorrectly extends interface 'A2': -!!! error TS2429: Types of property '2.0' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'Base': -!!! error TS2429: Property 'foo' is missing in type 'String'. +!!! error TS2430: Interface 'B2' incorrectly extends interface 'A2'. +!!! error TS2430: Types of property '2.0' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'Base'. +!!! error TS2430: Property 'foo' is missing in type 'String'. 1: Derived; // ok 2: string; // error } @@ -73,10 +73,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B3 extends A3 { ~~ -!!! error TS2429: Interface 'B3' incorrectly extends interface 'A3': -!!! error TS2429: Types of property ''2.0'' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'Base': -!!! error TS2429: Property 'foo' is missing in type 'String'. +!!! error TS2430: Interface 'B3' incorrectly extends interface 'A3'. +!!! error TS2430: Types of property ''2.0'' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'Base'. +!!! error TS2430: Property 'foo' is missing in type 'String'. '1': Derived; // ok '2.0': string; // error } @@ -91,10 +91,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B extends A { ~ -!!! error TS2429: Interface 'B' incorrectly extends interface 'A': -!!! error TS2429: Types of property 'bar' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'Base': -!!! error TS2429: Property 'foo' is missing in type 'String'. +!!! error TS2430: Interface 'B' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'bar' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'Base'. +!!! error TS2430: Property 'foo' is missing in type 'String'. foo?: Derived; // ok bar?: string; // error } @@ -106,10 +106,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B2 extends A2 { ~~ -!!! error TS2429: Interface 'B2' incorrectly extends interface 'A2': -!!! error TS2429: Types of property '2.0' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'Base': -!!! error TS2429: Property 'foo' is missing in type 'String'. +!!! error TS2430: Interface 'B2' incorrectly extends interface 'A2'. +!!! error TS2430: Types of property '2.0' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'Base'. +!!! error TS2430: Property 'foo' is missing in type 'String'. 1?: Derived; // ok 2?: string; // error } @@ -121,10 +121,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B3 extends A3 { ~~ -!!! error TS2429: Interface 'B3' incorrectly extends interface 'A3': -!!! error TS2429: Types of property ''2.0'' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'Base': -!!! error TS2429: Property 'foo' is missing in type 'String'. +!!! error TS2430: Interface 'B3' incorrectly extends interface 'A3'. +!!! error TS2430: Types of property ''2.0'' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'Base'. +!!! error TS2430: Property 'foo' is missing in type 'String'. '1'?: Derived; // ok '2.0'?: string; // error } diff --git a/tests/baselines/reference/subtypingWithObjectMembers3.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers3.errors.txt index 47d34e19b31..8db24b325c0 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers3.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers3.errors.txt @@ -1,26 +1,26 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(17,15): error TS2429: Interface 'B' incorrectly extends interface 'A': - Types of property 'bar' are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(17,15): error TS2430: Interface 'B' incorrectly extends interface 'A'. + Types of property 'bar' are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(27,15): error TS2429: Interface 'B2' incorrectly extends interface 'A2': - Types of property '2.0' are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(27,15): error TS2430: Interface 'B2' incorrectly extends interface 'A2'. + Types of property '2.0' are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(37,15): error TS2429: Interface 'B3' incorrectly extends interface 'A3': - Types of property ''2.0'' are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(37,15): error TS2430: Interface 'B3' incorrectly extends interface 'A3'. + Types of property ''2.0'' are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(49,15): error TS2429: Interface 'B' incorrectly extends interface 'A': - Types of property 'bar' are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(49,15): error TS2430: Interface 'B' incorrectly extends interface 'A'. + Types of property 'bar' are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(59,15): error TS2429: Interface 'B2' incorrectly extends interface 'A2': - Types of property '2.0' are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(59,15): error TS2430: Interface 'B2' incorrectly extends interface 'A2'. + Types of property '2.0' are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(69,15): error TS2429: Interface 'B3' incorrectly extends interface 'A3': - Types of property ''2.0'' are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(69,15): error TS2430: Interface 'B3' incorrectly extends interface 'A3'. + Types of property ''2.0'' are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. @@ -43,10 +43,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B extends A { ~ -!!! error TS2429: Interface 'B' incorrectly extends interface 'A': -!!! error TS2429: Types of property 'bar' are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'Derived': -!!! error TS2429: Property 'bar' is missing in type 'Base'. +!!! error TS2430: Interface 'B' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'bar' are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2430: Property 'bar' is missing in type 'Base'. foo: Derived; // ok bar: Base; // error } @@ -58,10 +58,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B2 extends A2 { ~~ -!!! error TS2429: Interface 'B2' incorrectly extends interface 'A2': -!!! error TS2429: Types of property '2.0' are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'Derived': -!!! error TS2429: Property 'bar' is missing in type 'Base'. +!!! error TS2430: Interface 'B2' incorrectly extends interface 'A2'. +!!! error TS2430: Types of property '2.0' are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2430: Property 'bar' is missing in type 'Base'. 1: Derived; // ok 2: Base; // error } @@ -73,10 +73,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B3 extends A3 { ~~ -!!! error TS2429: Interface 'B3' incorrectly extends interface 'A3': -!!! error TS2429: Types of property ''2.0'' are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'Derived': -!!! error TS2429: Property 'bar' is missing in type 'Base'. +!!! error TS2430: Interface 'B3' incorrectly extends interface 'A3'. +!!! error TS2430: Types of property ''2.0'' are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2430: Property 'bar' is missing in type 'Base'. '1': Derived; // ok '2.0': Base; // error } @@ -90,10 +90,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B extends A { ~ -!!! error TS2429: Interface 'B' incorrectly extends interface 'A': -!!! error TS2429: Types of property 'bar' are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'Derived': -!!! error TS2429: Property 'bar' is missing in type 'Base'. +!!! error TS2430: Interface 'B' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'bar' are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2430: Property 'bar' is missing in type 'Base'. foo?: Derived; // ok bar?: Base; // error } @@ -105,10 +105,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B2 extends A2 { ~~ -!!! error TS2429: Interface 'B2' incorrectly extends interface 'A2': -!!! error TS2429: Types of property '2.0' are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'Derived': -!!! error TS2429: Property 'bar' is missing in type 'Base'. +!!! error TS2430: Interface 'B2' incorrectly extends interface 'A2'. +!!! error TS2430: Types of property '2.0' are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2430: Property 'bar' is missing in type 'Base'. 1?: Derived; // ok 2?: Base; // error } @@ -120,10 +120,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B3 extends A3 { ~~ -!!! error TS2429: Interface 'B3' incorrectly extends interface 'A3': -!!! error TS2429: Types of property ''2.0'' are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'Derived': -!!! error TS2429: Property 'bar' is missing in type 'Base'. +!!! error TS2430: Interface 'B3' incorrectly extends interface 'A3'. +!!! error TS2430: Types of property ''2.0'' are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2430: Property 'bar' is missing in type 'Base'. '1'?: Derived; // ok '2.0'?: Base; // error } diff --git a/tests/baselines/reference/subtypingWithObjectMembers5.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers5.errors.txt index 3f646666ad1..7fd025721ec 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers5.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers5.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(16,11): error TS2421: Class 'B' incorrectly implements interface 'A': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(16,11): error TS2420: Class 'B' incorrectly implements interface 'A'. Property 'foo' is missing in type 'B'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(24,11): error TS2421: Class 'B2' incorrectly implements interface 'A2': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(24,11): error TS2420: Class 'B2' incorrectly implements interface 'A2'. Property '1' is missing in type 'B2'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(32,11): error TS2421: Class 'B3' incorrectly implements interface 'A3': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(32,11): error TS2420: Class 'B3' incorrectly implements interface 'A3'. Property ''1'' is missing in type 'B3'. @@ -24,8 +24,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B implements A { ~ -!!! error TS2421: Class 'B' incorrectly implements interface 'A': -!!! error TS2421: Property 'foo' is missing in type 'B'. +!!! error TS2420: Class 'B' incorrectly implements interface 'A'. +!!! error TS2420: Property 'foo' is missing in type 'B'. fooo: Derived; // error } @@ -35,8 +35,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B2 implements A2 { ~~ -!!! error TS2421: Class 'B2' incorrectly implements interface 'A2': -!!! error TS2421: Property '1' is missing in type 'B2'. +!!! error TS2420: Class 'B2' incorrectly implements interface 'A2'. +!!! error TS2420: Property '1' is missing in type 'B2'. 2: Derived; // error } @@ -46,8 +46,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 implements A3 { ~~ -!!! error TS2421: Class 'B3' incorrectly implements interface 'A3': -!!! error TS2421: Property ''1'' is missing in type 'B3'. +!!! error TS2420: Class 'B3' incorrectly implements interface 'A3'. +!!! error TS2420: Property ''1'' is missing in type 'B3'. '1.0': Derived; // error } } diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.errors.txt b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.errors.txt index 09dfa1696df..50646f64eae 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility.ts(15,7): error TS2416: Class 'B' incorrectly extends base class 'A': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility.ts(15,7): error TS2415: Class 'B' incorrectly extends base class 'A'. Property 'foo' is private in type 'B' but not in type 'A'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility.ts(23,7): error TS2416: Class 'B2' incorrectly extends base class 'A2': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility.ts(23,7): error TS2415: Class 'B2' incorrectly extends base class 'A2'. Property '1' is private in type 'B2' but not in type 'A2'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility.ts(31,7): error TS2416: Class 'B3' incorrectly extends base class 'A3': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility.ts(31,7): error TS2415: Class 'B3' incorrectly extends base class 'A3'. Property ''1'' is private in type 'B3' but not in type 'A3'. @@ -23,8 +23,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Property 'foo' is private in type 'B' but not in type 'A'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Property 'foo' is private in type 'B' but not in type 'A'. private foo: Derived; // error } @@ -34,8 +34,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B2 extends A2 { ~~ -!!! error TS2416: Class 'B2' incorrectly extends base class 'A2': -!!! error TS2416: Property '1' is private in type 'B2' but not in type 'A2'. +!!! error TS2415: Class 'B2' incorrectly extends base class 'A2'. +!!! error TS2415: Property '1' is private in type 'B2' but not in type 'A2'. private 1: Derived; // error } @@ -45,7 +45,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A3 { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A3': -!!! error TS2416: Property ''1'' is private in type 'B3' but not in type 'A3'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A3'. +!!! error TS2415: Property ''1'' is private in type 'B3' but not in type 'A3'. private '1': Derived; // error } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.errors.txt b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.errors.txt index 9af7e894b27..083e96eaf5f 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(16,11): error TS2416: Class 'B' incorrectly extends base class 'A': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(16,11): error TS2415: Class 'B' incorrectly extends base class 'A'. Property 'foo' is private in type 'A' but not in type 'B'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(24,11): error TS2416: Class 'B2' incorrectly extends base class 'A2': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(24,11): error TS2415: Class 'B2' incorrectly extends base class 'A2'. Property '1' is private in type 'A2' but not in type 'B2'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(32,11): error TS2416: Class 'B3' incorrectly extends base class 'A3': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(32,11): error TS2415: Class 'B3' incorrectly extends base class 'A3'. Property ''1'' is private in type 'A3' but not in type 'B3'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(42,11): error TS2416: Class 'B' incorrectly extends base class 'A': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(42,11): error TS2415: Class 'B' incorrectly extends base class 'A'. Property 'foo' is private in type 'A' but not in type 'B'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(50,11): error TS2416: Class 'B2' incorrectly extends base class 'A2': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(50,11): error TS2415: Class 'B2' incorrectly extends base class 'A2'. Property '1' is private in type 'A2' but not in type 'B2'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(58,11): error TS2416: Class 'B3' incorrectly extends base class 'A3': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(58,11): error TS2415: Class 'B3' incorrectly extends base class 'A3'. Property ''1'' is private in type 'A3' but not in type 'B3'. @@ -30,8 +30,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Property 'foo' is private in type 'A' but not in type 'B'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Property 'foo' is private in type 'A' but not in type 'B'. public foo: Derived; // error } @@ -41,8 +41,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B2 extends A2 { ~~ -!!! error TS2416: Class 'B2' incorrectly extends base class 'A2': -!!! error TS2416: Property '1' is private in type 'A2' but not in type 'B2'. +!!! error TS2415: Class 'B2' incorrectly extends base class 'A2'. +!!! error TS2415: Property '1' is private in type 'A2' but not in type 'B2'. public 1: Derived; // error } @@ -52,8 +52,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A3 { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A3': -!!! error TS2416: Property ''1'' is private in type 'A3' but not in type 'B3'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A3'. +!!! error TS2415: Property ''1'' is private in type 'A3' but not in type 'B3'. public '1': Derived; // error } } @@ -65,8 +65,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Property 'foo' is private in type 'A' but not in type 'B'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Property 'foo' is private in type 'A' but not in type 'B'. foo: Derived; // error } @@ -76,8 +76,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B2 extends A2 { ~~ -!!! error TS2416: Class 'B2' incorrectly extends base class 'A2': -!!! error TS2416: Property '1' is private in type 'A2' but not in type 'B2'. +!!! error TS2415: Class 'B2' incorrectly extends base class 'A2'. +!!! error TS2415: Property '1' is private in type 'A2' but not in type 'B2'. 1: Derived; // error } @@ -87,8 +87,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A3 { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A3': -!!! error TS2416: Property ''1'' is private in type 'A3' but not in type 'B3'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A3'. +!!! error TS2415: Property ''1'' is private in type 'A3' but not in type 'B3'. '1': Derived; // error } } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithObjectMembersOptionality2.errors.txt b/tests/baselines/reference/subtypingWithObjectMembersOptionality2.errors.txt index ac17303572d..89d5ef7915c 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersOptionality2.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembersOptionality2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality2.ts(10,11): error TS2429: Interface 'S' incorrectly extends interface 'T': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality2.ts(10,11): error TS2430: Interface 'S' incorrectly extends interface 'T'. Property 'Foo' is optional in type 'S' but required in type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality2.ts(18,11): error TS2429: Interface 'S2' incorrectly extends interface 'T2': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality2.ts(18,11): error TS2430: Interface 'S2' incorrectly extends interface 'T2'. Property '1' is optional in type 'S2' but required in type 'T2'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality2.ts(26,11): error TS2429: Interface 'S3' incorrectly extends interface 'T3': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality2.ts(26,11): error TS2430: Interface 'S3' incorrectly extends interface 'T3'. Property ''1'' is optional in type 'S3' but required in type 'T3'. @@ -18,8 +18,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface S extends T { ~ -!!! error TS2429: Interface 'S' incorrectly extends interface 'T': -!!! error TS2429: Property 'Foo' is optional in type 'S' but required in type 'T'. +!!! error TS2430: Interface 'S' incorrectly extends interface 'T'. +!!! error TS2430: Property 'Foo' is optional in type 'S' but required in type 'T'. Foo?: Derived // error } @@ -29,8 +29,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface S2 extends T2 { ~~ -!!! error TS2429: Interface 'S2' incorrectly extends interface 'T2': -!!! error TS2429: Property '1' is optional in type 'S2' but required in type 'T2'. +!!! error TS2430: Interface 'S2' incorrectly extends interface 'T2'. +!!! error TS2430: Property '1' is optional in type 'S2' but required in type 'T2'. 1?: Derived; // error } @@ -40,8 +40,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface S3 extends T3 { ~~ -!!! error TS2429: Interface 'S3' incorrectly extends interface 'T3': -!!! error TS2429: Property ''1'' is optional in type 'S3' but required in type 'T3'. +!!! error TS2430: Interface 'S3' incorrectly extends interface 'T3'. +!!! error TS2430: Property ''1'' is optional in type 'S3' but required in type 'T3'. '1'?: Derived; // error } diff --git a/tests/baselines/reference/subtypingWithStringIndexer.errors.txt b/tests/baselines/reference/subtypingWithStringIndexer.errors.txt index db7e6bd7d47..4ad0f665425 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer.errors.txt +++ b/tests/baselines/reference/subtypingWithStringIndexer.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer.ts(32,11): error TS2416: Class 'B3' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer.ts(32,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer.ts(36,11): error TS2416: Class 'B4' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer.ts(36,11): error TS2415: Class 'B4' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. @@ -40,17 +40,17 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Derived' is not assignable to type 'T'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Derived' is not assignable to type 'T'. [x: string]: Derived; // error } class B4 extends A { ~~ -!!! error TS2416: Class 'B4' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2415: Class 'B4' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Derived2' is not assignable to type 'T'. [x: string]: Derived2; // error } } diff --git a/tests/baselines/reference/subtypingWithStringIndexer2.errors.txt b/tests/baselines/reference/subtypingWithStringIndexer2.errors.txt index 7116f4d14af..add4abd8975 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer2.errors.txt +++ b/tests/baselines/reference/subtypingWithStringIndexer2.errors.txt @@ -1,17 +1,17 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(11,11): error TS2429: Interface 'B' incorrectly extends interface 'A': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(11,11): error TS2430: Interface 'B' incorrectly extends interface 'A'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(24,25): error TS2343: Type 'Base' does not satisfy the constraint 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(24,25): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(32,15): error TS2429: Interface 'B3' incorrectly extends interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(32,15): error TS2430: Interface 'B3' incorrectly extends interface 'A'. + Index signatures are incompatible. Type 'Base' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(36,15): error TS2429: Interface 'B4' incorrectly extends interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(36,15): error TS2430: Interface 'B4' incorrectly extends interface 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(40,15): error TS2429: Interface 'B5' incorrectly extends interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(40,15): error TS2430: Interface 'B5' incorrectly extends interface 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. @@ -28,10 +28,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B extends A { ~ -!!! error TS2429: Interface 'B' incorrectly extends interface 'A': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'Derived': -!!! error TS2429: Property 'bar' is missing in type 'Base'. +!!! error TS2430: Interface 'B' incorrectly extends interface 'A'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2430: Property 'bar' is missing in type 'Base'. [x: string]: Base; // error } @@ -46,8 +46,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B extends A { ~~~~~~~ -!!! error TS2343: Type 'Base' does not satisfy the constraint 'Derived': -!!! error TS2343: Property 'bar' is missing in type 'Base'. +!!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. +!!! error TS2344: Property 'bar' is missing in type 'Base'. [x: string]: Derived; // error } @@ -57,25 +57,25 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B3 extends A { ~~ -!!! error TS2429: Interface 'B3' incorrectly extends interface 'A': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'T'. +!!! error TS2430: Interface 'B3' incorrectly extends interface 'A'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'T'. [x: string]: Base; // error } interface B4 extends A { ~~ -!!! error TS2429: Interface 'B4' incorrectly extends interface 'A': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'Derived' is not assignable to type 'T'. +!!! error TS2430: Interface 'B4' incorrectly extends interface 'A'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'Derived' is not assignable to type 'T'. [x: string]: Derived; // error } interface B5 extends A { ~~ -!!! error TS2429: Interface 'B5' incorrectly extends interface 'A': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2430: Interface 'B5' incorrectly extends interface 'A'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'Derived2' is not assignable to type 'T'. [x: string]: Derived2; // error } } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithStringIndexer3.errors.txt b/tests/baselines/reference/subtypingWithStringIndexer3.errors.txt index 333e5a39c84..10c519cf304 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer3.errors.txt +++ b/tests/baselines/reference/subtypingWithStringIndexer3.errors.txt @@ -1,17 +1,17 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(11,7): error TS2416: Class 'B' incorrectly extends base class 'A': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(11,7): error TS2415: Class 'B' incorrectly extends base class 'A'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(24,21): error TS2343: Type 'Base' does not satisfy the constraint 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(24,21): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(32,11): error TS2416: Class 'B3' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(32,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Base' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(36,11): error TS2416: Class 'B4' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(36,11): error TS2415: Class 'B4' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(40,11): error TS2416: Class 'B5' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(40,11): error TS2415: Class 'B5' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. @@ -28,10 +28,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Base' is not assignable to type 'Derived': -!!! error TS2416: Property 'bar' is missing in type 'Base'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2415: Property 'bar' is missing in type 'Base'. [x: string]: Base; // error } @@ -46,8 +46,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~~~~~~~ -!!! error TS2343: Type 'Base' does not satisfy the constraint 'Derived': -!!! error TS2343: Property 'bar' is missing in type 'Base'. +!!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. +!!! error TS2344: Property 'bar' is missing in type 'Base'. [x: string]: Derived; // error } @@ -57,25 +57,25 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Base' is not assignable to type 'T'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Base' is not assignable to type 'T'. [x: string]: Base; // error } class B4 extends A { ~~ -!!! error TS2416: Class 'B4' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Derived' is not assignable to type 'T'. +!!! error TS2415: Class 'B4' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Derived' is not assignable to type 'T'. [x: string]: Derived; // error } class B5 extends A { ~~ -!!! error TS2416: Class 'B5' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2415: Class 'B5' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Derived2' is not assignable to type 'T'. [x: string]: Derived2; // error } } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt b/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt index e788ede4656..6df716791c2 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt +++ b/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt @@ -1,15 +1,15 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(11,7): error TS2416: Class 'B' incorrectly extends base class 'A': - Index signatures are incompatible: - Type 'string' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(11,7): error TS2415: Class 'B' incorrectly extends base class 'A'. + Index signatures are incompatible. + Type 'string' is not assignable to type 'Derived'. Property 'bar' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(20,11): error TS2416: Class 'B' incorrectly extends base class 'A': - Index signatures are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(20,11): error TS2415: Class 'B' incorrectly extends base class 'A'. + Index signatures are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(20,21): error TS2343: Type 'Base' does not satisfy the constraint 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(20,21): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(24,11): error TS2416: Class 'B3' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(24,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'string' is not assignable to type 'T'. @@ -26,10 +26,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Derived': -!!! error TS2416: Property 'bar' is missing in type 'String'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Derived'. +!!! error TS2415: Property 'bar' is missing in type 'String'. [x: string]: string; // error } @@ -40,21 +40,21 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Base': -!!! error TS2416: Property 'foo' is missing in type 'String'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Base'. +!!! error TS2415: Property 'foo' is missing in type 'String'. ~~~~~~~ -!!! error TS2343: Type 'Base' does not satisfy the constraint 'Derived': -!!! error TS2343: Property 'bar' is missing in type 'Base'. +!!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. +!!! error TS2344: Property 'bar' is missing in type 'Base'. [x: string]: string; // error } class B3 extends A { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'T'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'T'. [x: string]: string; // error } } \ No newline at end of file diff --git a/tests/baselines/reference/targetTypeTest3.errors.txt b/tests/baselines/reference/targetTypeTest3.errors.txt index 41b2d027fb5..af82adcace0 100644 --- a/tests/baselines/reference/targetTypeTest3.errors.txt +++ b/tests/baselines/reference/targetTypeTest3.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/targetTypeTest3.ts(4,5): error TS2322: Type '(string | number)[]' is not assignable to type 'string[]': - Type 'string | number' is not assignable to type 'string': +tests/cases/compiler/targetTypeTest3.ts(4,5): error TS2323: Type '(string | number)[]' is not assignable to type 'string[]'. + Type 'string | number' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. @@ -9,9 +9,9 @@ tests/cases/compiler/targetTypeTest3.ts(4,5): error TS2322: Type '(string | numb var a : string[] = [1,2,"3"]; // should produce an error ~ -!!! error TS2322: Type '(string | number)[]' is not assignable to type 'string[]': -!!! error TS2322: Type 'string | number' is not assignable to type 'string': -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '(string | number)[]' is not assignable to type 'string[]'. +!!! error TS2323: Type 'string | number' is not assignable to type 'string'. +!!! error TS2323: Type 'number' is not assignable to type 'string'. function func1(stuff:any[]) { return stuff; } diff --git a/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.errors.txt b/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.errors.txt index 9b068b62e68..b502eaad7e5 100644 --- a/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.errors.txt +++ b/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/trailingCommaInHeterogenousArrayLiteral1.ts(5,19): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. - Type 'string | number' is not assignable to type 'number': + Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/trailingCommaInHeterogenousArrayLiteral1.ts(6,19): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. - Type 'string | number' is not assignable to type 'number': + Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. @@ -14,12 +14,12 @@ tests/cases/compiler/trailingCommaInHeterogenousArrayLiteral1.ts(6,19): error TS this.test([1, 2, "hi", 5, ]); ~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. -!!! error TS2345: Type 'string | number' is not assignable to type 'number': +!!! error TS2345: Type 'string | number' is not assignable to type 'number'. !!! error TS2345: Type 'string' is not assignable to type 'number'. this.test([1, 2, "hi", 5]); ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. -!!! error TS2345: Type 'string | number' is not assignable to type 'number': +!!! error TS2345: Type 'string | number' is not assignable to type 'number'. !!! error TS2345: Type 'string' is not assignable to type 'number'. } } diff --git a/tests/baselines/reference/tupleTypes.errors.txt b/tests/baselines/reference/tupleTypes.errors.txt index 8bf6cca4855..6fdbd8a2f12 100644 --- a/tests/baselines/reference/tupleTypes.errors.txt +++ b/tests/baselines/reference/tupleTypes.errors.txt @@ -1,26 +1,26 @@ tests/cases/compiler/tupleTypes.ts(1,9): error TS1122: A tuple type element list cannot be empty. -tests/cases/compiler/tupleTypes.ts(14,1): error TS2322: Type 'undefined[]' is not assignable to type '[number, string]': +tests/cases/compiler/tupleTypes.ts(14,1): error TS2323: Type 'undefined[]' is not assignable to type '[number, string]'. Property '0' is missing in type 'undefined[]'. -tests/cases/compiler/tupleTypes.ts(15,1): error TS2322: Type '[number]' is not assignable to type '[number, string]': +tests/cases/compiler/tupleTypes.ts(15,1): error TS2323: Type '[number]' is not assignable to type '[number, string]'. Property '1' is missing in type '[number]'. -tests/cases/compiler/tupleTypes.ts(17,1): error TS2322: Type '[string, number]' is not assignable to type '[number, string]': - Types of property '0' are incompatible: +tests/cases/compiler/tupleTypes.ts(17,1): error TS2323: Type '[string, number]' is not assignable to type '[number, string]'. + Types of property '0' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/compiler/tupleTypes.ts(41,1): error TS2323: Type 'undefined[]' is not assignable to type '[number, string]'. -tests/cases/compiler/tupleTypes.ts(47,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]': - Types of property 'pop' are incompatible: - Type '() => string | number' is not assignable to type '() => number': - Type 'string | number' is not assignable to type 'number': +tests/cases/compiler/tupleTypes.ts(47,1): error TS2323: Type '[number, string]' is not assignable to type 'number[]'. + Types of property 'pop' are incompatible. + Type '() => string | number' is not assignable to type '() => number'. + Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/tupleTypes.ts(49,1): error TS2322: Type '[number, {}]' is not assignable to type 'number[]': - Types of property 'pop' are incompatible: - Type '() => {}' is not assignable to type '() => number': +tests/cases/compiler/tupleTypes.ts(49,1): error TS2323: Type '[number, {}]' is not assignable to type 'number[]'. + Types of property 'pop' are incompatible. + Type '() => {}' is not assignable to type '() => number'. Type '{}' is not assignable to type 'number'. -tests/cases/compiler/tupleTypes.ts(50,1): error TS2322: Type '[number, number]' is not assignable to type '[number, string]': - Types of property '1' are incompatible: +tests/cases/compiler/tupleTypes.ts(50,1): error TS2323: Type '[number, number]' is not assignable to type '[number, string]'. + Types of property '1' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is not assignable to type '[number, string]': - Types of property '1' are incompatible: +tests/cases/compiler/tupleTypes.ts(51,1): error TS2323: Type '[number, {}]' is not assignable to type '[number, string]'. + Types of property '1' are incompatible. Type '{}' is not assignable to type 'string'. @@ -42,18 +42,18 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n t = []; // Error ~ -!!! error TS2322: Type 'undefined[]' is not assignable to type '[number, string]': -!!! error TS2322: Property '0' is missing in type 'undefined[]'. +!!! error TS2323: Type 'undefined[]' is not assignable to type '[number, string]'. +!!! error TS2323: Property '0' is missing in type 'undefined[]'. t = [1]; // Error ~ -!!! error TS2322: Type '[number]' is not assignable to type '[number, string]': -!!! error TS2322: Property '1' is missing in type '[number]'. +!!! error TS2323: Type '[number]' is not assignable to type '[number, string]'. +!!! error TS2323: Property '1' is missing in type '[number]'. t = [1, "hello"]; // Ok t = ["hello", 1]; // Error ~ -!!! error TS2322: Type '[string, number]' is not assignable to type '[number, string]': -!!! error TS2322: Types of property '0' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '[string, number]' is not assignable to type '[number, string]'. +!!! error TS2323: Types of property '0' are incompatible. +!!! error TS2323: Type 'string' is not assignable to type 'number'. t = [1, "hello", 2]; // Ok var tf: [string, (x: string) => number] = ["hello", x => x.length]; @@ -87,28 +87,28 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n var a3: [number, {}]; a = a1; // Error ~ -!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]': -!!! error TS2322: Types of property 'pop' are incompatible: -!!! error TS2322: Type '() => string | number' is not assignable to type '() => number': -!!! error TS2322: Type 'string | number' is not assignable to type 'number': -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2323: Type '[number, string]' is not assignable to type 'number[]'. +!!! error TS2323: Types of property 'pop' are incompatible. +!!! error TS2323: Type '() => string | number' is not assignable to type '() => number'. +!!! error TS2323: Type 'string | number' is not assignable to type 'number'. +!!! error TS2323: Type 'string' is not assignable to type 'number'. a = a2; a = a3; // Error ~ -!!! error TS2322: Type '[number, {}]' is not assignable to type 'number[]': -!!! error TS2322: Types of property 'pop' are incompatible: -!!! error TS2322: Type '() => {}' is not assignable to type '() => number': -!!! error TS2322: Type '{}' is not assignable to type 'number'. +!!! error TS2323: Type '[number, {}]' is not assignable to type 'number[]'. +!!! error TS2323: Types of property 'pop' are incompatible. +!!! error TS2323: Type '() => {}' is not assignable to type '() => number'. +!!! error TS2323: Type '{}' is not assignable to type 'number'. a1 = a2; // Error ~~ -!!! error TS2322: Type '[number, number]' is not assignable to type '[number, string]': -!!! error TS2322: Types of property '1' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type '[number, number]' is not assignable to type '[number, string]'. +!!! error TS2323: Types of property '1' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. a1 = a3; // Error ~~ -!!! error TS2322: Type '[number, {}]' is not assignable to type '[number, string]': -!!! error TS2322: Types of property '1' are incompatible: -!!! error TS2322: Type '{}' is not assignable to type 'string'. +!!! error TS2323: Type '[number, {}]' is not assignable to type '[number, string]'. +!!! error TS2323: Types of property '1' are incompatible. +!!! error TS2323: Type '{}' is not assignable to type 'string'. a3 = a1; a3 = a2; \ No newline at end of file diff --git a/tests/baselines/reference/typeArgInference2.errors.txt b/tests/baselines/reference/typeArgInference2.errors.txt index 21fa647f442..08fc2f4e232 100644 --- a/tests/baselines/reference/typeArgInference2.errors.txt +++ b/tests/baselines/reference/typeArgInference2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeArgInference2.ts(12,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/compiler/typeArgInference2.ts(12,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '{ name: string; a: number; }' is not a valid type argument because it is not a supertype of candidate '{ name: string; b: number; }'. @@ -16,5 +16,5 @@ tests/cases/compiler/typeArgInference2.ts(12,10): error TS2453: The type argumen var z5 = foo({ name: "abc", a: 5 }); // { name: string; a: number } var z6 = foo({ name: "abc", a: 5 }, { name: "def", b: 5 }); // error ~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate '{ name: string; a: number; }' is not a valid type argument because it is not a supertype of candidate '{ name: string; b: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgInference2WithError.errors.txt b/tests/baselines/reference/typeArgInference2WithError.errors.txt index 3d3e4d35426..8a191ed310e 100644 --- a/tests/baselines/reference/typeArgInference2WithError.errors.txt +++ b/tests/baselines/reference/typeArgInference2WithError.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeArgInference2WithError.ts(7,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/compiler/typeArgInference2WithError.ts(7,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. @@ -11,5 +11,5 @@ tests/cases/compiler/typeArgInference2WithError.ts(7,10): error TS2453: The type var z7 = foo("abc", 5); // Error ~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentInference.errors.txt b/tests/baselines/reference/typeArgumentInference.errors.txt index 8003c0c0e6e..e374de7b13a 100644 --- a/tests/baselines/reference/typeArgumentInference.errors.txt +++ b/tests/baselines/reference/typeArgumentInference.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(68,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(68,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(82,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(82,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '{ x: number; z: Date; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. @@ -74,7 +74,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(82,11 } var a9a = someGenerics9('', 0, []); ~~~~~~~~~~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. var a9a: {}; var a9b = someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); @@ -91,7 +91,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(82,11 } var a9e = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); ~~~~~~~~~~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate '{ x: number; z: Date; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. var a9e: {}; var a9f = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt index de36203acb0..c251f860adb 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt @@ -3,10 +3,10 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(61,39): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(71,39): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(81,45): error TS2345: Argument of type '(n: string) => string' is not assignable to parameter of type '(b: number) => number'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(106,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(106,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(118,9): error TS2304: Cannot find name 'Window'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(120,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(120,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '{ x: number; z: any; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(120,51): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(122,56): error TS2304: Cannot find name 'window'. @@ -130,7 +130,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct var someGenerics9: someGenerics9; var a9a = new someGenerics9('', 0, []); ~~~~~~~~~~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. var a9a: {}; var a9b = new someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); @@ -149,7 +149,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct } var a9e = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ~~~~~~~~~~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate '{ x: number; z: any; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. ~~~~~~ !!! error TS2304: Cannot find name 'window'. diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraintAsCommonRoot.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithConstraintAsCommonRoot.errors.txt index 96698bc80c1..72db7214c45 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraintAsCommonRoot.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraintAsCommonRoot.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeArgumentInferenceWithConstraintAsCommonRoot.ts(7,1): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/compiler/typeArgumentInferenceWithConstraintAsCommonRoot.ts(7,1): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'Giraffe' is not a valid type argument because it is not a supertype of candidate 'Elephant'. @@ -11,5 +11,5 @@ tests/cases/compiler/typeArgumentInferenceWithConstraintAsCommonRoot.ts(7,1): er var e: Elephant; f(g, e); // valid because both Giraffe and Elephant satisfy the constraint. T is Animal ~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'Giraffe' is not a valid type argument because it is not a supertype of candidate 'Elephant'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt index 722f28772dd..a607bc2dc9d 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt @@ -8,10 +8,10 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(49,15): error TS2344: Type 'string' does not satisfy the constraint 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(55,41): error TS2345: Argument of type '(n: string) => string' is not assignable to parameter of type '(b: number) => number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(66,31): error TS2345: Argument of type '(a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void' is not assignable to parameter of type 'string'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(73,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(73,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(85,9): error TS2304: Cannot find name 'Window'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(87,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(87,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '{ x: number; z: any; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(87,47): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(89,52): error TS2304: Cannot find name 'window'. @@ -112,7 +112,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst } var a9a = someGenerics9('', 0, []); ~~~~~~~~~~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. var a9a: {}; var a9b = someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); @@ -131,7 +131,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst } var a9e = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ~~~~~~~~~~~~~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate '{ x: number; z: any; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. ~~~~~~ !!! error TS2304: Cannot find name 'window'. diff --git a/tests/baselines/reference/typeAssertions.errors.txt b/tests/baselines/reference/typeAssertions.errors.txt index 1ec22da4c57..ab5eb19ce2a 100644 --- a/tests/baselines/reference/typeAssertions.errors.txt +++ b/tests/baselines/reference/typeAssertions.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(5,5): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(31,12): error TS2353: Neither type 'SomeOther' nor type 'SomeBase' is assignable to the other: +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(31,12): error TS2352: Neither type 'SomeOther' nor type 'SomeBase' is assignable to the other. Property 'p' is missing in type 'SomeOther'. -tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(35,15): error TS2353: Neither type 'SomeOther' nor type 'SomeDerived' is assignable to the other: +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(35,15): error TS2352: Neither type 'SomeOther' nor type 'SomeDerived' is assignable to the other. Property 'x' is missing in type 'SomeOther'. tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(37,13): error TS2352: Neither type 'SomeDerived' nor type 'SomeOther' is assignable to the other. tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(38,13): error TS2352: Neither type 'SomeBase' nor type 'SomeOther' is assignable to the other. @@ -42,15 +42,15 @@ tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(38,13): err someBase = someBase; someBase = someOther; // Error ~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type 'SomeOther' nor type 'SomeBase' is assignable to the other: -!!! error TS2353: Property 'p' is missing in type 'SomeOther'. +!!! error TS2352: Neither type 'SomeOther' nor type 'SomeBase' is assignable to the other. +!!! error TS2352: Property 'p' is missing in type 'SomeOther'. someDerived = someDerived; someDerived = someBase; someDerived = someOther; // Error ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type 'SomeOther' nor type 'SomeDerived' is assignable to the other: -!!! error TS2353: Property 'x' is missing in type 'SomeOther'. +!!! error TS2352: Neither type 'SomeOther' nor type 'SomeDerived' is assignable to the other. +!!! error TS2352: Property 'x' is missing in type 'SomeOther'. someOther = someDerived; // Error ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/typeIdentityConsidersBrands.errors.txt b/tests/baselines/reference/typeIdentityConsidersBrands.errors.txt index 7d25976cb2f..2cae46779a8 100644 --- a/tests/baselines/reference/typeIdentityConsidersBrands.errors.txt +++ b/tests/baselines/reference/typeIdentityConsidersBrands.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeIdentityConsidersBrands.ts(30,1): error TS2322: Type 'X_1' is not assignable to type 'Y_1': +tests/cases/compiler/typeIdentityConsidersBrands.ts(30,1): error TS2323: Type 'X_1' is not assignable to type 'Y_1'. Types have separate declarations of a private property 'name'. tests/cases/compiler/typeIdentityConsidersBrands.ts(31,6): error TS2345: Argument of type 'Y_1' is not assignable to parameter of type 'X_1'. @@ -35,8 +35,8 @@ tests/cases/compiler/typeIdentityConsidersBrands.ts(31,6): error TS2345: Argumen a2 = b2; // should error ~~ -!!! error TS2322: Type 'X_1' is not assignable to type 'Y_1': -!!! error TS2322: Types have separate declarations of a private property 'name'. +!!! error TS2323: Type 'X_1' is not assignable to type 'Y_1'. +!!! error TS2323: Types have separate declarations of a private property 'name'. foo2(a2); // should error ~~ !!! error TS2345: Argument of type 'Y_1' is not assignable to parameter of type 'X_1'. diff --git a/tests/baselines/reference/typeInfer1.errors.txt b/tests/baselines/reference/typeInfer1.errors.txt index d7e54ebce27..a56668e62f3 100644 --- a/tests/baselines/reference/typeInfer1.errors.txt +++ b/tests/baselines/reference/typeInfer1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeInfer1.ts(11,5): error TS2322: Type '{ Moo: () => string; }' is not assignable to type 'ITextWriter2': +tests/cases/compiler/typeInfer1.ts(11,5): error TS2323: Type '{ Moo: () => string; }' is not assignable to type 'ITextWriter2'. Property 'Write' is missing in type '{ Moo: () => string; }'. @@ -15,7 +15,7 @@ tests/cases/compiler/typeInfer1.ts(11,5): error TS2322: Type '{ Moo: () => strin var yyyyyyyy: ITextWriter2 = { ~~~~~~~~ -!!! error TS2322: Type '{ Moo: () => string; }' is not assignable to type 'ITextWriter2': -!!! error TS2322: Property 'Write' is missing in type '{ Moo: () => string; }'. +!!! error TS2323: Type '{ Moo: () => string; }' is not assignable to type 'ITextWriter2'. +!!! error TS2323: Property 'Write' is missing in type '{ Moo: () => string; }'. Moo: function() { return "cow"; } } \ No newline at end of file diff --git a/tests/baselines/reference/typeInferenceConflictingCandidates.errors.txt b/tests/baselines/reference/typeInferenceConflictingCandidates.errors.txt index 836555d7e89..f275e44503a 100644 --- a/tests/baselines/reference/typeInferenceConflictingCandidates.errors.txt +++ b/tests/baselines/reference/typeInferenceConflictingCandidates.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeInferenceConflictingCandidates.ts(3,1): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +tests/cases/compiler/typeInferenceConflictingCandidates.ts(3,1): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. @@ -7,5 +7,5 @@ tests/cases/compiler/typeInferenceConflictingCandidates.ts(3,1): error TS2453: T g("", 3, a => a); ~ -!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly: +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/typeMatch1.errors.txt b/tests/baselines/reference/typeMatch1.errors.txt index 5921ba0a8d3..ae6eff78528 100644 --- a/tests/baselines/reference/typeMatch1.errors.txt +++ b/tests/baselines/reference/typeMatch1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/typeMatch1.ts(18,1): error TS2322: Type 'D' is not assignable to type 'C': +tests/cases/compiler/typeMatch1.ts(18,1): error TS2323: Type 'D' is not assignable to type 'C'. Types have separate declarations of a private property 'x'. -tests/cases/compiler/typeMatch1.ts(19,1): error TS2322: Type 'typeof C' is not assignable to type 'C': +tests/cases/compiler/typeMatch1.ts(19,1): error TS2323: Type 'typeof C' is not assignable to type 'C'. Property 'x' is missing in type 'typeof C'. tests/cases/compiler/typeMatch1.ts(20,1): error TS2365: Operator '==' cannot be applied to types 'typeof C' and 'typeof D'. @@ -25,12 +25,12 @@ tests/cases/compiler/typeMatch1.ts(20,1): error TS2365: Operator '==' cannot be x6 = x7; ~~ -!!! error TS2322: Type 'D' is not assignable to type 'C': -!!! error TS2322: Types have separate declarations of a private property 'x'. +!!! error TS2323: Type 'D' is not assignable to type 'C'. +!!! error TS2323: Types have separate declarations of a private property 'x'. x6=C; ~~ -!!! error TS2322: Type 'typeof C' is not assignable to type 'C': -!!! error TS2322: Property 'x' is missing in type 'typeof C'. +!!! error TS2323: Type 'typeof C' is not assignable to type 'C'. +!!! error TS2323: Property 'x' is missing in type 'typeof C'. C==D; ~~~~ !!! error TS2365: Operator '==' cannot be applied to types 'typeof C' and 'typeof D'. diff --git a/tests/baselines/reference/typeMatch2.errors.txt b/tests/baselines/reference/typeMatch2.errors.txt index 0bd20bda65f..867ccb93387 100644 --- a/tests/baselines/reference/typeMatch2.errors.txt +++ b/tests/baselines/reference/typeMatch2.errors.txt @@ -1,17 +1,17 @@ -tests/cases/compiler/typeMatch2.ts(3,2): error TS2322: Type '{}' is not assignable to type '{ x: number; y: number; }': +tests/cases/compiler/typeMatch2.ts(3,2): error TS2323: Type '{}' is not assignable to type '{ x: number; y: number; }'. Property 'x' is missing in type '{}'. -tests/cases/compiler/typeMatch2.ts(4,5): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }': +tests/cases/compiler/typeMatch2.ts(4,5): error TS2323: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. Property 'y' is missing in type '{ x: number; }'. -tests/cases/compiler/typeMatch2.ts(6,5): error TS2322: Type '{ x: number; z: number; }' is not assignable to type '{ x: number; y: number; }': +tests/cases/compiler/typeMatch2.ts(6,5): error TS2323: Type '{ x: number; z: number; }' is not assignable to type '{ x: number; y: number; }'. Property 'y' is missing in type '{ x: number; z: number; }'. -tests/cases/compiler/typeMatch2.ts(18,5): error TS2322: Type 'Animal[]' is not assignable to type 'Giraffe[]': - Type 'Animal' is not assignable to type 'Giraffe': +tests/cases/compiler/typeMatch2.ts(18,5): error TS2323: Type 'Animal[]' is not assignable to type 'Giraffe[]'. + Type 'Animal' is not assignable to type 'Giraffe'. Property 'g' is missing in type 'Animal'. -tests/cases/compiler/typeMatch2.ts(22,5): error TS2322: Type '{ f1: number; f2: Animal[]; }' is not assignable to type '{ f1: number; f2: Giraffe[]; }': - Types of property 'f2' are incompatible: - Type 'Animal[]' is not assignable to type 'Giraffe[]': +tests/cases/compiler/typeMatch2.ts(22,5): error TS2323: Type '{ f1: number; f2: Animal[]; }' is not assignable to type '{ f1: number; f2: Giraffe[]; }'. + Types of property 'f2' are incompatible. + Type 'Animal[]' is not assignable to type 'Giraffe[]'. Type 'Animal' is not assignable to type 'Giraffe'. -tests/cases/compiler/typeMatch2.ts(35,5): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }': +tests/cases/compiler/typeMatch2.ts(35,5): error TS2323: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. Property 'y' is missing in type '{ x: number; }'. @@ -20,17 +20,17 @@ tests/cases/compiler/typeMatch2.ts(35,5): error TS2322: Type '{ x: number; }' is var a = { x: 1, y: 2 }; a = {}; // error ~ -!!! error TS2322: Type '{}' is not assignable to type '{ x: number; y: number; }': -!!! error TS2322: Property 'x' is missing in type '{}'. +!!! error TS2323: Type '{}' is not assignable to type '{ x: number; y: number; }'. +!!! error TS2323: Property 'x' is missing in type '{}'. a = { x: 1 }; // error ~ -!!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }': -!!! error TS2322: Property 'y' is missing in type '{ x: number; }'. +!!! error TS2323: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. +!!! error TS2323: Property 'y' is missing in type '{ x: number; }'. a = { x: 1, y: 2, z: 3 }; a = { x: 1, z: 3 }; // error ~ -!!! error TS2322: Type '{ x: number; z: number; }' is not assignable to type '{ x: number; y: number; }': -!!! error TS2322: Property 'y' is missing in type '{ x: number; z: number; }'. +!!! error TS2323: Type '{ x: number; z: number; }' is not assignable to type '{ x: number; y: number; }'. +!!! error TS2323: Property 'y' is missing in type '{ x: number; z: number; }'. } class Animal { private a; } @@ -44,18 +44,18 @@ tests/cases/compiler/typeMatch2.ts(35,5): error TS2322: Type '{ x: number; }' is aa = gg; gg = aa; // error ~~ -!!! error TS2322: Type 'Animal[]' is not assignable to type 'Giraffe[]': -!!! error TS2322: Type 'Animal' is not assignable to type 'Giraffe': -!!! error TS2322: Property 'g' is missing in type 'Animal'. +!!! error TS2323: Type 'Animal[]' is not assignable to type 'Giraffe[]'. +!!! error TS2323: Type 'Animal' is not assignable to type 'Giraffe'. +!!! error TS2323: Property 'g' is missing in type 'Animal'. var xa = { f1: 5, f2: aa }; var xb = { f1: 5, f2: gg }; xa = xb; // Should be ok xb = xa; // Not ok ~~ -!!! error TS2322: Type '{ f1: number; f2: Animal[]; }' is not assignable to type '{ f1: number; f2: Giraffe[]; }': -!!! error TS2322: Types of property 'f2' are incompatible: -!!! error TS2322: Type 'Animal[]' is not assignable to type 'Giraffe[]': -!!! error TS2322: Type 'Animal' is not assignable to type 'Giraffe'. +!!! error TS2323: Type '{ f1: number; f2: Animal[]; }' is not assignable to type '{ f1: number; f2: Giraffe[]; }'. +!!! error TS2323: Types of property 'f2' are incompatible. +!!! error TS2323: Type 'Animal[]' is not assignable to type 'Giraffe[]'. +!!! error TS2323: Type 'Animal' is not assignable to type 'Giraffe'. } function f4() { @@ -70,8 +70,8 @@ tests/cases/compiler/typeMatch2.ts(35,5): error TS2322: Type '{ x: number; }' is a = { x: 1, y: _any, z:1 }; a = { x: 1 }; // error ~ -!!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }': -!!! error TS2322: Property 'y' is missing in type '{ x: number; }'. +!!! error TS2323: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. +!!! error TS2323: Property 'y' is missing in type '{ x: number; }'. var mf = function m(n) { return false; }; var zf = function z(n: number) { return true; }; mf=zf; diff --git a/tests/baselines/reference/typeName1.errors.txt b/tests/baselines/reference/typeName1.errors.txt index e941b34aaf6..6b896001b5a 100644 --- a/tests/baselines/reference/typeName1.errors.txt +++ b/tests/baselines/reference/typeName1.errors.txt @@ -1,30 +1,30 @@ -tests/cases/compiler/typeName1.ts(9,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }': +tests/cases/compiler/typeName1.ts(9,5): error TS2323: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. Property 'f' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(10,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }': +tests/cases/compiler/typeName1.ts(10,5): error TS2323: Type 'number' is not assignable to type '{ f(s: string): number; }'. Property 'f' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(11,5): error TS2323: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. -tests/cases/compiler/typeName1.ts(12,5): error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }': +tests/cases/compiler/typeName1.ts(12,5): error TS2323: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. Property 'x' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(13,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }': +tests/cases/compiler/typeName1.ts(13,5): error TS2323: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. Property 'x' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }': +tests/cases/compiler/typeName1.ts(14,5): error TS2323: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. Property 'z' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(15,5): error TS2323: Type 'number' is not assignable to type '(s: string) => boolean'. -tests/cases/compiler/typeName1.ts(16,5): error TS2322: Type 'number' is not assignable to type '{ (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }': +tests/cases/compiler/typeName1.ts(16,5): error TS2323: Type 'number' is not assignable to type '{ (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }'. Property 'z' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(16,10): error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. -tests/cases/compiler/typeName1.ts(17,5): error TS2322: Type 'number' is not assignable to type 'I': +tests/cases/compiler/typeName1.ts(17,5): error TS2323: Type 'number' is not assignable to type 'I'. Property 'k' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(18,5): error TS2322: Type 'number' is not assignable to type 'I[][][][]': +tests/cases/compiler/typeName1.ts(18,5): error TS2323: Type 'number' is not assignable to type 'I[][][][]'. Property 'length' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(19,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]': +tests/cases/compiler/typeName1.ts(19,5): error TS2323: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'. Property 'length' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(20,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }; }[][]': +tests/cases/compiler/typeName1.ts(20,5): error TS2323: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }; }[][]'. Property 'length' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(20,50): error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. -tests/cases/compiler/typeName1.ts(21,5): error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }': +tests/cases/compiler/typeName1.ts(21,5): error TS2323: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. Property 'x' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(22,5): error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }': +tests/cases/compiler/typeName1.ts(22,5): error TS2323: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. Property 'f' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(23,5): error TS2323: Type 'typeof C' is not assignable to type 'number'. @@ -40,62 +40,62 @@ tests/cases/compiler/typeName1.ts(23,5): error TS2323: Type 'typeof C' is not as var x1:{ f(s:string):number;f(n:number):string; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }': -!!! error TS2322: Property 'f' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. +!!! error TS2323: Property 'f' is missing in type 'Number'. var x2:{ f(s:string):number; } =3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }': -!!! error TS2322: Property 'f' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ f(s: string): number; }'. +!!! error TS2323: Property 'f' is missing in type 'Number'. var x3:{ (s:string):number;(n:number):string; }=3; ~~ !!! error TS2323: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. var x4:{ x;y;z:number;f(n:number):string;f(s:string):number; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }': -!!! error TS2322: Property 'x' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. +!!! error TS2323: Property 'x' is missing in type 'Number'. var x5:{ (s:string):number;(n:number):string;x;y;z:number;f(n:number):string;f(s:string):number; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }': -!!! error TS2322: Property 'x' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. +!!! error TS2323: Property 'x' is missing in type 'Number'. var x6:{ z:number;f:{(n:number):string;(s:string):number;}; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }': -!!! error TS2322: Property 'z' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. +!!! error TS2323: Property 'z' is missing in type 'Number'. var x7:(s:string)=>boolean=3; ~~ !!! error TS2323: Type 'number' is not assignable to type '(s: string) => boolean'. var x8:{ z:I;[s:string]:{ x; y; };[n:number]:{x; y;};():boolean; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }': -!!! error TS2322: Property 'z' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }'. +!!! error TS2323: Property 'z' is missing in type 'Number'. ~~~~ !!! error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. var x9:I=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type 'I': -!!! error TS2322: Property 'k' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type 'I'. +!!! error TS2323: Property 'k' is missing in type 'Number'. var x10:I[][][][]=3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type 'I[][][][]': -!!! error TS2322: Property 'length' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type 'I[][][][]'. +!!! error TS2323: Property 'length' is missing in type 'Number'. var x11:{z:I;x:boolean;}[][]=3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]': -!!! error TS2322: Property 'length' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'. +!!! error TS2323: Property 'length' is missing in type 'Number'. var x12:{z:I;x:boolean;y:(s:string)=>boolean;w:{ z:I;[s:string]:{ x; y; };[n:number]:{x; y;};():boolean; };}[][]=3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }; }[][]': -!!! error TS2322: Property 'length' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }; }[][]'. +!!! error TS2323: Property 'length' is missing in type 'Number'. ~~~~ !!! error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. var x13:{ new(): number; new(n:number):number; x: string; w: {y: number;}; (): {}; } = 3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }': -!!! error TS2322: Property 'x' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. +!!! error TS2323: Property 'x' is missing in type 'Number'. var x14:{ f(x:number):boolean; p; q; ():string; }=3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }': -!!! error TS2322: Property 'f' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. +!!! error TS2323: Property 'f' is missing in type 'Number'. var x15:number=C; ~~~ !!! error TS2323: Type 'typeof C' is not assignable to type 'number'. diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt index 30ff740ba44..96db3e9110c 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/typeParameterArgumentEquivalence.ts(4,5): error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: number) => boolean': - Types of parameters 'item' and 'item' are incompatible: +tests/cases/compiler/typeParameterArgumentEquivalence.ts(4,5): error TS2323: Type '(item: T) => boolean' is not assignable to type '(item: number) => boolean'. + Types of parameters 'item' and 'item' are incompatible. Type 'T' is not assignable to type 'number'. -tests/cases/compiler/typeParameterArgumentEquivalence.ts(5,5): error TS2322: Type '(item: number) => boolean' is not assignable to type '(item: T) => boolean': - Types of parameters 'item' and 'item' are incompatible: +tests/cases/compiler/typeParameterArgumentEquivalence.ts(5,5): error TS2323: Type '(item: number) => boolean' is not assignable to type '(item: T) => boolean'. + Types of parameters 'item' and 'item' are incompatible. Type 'number' is not assignable to type 'T'. @@ -12,13 +12,13 @@ tests/cases/compiler/typeParameterArgumentEquivalence.ts(5,5): error TS2322: Typ var y: (item: T) => boolean; x = y; // Should be an error ~ -!!! error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: number) => boolean': -!!! error TS2322: Types of parameters 'item' and 'item' are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'number'. +!!! error TS2323: Type '(item: T) => boolean' is not assignable to type '(item: number) => boolean'. +!!! error TS2323: Types of parameters 'item' and 'item' are incompatible. +!!! error TS2323: Type 'T' is not assignable to type 'number'. y = x; // Shound be an error ~ -!!! error TS2322: Type '(item: number) => boolean' is not assignable to type '(item: T) => boolean': -!!! error TS2322: Types of parameters 'item' and 'item' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'T'. +!!! error TS2323: Type '(item: number) => boolean' is not assignable to type '(item: T) => boolean'. +!!! error TS2323: Types of parameters 'item' and 'item' are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt index 76e7960ff61..f1350ebe853 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/typeParameterArgumentEquivalence2.ts(4,5): error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: U) => boolean': - Types of parameters 'item' and 'item' are incompatible: +tests/cases/compiler/typeParameterArgumentEquivalence2.ts(4,5): error TS2323: Type '(item: T) => boolean' is not assignable to type '(item: U) => boolean'. + Types of parameters 'item' and 'item' are incompatible. Type 'T' is not assignable to type 'U'. -tests/cases/compiler/typeParameterArgumentEquivalence2.ts(5,5): error TS2322: Type '(item: U) => boolean' is not assignable to type '(item: T) => boolean': - Types of parameters 'item' and 'item' are incompatible: +tests/cases/compiler/typeParameterArgumentEquivalence2.ts(5,5): error TS2323: Type '(item: U) => boolean' is not assignable to type '(item: T) => boolean'. + Types of parameters 'item' and 'item' are incompatible. Type 'U' is not assignable to type 'T'. @@ -12,13 +12,13 @@ tests/cases/compiler/typeParameterArgumentEquivalence2.ts(5,5): error TS2322: Ty var y: (item: T) => boolean; x = y; // Should be an error ~ -!!! error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: U) => boolean': -!!! error TS2322: Types of parameters 'item' and 'item' are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'U'. +!!! error TS2323: Type '(item: T) => boolean' is not assignable to type '(item: U) => boolean'. +!!! error TS2323: Types of parameters 'item' and 'item' are incompatible. +!!! error TS2323: Type 'T' is not assignable to type 'U'. y = x; // Shound be an error ~ -!!! error TS2322: Type '(item: U) => boolean' is not assignable to type '(item: T) => boolean': -!!! error TS2322: Types of parameters 'item' and 'item' are incompatible: -!!! error TS2322: Type 'U' is not assignable to type 'T'. +!!! error TS2323: Type '(item: U) => boolean' is not assignable to type '(item: T) => boolean'. +!!! error TS2323: Types of parameters 'item' and 'item' are incompatible. +!!! error TS2323: Type 'U' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt index 80c9a2af69c..59ac7d39e26 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/typeParameterArgumentEquivalence3.ts(4,5): error TS2322: Type '(item: any) => boolean' is not assignable to type '(item: any) => T': +tests/cases/compiler/typeParameterArgumentEquivalence3.ts(4,5): error TS2323: Type '(item: any) => boolean' is not assignable to type '(item: any) => T'. Type 'boolean' is not assignable to type 'T'. -tests/cases/compiler/typeParameterArgumentEquivalence3.ts(5,5): error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => boolean': +tests/cases/compiler/typeParameterArgumentEquivalence3.ts(5,5): error TS2323: Type '(item: any) => T' is not assignable to type '(item: any) => boolean'. Type 'T' is not assignable to type 'boolean'. @@ -10,11 +10,11 @@ tests/cases/compiler/typeParameterArgumentEquivalence3.ts(5,5): error TS2322: Ty var y: (item) => boolean; x = y; // Should be an error ~ -!!! error TS2322: Type '(item: any) => boolean' is not assignable to type '(item: any) => T': -!!! error TS2322: Type 'boolean' is not assignable to type 'T'. +!!! error TS2323: Type '(item: any) => boolean' is not assignable to type '(item: any) => T'. +!!! error TS2323: Type 'boolean' is not assignable to type 'T'. y = x; // Shound be an error ~ -!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => boolean': -!!! error TS2322: Type 'T' is not assignable to type 'boolean'. +!!! error TS2323: Type '(item: any) => T' is not assignable to type '(item: any) => boolean'. +!!! error TS2323: Type 'T' is not assignable to type 'boolean'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt index a49aad4067a..f62a5a0e4e7 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/typeParameterArgumentEquivalence4.ts(4,5): error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U': +tests/cases/compiler/typeParameterArgumentEquivalence4.ts(4,5): error TS2323: Type '(item: any) => T' is not assignable to type '(item: any) => U'. Type 'T' is not assignable to type 'U'. -tests/cases/compiler/typeParameterArgumentEquivalence4.ts(5,5): error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T': +tests/cases/compiler/typeParameterArgumentEquivalence4.ts(5,5): error TS2323: Type '(item: any) => U' is not assignable to type '(item: any) => T'. Type 'U' is not assignable to type 'T'. @@ -10,11 +10,11 @@ tests/cases/compiler/typeParameterArgumentEquivalence4.ts(5,5): error TS2322: Ty var y: (item) => T; x = y; // Should be an error ~ -!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U': -!!! error TS2322: Type 'T' is not assignable to type 'U'. +!!! error TS2323: Type '(item: any) => T' is not assignable to type '(item: any) => U'. +!!! error TS2323: Type 'T' is not assignable to type 'U'. y = x; // Shound be an error ~ -!!! error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T': -!!! error TS2322: Type 'U' is not assignable to type 'T'. +!!! error TS2323: Type '(item: any) => U' is not assignable to type '(item: any) => T'. +!!! error TS2323: Type 'U' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt index 78edb104786..41d0162af5b 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/typeParameterArgumentEquivalence5.ts(4,5): error TS2322: Type '() => (item: any) => T' is not assignable to type '() => (item: any) => U': - Type '(item: any) => T' is not assignable to type '(item: any) => U': +tests/cases/compiler/typeParameterArgumentEquivalence5.ts(4,5): error TS2323: Type '() => (item: any) => T' is not assignable to type '() => (item: any) => U'. + Type '(item: any) => T' is not assignable to type '(item: any) => U'. Type 'T' is not assignable to type 'U'. -tests/cases/compiler/typeParameterArgumentEquivalence5.ts(5,5): error TS2322: Type '() => (item: any) => U' is not assignable to type '() => (item: any) => T': - Type '(item: any) => U' is not assignable to type '(item: any) => T': +tests/cases/compiler/typeParameterArgumentEquivalence5.ts(5,5): error TS2323: Type '() => (item: any) => U' is not assignable to type '() => (item: any) => T'. + Type '(item: any) => U' is not assignable to type '(item: any) => T'. Type 'U' is not assignable to type 'T'. @@ -12,13 +12,13 @@ tests/cases/compiler/typeParameterArgumentEquivalence5.ts(5,5): error TS2322: Ty var y: () => (item) => T; x = y; // Should be an error ~ -!!! error TS2322: Type '() => (item: any) => T' is not assignable to type '() => (item: any) => U': -!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U': -!!! error TS2322: Type 'T' is not assignable to type 'U'. +!!! error TS2323: Type '() => (item: any) => T' is not assignable to type '() => (item: any) => U'. +!!! error TS2323: Type '(item: any) => T' is not assignable to type '(item: any) => U'. +!!! error TS2323: Type 'T' is not assignable to type 'U'. y = x; // Shound be an error ~ -!!! error TS2322: Type '() => (item: any) => U' is not assignable to type '() => (item: any) => T': -!!! error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T': -!!! error TS2322: Type 'U' is not assignable to type 'T'. +!!! error TS2323: Type '() => (item: any) => U' is not assignable to type '() => (item: any) => T'. +!!! error TS2323: Type '(item: any) => U' is not assignable to type '(item: any) => T'. +!!! error TS2323: Type 'U' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAssignmentCompat1.errors.txt b/tests/baselines/reference/typeParameterAssignmentCompat1.errors.txt index bb778353007..a2692184aff 100644 --- a/tests/baselines/reference/typeParameterAssignmentCompat1.errors.txt +++ b/tests/baselines/reference/typeParameterAssignmentCompat1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/typeParameterAssignmentCompat1.ts(8,5): error TS2322: Type 'Foo' is not assignable to type 'Foo': +tests/cases/compiler/typeParameterAssignmentCompat1.ts(8,5): error TS2323: Type 'Foo' is not assignable to type 'Foo'. Type 'U' is not assignable to type 'T'. -tests/cases/compiler/typeParameterAssignmentCompat1.ts(9,12): error TS2322: Type 'Foo' is not assignable to type 'Foo': +tests/cases/compiler/typeParameterAssignmentCompat1.ts(9,12): error TS2323: Type 'Foo' is not assignable to type 'Foo'. Type 'T' is not assignable to type 'U'. -tests/cases/compiler/typeParameterAssignmentCompat1.ts(16,9): error TS2322: Type 'Foo' is not assignable to type 'Foo': +tests/cases/compiler/typeParameterAssignmentCompat1.ts(16,9): error TS2323: Type 'Foo' is not assignable to type 'Foo'. Type 'U' is not assignable to type 'T'. -tests/cases/compiler/typeParameterAssignmentCompat1.ts(17,16): error TS2322: Type 'Foo' is not assignable to type 'Foo': +tests/cases/compiler/typeParameterAssignmentCompat1.ts(17,16): error TS2323: Type 'Foo' is not assignable to type 'Foo'. Type 'T' is not assignable to type 'U'. @@ -18,12 +18,12 @@ tests/cases/compiler/typeParameterAssignmentCompat1.ts(17,16): error TS2322: Typ var y: Foo; x = y; // should be an error ~ -!!! error TS2322: Type 'Foo' is not assignable to type 'Foo': -!!! error TS2322: Type 'U' is not assignable to type 'T'. +!!! error TS2323: Type 'Foo' is not assignable to type 'Foo'. +!!! error TS2323: Type 'U' is not assignable to type 'T'. return x; ~ -!!! error TS2322: Type 'Foo' is not assignable to type 'Foo': -!!! error TS2322: Type 'T' is not assignable to type 'U'. +!!! error TS2323: Type 'Foo' is not assignable to type 'Foo'. +!!! error TS2323: Type 'T' is not assignable to type 'U'. } class C { @@ -32,11 +32,11 @@ tests/cases/compiler/typeParameterAssignmentCompat1.ts(17,16): error TS2322: Typ var y: Foo; x = y; // should be an error ~ -!!! error TS2322: Type 'Foo' is not assignable to type 'Foo': -!!! error TS2322: Type 'U' is not assignable to type 'T'. +!!! error TS2323: Type 'Foo' is not assignable to type 'Foo'. +!!! error TS2323: Type 'U' is not assignable to type 'T'. return x; ~ -!!! error TS2322: Type 'Foo' is not assignable to type 'Foo': -!!! error TS2322: Type 'T' is not assignable to type 'U'. +!!! error TS2323: Type 'Foo' is not assignable to type 'Foo'. +!!! error TS2323: Type 'T' is not assignable to type 'U'. } } \ No newline at end of file diff --git a/tests/baselines/reference/typeofAmbientExternalModules.errors.txt b/tests/baselines/reference/typeofAmbientExternalModules.errors.txt index 8057b4f8a11..007581e54f2 100644 --- a/tests/baselines/reference/typeofAmbientExternalModules.errors.txt +++ b/tests/baselines/reference/typeofAmbientExternalModules.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/typeofAmbientExternalModules_2.ts(7,1): error TS2322: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"': +tests/cases/compiler/typeofAmbientExternalModules_2.ts(7,1): error TS2323: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"'. Property 'C' is missing in type 'typeof D'. -tests/cases/compiler/typeofAmbientExternalModules_2.ts(9,1): error TS2322: Type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"' is not assignable to type 'typeof D': +tests/cases/compiler/typeofAmbientExternalModules_2.ts(9,1): error TS2323: Type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"' is not assignable to type 'typeof D'. Property 'prototype' is missing in type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"'. @@ -13,13 +13,13 @@ tests/cases/compiler/typeofAmbientExternalModules_2.ts(9,1): error TS2322: Type var y1: typeof ext = ext; y1 = exp; ~~ -!!! error TS2322: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"': -!!! error TS2322: Property 'C' is missing in type 'typeof D'. +!!! error TS2323: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"'. +!!! error TS2323: Property 'C' is missing in type 'typeof D'. var y2: typeof exp = exp; y2 = ext; ~~ -!!! error TS2322: Type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"' is not assignable to type 'typeof D': -!!! error TS2322: Property 'prototype' is missing in type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"'. +!!! error TS2323: Type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"' is not assignable to type 'typeof D'. +!!! error TS2323: Property 'prototype' is missing in type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"'. ==== tests/cases/compiler/typeofAmbientExternalModules_0.ts (0 errors) ==== export class C { foo: string; } diff --git a/tests/baselines/reference/typeofExternalModules.errors.txt b/tests/baselines/reference/typeofExternalModules.errors.txt index 3290d769226..a7610f299da 100644 --- a/tests/baselines/reference/typeofExternalModules.errors.txt +++ b/tests/baselines/reference/typeofExternalModules.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/typeofExternalModules_core.ts(5,1): error TS2322: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofExternalModules_external"': +tests/cases/compiler/typeofExternalModules_core.ts(5,1): error TS2323: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofExternalModules_external"'. Property 'C' is missing in type 'typeof D'. -tests/cases/compiler/typeofExternalModules_core.ts(7,1): error TS2322: Type 'typeof "tests/cases/compiler/typeofExternalModules_external"' is not assignable to type 'typeof D': +tests/cases/compiler/typeofExternalModules_core.ts(7,1): error TS2323: Type 'typeof "tests/cases/compiler/typeofExternalModules_external"' is not assignable to type 'typeof D'. Property 'prototype' is missing in type 'typeof "tests/cases/compiler/typeofExternalModules_external"'. @@ -11,13 +11,13 @@ tests/cases/compiler/typeofExternalModules_core.ts(7,1): error TS2322: Type 'typ var y1: typeof ext = ext; y1 = exp; ~~ -!!! error TS2322: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofExternalModules_external"': -!!! error TS2322: Property 'C' is missing in type 'typeof D'. +!!! error TS2323: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofExternalModules_external"'. +!!! error TS2323: Property 'C' is missing in type 'typeof D'. var y2: typeof exp = exp; y2 = ext; ~~ -!!! error TS2322: Type 'typeof "tests/cases/compiler/typeofExternalModules_external"' is not assignable to type 'typeof D': -!!! error TS2322: Property 'prototype' is missing in type 'typeof "tests/cases/compiler/typeofExternalModules_external"'. +!!! error TS2323: Type 'typeof "tests/cases/compiler/typeofExternalModules_external"' is not assignable to type 'typeof D'. +!!! error TS2323: Property 'prototype' is missing in type 'typeof "tests/cases/compiler/typeofExternalModules_external"'. ==== tests/cases/compiler/typeofExternalModules_external.ts (0 errors) ==== export class C { } diff --git a/tests/baselines/reference/typeofInternalModules.errors.txt b/tests/baselines/reference/typeofInternalModules.errors.txt index e4ce2b39c58..7743f70946f 100644 --- a/tests/baselines/reference/typeofInternalModules.errors.txt +++ b/tests/baselines/reference/typeofInternalModules.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/typeofInternalModules.ts(15,16): error TS2304: Cannot find name 'importUninst'. tests/cases/compiler/typeofInternalModules.ts(17,9): error TS2304: Cannot find name 'Outer'. -tests/cases/compiler/typeofInternalModules.ts(19,1): error TS2322: Type 'typeof Outer' is not assignable to type 'typeof instantiated': +tests/cases/compiler/typeofInternalModules.ts(19,1): error TS2323: Type 'typeof Outer' is not assignable to type 'typeof instantiated'. Property 'C' is missing in type 'typeof Outer'. tests/cases/compiler/typeofInternalModules.ts(21,16): error TS2304: Cannot find name 'importUninst'. -tests/cases/compiler/typeofInternalModules.ts(23,1): error TS2322: Type 'typeof instantiated' is not assignable to type 'typeof Outer': +tests/cases/compiler/typeofInternalModules.ts(23,1): error TS2323: Type 'typeof instantiated' is not assignable to type 'typeof Outer'. Property 'instantiated' is missing in type 'typeof instantiated'. @@ -32,8 +32,8 @@ tests/cases/compiler/typeofInternalModules.ts(23,1): error TS2322: Type 'typeof var x5: typeof importInst; x5 = Outer; ~~ -!!! error TS2322: Type 'typeof Outer' is not assignable to type 'typeof instantiated': -!!! error TS2322: Property 'C' is missing in type 'typeof Outer'. +!!! error TS2323: Type 'typeof Outer' is not assignable to type 'typeof instantiated'. +!!! error TS2323: Property 'C' is missing in type 'typeof Outer'. x5 = Outer.instantiated; var x6: typeof importUninst; ~~~~~~~~~~~~ @@ -41,6 +41,6 @@ tests/cases/compiler/typeofInternalModules.ts(23,1): error TS2322: Type 'typeof var x7: typeof Outer = Outer; x7 = importInst; ~~ -!!! error TS2322: Type 'typeof instantiated' is not assignable to type 'typeof Outer': -!!! error TS2322: Property 'instantiated' is missing in type 'typeof instantiated'. +!!! error TS2323: Type 'typeof instantiated' is not assignable to type 'typeof Outer'. +!!! error TS2323: Property 'instantiated' is missing in type 'typeof instantiated'. \ No newline at end of file diff --git a/tests/baselines/reference/typesOnlyExternalModuleStillHasInstance.errors.txt b/tests/baselines/reference/typesOnlyExternalModuleStillHasInstance.errors.txt index ca5f6e36cea..d90944c906a 100644 --- a/tests/baselines/reference/typesOnlyExternalModuleStillHasInstance.errors.txt +++ b/tests/baselines/reference/typesOnlyExternalModuleStillHasInstance.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/externalModules/foo_1.ts(5,5): error TS2322: Type 'typeof "tests/cases/conformance/externalModules/foo_0"' is not assignable to type '{ M2: Object; }': +tests/cases/conformance/externalModules/foo_1.ts(5,5): error TS2323: Type 'typeof "tests/cases/conformance/externalModules/foo_0"' is not assignable to type '{ M2: Object; }'. Property 'M2' is missing in type 'typeof "tests/cases/conformance/externalModules/foo_0"'. @@ -9,8 +9,8 @@ tests/cases/conformance/externalModules/foo_1.ts(5,5): error TS2322: Type 'typeo var x: typeof foo0 = {}; var y: {M2: Object} = foo0; ~ -!!! error TS2322: Type 'typeof "tests/cases/conformance/externalModules/foo_0"' is not assignable to type '{ M2: Object; }': -!!! error TS2322: Property 'M2' is missing in type 'typeof "tests/cases/conformance/externalModules/foo_0"'. +!!! error TS2323: Type 'typeof "tests/cases/conformance/externalModules/foo_0"' is not assignable to type '{ M2: Object; }'. +!!! error TS2323: Property 'M2' is missing in type 'typeof "tests/cases/conformance/externalModules/foo_0"'. ==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ==== export interface Person { diff --git a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.errors.txt b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.errors.txt index 5b455a84b59..624d53f95d3 100644 --- a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.errors.txt +++ b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(3,10): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(5,10): error TS2347: Untyped function calls may not accept type arguments. tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(8,10): error TS2347: Untyped function calls may not accept type arguments. -tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(10,7): error TS2421: Class 'C' incorrectly implements interface 'Function': +tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(10,7): error TS2420: Class 'C' incorrectly implements interface 'Function'. Property 'apply' is missing in type 'C'. tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(18,10): error TS2349: Cannot invoke an expression whose type lacks a call signature. tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(20,18): error TS2311: A class may only extend another class. @@ -29,8 +29,8 @@ tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(41,1): error TS2 class C implements Function { ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'Function': -!!! error TS2421: Property 'apply' is missing in type 'C'. +!!! error TS2420: Class 'C' incorrectly implements interface 'Function'. +!!! error TS2420: Property 'apply' is missing in type 'C'. prototype = null; length = 1; arguments = null; diff --git a/tests/baselines/reference/widenedTypes.errors.txt b/tests/baselines/reference/widenedTypes.errors.txt index fb0c38a514e..c65e2873416 100644 --- a/tests/baselines/reference/widenedTypes.errors.txt +++ b/tests/baselines/reference/widenedTypes.errors.txt @@ -4,10 +4,10 @@ tests/cases/compiler/widenedTypes.ts(6,7): error TS2361: The right-hand side of tests/cases/compiler/widenedTypes.ts(8,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. tests/cases/compiler/widenedTypes.ts(11,1): error TS2323: Type 'string' is not assignable to type 'number'. tests/cases/compiler/widenedTypes.ts(18,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/widenedTypes.ts(23,5): error TS2322: Type 'number[]' is not assignable to type 'string[]': +tests/cases/compiler/widenedTypes.ts(23,5): error TS2323: Type 'number[]' is not assignable to type 'string[]'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/widenedTypes.ts(24,5): error TS2322: Type '{ [x: string]: number; x: number; y: null; }' is not assignable to type '{ [x: string]: string; }': - Index signatures are incompatible: +tests/cases/compiler/widenedTypes.ts(24,5): error TS2323: Type '{ [x: string]: number; x: number; y: null; }' is not assignable to type '{ [x: string]: string; }'. + Index signatures are incompatible. Type 'number' is not assignable to type 'string'. @@ -48,10 +48,10 @@ tests/cases/compiler/widenedTypes.ts(24,5): error TS2322: Type '{ [x: string]: n // Highlights the difference between array literals and object literals var arr: string[] = [3, null]; // not assignable because null is not widened. BCT is {} ~~~ -!!! error TS2322: Type 'number[]' is not assignable to type 'string[]': -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2323: Type 'number[]' is not assignable to type 'string[]'. +!!! error TS2323: Type 'number' is not assignable to type 'string'. var obj: { [x: string]: string; } = { x: 3, y: null }; // assignable because null is widened, and therefore BCT is any ~~~ -!!! error TS2322: Type '{ [x: string]: number; x: number; y: null; }' is not assignable to type '{ [x: string]: string; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2323: Type '{ [x: string]: number; x: number; y: null; }' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2323: Index signatures are incompatible. +!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt b/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt index a0decc891df..57a4d7e5bc2 100644 --- a/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt +++ b/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/wrappedRecursiveGenericType.ts(13,1): error TS2322: Type 'number' is not assignable to type 'X': +tests/cases/compiler/wrappedRecursiveGenericType.ts(13,1): error TS2323: Type 'number' is not assignable to type 'X'. Property 'e' is missing in type 'Number'. tests/cases/compiler/wrappedRecursiveGenericType.ts(14,1): error TS2323: Type 'number' is not assignable to type 'X'. @@ -18,8 +18,8 @@ tests/cases/compiler/wrappedRecursiveGenericType.ts(14,1): error TS2323: Type 'n x.a.val = 5; // val -> number x.a.b.val = 5; // val -> X (This should be an error) ~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'X': -!!! error TS2322: Property 'e' is missing in type 'Number'. +!!! error TS2323: Type 'number' is not assignable to type 'X'. +!!! error TS2323: Property 'e' is missing in type 'Number'. x.a.b.a.val = 5; // val -> X (This should be an error) ~~~~~~~~~~~ !!! error TS2323: Type 'number' is not assignable to type 'X'. \ No newline at end of file From d6ac176be976d7869622002cf146454410ad3936 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 28 Oct 2014 09:09:46 -0700 Subject: [PATCH 19/28] Respond to code review comments --- src/services/services.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index 19d602b55d7..7a6a810b305 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2019,17 +2019,15 @@ module ts { } /** Returns true if the position is within a comment */ - function isInsideComment(token: Node, position: number): boolean { - var sourceFile = token.getSourceFile(); - - // The position has to be: 1. in the leading trivia (before tokek.getStart()), and 2. within a comment - return position <= token.getStart() && + function isInsideComment(sourceFile: SourceFile, token: Node, position: number): boolean { + // The position has to be: 1. in the leading trivia (before token.getStart()), and 2. within a comment + return position <= token.getStart(sourceFile) && (isInsideCommentRange(getTrailingCommentRanges(sourceFile.text, token.getFullStart())) || isInsideCommentRange(getLeadingCommentRanges(sourceFile.text, token.getFullStart()))); function isInsideCommentRange(comments: CommentRange[]): boolean { return forEach(comments, comment => { - // either we are 1. completely inside the comment, or 2. at the end of + // either we are 1. completely inside the comment, or 2. at the end of the comment if (comment.pos < position && position < comment.end) { return true; } @@ -2363,8 +2361,8 @@ module ts { var currentToken = getTokenAtPosition(sourceFile, position); // Completion not allowed inside comments, bail out if this is the case - if (isInsideComment(currentToken, position)) { - host.log("Returning an empty list because completion was blocked."); + if (isInsideComment(sourceFile, currentToken, position)) { + host.log("Returning an empty list because completion was inside a comment."); return undefined; } @@ -2380,7 +2378,7 @@ module ts { // Check if this is a valid completion location if (previousToken && isCompletionListBlocker(previousToken)) { - host.log("Returning an empty list because completion was blocked."); + host.log("Returning an empty list because completion was requested in an invalid position."); return undefined; } @@ -5157,7 +5155,7 @@ module ts { // OK, we have found a match in the file. This is only an acceptable match if // it is contained within a comment. var token = getTokenAtPosition(sourceFile, matchPosition); - if (!isInsideComment(token, matchPosition)) { + if (!isInsideComment(sourceFile, token, matchPosition)) { continue; } From 1fede10b6c8ef48156520a32a5825565f3680982 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 28 Oct 2014 11:40:54 -0700 Subject: [PATCH 20/28] Use of union types and type aliases in compiler --- src/compiler/checker.ts | 14 +++--- src/compiler/commandLineParser.ts | 7 +-- src/compiler/parser.ts | 1 - src/compiler/types.ts | 71 +++++++++++-------------------- 4 files changed, 35 insertions(+), 58 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d024d03e0ec..803d03f1bb1 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -472,7 +472,7 @@ module ts { // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace if (entityName.kind === SyntaxKind.Identifier && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { - entityName = entityName.parent; + entityName = entityName.parent; } // Check for case 1 and 3 in the above example if (entityName.kind === SyntaxKind.Identifier || entityName.parent.kind === SyntaxKind.QualifiedName) { @@ -8070,7 +8070,7 @@ module ts { function isInRightSideOfImportOrExportAssignment(node: EntityName) { while (node.parent.kind === SyntaxKind.QualifiedName) { - node = node.parent; + node = node.parent; } if (node.parent.kind === SyntaxKind.ImportDeclaration) { @@ -8104,7 +8104,7 @@ module ts { } if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { - entityName = entityName.parent; + entityName = entityName.parent; } if (isExpression(entityName)) { @@ -8117,7 +8117,7 @@ module ts { else if (entityName.kind === SyntaxKind.QualifiedName || entityName.kind === SyntaxKind.PropertyAccess) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { - checkPropertyAccess(entityName); + checkPropertyAccess(entityName); } return getNodeLinks(entityName).resolvedSymbol; } @@ -8149,10 +8149,10 @@ module ts { return getSymbolOfNode(node.parent); } - if (node.kind === SyntaxKind.Identifier && isInRightSideOfImportOrExportAssignment(node)) { + if (node.kind === SyntaxKind.Identifier && isInRightSideOfImportOrExportAssignment(node)) { return node.parent.kind === SyntaxKind.ExportAssignment ? getSymbolOfEntityName(node) - : getSymbolOfPartOfRightHandSideOfImport(node); + : getSymbolOfPartOfRightHandSideOfImport(node); } switch (node.kind) { @@ -8233,7 +8233,7 @@ module ts { return symbol && getTypeOfSymbol(symbol); } - if (isInRightSideOfImportOrExportAssignment(node)) { + if (isInRightSideOfImportOrExportAssignment(node)) { var symbol = getSymbolInfo(node); var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index a7993484c64..63c555f1951 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -183,9 +183,10 @@ module ts { break; // If not a primitive, the possible types are specified in what is effectively a map of options. default: - var value = (args[i++] || "").toLowerCase(); - if (hasProperty(opt.type, value)) { - options[opt.name] = opt.type[value]; + var map = >opt.type; + var key = (args[i++] || "").toLowerCase(); + if (hasProperty(map, key)) { + options[opt.name] = map[key]; } else { errors.push(createCompilerDiagnostic(opt.error)); diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 1ffdab29752..6c2207a08d2 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -1086,7 +1086,6 @@ module ts { return finishNode(node); } error(Diagnostics.Identifier_expected); - var node = createMissingNode(); node.text = ""; return node; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 5dd102adbe5..fd448dec06b 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -282,9 +282,7 @@ module ts { right: Identifier; } - export interface EntityName extends Node { - // Identifier, QualifiedName, or Missing - } + export type EntityName = Identifier | QualifiedName; export interface ParsedSignature { typeParameters?: NodeArray; @@ -312,7 +310,7 @@ module ts { export interface ParameterDeclaration extends VariableDeclaration { } export interface FunctionDeclaration extends Declaration, ParsedSignature { - body?: Node; // Block or Expression + body?: Block | Expression; } export interface MethodDeclaration extends FunctionDeclaration { } @@ -378,7 +376,7 @@ module ts { } export interface FunctionExpression extends Expression, FunctionDeclaration { - body: Node; // Required, whereas the member inherited from FunctionDeclaration is optional + body: Block | Expression; // Required, whereas the member inherited from FunctionDeclaration is optional } // The text property of a LiteralExpression stores the interpreted value of the literal in text form. For a StringLiteral @@ -536,7 +534,7 @@ module ts { } export interface ModuleDeclaration extends Declaration { - body: Node; // Block or ModuleDeclaration + body: Block | ModuleDeclaration; } export interface ImportDeclaration extends Declaration { @@ -588,40 +586,24 @@ module ts { } export interface SourceMapSpan { - /** Line number in the js file*/ - emittedLine: number; - /** Column number in the js file */ - emittedColumn: number; - /** Line number in the ts file */ - sourceLine: number; - /** Column number in the ts file */ - sourceColumn: number; - /** Optional name (index into names array) associated with this span */ - nameIndex?: number; - /** ts file (index into sources array) associated with this span*/ - sourceIndex: number; + emittedLine: number; // Line number in the .js file + emittedColumn: number; // Column number in the .js file + sourceLine: number; // Line number in the .ts file + sourceColumn: number; // Column number in the .ts file + nameIndex?: number; // Optional name (index into names array) associated with this span + sourceIndex: number; // .ts file (index into sources array) associated with this span*/ } export interface SourceMapData { - /** Where the sourcemap file is written */ - sourceMapFilePath: string; - /** source map URL written in the js file */ - jsSourceMappingURL: string; - /** Source map's file field - js file name*/ - sourceMapFile: string; - /** Source map's sourceRoot field - location where the sources will be present if not "" */ - sourceMapSourceRoot: string; - /** Source map's sources field - list of sources that can be indexed in this source map*/ - sourceMapSources: string[]; - /** input source file (which one can use on program to get the file) - this is one to one mapping with the sourceMapSources list*/ - inputSourceFileNames: string[]; - /** Source map's names field - list of names that can be indexed in this source map*/ - sourceMapNames?: string[]; - /** Source map's mapping field - encoded source map spans*/ - sourceMapMappings: string; - /** Raw source map spans that were encoded into the sourceMapMappings*/ - sourceMapDecodedMappings: SourceMapSpan[]; + sourceMapFilePath: string; // Where the sourcemap file is written + jsSourceMappingURL: string; // source map URL written in the .js file + sourceMapFile: string; // Source map's file field - .js file name + sourceMapSourceRoot: string; // Source map's sourceRoot field - location where the sources will be present if not "" + sourceMapSources: string[]; // Source map's sources field - list of sources that can be indexed in this source map + inputSourceFileNames: string[]; // Input source file (which one can use on program to get the file), 1:1 mapping with the sourceMapSources list + sourceMapNames?: string[]; // Source map's names field - list of names that can be indexed in this source map + sourceMapMappings: string; // Source map's mapping field - encoded source map spans + sourceMapDecodedMappings: SourceMapSpan[]; // Raw source map spans that were encoded into the sourceMapMappings } // Return code used by getEmitOutput function to indicate status of the function @@ -674,11 +656,8 @@ module ts { isUndefinedSymbol(symbol: Symbol): boolean; isArgumentsSymbol(symbol: Symbol): boolean; hasEarlyErrors(sourceFile?: SourceFile): boolean; - - // Returns the constant value of this enum member, or 'undefined' if the enum member has a - // computed value. + // Returns the constant value of this enum member, or 'undefined' if the enum member has a computed value. getEnumMemberValue(node: EnumMember): number; - isValidPropertyAccess(node: PropertyAccess, propertyName: string): boolean; getAliasedSymbol(symbol: Symbol): Symbol; } @@ -765,16 +744,14 @@ module ts { writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; isImportDeclarationEntityNameReferenceDeclarationVisibile(entityName: EntityName): SymbolAccessiblityResult; - - // Returns the constant value this property access resolves to, or 'undefined' if it does - // resolve to a constant. + // Returns the constant value this property access resolves to, or 'undefined' for a non-constant getConstantValue(node: PropertyAccess): number; hasEarlyErrors(sourceFile?: SourceFile): boolean; } export enum SymbolFlags { FunctionScopedVariable = 0x00000001, // Variable (var) or parameter - BlockScopedVariable = 0x00000002, // A block-scoped variable (let ot const) + BlockScopedVariable = 0x00000002, // A block-scoped variable (let or const) Property = 0x00000004, // Property or enum member EnumMember = 0x00000008, // Enum member Function = 0x00000010, // Function @@ -1097,7 +1074,7 @@ module ts { target?: ScriptTarget; version?: boolean; watch?: boolean; - [option: string]: any; + [option: string]: string | number | boolean; } export enum ModuleKind { @@ -1130,7 +1107,7 @@ module ts { export interface CommandLineOption { name: string; - type: any; // "string", "number", "boolean", or an object literal mapping named values to actual values + type: string | Map; // "string", "number", "boolean", or an object literal mapping named values to actual values shortName?: string; // A short pneumonic for convenience - for instance, 'h' can be used in place of 'help'. description?: DiagnosticMessage; // The message describing what the command line switch does paramName?: DiagnosticMessage; // The name to be used for a non-boolean option's parameter. From 35dc29df46532f1216c0e6eee27fb2326172e017 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 28 Oct 2014 11:46:36 -0700 Subject: [PATCH 21/28] Fixing type check error in services.ts --- src/services/services.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index 7cdb52ff6cf..b1761817a03 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -4586,11 +4586,10 @@ module ts { return root.parent.kind === SyntaxKind.TypeReference && !isLastClause; } - function isInRightSideOfImport(node: EntityName) { + function isInRightSideOfImport(node: Node) { while (node.parent.kind === SyntaxKind.QualifiedName) { node = node.parent; } - return node.parent.kind === SyntaxKind.ImportDeclaration && (node.parent).entityName === node; } From 77d4e2ff3c473f7b2779a83a7ceef281270f09c5 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 28 Oct 2014 11:47:28 -0700 Subject: [PATCH 22/28] Updating LKG compiler to get type alias support --- bin/tsc.js | 2957 ++++++++++++---------- bin/typescriptServices.js | 5066 ++++++++++++++++++------------------- 2 files changed, 4087 insertions(+), 3936 deletions(-) diff --git a/bin/tsc.js b/bin/tsc.js index bb432bf9c47..aaba61dfe94 100644 --- a/bin/tsc.js +++ b/bin/tsc.js @@ -128,7 +128,13 @@ var ts; 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: 1150, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - An_enum_member_cannot_have_a_numeric_name: { code: 1151, category: 1 /* Error */, key: "An enum member cannot have a numeric name." }, + var_let_or_const_expected: { code: 1152, category: 1 /* Error */, key: "'var', 'let' or 'const' expected." }, + let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1 /* Error */, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1 /* Error */, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_must_be_initialized: { code: 1155, category: 1 /* Error */, key: "'const' declarations must be initialized" }, + const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1 /* Error */, key: "'const' declarations can only be declared inside a block." }, + let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1 /* Error */, key: "'let' declarations can only be declared inside a block." }, + Aliased_type_cannot_be_an_object_type_literal_Use_an_interface_declaration_instead: { code: 1158, category: 1 /* Error */, key: "Aliased type cannot be an object type literal. Use an interface declaration 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." }, @@ -275,6 +281,12 @@ var ts; Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1 /* Error */, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, + Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: 1 /* Error */, key: "Block-scoped variable '{0}' used before its declaration.", isEarly: true }, + The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: 1 /* Error */, key: "The operand of an increment or decrement operator cannot be a constant.", isEarly: true }, + Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: 1 /* Error */, key: "Left-hand side of assignment expression cannot be a constant.", isEarly: true }, + Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: 1 /* Error */, key: "Cannot redeclare block-scoped variable '{0}'.", isEarly: true }, + An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: 1 /* Error */, key: "An enum member cannot have a numeric name." }, + Type_alias_0_circularly_references_itself: { code: 2453, category: 1 /* Error */, key: "Type alias '{0}' circularly references itself." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1 /* Error */, key: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, @@ -354,6 +366,9 @@ var ts; Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, + Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4079, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2: { code: 4080, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using private name '{1}'." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: 1 /* Error */, key: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1 /* Error */, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: 1 /* Error */, key: "Cannot read file '{0}': {1}" }, @@ -369,7 +384,7 @@ var ts; Watch_input_files: { code: 6005, category: 2 /* Message */, key: "Watch input files." }, Redirect_output_structure_to_the_directory: { code: 6006, category: 2 /* Message */, key: "Redirect output structure to the directory." }, Do_not_emit_comments_to_output: { code: 6009, category: 2 /* Message */, key: "Do not emit comments to output." }, - Specify_ECMAScript_target_version_Colon_ES3_default_or_ES5: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), or 'ES5'" }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2 /* Message */, key: "Specify module code generation: 'commonjs' or 'amd'" }, Print_this_message: { code: 6017, category: 2 /* Message */, key: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: 2 /* Message */, key: "Print the compiler's version." }, @@ -391,7 +406,7 @@ var ts; Compiler_option_0_expects_an_argument: { code: 6044, category: 1 /* Error */, key: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1 /* Error */, key: "Unterminated quoted string in response file '{0}'." }, Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_or_es5: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3' or 'es5'." }, + Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: 1 /* Error */, key: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: 1 /* Error */, key: "Unable to open file '{0}'." }, @@ -470,6 +485,7 @@ var ts; "throw": 88 /* ThrowKeyword */, "true": 89 /* TrueKeyword */, "try": 90 /* TryKeyword */, + "type": 115 /* TypeKeyword */, "typeof": 91 /* TypeOfKeyword */, "var": 92 /* VarKeyword */, "void": 93 /* VoidKeyword */, @@ -527,10 +543,10 @@ var ts; "|=": 57 /* BarEqualsToken */, "^=": 58 /* CaretEqualsToken */ }; - var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; - var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; - var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; - var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; + var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; function lookupInUnicodeMap(code, map) { if (code < map[0]) { return false; @@ -1476,85 +1492,87 @@ var ts; SyntaxKind[SyntaxKind["NumberKeyword"] = 112] = "NumberKeyword"; SyntaxKind[SyntaxKind["SetKeyword"] = 113] = "SetKeyword"; SyntaxKind[SyntaxKind["StringKeyword"] = 114] = "StringKeyword"; - SyntaxKind[SyntaxKind["Missing"] = 115] = "Missing"; - SyntaxKind[SyntaxKind["QualifiedName"] = 116] = "QualifiedName"; - SyntaxKind[SyntaxKind["TypeParameter"] = 117] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 118] = "Parameter"; - SyntaxKind[SyntaxKind["Property"] = 119] = "Property"; - SyntaxKind[SyntaxKind["Method"] = 120] = "Method"; - SyntaxKind[SyntaxKind["Constructor"] = 121] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 122] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 123] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 124] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 125] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 126] = "IndexSignature"; - SyntaxKind[SyntaxKind["TypeReference"] = 127] = "TypeReference"; - SyntaxKind[SyntaxKind["TypeQuery"] = 128] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 129] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 130] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 131] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 132] = "UnionType"; - SyntaxKind[SyntaxKind["ParenType"] = 133] = "ParenType"; - SyntaxKind[SyntaxKind["ArrayLiteral"] = 134] = "ArrayLiteral"; - SyntaxKind[SyntaxKind["ObjectLiteral"] = 135] = "ObjectLiteral"; - SyntaxKind[SyntaxKind["PropertyAssignment"] = 136] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["PropertyAccess"] = 137] = "PropertyAccess"; - SyntaxKind[SyntaxKind["IndexedAccess"] = 138] = "IndexedAccess"; - SyntaxKind[SyntaxKind["CallExpression"] = 139] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 140] = "NewExpression"; - SyntaxKind[SyntaxKind["TypeAssertion"] = 141] = "TypeAssertion"; - SyntaxKind[SyntaxKind["ParenExpression"] = 142] = "ParenExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 143] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 144] = "ArrowFunction"; - SyntaxKind[SyntaxKind["PrefixOperator"] = 145] = "PrefixOperator"; - SyntaxKind[SyntaxKind["PostfixOperator"] = 146] = "PostfixOperator"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 147] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 148] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 149] = "OmittedExpression"; - SyntaxKind[SyntaxKind["Block"] = 150] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 151] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 152] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 153] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 154] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 155] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 156] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 157] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 158] = "ForInStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 159] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 160] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 161] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 162] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 163] = "SwitchStatement"; - SyntaxKind[SyntaxKind["CaseClause"] = 164] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 165] = "DefaultClause"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 166] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 167] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 168] = "TryStatement"; - SyntaxKind[SyntaxKind["TryBlock"] = 169] = "TryBlock"; - SyntaxKind[SyntaxKind["CatchBlock"] = 170] = "CatchBlock"; - SyntaxKind[SyntaxKind["FinallyBlock"] = 171] = "FinallyBlock"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 172] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 173] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 174] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["FunctionBlock"] = 175] = "FunctionBlock"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 176] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 177] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 178] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 179] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 180] = "ModuleBlock"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 181] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 182] = "ExportAssignment"; - SyntaxKind[SyntaxKind["EnumMember"] = 183] = "EnumMember"; - SyntaxKind[SyntaxKind["SourceFile"] = 184] = "SourceFile"; - SyntaxKind[SyntaxKind["Program"] = 185] = "Program"; - SyntaxKind[SyntaxKind["SyntaxList"] = 186] = "SyntaxList"; - SyntaxKind[SyntaxKind["Count"] = 187] = "Count"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 115] = "TypeKeyword"; + SyntaxKind[SyntaxKind["Missing"] = 116] = "Missing"; + SyntaxKind[SyntaxKind["QualifiedName"] = 117] = "QualifiedName"; + SyntaxKind[SyntaxKind["TypeParameter"] = 118] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 119] = "Parameter"; + SyntaxKind[SyntaxKind["Property"] = 120] = "Property"; + SyntaxKind[SyntaxKind["Method"] = 121] = "Method"; + SyntaxKind[SyntaxKind["Constructor"] = 122] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 123] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 124] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 125] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 126] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 127] = "IndexSignature"; + SyntaxKind[SyntaxKind["TypeReference"] = 128] = "TypeReference"; + SyntaxKind[SyntaxKind["TypeQuery"] = 129] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 130] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 131] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 132] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 133] = "UnionType"; + SyntaxKind[SyntaxKind["ParenType"] = 134] = "ParenType"; + SyntaxKind[SyntaxKind["ArrayLiteral"] = 135] = "ArrayLiteral"; + SyntaxKind[SyntaxKind["ObjectLiteral"] = 136] = "ObjectLiteral"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 137] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["PropertyAccess"] = 138] = "PropertyAccess"; + SyntaxKind[SyntaxKind["IndexedAccess"] = 139] = "IndexedAccess"; + SyntaxKind[SyntaxKind["CallExpression"] = 140] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 141] = "NewExpression"; + SyntaxKind[SyntaxKind["TypeAssertion"] = 142] = "TypeAssertion"; + SyntaxKind[SyntaxKind["ParenExpression"] = 143] = "ParenExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 144] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 145] = "ArrowFunction"; + SyntaxKind[SyntaxKind["PrefixOperator"] = 146] = "PrefixOperator"; + SyntaxKind[SyntaxKind["PostfixOperator"] = 147] = "PostfixOperator"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 148] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 149] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 150] = "OmittedExpression"; + SyntaxKind[SyntaxKind["Block"] = 151] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 152] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 153] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 154] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 155] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 156] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 157] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 158] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 159] = "ForInStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 160] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 161] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 162] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 163] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 164] = "SwitchStatement"; + SyntaxKind[SyntaxKind["CaseClause"] = 165] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 166] = "DefaultClause"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 167] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 168] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 169] = "TryStatement"; + SyntaxKind[SyntaxKind["TryBlock"] = 170] = "TryBlock"; + SyntaxKind[SyntaxKind["CatchBlock"] = 171] = "CatchBlock"; + SyntaxKind[SyntaxKind["FinallyBlock"] = 172] = "FinallyBlock"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 173] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 174] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 175] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["FunctionBlock"] = 176] = "FunctionBlock"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 177] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 178] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 179] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 180] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 181] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 182] = "ModuleBlock"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 183] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 184] = "ExportAssignment"; + SyntaxKind[SyntaxKind["EnumMember"] = 185] = "EnumMember"; + SyntaxKind[SyntaxKind["SourceFile"] = 186] = "SourceFile"; + SyntaxKind[SyntaxKind["Program"] = 187] = "Program"; + SyntaxKind[SyntaxKind["SyntaxList"] = 188] = "SyntaxList"; + SyntaxKind[SyntaxKind["Count"] = 189] = "Count"; SyntaxKind[SyntaxKind["FirstAssignment"] = SyntaxKind.EqualsToken] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = SyntaxKind.CaretEqualsToken] = "LastAssignment"; SyntaxKind[SyntaxKind["FirstReservedWord"] = SyntaxKind.BreakKeyword] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = SyntaxKind.WithKeyword] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = SyntaxKind.BreakKeyword] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.StringKeyword] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.TypeKeyword] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = SyntaxKind.YieldKeyword] = "LastFutureReservedWord"; SyntaxKind[SyntaxKind["FirstTypeNode"] = SyntaxKind.TypeReference] = "FirstTypeNode"; @@ -1562,7 +1580,7 @@ var ts; SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.CaretEqualsToken] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = SyntaxKind.EndOfFileToken] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = SyntaxKind.StringKeyword] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = SyntaxKind.TypeKeyword] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = SyntaxKind.SingleLineCommentTrivia] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = SyntaxKind.WhitespaceTrivia] = "LastTriviaToken"; })(ts.SyntaxKind || (ts.SyntaxKind = {})); @@ -1579,8 +1597,11 @@ var ts; NodeFlags[NodeFlags["MultiLine"] = 0x00000100] = "MultiLine"; NodeFlags[NodeFlags["Synthetic"] = 0x00000200] = "Synthetic"; NodeFlags[NodeFlags["DeclarationFile"] = 0x00000400] = "DeclarationFile"; + NodeFlags[NodeFlags["Let"] = 0x00000800] = "Let"; + NodeFlags[NodeFlags["Const"] = 0x00001000] = "Const"; NodeFlags[NodeFlags["Modifier"] = NodeFlags.Export | NodeFlags.Ambient | NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected | NodeFlags.Static] = "Modifier"; NodeFlags[NodeFlags["AccessibilityModifier"] = NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected] = "AccessibilityModifier"; + NodeFlags[NodeFlags["BlockScoped"] = NodeFlags.Let | NodeFlags.Const] = "BlockScoped"; })(ts.NodeFlags || (ts.NodeFlags = {})); var NodeFlags = ts.NodeFlags; (function (EmitReturnStatus) { @@ -1616,42 +1637,46 @@ var ts; })(ts.SymbolAccessibility || (ts.SymbolAccessibility = {})); var SymbolAccessibility = ts.SymbolAccessibility; (function (SymbolFlags) { - SymbolFlags[SymbolFlags["Variable"] = 0x00000001] = "Variable"; - SymbolFlags[SymbolFlags["Property"] = 0x00000002] = "Property"; - SymbolFlags[SymbolFlags["EnumMember"] = 0x00000004] = "EnumMember"; - SymbolFlags[SymbolFlags["Function"] = 0x00000008] = "Function"; - SymbolFlags[SymbolFlags["Class"] = 0x00000010] = "Class"; - SymbolFlags[SymbolFlags["Interface"] = 0x00000020] = "Interface"; - SymbolFlags[SymbolFlags["Enum"] = 0x00000040] = "Enum"; - SymbolFlags[SymbolFlags["ValueModule"] = 0x00000080] = "ValueModule"; - SymbolFlags[SymbolFlags["NamespaceModule"] = 0x00000100] = "NamespaceModule"; - SymbolFlags[SymbolFlags["TypeLiteral"] = 0x00000200] = "TypeLiteral"; - SymbolFlags[SymbolFlags["ObjectLiteral"] = 0x00000400] = "ObjectLiteral"; - SymbolFlags[SymbolFlags["Method"] = 0x00000800] = "Method"; - SymbolFlags[SymbolFlags["Constructor"] = 0x00001000] = "Constructor"; - SymbolFlags[SymbolFlags["GetAccessor"] = 0x00002000] = "GetAccessor"; - SymbolFlags[SymbolFlags["SetAccessor"] = 0x00004000] = "SetAccessor"; - SymbolFlags[SymbolFlags["CallSignature"] = 0x00008000] = "CallSignature"; - SymbolFlags[SymbolFlags["ConstructSignature"] = 0x00010000] = "ConstructSignature"; - SymbolFlags[SymbolFlags["IndexSignature"] = 0x00020000] = "IndexSignature"; - SymbolFlags[SymbolFlags["TypeParameter"] = 0x00040000] = "TypeParameter"; - SymbolFlags[SymbolFlags["ExportValue"] = 0x00080000] = "ExportValue"; - SymbolFlags[SymbolFlags["ExportType"] = 0x00100000] = "ExportType"; - SymbolFlags[SymbolFlags["ExportNamespace"] = 0x00200000] = "ExportNamespace"; - SymbolFlags[SymbolFlags["Import"] = 0x00400000] = "Import"; - SymbolFlags[SymbolFlags["Instantiated"] = 0x00800000] = "Instantiated"; - SymbolFlags[SymbolFlags["Merged"] = 0x01000000] = "Merged"; - SymbolFlags[SymbolFlags["Transient"] = 0x02000000] = "Transient"; - SymbolFlags[SymbolFlags["Prototype"] = 0x04000000] = "Prototype"; - SymbolFlags[SymbolFlags["UnionProperty"] = 0x08000000] = "UnionProperty"; + SymbolFlags[SymbolFlags["FunctionScopedVariable"] = 0x00000001] = "FunctionScopedVariable"; + SymbolFlags[SymbolFlags["BlockScopedVariable"] = 0x00000002] = "BlockScopedVariable"; + SymbolFlags[SymbolFlags["Property"] = 0x00000004] = "Property"; + SymbolFlags[SymbolFlags["EnumMember"] = 0x00000008] = "EnumMember"; + SymbolFlags[SymbolFlags["Function"] = 0x00000010] = "Function"; + SymbolFlags[SymbolFlags["Class"] = 0x00000020] = "Class"; + SymbolFlags[SymbolFlags["Interface"] = 0x00000040] = "Interface"; + SymbolFlags[SymbolFlags["Enum"] = 0x00000080] = "Enum"; + SymbolFlags[SymbolFlags["ValueModule"] = 0x00000100] = "ValueModule"; + SymbolFlags[SymbolFlags["NamespaceModule"] = 0x00000200] = "NamespaceModule"; + SymbolFlags[SymbolFlags["TypeLiteral"] = 0x00000400] = "TypeLiteral"; + SymbolFlags[SymbolFlags["ObjectLiteral"] = 0x00000800] = "ObjectLiteral"; + SymbolFlags[SymbolFlags["Method"] = 0x00001000] = "Method"; + SymbolFlags[SymbolFlags["Constructor"] = 0x00002000] = "Constructor"; + SymbolFlags[SymbolFlags["GetAccessor"] = 0x00004000] = "GetAccessor"; + SymbolFlags[SymbolFlags["SetAccessor"] = 0x00008000] = "SetAccessor"; + SymbolFlags[SymbolFlags["CallSignature"] = 0x00010000] = "CallSignature"; + SymbolFlags[SymbolFlags["ConstructSignature"] = 0x00020000] = "ConstructSignature"; + SymbolFlags[SymbolFlags["IndexSignature"] = 0x00040000] = "IndexSignature"; + SymbolFlags[SymbolFlags["TypeParameter"] = 0x00080000] = "TypeParameter"; + SymbolFlags[SymbolFlags["TypeAlias"] = 0x00100000] = "TypeAlias"; + SymbolFlags[SymbolFlags["ExportValue"] = 0x00200000] = "ExportValue"; + SymbolFlags[SymbolFlags["ExportType"] = 0x00400000] = "ExportType"; + SymbolFlags[SymbolFlags["ExportNamespace"] = 0x00800000] = "ExportNamespace"; + SymbolFlags[SymbolFlags["Import"] = 0x01000000] = "Import"; + SymbolFlags[SymbolFlags["Instantiated"] = 0x02000000] = "Instantiated"; + SymbolFlags[SymbolFlags["Merged"] = 0x04000000] = "Merged"; + SymbolFlags[SymbolFlags["Transient"] = 0x08000000] = "Transient"; + SymbolFlags[SymbolFlags["Prototype"] = 0x10000000] = "Prototype"; + SymbolFlags[SymbolFlags["UnionProperty"] = 0x20000000] = "UnionProperty"; + SymbolFlags[SymbolFlags["Variable"] = SymbolFlags.FunctionScopedVariable | SymbolFlags.BlockScopedVariable] = "Variable"; SymbolFlags[SymbolFlags["Value"] = SymbolFlags.Variable | SymbolFlags.Property | SymbolFlags.EnumMember | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule | SymbolFlags.Method | SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Value"; - SymbolFlags[SymbolFlags["Type"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral | SymbolFlags.TypeParameter] = "Type"; + SymbolFlags[SymbolFlags["Type"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral | SymbolFlags.TypeParameter | SymbolFlags.TypeAlias] = "Type"; SymbolFlags[SymbolFlags["Namespace"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Namespace"; SymbolFlags[SymbolFlags["Module"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Module"; SymbolFlags[SymbolFlags["Accessor"] = SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Accessor"; SymbolFlags[SymbolFlags["Signature"] = SymbolFlags.CallSignature | SymbolFlags.ConstructSignature | SymbolFlags.IndexSignature] = "Signature"; + SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = SymbolFlags.Value & ~SymbolFlags.FunctionScopedVariable] = "FunctionScopedVariableExcludes"; + SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = SymbolFlags.Value] = "BlockScopedVariableExcludes"; SymbolFlags[SymbolFlags["ParameterExcludes"] = SymbolFlags.Value] = "ParameterExcludes"; - SymbolFlags[SymbolFlags["VariableExcludes"] = SymbolFlags.Value & ~SymbolFlags.Variable] = "VariableExcludes"; SymbolFlags[SymbolFlags["PropertyExcludes"] = SymbolFlags.Value] = "PropertyExcludes"; SymbolFlags[SymbolFlags["EnumMemberExcludes"] = SymbolFlags.Value] = "EnumMemberExcludes"; SymbolFlags[SymbolFlags["FunctionExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.ValueModule)] = "FunctionExcludes"; @@ -1664,8 +1689,9 @@ var ts; SymbolFlags[SymbolFlags["GetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.SetAccessor] = "GetAccessorExcludes"; SymbolFlags[SymbolFlags["SetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.GetAccessor] = "SetAccessorExcludes"; SymbolFlags[SymbolFlags["TypeParameterExcludes"] = SymbolFlags.Type & ~SymbolFlags.TypeParameter] = "TypeParameterExcludes"; + SymbolFlags[SymbolFlags["TypeAliasExcludes"] = SymbolFlags.Type] = "TypeAliasExcludes"; SymbolFlags[SymbolFlags["ImportExcludes"] = SymbolFlags.Import] = "ImportExcludes"; - SymbolFlags[SymbolFlags["ModuleMember"] = SymbolFlags.Variable | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.Module | SymbolFlags.Import] = "ModuleMember"; + SymbolFlags[SymbolFlags["ModuleMember"] = SymbolFlags.Variable | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.Module | SymbolFlags.TypeAlias | SymbolFlags.Import] = "ModuleMember"; SymbolFlags[SymbolFlags["ExportHasLocal"] = SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule] = "ExportHasLocal"; SymbolFlags[SymbolFlags["HasLocals"] = SymbolFlags.Function | SymbolFlags.Module | SymbolFlags.Method | SymbolFlags.Constructor | SymbolFlags.Accessor | SymbolFlags.Signature] = "HasLocals"; SymbolFlags[SymbolFlags["HasExports"] = SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.Module] = "HasExports"; @@ -1736,6 +1762,8 @@ var ts; (function (ScriptTarget) { ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; + ScriptTarget[ScriptTarget["ES6"] = 2] = "ES6"; + ScriptTarget[ScriptTarget["Latest"] = ScriptTarget.ES6] = "Latest"; })(ts.ScriptTarget || (ts.ScriptTarget = {})); var ScriptTarget = ts.ScriptTarget; (function (CharacterCodes) { @@ -2068,7 +2096,8 @@ var ts; length: length, messageText: text, category: message.category, - code: message.code + code: message.code, + isEarly: message.isEarly }; } ts.createFileDiagnostic = createFileDiagnostic; @@ -2083,7 +2112,8 @@ var ts; length: undefined, messageText: text, category: message.category, - code: message.code + code: message.code, + isEarly: message.isEarly }; } ts.createCompilerDiagnostic = createCompilerDiagnostic; @@ -2609,7 +2639,7 @@ var sys = (function () { })(); var ts; (function (ts) { - var nodeConstructors = new Array(187 /* Count */); + var nodeConstructors = new Array(189 /* Count */); function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); } @@ -2622,7 +2652,7 @@ var ts; return node; } function getSourceFileOfNode(node) { - while (node && node.kind !== 184 /* SourceFile */) + while (node && node.kind !== 186 /* SourceFile */) node = node.parent; return node; } @@ -2659,13 +2689,81 @@ var ts; } ts.unescapeIdentifier = unescapeIdentifier; function identifierToString(identifier) { - return identifier.kind === 115 /* Missing */ ? "(Missing)" : getTextOfNode(identifier); + return identifier.kind === 116 /* Missing */ ? "(Missing)" : getTextOfNode(identifier); } ts.identifierToString = identifierToString; + function isExpression(node) { + switch (node.kind) { + case 87 /* ThisKeyword */: + case 85 /* SuperKeyword */: + case 83 /* NullKeyword */: + case 89 /* TrueKeyword */: + case 74 /* FalseKeyword */: + case 8 /* RegularExpressionLiteral */: + case 135 /* ArrayLiteral */: + case 136 /* ObjectLiteral */: + case 138 /* PropertyAccess */: + case 139 /* IndexedAccess */: + case 140 /* CallExpression */: + case 141 /* NewExpression */: + case 142 /* TypeAssertion */: + case 143 /* ParenExpression */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: + case 146 /* PrefixOperator */: + case 147 /* PostfixOperator */: + case 148 /* BinaryExpression */: + case 149 /* ConditionalExpression */: + case 150 /* OmittedExpression */: + return true; + case 117 /* QualifiedName */: + while (node.parent.kind === 117 /* QualifiedName */) + node = node.parent; + return node.parent.kind === 129 /* TypeQuery */; + case 59 /* Identifier */: + if (node.parent.kind === 129 /* TypeQuery */) { + return true; + } + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + var parent = node.parent; + switch (parent.kind) { + case 174 /* VariableDeclaration */: + case 119 /* Parameter */: + case 120 /* Property */: + case 185 /* EnumMember */: + case 137 /* PropertyAssignment */: + return parent.initializer === node; + case 154 /* ExpressionStatement */: + case 155 /* IfStatement */: + case 156 /* DoStatement */: + case 157 /* WhileStatement */: + case 162 /* ReturnStatement */: + case 163 /* WithStatement */: + case 164 /* SwitchStatement */: + case 165 /* CaseClause */: + case 168 /* ThrowStatement */: + case 164 /* SwitchStatement */: + return parent.expression === node; + case 158 /* ForStatement */: + return parent.initializer === node || parent.condition === node || parent.iterator === node; + case 159 /* ForInStatement */: + return parent.variable === node || parent.expression === node; + case 142 /* TypeAssertion */: + return node === parent.operand; + default: + if (isExpression(parent)) { + return true; + } + } + } + return false; + } + ts.isExpression = isExpression; function createDiagnosticForNode(node, message, arg0, arg1, arg2) { node = getErrorSpanForNode(node); var file = getSourceFileOfNode(node); - var start = node.kind === 115 /* Missing */ ? node.pos : ts.skipTrivia(file.text, node.pos); + var start = node.kind === 116 /* Missing */ ? node.pos : ts.skipTrivia(file.text, node.pos); var length = node.end - start; return ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); } @@ -2681,12 +2779,12 @@ var ts; function getErrorSpanForNode(node) { var errorSpan; switch (node.kind) { - case 173 /* VariableDeclaration */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 179 /* ModuleDeclaration */: - case 178 /* EnumDeclaration */: - case 183 /* EnumMember */: + case 174 /* VariableDeclaration */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 181 /* ModuleDeclaration */: + case 180 /* EnumDeclaration */: + case 185 /* EnumMember */: errorSpan = node.name; break; } @@ -2702,7 +2800,7 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isPrologueDirective(node) { - return node.kind === 153 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; + return node.kind === 154 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function isEvalOrArgumentsIdentifier(node) { @@ -2714,7 +2812,7 @@ var ts; } function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { sourceFileOfNode = sourceFileOfNode || getSourceFileOfNode(node); - if (node.kind === 118 /* Parameter */ || node.kind === 117 /* TypeParameter */) { + if (node.kind === 119 /* Parameter */ || node.kind === 118 /* TypeParameter */) { return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); } else { @@ -2750,119 +2848,121 @@ var ts; if (!node) return; switch (node.kind) { - case 116 /* QualifiedName */: + case 117 /* QualifiedName */: return child(node.left) || child(node.right); - case 117 /* TypeParameter */: + case 118 /* TypeParameter */: return child(node.name) || child(node.constraint); - case 118 /* Parameter */: + case 119 /* Parameter */: return child(node.name) || child(node.type) || child(node.initializer); - case 119 /* Property */: - case 136 /* PropertyAssignment */: + case 120 /* Property */: + case 137 /* PropertyAssignment */: return child(node.name) || child(node.type) || child(node.initializer); - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: + case 125 /* CallSignature */: + case 126 /* ConstructSignature */: + case 127 /* IndexSignature */: return children(node.typeParameters) || children(node.parameters) || child(node.type); - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 143 /* FunctionExpression */: - case 174 /* FunctionDeclaration */: - case 144 /* ArrowFunction */: + case 121 /* Method */: + case 122 /* Constructor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 144 /* FunctionExpression */: + case 175 /* FunctionDeclaration */: + case 145 /* ArrowFunction */: return child(node.name) || children(node.typeParameters) || children(node.parameters) || child(node.type) || child(node.body); - case 127 /* TypeReference */: + case 128 /* TypeReference */: return child(node.typeName) || children(node.typeArguments); - case 128 /* TypeQuery */: + case 129 /* TypeQuery */: return child(node.exprName); - case 129 /* TypeLiteral */: + case 130 /* TypeLiteral */: return children(node.members); - case 130 /* ArrayType */: + case 131 /* ArrayType */: return child(node.elementType); - case 131 /* TupleType */: + case 132 /* TupleType */: return children(node.elementTypes); - case 132 /* UnionType */: + case 133 /* UnionType */: return children(node.types); - case 133 /* ParenType */: + case 134 /* ParenType */: return child(node.type); - case 134 /* ArrayLiteral */: + case 135 /* ArrayLiteral */: return children(node.elements); - case 135 /* ObjectLiteral */: + case 136 /* ObjectLiteral */: return children(node.properties); - case 137 /* PropertyAccess */: + case 138 /* PropertyAccess */: return child(node.left) || child(node.right); - case 138 /* IndexedAccess */: + case 139 /* IndexedAccess */: return child(node.object) || child(node.index); - case 139 /* CallExpression */: - case 140 /* NewExpression */: + case 140 /* CallExpression */: + case 141 /* NewExpression */: return child(node.func) || children(node.typeArguments) || children(node.arguments); - case 141 /* TypeAssertion */: + case 142 /* TypeAssertion */: return child(node.type) || child(node.operand); - case 142 /* ParenExpression */: + case 143 /* ParenExpression */: return child(node.expression); - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: + case 146 /* PrefixOperator */: + case 147 /* PostfixOperator */: return child(node.operand); - case 147 /* BinaryExpression */: + case 148 /* BinaryExpression */: return child(node.left) || child(node.right); - case 148 /* ConditionalExpression */: + case 149 /* ConditionalExpression */: return child(node.condition) || child(node.whenTrue) || child(node.whenFalse); - case 150 /* Block */: - case 169 /* TryBlock */: - case 171 /* FinallyBlock */: - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: - case 184 /* SourceFile */: + case 151 /* Block */: + case 170 /* TryBlock */: + case 172 /* FinallyBlock */: + case 176 /* FunctionBlock */: + case 182 /* ModuleBlock */: + case 186 /* SourceFile */: return children(node.statements); - case 151 /* VariableStatement */: + case 152 /* VariableStatement */: return children(node.declarations); - case 153 /* ExpressionStatement */: + case 154 /* ExpressionStatement */: return child(node.expression); - case 154 /* IfStatement */: + case 155 /* IfStatement */: return child(node.expression) || child(node.thenStatement) || child(node.elseStatement); - case 155 /* DoStatement */: + case 156 /* DoStatement */: return child(node.statement) || child(node.expression); - case 156 /* WhileStatement */: + case 157 /* WhileStatement */: return child(node.expression) || child(node.statement); - case 157 /* ForStatement */: + case 158 /* ForStatement */: return children(node.declarations) || child(node.initializer) || child(node.condition) || child(node.iterator) || child(node.statement); - case 158 /* ForInStatement */: + case 159 /* ForInStatement */: return child(node.declaration) || child(node.variable) || child(node.expression) || child(node.statement); - case 159 /* ContinueStatement */: - case 160 /* BreakStatement */: + case 160 /* ContinueStatement */: + case 161 /* BreakStatement */: return child(node.label); - case 161 /* ReturnStatement */: + case 162 /* ReturnStatement */: return child(node.expression); - case 162 /* WithStatement */: + case 163 /* WithStatement */: return child(node.expression) || child(node.statement); - case 163 /* SwitchStatement */: + case 164 /* SwitchStatement */: return child(node.expression) || children(node.clauses); - case 164 /* CaseClause */: - case 165 /* DefaultClause */: + case 165 /* CaseClause */: + case 166 /* DefaultClause */: return child(node.expression) || children(node.statements); - case 166 /* LabeledStatement */: + case 167 /* LabeledStatement */: return child(node.label) || child(node.statement); - case 167 /* ThrowStatement */: + case 168 /* ThrowStatement */: return child(node.expression); - case 168 /* TryStatement */: + case 169 /* TryStatement */: return child(node.tryBlock) || child(node.catchBlock) || child(node.finallyBlock); - case 170 /* CatchBlock */: + case 171 /* CatchBlock */: return child(node.variable) || children(node.statements); - case 173 /* VariableDeclaration */: + case 174 /* VariableDeclaration */: return child(node.name) || child(node.type) || child(node.initializer); - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: return child(node.name) || children(node.typeParameters) || child(node.baseType) || children(node.implementedTypes) || children(node.members); - case 177 /* InterfaceDeclaration */: + case 178 /* InterfaceDeclaration */: return child(node.name) || children(node.typeParameters) || children(node.baseTypes) || children(node.members); - case 178 /* EnumDeclaration */: + case 179 /* TypeAliasDeclaration */: + return child(node.name) || child(node.type); + case 180 /* EnumDeclaration */: return child(node.name) || children(node.members); - case 183 /* EnumMember */: + case 185 /* EnumMember */: return child(node.name) || child(node.initializer); - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: return child(node.name) || child(node.body); - case 181 /* ImportDeclaration */: + case 183 /* ImportDeclaration */: return child(node.name) || child(node.entityName) || child(node.externalModuleName); - case 182 /* ExportAssignment */: + case 184 /* ExportAssignment */: return child(node.exportName); } } @@ -2871,24 +2971,24 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 161 /* ReturnStatement */: + case 162 /* ReturnStatement */: return visitor(node); - case 150 /* Block */: - case 175 /* FunctionBlock */: - case 154 /* IfStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 157 /* ForStatement */: - case 158 /* ForInStatement */: - case 162 /* WithStatement */: - case 163 /* SwitchStatement */: - case 164 /* CaseClause */: - case 165 /* DefaultClause */: - case 166 /* LabeledStatement */: - case 168 /* TryStatement */: - case 169 /* TryBlock */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: + case 151 /* Block */: + case 176 /* FunctionBlock */: + case 155 /* IfStatement */: + case 156 /* DoStatement */: + case 157 /* WhileStatement */: + case 158 /* ForStatement */: + case 159 /* ForInStatement */: + case 163 /* WithStatement */: + case 164 /* SwitchStatement */: + case 165 /* CaseClause */: + case 166 /* DefaultClause */: + case 167 /* LabeledStatement */: + case 169 /* TryStatement */: + case 170 /* TryBlock */: + case 171 /* CatchBlock */: + case 172 /* FinallyBlock */: return forEachChild(node, traverse); } } @@ -2897,13 +2997,13 @@ var ts; function isAnyFunction(node) { if (node) { switch (node.kind) { - case 143 /* FunctionExpression */: - case 174 /* FunctionDeclaration */: - case 144 /* ArrowFunction */: - case 120 /* Method */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 121 /* Constructor */: + case 144 /* FunctionExpression */: + case 175 /* FunctionDeclaration */: + case 145 /* ArrowFunction */: + case 121 /* Method */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 122 /* Constructor */: return true; } } @@ -2926,20 +3026,20 @@ var ts; return undefined; } switch (node.kind) { - case 144 /* ArrowFunction */: + case 145 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 179 /* ModuleDeclaration */: - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 178 /* EnumDeclaration */: - case 184 /* SourceFile */: + case 175 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: + case 181 /* ModuleDeclaration */: + case 120 /* Property */: + case 121 /* Method */: + case 122 /* Constructor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 180 /* EnumDeclaration */: + case 186 /* SourceFile */: return node; } } @@ -2952,11 +3052,11 @@ var ts; return undefined; } switch (node.kind) { - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 120 /* Property */: + case 121 /* Method */: + case 122 /* Constructor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: return node; } } @@ -2977,21 +3077,22 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 117 /* TypeParameter */: - case 118 /* Parameter */: - case 173 /* VariableDeclaration */: - case 119 /* Property */: - case 136 /* PropertyAssignment */: - case 183 /* EnumMember */: - case 120 /* Method */: - case 174 /* FunctionDeclaration */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: - case 179 /* ModuleDeclaration */: - case 181 /* ImportDeclaration */: + case 118 /* TypeParameter */: + case 119 /* Parameter */: + case 174 /* VariableDeclaration */: + case 120 /* Property */: + case 137 /* PropertyAssignment */: + case 185 /* EnumMember */: + case 121 /* Method */: + case 175 /* FunctionDeclaration */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 179 /* TypeAliasDeclaration */: + case 180 /* EnumDeclaration */: + case 181 /* ModuleDeclaration */: + case 183 /* ImportDeclaration */: return true; } return false; @@ -2999,24 +3100,24 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 160 /* BreakStatement */: - case 159 /* ContinueStatement */: - case 172 /* DebuggerStatement */: - case 155 /* DoStatement */: - case 153 /* ExpressionStatement */: - case 152 /* EmptyStatement */: - case 158 /* ForInStatement */: - case 157 /* ForStatement */: - case 154 /* IfStatement */: - case 166 /* LabeledStatement */: - case 161 /* ReturnStatement */: - case 163 /* SwitchStatement */: + case 161 /* BreakStatement */: + case 160 /* ContinueStatement */: + case 173 /* DebuggerStatement */: + case 156 /* DoStatement */: + case 154 /* ExpressionStatement */: + case 153 /* EmptyStatement */: + case 159 /* ForInStatement */: + case 158 /* ForStatement */: + case 155 /* IfStatement */: + case 167 /* LabeledStatement */: + case 162 /* ReturnStatement */: + case 164 /* SwitchStatement */: case 88 /* ThrowKeyword */: - case 168 /* TryStatement */: - case 151 /* VariableStatement */: - case 156 /* WhileStatement */: - case 162 /* WithStatement */: - case 182 /* ExportAssignment */: + case 169 /* TryStatement */: + case 152 /* VariableStatement */: + case 157 /* WhileStatement */: + case 163 /* WithStatement */: + case 184 /* ExportAssignment */: return true; default: return false; @@ -3028,10 +3129,10 @@ var ts; return false; } var parent = name.parent; - if (isDeclaration(parent) || parent.kind === 143 /* FunctionExpression */) { + if (isDeclaration(parent) || parent.kind === 144 /* FunctionExpression */) { return parent.name === name; } - if (parent.kind === 170 /* CatchBlock */) { + if (parent.kind === 171 /* CatchBlock */) { return parent.variable === name; } return false; @@ -3039,15 +3140,16 @@ var ts; ts.isDeclarationOrFunctionExpressionOrCatchVariableName = isDeclarationOrFunctionExpressionOrCatchVariableName; function getAncestor(node, kind) { switch (kind) { - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: while (node) { switch (node.kind) { - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: return node; - case 178 /* EnumDeclaration */: - case 177 /* InterfaceDeclaration */: - case 179 /* ModuleDeclaration */: - case 181 /* ImportDeclaration */: + case 180 /* EnumDeclaration */: + case 178 /* InterfaceDeclaration */: + case 179 /* TypeAliasDeclaration */: + case 181 /* ModuleDeclaration */: + case 183 /* ImportDeclaration */: return undefined; default: node = node.parent; @@ -3405,7 +3507,7 @@ var ts; return node; } function createMissingNode() { - return createNode(115 /* Missing */); + return createNode(116 /* Missing */); } function internIdentifier(text) { return ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); @@ -3641,7 +3743,7 @@ var ts; function parseEntityName(allowReservedWords) { var entity = parseIdentifier(); while (parseOptional(15 /* DotToken */)) { - var node = createNode(116 /* QualifiedName */, entity.pos); + var node = createNode(117 /* QualifiedName */, entity.pos); node.left = entity; node.right = allowReservedWords ? parseIdentifierName() : parseIdentifier(); entity = finishNode(node); @@ -3677,7 +3779,7 @@ var ts; return createMissingNode(); } function parseTypeReference() { - var node = createNode(127 /* TypeReference */); + var node = createNode(128 /* TypeReference */); node.typeName = parseEntityName(false); if (!scanner.hasPrecedingLineBreak() && token === 19 /* LessThanToken */) { node.typeArguments = parseTypeArguments(); @@ -3685,13 +3787,13 @@ var ts; return finishNode(node); } function parseTypeQuery() { - var node = createNode(128 /* TypeQuery */); + var node = createNode(129 /* TypeQuery */); parseExpected(91 /* TypeOfKeyword */); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(117 /* TypeParameter */); + var node = createNode(118 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(73 /* ExtendsKeyword */)) { if (isType() || !isExpression()) { @@ -3724,13 +3826,13 @@ var ts; } function parseParameter(flags) { if (flags === void 0) { flags = 0; } - var node = createNode(118 /* Parameter */); + var node = createNode(119 /* Parameter */); node.flags |= parseAndCheckModifiers(3 /* Parameters */); if (parseOptional(16 /* DotDotDotToken */)) { node.flags |= 8 /* Rest */; } node.name = parseIdentifier(); - if (node.name.kind === 115 /* Missing */ && node.flags === 0 && isModifier(token)) { + if (node.name.kind === 116 /* Missing */ && node.flags === 0 && isModifier(token)) { nextToken(); } if (parseOptional(45 /* QuestionToken */)) { @@ -3741,7 +3843,7 @@ var ts; return finishNode(node); } function parseSignature(kind, returnToken, returnTokenRequired) { - if (kind === 125 /* ConstructSignature */) { + if (kind === 126 /* ConstructSignature */) { parseExpected(82 /* NewKeyword */); } var typeParameters = parseTypeParameters(); @@ -3812,7 +3914,7 @@ var ts; return finishNode(node); } function parseIndexSignatureMember() { - var node = createNode(126 /* IndexSignature */); + var node = createNode(127 /* IndexSignature */); var errorCountBeforeIndexSignature = file.syntacticErrors.length; var indexerStart = scanner.getTokenPos(); node.parameters = parseParameterList(13 /* OpenBracketToken */, 14 /* CloseBracketToken */); @@ -3872,14 +3974,14 @@ var ts; node.flags |= 4 /* QuestionMark */; } if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - node.kind = 120 /* Method */; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + node.kind = 121 /* Method */; + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; } else { - node.kind = 119 /* Property */; + node.kind = 120 /* Property */; node.type = parseTypeAnnotation(); } parseSemicolon(); @@ -3899,12 +4001,12 @@ var ts; switch (token) { case 11 /* OpenParenToken */: case 19 /* LessThanToken */: - return parseSignatureMember(124 /* CallSignature */, 46 /* ColonToken */); + return parseSignatureMember(125 /* CallSignature */, 46 /* ColonToken */); case 13 /* OpenBracketToken */: return parseIndexSignatureMember(); case 82 /* NewKeyword */: if (lookAhead(function () { return nextToken() === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */; })) { - return parseSignatureMember(125 /* ConstructSignature */, 46 /* ColonToken */); + return parseSignatureMember(126 /* ConstructSignature */, 46 /* ColonToken */); } case 7 /* StringLiteral */: case 6 /* NumericLiteral */: @@ -3916,7 +4018,7 @@ var ts; } } function parseTypeLiteral() { - var node = createNode(129 /* TypeLiteral */); + var node = createNode(130 /* TypeLiteral */); if (parseExpected(9 /* OpenBraceToken */)) { node.members = parseList(5 /* TypeMembers */, false, parseTypeMember); parseExpected(10 /* CloseBraceToken */); @@ -3927,7 +4029,7 @@ var ts; return finishNode(node); } function parseTupleType() { - var node = createNode(131 /* TupleType */); + var node = createNode(132 /* TupleType */); var startTokenPos = scanner.getTokenPos(); var startErrorCount = file.syntacticErrors.length; node.elementTypes = parseBracketedList(16 /* TupleElementTypes */, parseType, 13 /* OpenBracketToken */, 14 /* CloseBracketToken */); @@ -3937,14 +4039,14 @@ var ts; return finishNode(node); } function parseParenType() { - var node = createNode(133 /* ParenType */); + var node = createNode(134 /* ParenType */); parseExpected(11 /* OpenParenToken */); node.type = parseType(); parseExpected(12 /* CloseParenToken */); return finishNode(node); } function parseFunctionType(signatureKind) { - var node = createNode(129 /* TypeLiteral */); + var node = createNode(130 /* TypeLiteral */); var member = createNode(signatureKind); var sig = parseSignature(signatureKind, 27 /* EqualsGreaterThanToken */, true); member.typeParameters = sig.typeParameters; @@ -4009,7 +4111,7 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(13 /* OpenBracketToken */)) { parseExpected(14 /* CloseBracketToken */); - var node = createNode(130 /* ArrayType */, type.pos); + var node = createNode(131 /* ArrayType */, type.pos); node.elementType = type; type = finishNode(node); } @@ -4024,7 +4126,7 @@ var ts; types.push(parsePrimaryType()); } types.end = getNodeEnd(); - var node = createNode(132 /* UnionType */, type.pos); + var node = createNode(133 /* UnionType */, type.pos); node.types = types; type = finishNode(node); } @@ -4053,10 +4155,10 @@ var ts; } function parseType() { if (isFunctionType()) { - return parseFunctionType(124 /* CallSignature */); + return parseFunctionType(125 /* CallSignature */); } if (token === 82 /* NewKeyword */) { - return parseFunctionType(125 /* ConstructSignature */); + return parseFunctionType(126 /* ConstructSignature */); } return parseUnionType(); } @@ -4136,16 +4238,16 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 137 /* PropertyAccess */: - case 138 /* IndexedAccess */: - case 140 /* NewExpression */: - case 139 /* CallExpression */: - case 134 /* ArrayLiteral */: - case 142 /* ParenExpression */: - case 135 /* ObjectLiteral */: - case 143 /* FunctionExpression */: + case 138 /* PropertyAccess */: + case 139 /* IndexedAccess */: + case 141 /* NewExpression */: + case 140 /* CallExpression */: + case 135 /* ArrayLiteral */: + case 143 /* ParenExpression */: + case 136 /* ObjectLiteral */: + case 144 /* FunctionExpression */: case 59 /* Identifier */: - case 115 /* Missing */: + case 116 /* Missing */: case 8 /* RegularExpressionLiteral */: case 6 /* NumericLiteral */: case 7 /* StringLiteral */: @@ -4162,7 +4264,7 @@ var ts; function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 27 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); parseExpected(27 /* EqualsGreaterThanToken */); - var parameter = createNode(118 /* Parameter */, identifier.pos); + var parameter = createNode(119 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); var parameters = []; @@ -4179,12 +4281,12 @@ var ts; } var pos = getNodePos(); if (triState === 1 /* True */) { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); if (parseExpected(27 /* EqualsGreaterThanToken */) || token === 9 /* OpenBraceToken */) { return parseArrowExpressionTail(pos, sig, false); } else { - return makeFunctionExpression(144 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); + return makeFunctionExpression(145 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); } } var sig = tryParseSignatureIfArrowOrBraceFollows(); @@ -4240,7 +4342,7 @@ var ts; } function tryParseSignatureIfArrowOrBraceFollows() { return tryParse(function () { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); if (token === 27 /* EqualsGreaterThanToken */ || token === 9 /* OpenBraceToken */) { return sig; } @@ -4258,7 +4360,7 @@ var ts; else { body = parseAssignmentExpression(noIn); } - return makeFunctionExpression(144 /* ArrowFunction */, pos, undefined, sig, body); + return makeFunctionExpression(145 /* ArrowFunction */, pos, undefined, sig, body); } function isAssignmentOperator() { return token >= ts.SyntaxKind.FirstAssignment && token <= ts.SyntaxKind.LastAssignment; @@ -4266,7 +4368,7 @@ var ts; function parseConditionalExpression(noIn) { var expr = parseBinaryExpression(noIn); while (parseOptional(45 /* QuestionToken */)) { - var node = createNode(148 /* ConditionalExpression */, expr.pos); + var node = createNode(149 /* ConditionalExpression */, expr.pos); node.condition = expr; node.whenTrue = parseAssignmentExpression(false); parseExpected(46 /* ColonToken */); @@ -4330,7 +4432,7 @@ var ts; return undefined; } function makeBinaryExpression(left, operator, right) { - var node = createNode(147 /* BinaryExpression */, left.pos); + var node = createNode(148 /* BinaryExpression */, left.pos); node.left = left; node.operator = operator; node.right = right; @@ -4359,7 +4461,7 @@ var ts; grammarErrorOnNode(operand, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); } } - return makeUnaryExpression(145 /* PrefixOperator */, pos, operator, operand); + return makeUnaryExpression(146 /* PrefixOperator */, pos, operator, operand); case 19 /* LessThanToken */: return parseTypeAssertion(); } @@ -4376,12 +4478,12 @@ var ts; } var operator = token; nextToken(); - expr = makeUnaryExpression(146 /* PostfixOperator */, expr.pos, operator, expr); + expr = makeUnaryExpression(147 /* PostfixOperator */, expr.pos, operator, expr); } return expr; } function parseTypeAssertion() { - var node = createNode(141 /* TypeAssertion */); + var node = createNode(142 /* TypeAssertion */); parseExpected(19 /* LessThanToken */); node.type = parseType(); parseExpected(20 /* GreaterThanToken */); @@ -4398,7 +4500,7 @@ var ts; while (true) { var dotStart = scanner.getTokenPos(); if (parseOptional(15 /* DotToken */)) { - var propertyAccess = createNode(137 /* PropertyAccess */, expr.pos); + var propertyAccess = createNode(138 /* PropertyAccess */, expr.pos); if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord() && lookAhead(function () { return scanner.isReservedWord(); })) { grammarErrorAtPos(dotStart, scanner.getStartPos() - dotStart, ts.Diagnostics.Identifier_expected); var id = createMissingNode(); @@ -4413,7 +4515,7 @@ var ts; } var bracketStart = scanner.getTokenPos(); if (parseOptional(13 /* OpenBracketToken */)) { - var indexedAccess = createNode(138 /* IndexedAccess */, expr.pos); + var indexedAccess = createNode(139 /* IndexedAccess */, expr.pos); indexedAccess.object = expr; if (inNewExpression && parseOptional(14 /* CloseBracketToken */)) { indexedAccess.index = createMissingNode(); @@ -4431,7 +4533,7 @@ var ts; continue; } if ((token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) && !inNewExpression) { - var callExpr = createNode(139 /* CallExpression */, expr.pos); + var callExpr = createNode(140 /* CallExpression */, expr.pos); callExpr.func = expr; if (token === 19 /* LessThanToken */) { if (!(callExpr.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) @@ -4467,7 +4569,7 @@ var ts; var errorStart = scanner.getTokenPos(); var errorLength = scanner.getTextPos() - errorStart; grammarErrorAtPos(errorStart, errorLength, ts.Diagnostics.Type_expected); - return createNode(115 /* Missing */); + return createNode(116 /* Missing */); } return parseType(); } @@ -4507,7 +4609,7 @@ var ts; return createMissingNode(); } function parseParenExpression() { - var node = createNode(142 /* ParenExpression */); + var node = createNode(143 /* ParenExpression */); parseExpected(11 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(12 /* CloseParenToken */); @@ -4520,7 +4622,7 @@ var ts; var errorLength = scanner.getTextPos() - errorStart; grammarErrorAtPos(errorStart, errorLength, omittedExpressionDiagnostic); } - return createNode(149 /* OmittedExpression */); + return createNode(150 /* OmittedExpression */); } return parseAssignmentExpression(); } @@ -4531,7 +4633,7 @@ var ts; return parseAssignmentExpressionOrOmittedExpression(ts.Diagnostics.Argument_expression_expected); } function parseArrayLiteral() { - var node = createNode(134 /* ArrayLiteral */); + var node = createNode(135 /* ArrayLiteral */); parseExpected(13 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) node.flags |= 256 /* MultiLine */; @@ -4540,12 +4642,12 @@ var ts; return finishNode(node); } function parsePropertyAssignment() { - var node = createNode(136 /* PropertyAssignment */); + var node = createNode(137 /* PropertyAssignment */); node.name = parsePropertyName(); if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); var body = parseBody(false); - node.initializer = makeFunctionExpression(143 /* FunctionExpression */, node.pos, undefined, sig, body); + node.initializer = makeFunctionExpression(144 /* FunctionExpression */, node.pos, undefined, sig, body); } else { parseExpected(46 /* ColonToken */); @@ -4557,13 +4659,13 @@ var ts; var initialPos = getNodePos(); var initialToken = token; if (parseContextualModifier(109 /* GetKeyword */) || parseContextualModifier(113 /* SetKeyword */)) { - var kind = initialToken === 109 /* GetKeyword */ ? 122 /* GetAccessor */ : 123 /* SetAccessor */; + var kind = initialToken === 109 /* GetKeyword */ ? 123 /* GetAccessor */ : 124 /* SetAccessor */; return parseAndCheckMemberAccessorDeclaration(kind, initialPos, 0); } return parsePropertyAssignment(); } function parseObjectLiteral() { - var node = createNode(135 /* ObjectLiteral */); + var node = createNode(136 /* ObjectLiteral */); parseExpected(9 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.flags |= 256 /* MultiLine */; @@ -4576,17 +4678,17 @@ var ts; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; ts.forEach(node.properties, function (p) { - if (p.kind === 149 /* OmittedExpression */) { + if (p.kind === 150 /* OmittedExpression */) { return; } var currentKind; - if (p.kind === 136 /* PropertyAssignment */) { + if (p.kind === 137 /* PropertyAssignment */) { currentKind = Property; } - else if (p.kind === 122 /* GetAccessor */) { + else if (p.kind === 123 /* GetAccessor */) { currentKind = GetAccessor; } - else if (p.kind === 123 /* SetAccessor */) { + else if (p.kind === 124 /* SetAccessor */) { currentKind = SetAccesor; } else { @@ -4621,12 +4723,12 @@ var ts; var pos = getNodePos(); parseExpected(77 /* FunctionKeyword */); var name = isIdentifier() ? parseIdentifier() : undefined; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); var body = parseBody(false); if (name && isInStrictMode && isEvalOrArgumentsIdentifier(name)) { reportInvalidUseInStrictMode(name); } - return makeFunctionExpression(143 /* FunctionExpression */, pos, name, sig, body); + return makeFunctionExpression(144 /* FunctionExpression */, pos, name, sig, body); } function makeFunctionExpression(kind, pos, name, sig, body) { var node = createNode(kind, pos); @@ -4638,7 +4740,7 @@ var ts; return finishNode(node); } function parseNewExpression() { - var node = createNode(140 /* NewExpression */); + var node = createNode(141 /* NewExpression */); parseExpected(82 /* NewKeyword */); node.func = parseCallAndAccess(parsePrimaryExpression(), true); if (parseOptional(11 /* OpenParenToken */) || token === 19 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { @@ -4647,10 +4749,13 @@ var ts; } return finishNode(node); } + function parseStatementAllowingLetDeclaration() { + return parseStatement(true); + } function parseBlock(ignoreMissingOpenBrace, checkForStrictMode) { - var node = createNode(150 /* Block */); + var node = createNode(151 /* Block */); if (parseExpected(9 /* OpenBraceToken */) || ignoreMissingOpenBrace) { - node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatement); + node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatementAllowingLetDeclaration); parseExpected(10 /* CloseBraceToken */); } else { @@ -4671,7 +4776,7 @@ var ts; } labelledStatementInfo.pushFunctionBoundary(); var block = parseBlock(ignoreMissingOpenBrace, true); - block.kind = 175 /* FunctionBlock */; + block.kind = 176 /* FunctionBlock */; labelledStatementInfo.pop(); inFunctionBody = saveInFunctionBody; inSwitchStatement = saveInSwitchStatement; @@ -4679,26 +4784,26 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(152 /* EmptyStatement */); + var node = createNode(153 /* EmptyStatement */); parseExpected(17 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(154 /* IfStatement */); + var node = createNode(155 /* IfStatement */); parseExpected(78 /* IfKeyword */); parseExpected(11 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(12 /* CloseParenToken */); - node.thenStatement = parseStatement(); - node.elseStatement = parseOptional(70 /* ElseKeyword */) ? parseStatement() : undefined; + node.thenStatement = parseStatement(false); + node.elseStatement = parseOptional(70 /* ElseKeyword */) ? parseStatement(false) : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(155 /* DoStatement */); + var node = createNode(156 /* DoStatement */); parseExpected(69 /* DoKeyword */); var saveInIterationStatement = inIterationStatement; inIterationStatement = 1 /* Nested */; - node.statement = parseStatement(); + node.statement = parseStatement(false); inIterationStatement = saveInIterationStatement; parseExpected(94 /* WhileKeyword */); parseExpected(11 /* OpenParenToken */); @@ -4708,14 +4813,14 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(156 /* WhileStatement */); + var node = createNode(157 /* WhileStatement */); parseExpected(94 /* WhileKeyword */); parseExpected(11 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(12 /* CloseParenToken */); var saveInIterationStatement = inIterationStatement; inIterationStatement = 1 /* Nested */; - node.statement = parseStatement(); + node.statement = parseStatement(false); inIterationStatement = saveInIterationStatement; return finishNode(node); } @@ -4730,13 +4835,31 @@ var ts; error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); } } + else if (parseOptional(98 /* LetKeyword */)) { + var declarations = parseVariableDeclarationList(2048 /* Let */, true); + if (!declarations.length) { + error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); + } + if (languageVersion < 2 /* ES6 */) { + grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + else if (parseOptional(64 /* ConstKeyword */)) { + var declarations = parseVariableDeclarationList(4096 /* Const */, true); + if (!declarations.length) { + error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); + } + if (languageVersion < 2 /* ES6 */) { + grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } else { var varOrInit = parseExpression(true); } } var forOrForInStatement; if (parseOptional(80 /* InKeyword */)) { - var forInStatement = createNode(158 /* ForInStatement */, pos); + var forInStatement = createNode(159 /* ForInStatement */, pos); if (declarations) { if (declarations.length > 1) { error(ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); @@ -4751,7 +4874,7 @@ var ts; forOrForInStatement = forInStatement; } else { - var forStatement = createNode(157 /* ForStatement */, pos); + var forStatement = createNode(158 /* ForStatement */, pos); if (declarations) forStatement.declarations = declarations; if (varOrInit) @@ -4769,14 +4892,14 @@ var ts; } var saveInIterationStatement = inIterationStatement; inIterationStatement = 1 /* Nested */; - forOrForInStatement.statement = parseStatement(); + forOrForInStatement.statement = parseStatement(false); inIterationStatement = saveInIterationStatement; return finishNode(forOrForInStatement); } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); var errorCountBeforeStatement = file.syntacticErrors.length; - parseExpected(kind === 160 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */); + parseExpected(kind === 161 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */); if (!canParseSemicolon()) node.label = parseIdentifier(); parseSemicolon(); @@ -4792,7 +4915,7 @@ var ts; return node; } function checkBareBreakOrContinueStatement(node) { - if (node.kind === 160 /* BreakStatement */) { + if (node.kind === 161 /* BreakStatement */) { if (inIterationStatement === 1 /* Nested */ || inSwitchStatement === 1 /* Nested */) { return; } @@ -4801,7 +4924,7 @@ var ts; return; } } - else if (node.kind === 159 /* ContinueStatement */) { + else if (node.kind === 160 /* ContinueStatement */) { if (inIterationStatement === 1 /* Nested */) { return; } @@ -4817,7 +4940,7 @@ var ts; grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } function checkBreakOrContinueStatementWithLabel(node) { - var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 159 /* ContinueStatement */, false); + var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 160 /* ContinueStatement */, false); if (nodeIsNestedInLabel === 1 /* Nested */) { return; } @@ -4825,10 +4948,10 @@ var ts; grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); return; } - if (node.kind === 159 /* ContinueStatement */) { + if (node.kind === 160 /* ContinueStatement */) { grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); } - else if (node.kind === 160 /* BreakStatement */) { + else if (node.kind === 161 /* BreakStatement */) { grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement); } else { @@ -4836,7 +4959,7 @@ var ts; } } function parseReturnStatement() { - var node = createNode(161 /* ReturnStatement */); + var node = createNode(162 /* ReturnStatement */); var errorCountBeforeReturnStatement = file.syntacticErrors.length; var returnTokenStart = scanner.getTokenPos(); var returnTokenLength = scanner.getTextPos() - returnTokenStart; @@ -4850,14 +4973,14 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(162 /* WithStatement */); + var node = createNode(163 /* WithStatement */); var startPos = scanner.getTokenPos(); parseExpected(95 /* WithKeyword */); var endPos = scanner.getStartPos(); parseExpected(11 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(12 /* CloseParenToken */); - node.statement = parseStatement(); + node.statement = parseStatement(false); node = finishNode(node); if (isInStrictMode) { grammarErrorAtPos(startPos, endPos - startPos, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); @@ -4865,25 +4988,25 @@ var ts; return node; } function parseCaseClause() { - var node = createNode(164 /* CaseClause */); + var node = createNode(165 /* CaseClause */); parseExpected(61 /* CaseKeyword */); node.expression = parseExpression(); parseExpected(46 /* ColonToken */); - node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); + node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatementAllowingLetDeclaration); return finishNode(node); } function parseDefaultClause() { - var node = createNode(165 /* DefaultClause */); + var node = createNode(166 /* DefaultClause */); parseExpected(67 /* DefaultKeyword */); parseExpected(46 /* ColonToken */); - node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); + node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatementAllowingLetDeclaration); return finishNode(node); } function parseCaseOrDefaultClause() { return token === 61 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(163 /* SwitchStatement */); + var node = createNode(164 /* SwitchStatement */); parseExpected(86 /* SwitchKeyword */); parseExpected(11 /* OpenParenToken */); node.expression = parseExpression(); @@ -4894,7 +5017,7 @@ var ts; node.clauses = parseList(3 /* SwitchClauses */, false, parseCaseOrDefaultClause); inSwitchStatement = saveInSwitchStatement; parseExpected(10 /* CloseBraceToken */); - var defaultClauses = ts.filter(node.clauses, function (clause) { return clause.kind === 165 /* DefaultClause */; }); + var defaultClauses = ts.filter(node.clauses, function (clause) { return clause.kind === 166 /* DefaultClause */; }); for (var i = 1, n = defaultClauses.length; i < n; i++) { var clause = defaultClauses[i]; var start = ts.skipTrivia(file.text, clause.pos); @@ -4904,7 +5027,7 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(167 /* ThrowStatement */); + var node = createNode(168 /* ThrowStatement */); parseExpected(88 /* ThrowKeyword */); if (scanner.hasPrecedingLineBreak()) { error(ts.Diagnostics.Line_break_not_permitted_here); @@ -4914,13 +5037,13 @@ var ts; return finishNode(node); } function parseTryStatement() { - var node = createNode(168 /* TryStatement */); - node.tryBlock = parseTokenAndBlock(90 /* TryKeyword */, 169 /* TryBlock */); + var node = createNode(169 /* TryStatement */); + node.tryBlock = parseTokenAndBlock(90 /* TryKeyword */, 170 /* TryBlock */); if (token === 62 /* CatchKeyword */) { node.catchBlock = parseCatchBlock(); } if (token === 75 /* FinallyKeyword */) { - node.finallyBlock = parseTokenAndBlock(75 /* FinallyKeyword */, 171 /* FinallyBlock */); + node.finallyBlock = parseTokenAndBlock(75 /* FinallyKeyword */, 172 /* FinallyBlock */); } if (!(node.catchBlock || node.finallyBlock)) { error(ts.Diagnostics.catch_or_finally_expected); @@ -4945,7 +5068,7 @@ var ts; var typeAnnotation = parseTypeAnnotation(); parseExpected(12 /* CloseParenToken */); var result = parseBlock(false, false); - result.kind = 170 /* CatchBlock */; + result.kind = 171 /* CatchBlock */; result.pos = pos; result.variable = variable; if (typeAnnotation) { @@ -4957,7 +5080,7 @@ var ts; return result; } function parseDebuggerStatement() { - var node = createNode(172 /* DebuggerStatement */); + var node = createNode(173 /* DebuggerStatement */); parseExpected(66 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -4965,28 +5088,28 @@ var ts; function isIterationStatementStart() { return token === 94 /* WhileKeyword */ || token === 69 /* DoKeyword */ || token === 76 /* ForKeyword */; } - function parseStatementWithLabelSet() { + function parseStatementWithLabelSet(allowLetAndConstDeclarations) { labelledStatementInfo.pushCurrentLabelSet(isIterationStatementStart()); - var statement = parseStatement(); + var statement = parseStatement(allowLetAndConstDeclarations); labelledStatementInfo.pop(); return statement; } function isLabel() { return isIdentifier() && lookAhead(function () { return nextToken() === 46 /* ColonToken */; }); } - function parseLabelledStatement() { - var node = createNode(166 /* LabeledStatement */); + function parseLabeledStatement(allowLetAndConstDeclarations) { + var node = createNode(167 /* LabeledStatement */); node.label = parseIdentifier(); parseExpected(46 /* ColonToken */); if (labelledStatementInfo.nodeIsNestedInLabel(node.label, false, true)) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); } labelledStatementInfo.addLabel(node.label); - node.statement = isLabel() ? parseLabelledStatement() : parseStatementWithLabelSet(); + node.statement = isLabel() ? parseLabeledStatement(allowLetAndConstDeclarations) : parseStatementWithLabelSet(allowLetAndConstDeclarations); return finishNode(node); } function parseExpressionStatement() { - var node = createNode(153 /* ExpressionStatement */); + var node = createNode(154 /* ExpressionStatement */); node.expression = parseExpression(); parseSemicolon(); return finishNode(node); @@ -4997,6 +5120,8 @@ var ts; return !inErrorRecovery; case 9 /* OpenBraceToken */: case 92 /* VarKeyword */: + case 98 /* LetKeyword */: + case 64 /* ConstKeyword */: case 77 /* FunctionKeyword */: case 78 /* IfKeyword */: case 69 /* DoKeyword */: @@ -5017,6 +5142,7 @@ var ts; case 63 /* ClassKeyword */: case 110 /* ModuleKeyword */: case 71 /* EnumKeyword */: + case 115 /* TypeKeyword */: if (isDeclaration()) { return false; } @@ -5031,12 +5157,14 @@ var ts; return isExpression(); } } - function parseStatement() { + function parseStatement(allowLetAndConstDeclarations) { switch (token) { case 9 /* OpenBraceToken */: return parseBlock(false, false); case 92 /* VarKeyword */: - return parseVariableStatement(); + case 98 /* LetKeyword */: + case 64 /* ConstKeyword */: + return parseVariableStatement(allowLetAndConstDeclarations); case 77 /* FunctionKeyword */: return parseFunctionDeclaration(); case 17 /* SemicolonToken */: @@ -5050,9 +5178,9 @@ var ts; case 76 /* ForKeyword */: return parseForOrForInStatement(); case 65 /* ContinueKeyword */: - return parseBreakOrContinueStatement(159 /* ContinueStatement */); + return parseBreakOrContinueStatement(160 /* ContinueStatement */); case 60 /* BreakKeyword */: - return parseBreakOrContinueStatement(160 /* BreakStatement */); + return parseBreakOrContinueStatement(161 /* BreakStatement */); case 84 /* ReturnKeyword */: return parseReturnStatement(); case 95 /* WithKeyword */: @@ -5069,14 +5197,11 @@ var ts; return parseDebuggerStatement(); default: if (isLabel()) { - return parseLabelledStatement(); + return parseLabeledStatement(allowLetAndConstDeclarations); } return parseExpressionStatement(); } } - function parseStatementOrFunction() { - return token === 77 /* FunctionKeyword */ ? parseFunctionDeclaration() : parseStatement(); - } function parseAndCheckFunctionBody(isConstructor) { var initialPosition = scanner.getTokenPos(); var errorCountBeforeBody = file.syntacticErrors.length; @@ -5095,7 +5220,7 @@ var ts; error(ts.Diagnostics.Block_or_expected); } function parseVariableDeclaration(flags, noIn) { - var node = createNode(173 /* VariableDeclaration */); + var node = createNode(174 /* VariableDeclaration */); node.flags = flags; var errorCountBeforeVariableDeclaration = file.syntacticErrors.length; node.name = parseIdentifier(); @@ -5106,6 +5231,9 @@ var ts; if (inAmbientContext && node.initializer && errorCountBeforeVariableDeclaration === file.syntacticErrors.length) { grammarErrorAtPos(initializerStart, initializerFirstTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } + if (!inAmbientContext && !node.initializer && flags & 4096 /* Const */) { + grammarErrorOnNode(node, ts.Diagnostics.const_declarations_must_be_initialized); + } if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { reportInvalidUseInStrictMode(node.name); } @@ -5114,27 +5242,52 @@ var ts; function parseVariableDeclarationList(flags, noIn) { return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }, false); } - function parseVariableStatement(pos, flags) { - var node = createNode(151 /* VariableStatement */, pos); + function parseVariableStatement(allowLetAndConstDeclarations, pos, flags) { + var node = createNode(152 /* VariableStatement */, pos); if (flags) node.flags = flags; var errorCountBeforeVarStatement = file.syntacticErrors.length; - parseExpected(92 /* VarKeyword */); - node.declarations = parseVariableDeclarationList(flags, false); + if (token === 98 /* LetKeyword */) { + node.flags |= 2048 /* Let */; + } + else if (token === 64 /* ConstKeyword */) { + node.flags |= 4096 /* Const */; + } + else if (token !== 92 /* VarKeyword */) { + error(ts.Diagnostics.var_let_or_const_expected); + } + nextToken(); + node.declarations = parseVariableDeclarationList(node.flags, false); parseSemicolon(); finishNode(node); if (!node.declarations.length && file.syntacticErrors.length === errorCountBeforeVarStatement) { grammarErrorOnNode(node, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); } + if (languageVersion < 2 /* ES6 */) { + if (node.flags & 2048 /* Let */) { + grammarErrorOnNode(node, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + else if (node.flags & 4096 /* Const */) { + grammarErrorOnNode(node, ts.Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + else if (!allowLetAndConstDeclarations) { + if (node.flags & 2048 /* Let */) { + grammarErrorOnNode(node, ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block); + } + else if (node.flags & 4096 /* Const */) { + grammarErrorOnNode(node, ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block); + } + } return node; } function parseFunctionDeclaration(pos, flags) { - var node = createNode(174 /* FunctionDeclaration */, pos); + var node = createNode(175 /* FunctionDeclaration */, pos); if (flags) node.flags = flags; parseExpected(77 /* FunctionKeyword */); node.name = parseIdentifier(); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -5145,10 +5298,10 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(pos, flags) { - var node = createNode(121 /* Constructor */, pos); + var node = createNode(122 /* Constructor */, pos); node.flags = flags; parseExpected(107 /* ConstructorKeyword */); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -5169,10 +5322,10 @@ var ts; errorAtPos(questionStart, scanner.getStartPos() - questionStart, ts.Diagnostics.A_class_member_cannot_be_declared_optional); } if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - var method = createNode(120 /* Method */, pos); + var method = createNode(121 /* Method */, pos); method.flags = flags; method.name = name; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); method.typeParameters = sig.typeParameters; method.parameters = sig.parameters; method.type = sig.type; @@ -5180,7 +5333,7 @@ var ts; return finishNode(method); } else { - var property = createNode(119 /* Property */, pos); + var property = createNode(120 /* Property */, pos); property.flags = flags; property.name = name; property.type = parseTypeAnnotation(); @@ -5207,10 +5360,10 @@ var ts; else if (accessor.typeParameters) { grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 122 /* GetAccessor */ && accessor.parameters.length) { + else if (kind === 123 /* GetAccessor */ && accessor.parameters.length) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 123 /* SetAccessor */) { + else if (kind === 124 /* SetAccessor */) { if (accessor.type) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -5240,7 +5393,7 @@ var ts; var node = createNode(kind, pos); node.flags = flags; node.name = parsePropertyName(); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -5418,10 +5571,10 @@ var ts; var pos = getNodePos(); var flags = parseAndCheckModifiers(2 /* ClassMembers */); if (parseContextualModifier(109 /* GetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(122 /* GetAccessor */, pos, flags); + return parseAndCheckMemberAccessorDeclaration(123 /* GetAccessor */, pos, flags); } if (parseContextualModifier(113 /* SetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(123 /* SetAccessor */, pos, flags); + return parseAndCheckMemberAccessorDeclaration(124 /* SetAccessor */, pos, flags); } if (token === 107 /* ConstructorKeyword */) { return parseConstructorDeclaration(pos, flags); @@ -5440,7 +5593,7 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassDeclaration(pos, flags) { - var node = createNode(176 /* ClassDeclaration */, pos); + var node = createNode(177 /* ClassDeclaration */, pos); node.flags = flags; var errorCountBeforeClassDeclaration = file.syntacticErrors.length; parseExpected(63 /* ClassKeyword */); @@ -5467,7 +5620,7 @@ var ts; return finishNode(node); } function parseInterfaceDeclaration(pos, flags) { - var node = createNode(177 /* InterfaceDeclaration */, pos); + var node = createNode(178 /* InterfaceDeclaration */, pos); node.flags = flags; var errorCountBeforeInterfaceDeclaration = file.syntacticErrors.length; parseExpected(97 /* InterfaceKeyword */); @@ -5486,12 +5639,29 @@ var ts; } return finishNode(node); } + function parseTypeAliasDeclaration(pos, flags) { + var node = createNode(179 /* TypeAliasDeclaration */, pos); + node.flags = flags; + parseExpected(115 /* TypeKeyword */); + node.name = parseIdentifier(); + parseExpected(47 /* EqualsToken */); + node.type = parseType(); + parseSemicolon(); + var n = node.type; + while (n.kind === 134 /* ParenType */) { + n = n.type; + } + if (n.kind === 130 /* TypeLiteral */ && (n.pos !== n.members.pos || n.end !== n.members.end)) { + grammarErrorOnNode(node.type, ts.Diagnostics.Aliased_type_cannot_be_an_object_type_literal_Use_an_interface_declaration_instead); + } + return finishNode(node); + } function parseAndCheckEnumDeclaration(pos, flags) { function isIntegerLiteral(expression) { function isInteger(literalExpression) { return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); } - if (expression.kind === 145 /* PrefixOperator */) { + if (expression.kind === 146 /* PrefixOperator */) { var unaryExpression = expression; if (unaryExpression.operator === 28 /* PlusToken */ || unaryExpression.operator === 29 /* MinusToken */) { expression = unaryExpression.operand; @@ -5504,7 +5674,7 @@ var ts; } var inConstantEnumMemberSection = true; function parseAndCheckEnumMember() { - var node = createNode(183 /* EnumMember */); + var node = createNode(185 /* EnumMember */); var errorCountBeforeEnumMember = file.syntacticErrors.length; node.name = parsePropertyName(); node.initializer = parseInitializer(false); @@ -5521,7 +5691,7 @@ var ts; } return finishNode(node); } - var node = createNode(178 /* EnumDeclaration */, pos); + var node = createNode(180 /* EnumDeclaration */, pos); node.flags = flags; parseExpected(71 /* EnumKeyword */); node.name = parseIdentifier(); @@ -5535,7 +5705,7 @@ var ts; return finishNode(node); } function parseModuleBody() { - var node = createNode(180 /* ModuleBlock */); + var node = createNode(182 /* ModuleBlock */); if (parseExpected(9 /* OpenBraceToken */)) { node.statements = parseList(1 /* ModuleElements */, false, parseModuleElement); parseExpected(10 /* CloseBraceToken */); @@ -5546,7 +5716,7 @@ var ts; return finishNode(node); } function parseInternalModuleTail(pos, flags) { - var node = createNode(179 /* ModuleDeclaration */, pos); + var node = createNode(181 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseIdentifier(); if (parseOptional(15 /* DotToken */)) { @@ -5555,10 +5725,10 @@ var ts; else { node.body = parseModuleBody(); ts.forEach(node.body.statements, function (s) { - if (s.kind === 182 /* ExportAssignment */) { + if (s.kind === 184 /* ExportAssignment */) { grammarErrorOnNode(s, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); } - else if (s.kind === 181 /* ImportDeclaration */ && s.externalModuleName) { + else if (s.kind === 183 /* ImportDeclaration */ && s.externalModuleName) { grammarErrorOnNode(s, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); } }); @@ -5566,7 +5736,7 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(pos, flags) { - var node = createNode(179 /* ModuleDeclaration */, pos); + var node = createNode(181 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseStringLiteral(); if (!inAmbientContext) { @@ -5586,7 +5756,7 @@ var ts; return token === 7 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); } function parseImportDeclaration(pos, flags) { - var node = createNode(181 /* ImportDeclaration */, pos); + var node = createNode(183 /* ImportDeclaration */, pos); node.flags = flags; parseExpected(79 /* ImportKeyword */); node.name = parseIdentifier(); @@ -5603,7 +5773,7 @@ var ts; return finishNode(node); } function parseExportAssignmentTail(pos) { - var node = createNode(182 /* ExportAssignment */, pos); + var node = createNode(184 /* ExportAssignment */, pos); node.exportName = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -5611,12 +5781,15 @@ var ts; function isDeclaration() { switch (token) { case 92 /* VarKeyword */: + case 98 /* LetKeyword */: + case 64 /* ConstKeyword */: case 77 /* FunctionKeyword */: return true; case 63 /* ClassKeyword */: case 97 /* InterfaceKeyword */: case 71 /* EnumKeyword */: case 79 /* ImportKeyword */: + case 115 /* TypeKeyword */: return lookAhead(function () { return nextToken() >= 59 /* Identifier */; }); case 110 /* ModuleKeyword */: return lookAhead(function () { return nextToken() >= 59 /* Identifier */ || token === 7 /* StringLiteral */; }); @@ -5656,7 +5829,9 @@ var ts; var result; switch (token) { case 92 /* VarKeyword */: - result = parseVariableStatement(pos, flags); + case 98 /* LetKeyword */: + case 64 /* ConstKeyword */: + result = parseVariableStatement(true, pos, flags); break; case 77 /* FunctionKeyword */: result = parseFunctionDeclaration(pos, flags); @@ -5667,6 +5842,9 @@ var ts; case 97 /* InterfaceKeyword */: result = parseInterfaceDeclaration(pos, flags); break; + case 115 /* TypeKeyword */: + result = parseTypeAliasDeclaration(pos, flags); + break; case 71 /* EnumKeyword */: result = parseAndCheckEnumDeclaration(pos, flags); break; @@ -5698,7 +5876,7 @@ var ts; var statementStart = scanner.getTokenPos(); var statementFirstTokenLength = scanner.getTextPos() - statementStart; var errorCountBeforeStatement = file.syntacticErrors.length; - var statement = parseStatement(); + var statement = parseStatement(true); if (inAmbientContext && file.syntacticErrors.length === errorCountBeforeStatement) { grammarErrorAtPos(statementStart, statementFirstTokenLength, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); } @@ -5750,7 +5928,7 @@ var ts; }; } function getExternalModuleIndicator() { - return ts.forEach(file.statements, function (node) { return node.flags & 1 /* Export */ || node.kind === 181 /* ImportDeclaration */ && node.externalModuleName || node.kind === 182 /* ExportAssignment */ ? node : undefined; }); + return ts.forEach(file.statements, function (node) { return node.flags & 1 /* Export */ || node.kind === 183 /* ImportDeclaration */ && node.externalModuleName || node.kind === 184 /* ExportAssignment */ ? node : undefined; }); } scanner = ts.createScanner(languageVersion, true, sourceText, scanError, onComment); var rootNodeFlags = 0; @@ -5758,7 +5936,7 @@ var ts; rootNodeFlags = 1024 /* DeclarationFile */; inAmbientContext = true; } - file = createRootNode(184 /* SourceFile */, 0, sourceText.length, rootNodeFlags); + file = createRootNode(186 /* SourceFile */, 0, sourceText.length, rootNodeFlags); file.filename = ts.normalizePath(filename); file.text = sourceText; file.getLineAndCharacterFromPosition = getLineAndCharacterlFromSourcePosition; @@ -5891,7 +6069,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 181 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 183 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5909,9 +6087,9 @@ var ts; } } } - else if (node.kind === 179 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { + else if (node.kind === 181 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { forEachChild(node.body, function (node) { - if (node.kind === 181 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 183 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5984,16 +6162,16 @@ var ts; var ts; (function (ts) { function isInstantiated(node) { - if (node.kind === 177 /* InterfaceDeclaration */) { + if (node.kind === 178 /* InterfaceDeclaration */) { return false; } - else if (node.kind === 181 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { + else if (node.kind === 183 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { return false; } - else if (node.kind === 180 /* ModuleBlock */ && !ts.forEachChild(node, isInstantiated)) { + else if (node.kind === 182 /* ModuleBlock */ && !ts.forEachChild(node, isInstantiated)) { return false; } - else if (node.kind === 179 /* ModuleDeclaration */ && !isInstantiated(node.body)) { + else if (node.kind === 181 /* ModuleDeclaration */ && !isInstantiated(node.body)) { return false; } else { @@ -6004,12 +6182,13 @@ var ts; function bindSourceFile(file) { var parent; var container; + var blockScopeContainer; var lastContainer; var symbolCount = 0; var Symbol = ts.objectAllocator.getSymbolConstructor(); if (!file.locals) { file.locals = {}; - container = file; + container = blockScopeContainer = file; bind(file); file.symbolCount = symbolCount; } @@ -6032,19 +6211,19 @@ var ts; } function getDeclarationName(node) { if (node.name) { - if (node.kind === 179 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { + if (node.kind === 181 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { return '"' + node.name.text + '"'; } return node.name.text; } switch (node.kind) { - case 121 /* Constructor */: + case 122 /* Constructor */: return "__constructor"; - case 124 /* CallSignature */: + case 125 /* CallSignature */: return "__call"; - case 125 /* ConstructSignature */: + case 126 /* ConstructSignature */: return "__new"; - case 126 /* IndexSignature */: + case 127 /* IndexSignature */: return "__index"; } } @@ -6059,10 +6238,11 @@ var ts; if (node.name) { node.name.parent = node; } + var message = symbol.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(symbol.declarations, function (declaration) { - file.semanticErrors.push(ts.createDiagnosticForNode(declaration.name, ts.Diagnostics.Duplicate_identifier_0, getDisplayName(declaration))); + file.semanticErrors.push(ts.createDiagnosticForNode(declaration.name, message, getDisplayName(declaration))); }); - file.semanticErrors.push(ts.createDiagnosticForNode(node.name, ts.Diagnostics.Duplicate_identifier_0, getDisplayName(node))); + file.semanticErrors.push(ts.createDiagnosticForNode(node.name, message, getDisplayName(node))); symbol = createSymbol(0, name); } } @@ -6071,8 +6251,8 @@ var ts; } addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if (node.kind === 176 /* ClassDeclaration */ && symbol.exports) { - var prototypeSymbol = createSymbol(2 /* Property */ | 67108864 /* Prototype */, "prototype"); + if (node.kind === 177 /* ClassDeclaration */ && symbol.exports) { + var prototypeSymbol = createSymbol(4 /* Property */ | 268435456 /* Prototype */, "prototype"); if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { if (node.name) { node.name.parent = node; @@ -6095,15 +6275,15 @@ var ts; function declareModuleMember(node, symbolKind, symbolExcludes) { var exportKind = 0; if (symbolKind & ts.SymbolFlags.Value) { - exportKind |= 524288 /* ExportValue */; + exportKind |= 2097152 /* ExportValue */; } if (symbolKind & ts.SymbolFlags.Type) { - exportKind |= 1048576 /* ExportType */; + exportKind |= 4194304 /* ExportType */; } if (symbolKind & ts.SymbolFlags.Namespace) { - exportKind |= 2097152 /* ExportNamespace */; + exportKind |= 8388608 /* ExportNamespace */; } - if (node.flags & 1 /* Export */ || (node.kind !== 181 /* ImportDeclaration */ && isAmbientContext(container))) { + if (node.flags & 1 /* Export */ || (node.kind !== 183 /* ImportDeclaration */ && isAmbientContext(container))) { if (exportKind) { var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); @@ -6117,12 +6297,13 @@ var ts; declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); } } - function bindChildren(node, symbolKind) { + function bindChildren(node, symbolKind, isBlockScopeContainer) { if (symbolKind & ts.SymbolFlags.HasLocals) { node.locals = {}; } var saveParent = parent; var saveContainer = container; + var savedBlockScopeContainer = blockScopeContainer; parent = node; if (symbolKind & ts.SymbolFlags.IsContainer) { container = node; @@ -6133,156 +6314,197 @@ var ts; lastContainer = container; } } + if (isBlockScopeContainer) { + blockScopeContainer = node; + } ts.forEachChild(node, bind); container = saveContainer; parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; } - function bindDeclaration(node, symbolKind, symbolExcludes) { + function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { switch (container.kind) { - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 184 /* SourceFile */: + case 186 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; } - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 125 /* CallSignature */: + case 126 /* ConstructSignature */: + case 127 /* IndexSignature */: + case 121 /* Method */: + case 122 /* Constructor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 175 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: if (node.flags & 128 /* Static */) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - case 129 /* TypeLiteral */: - case 135 /* ObjectLiteral */: - case 177 /* InterfaceDeclaration */: + case 130 /* TypeLiteral */: + case 136 /* ObjectLiteral */: + case 178 /* InterfaceDeclaration */: declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); break; - case 178 /* EnumDeclaration */: + case 180 /* EnumDeclaration */: declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - bindChildren(node, symbolKind); + bindChildren(node, symbolKind, isBlockScopeContainer); } function bindConstructorDeclaration(node) { - bindDeclaration(node, 4096 /* Constructor */, 0); + bindDeclaration(node, 8192 /* Constructor */, 0, true); ts.forEach(node.parameters, function (p) { if (p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */)) { - bindDeclaration(p, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); + bindDeclaration(p, 4 /* Property */, ts.SymbolFlags.PropertyExcludes, false); } }); } function bindModuleDeclaration(node) { if (node.name.kind === 7 /* StringLiteral */) { - bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); + bindDeclaration(node, 256 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes, true); } else if (isInstantiated(node)) { - bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); + bindDeclaration(node, 256 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes, true); } else { - bindDeclaration(node, 256 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); + bindDeclaration(node, 512 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */, true); } } - function bindAnonymousDeclaration(node, symbolKind, name) { + function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { var symbol = createSymbol(symbolKind, name); addDeclarationToSymbol(symbol, node, symbolKind); - bindChildren(node, symbolKind); + bindChildren(node, symbolKind, isBlockScopeContainer); } function bindCatchVariableDeclaration(node) { - var symbol = createSymbol(1 /* Variable */, node.variable.text || "__missing"); - addDeclarationToSymbol(symbol, node, 1 /* Variable */); + var symbol = createSymbol(1 /* FunctionScopedVariable */, node.variable.text || "__missing"); + addDeclarationToSymbol(symbol, node, 1 /* FunctionScopedVariable */); var saveParent = parent; - parent = node; + var savedBlockScopeContainer = blockScopeContainer; + parent = blockScopeContainer = node; ts.forEachChild(node, bind); parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; + } + function bindBlockScopedVariableDeclaration(node) { + switch (blockScopeContainer.kind) { + case 181 /* ModuleDeclaration */: + declareModuleMember(node, 2 /* BlockScopedVariable */, ts.SymbolFlags.BlockScopedVariableExcludes); + break; + case 186 /* SourceFile */: + if (ts.isExternalModule(container)) { + declareModuleMember(node, 2 /* BlockScopedVariable */, ts.SymbolFlags.BlockScopedVariableExcludes); + break; + } + default: + if (!blockScopeContainer.locals) { + blockScopeContainer.locals = {}; + } + declareSymbol(blockScopeContainer.locals, undefined, node, 2 /* BlockScopedVariable */, ts.SymbolFlags.BlockScopedVariableExcludes); + } + bindChildren(node, 2 /* BlockScopedVariable */, false); } function bind(node) { node.parent = parent; switch (node.kind) { - case 117 /* TypeParameter */: - bindDeclaration(node, 262144 /* TypeParameter */, ts.SymbolFlags.TypeParameterExcludes); + case 118 /* TypeParameter */: + bindDeclaration(node, 524288 /* TypeParameter */, ts.SymbolFlags.TypeParameterExcludes, false); break; - case 118 /* Parameter */: - bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.ParameterExcludes); + case 119 /* Parameter */: + bindDeclaration(node, 1 /* FunctionScopedVariable */, ts.SymbolFlags.ParameterExcludes, false); break; - case 173 /* VariableDeclaration */: - bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.VariableExcludes); + case 174 /* VariableDeclaration */: + if (node.flags & ts.NodeFlags.BlockScoped) { + bindBlockScopedVariableDeclaration(node); + } + else { + bindDeclaration(node, 1 /* FunctionScopedVariable */, ts.SymbolFlags.FunctionScopedVariableExcludes, false); + } break; - case 119 /* Property */: - case 136 /* PropertyAssignment */: - bindDeclaration(node, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); + case 120 /* Property */: + case 137 /* PropertyAssignment */: + bindDeclaration(node, 4 /* Property */, ts.SymbolFlags.PropertyExcludes, false); break; - case 183 /* EnumMember */: - bindDeclaration(node, 4 /* EnumMember */, ts.SymbolFlags.EnumMemberExcludes); + case 185 /* EnumMember */: + bindDeclaration(node, 8 /* EnumMember */, ts.SymbolFlags.EnumMemberExcludes, false); break; - case 124 /* CallSignature */: - bindDeclaration(node, 32768 /* CallSignature */, 0); + case 125 /* CallSignature */: + bindDeclaration(node, 65536 /* CallSignature */, 0, false); break; - case 120 /* Method */: - bindDeclaration(node, 2048 /* Method */, ts.SymbolFlags.MethodExcludes); + case 121 /* Method */: + bindDeclaration(node, 4096 /* Method */, ts.SymbolFlags.MethodExcludes, true); break; - case 125 /* ConstructSignature */: - bindDeclaration(node, 65536 /* ConstructSignature */, 0); + case 126 /* ConstructSignature */: + bindDeclaration(node, 131072 /* ConstructSignature */, 0, true); break; - case 126 /* IndexSignature */: - bindDeclaration(node, 131072 /* IndexSignature */, 0); + case 127 /* IndexSignature */: + bindDeclaration(node, 262144 /* IndexSignature */, 0, false); break; - case 174 /* FunctionDeclaration */: - bindDeclaration(node, 8 /* Function */, ts.SymbolFlags.FunctionExcludes); + case 175 /* FunctionDeclaration */: + bindDeclaration(node, 16 /* Function */, ts.SymbolFlags.FunctionExcludes, true); break; - case 121 /* Constructor */: + case 122 /* Constructor */: bindConstructorDeclaration(node); break; - case 122 /* GetAccessor */: - bindDeclaration(node, 8192 /* GetAccessor */, ts.SymbolFlags.GetAccessorExcludes); + case 123 /* GetAccessor */: + bindDeclaration(node, 16384 /* GetAccessor */, ts.SymbolFlags.GetAccessorExcludes, true); break; - case 123 /* SetAccessor */: - bindDeclaration(node, 16384 /* SetAccessor */, ts.SymbolFlags.SetAccessorExcludes); + case 124 /* SetAccessor */: + bindDeclaration(node, 32768 /* SetAccessor */, ts.SymbolFlags.SetAccessorExcludes, true); break; - case 129 /* TypeLiteral */: - bindAnonymousDeclaration(node, 512 /* TypeLiteral */, "__type"); + case 130 /* TypeLiteral */: + bindAnonymousDeclaration(node, 1024 /* TypeLiteral */, "__type", false); break; - case 135 /* ObjectLiteral */: - bindAnonymousDeclaration(node, 1024 /* ObjectLiteral */, "__object"); + case 136 /* ObjectLiteral */: + bindAnonymousDeclaration(node, 2048 /* ObjectLiteral */, "__object", false); break; - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - bindAnonymousDeclaration(node, 8 /* Function */, "__function"); + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: + bindAnonymousDeclaration(node, 16 /* Function */, "__function", true); break; - case 170 /* CatchBlock */: + case 171 /* CatchBlock */: bindCatchVariableDeclaration(node); break; - case 176 /* ClassDeclaration */: - bindDeclaration(node, 16 /* Class */, ts.SymbolFlags.ClassExcludes); + case 177 /* ClassDeclaration */: + bindDeclaration(node, 32 /* Class */, ts.SymbolFlags.ClassExcludes, false); break; - case 177 /* InterfaceDeclaration */: - bindDeclaration(node, 32 /* Interface */, ts.SymbolFlags.InterfaceExcludes); + case 178 /* InterfaceDeclaration */: + bindDeclaration(node, 64 /* Interface */, ts.SymbolFlags.InterfaceExcludes, false); break; - case 178 /* EnumDeclaration */: - bindDeclaration(node, 64 /* Enum */, ts.SymbolFlags.EnumExcludes); + case 179 /* TypeAliasDeclaration */: + bindDeclaration(node, 1048576 /* TypeAlias */, ts.SymbolFlags.TypeAliasExcludes, false); break; - case 179 /* ModuleDeclaration */: + case 180 /* EnumDeclaration */: + bindDeclaration(node, 128 /* Enum */, ts.SymbolFlags.EnumExcludes, false); + break; + case 181 /* ModuleDeclaration */: bindModuleDeclaration(node); break; - case 181 /* ImportDeclaration */: - bindDeclaration(node, 4194304 /* Import */, ts.SymbolFlags.ImportExcludes); + case 183 /* ImportDeclaration */: + bindDeclaration(node, 16777216 /* Import */, ts.SymbolFlags.ImportExcludes, false); break; - case 184 /* SourceFile */: + case 186 /* SourceFile */: if (ts.isExternalModule(node)) { - bindAnonymousDeclaration(node, 128 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"'); + bindAnonymousDeclaration(node, 256 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"', true); break; } + case 151 /* Block */: + case 170 /* TryBlock */: + case 171 /* CatchBlock */: + case 172 /* FinallyBlock */: + case 158 /* ForStatement */: + case 159 /* ForInStatement */: + case 164 /* SwitchStatement */: + bindChildren(node, 0, true); + break; default: var saveParent = parent; parent = node; @@ -6343,7 +6565,7 @@ var ts; } function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 121 /* Constructor */ && member.body) { + if (member.kind === 122 /* Constructor */ && member.body) { return member; } }); @@ -6353,14 +6575,14 @@ var ts; var getAccessor; var setAccessor; ts.forEach(node.members, function (member) { - if ((member.kind === 122 /* GetAccessor */ || member.kind === 123 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { + if ((member.kind === 123 /* GetAccessor */ || member.kind === 124 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { if (!firstAccessor) { firstAccessor = member; } - if (member.kind === 122 /* GetAccessor */ && !getAccessor) { + if (member.kind === 123 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 123 /* SetAccessor */ && !setAccessor) { + if (member.kind === 124 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -6683,7 +6905,7 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 174 /* FunctionDeclaration */ || node.kind === 143 /* FunctionExpression */ || node.kind === 120 /* Method */ || node.kind === 122 /* GetAccessor */ || node.kind === 123 /* SetAccessor */ || node.kind === 179 /* ModuleDeclaration */ || node.kind === 176 /* ClassDeclaration */ || node.kind === 178 /* EnumDeclaration */) { + else if (node.kind === 175 /* FunctionDeclaration */ || node.kind === 144 /* FunctionExpression */ || node.kind === 121 /* Method */ || node.kind === 123 /* GetAccessor */ || node.kind === 124 /* SetAccessor */ || node.kind === 181 /* ModuleDeclaration */ || node.kind === 177 /* ClassDeclaration */ || node.kind === 180 /* EnumDeclaration */) { if (node.name) { scopeName = node.name.text; } @@ -6765,7 +6987,7 @@ var ts; } function emitNodeWithMap(node) { if (node) { - if (node.kind != 184 /* SourceFile */) { + if (node.kind != 186 /* SourceFile */) { recordEmitNodeStartSpan(node); emitNode(node); recordEmitNodeEndSpan(node); @@ -6878,29 +7100,29 @@ var ts; function isNonExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 118 /* Parameter */: - case 173 /* VariableDeclaration */: - case 119 /* Property */: - case 136 /* PropertyAssignment */: - case 183 /* EnumMember */: - case 120 /* Method */: - case 174 /* FunctionDeclaration */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 143 /* FunctionExpression */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: - case 179 /* ModuleDeclaration */: - case 181 /* ImportDeclaration */: + case 119 /* Parameter */: + case 174 /* VariableDeclaration */: + case 120 /* Property */: + case 137 /* PropertyAssignment */: + case 185 /* EnumMember */: + case 121 /* Method */: + case 175 /* FunctionDeclaration */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 144 /* FunctionExpression */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 180 /* EnumDeclaration */: + case 181 /* ModuleDeclaration */: + case 183 /* ImportDeclaration */: return parent.name === node; - case 160 /* BreakStatement */: - case 159 /* ContinueStatement */: - case 182 /* ExportAssignment */: + case 161 /* BreakStatement */: + case 160 /* ContinueStatement */: + case 184 /* ExportAssignment */: return false; - case 166 /* LabeledStatement */: + case 167 /* LabeledStatement */: return node.parent.label === node; - case 170 /* CatchBlock */: + case 171 /* CatchBlock */: return node.parent.variable === node; } } @@ -6999,7 +7221,7 @@ var ts; } else { emit(node.func); - superCall = node.func.kind === 137 /* PropertyAccess */ && node.func.left.kind === 85 /* SuperKeyword */; + superCall = node.func.kind === 138 /* PropertyAccess */ && node.func.left.kind === 85 /* SuperKeyword */; } if (superCall) { write(".call("); @@ -7026,12 +7248,12 @@ var ts; } } function emitParenExpression(node) { - if (node.expression.kind === 141 /* TypeAssertion */) { + if (node.expression.kind === 142 /* TypeAssertion */) { var operand = node.expression.operand; - while (operand.kind == 141 /* TypeAssertion */) { + while (operand.kind == 142 /* TypeAssertion */) { operand = operand.operand; } - if (operand.kind !== 145 /* PrefixOperator */ && operand.kind !== 146 /* PostfixOperator */ && operand.kind !== 140 /* NewExpression */ && !(operand.kind === 139 /* CallExpression */ && node.parent.kind === 140 /* NewExpression */) && !(operand.kind === 143 /* FunctionExpression */ && node.parent.kind === 139 /* CallExpression */)) { + if (operand.kind !== 146 /* PrefixOperator */ && operand.kind !== 147 /* PostfixOperator */ && operand.kind !== 141 /* NewExpression */ && !(operand.kind === 140 /* CallExpression */ && node.parent.kind === 141 /* NewExpression */) && !(operand.kind === 144 /* FunctionExpression */ && node.parent.kind === 140 /* CallExpression */)) { emit(operand); return; } @@ -7041,13 +7263,13 @@ var ts; write(")"); } function emitUnaryExpression(node) { - if (node.kind === 145 /* PrefixOperator */) { + if (node.kind === 146 /* PrefixOperator */) { write(ts.tokenToString(node.operator)); } if (node.operator >= 59 /* Identifier */) { write(" "); } - else if (node.kind === 145 /* PrefixOperator */ && node.operand.kind === 145 /* PrefixOperator */) { + else if (node.kind === 146 /* PrefixOperator */ && node.operand.kind === 146 /* PrefixOperator */) { var operand = node.operand; if (node.operator === 28 /* PlusToken */ && (operand.operator === 28 /* PlusToken */ || operand.operator === 33 /* PlusPlusToken */)) { write(" "); @@ -7057,7 +7279,7 @@ var ts; } } emit(node.operand); - if (node.kind === 146 /* PostfixOperator */) { + if (node.kind === 147 /* PostfixOperator */) { write(ts.tokenToString(node.operator)); } } @@ -7080,8 +7302,8 @@ var ts; emitToken(9 /* OpenBraceToken */, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 180 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 179 /* ModuleDeclaration */); + if (node.kind === 182 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 181 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); @@ -7091,7 +7313,7 @@ var ts; scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 150 /* Block */) { + if (node.kind === 151 /* Block */) { write(" "); emit(node); } @@ -7103,7 +7325,7 @@ var ts; } } function emitExpressionStatement(node) { - var isArrowExpression = node.expression.kind === 144 /* ArrowFunction */; + var isArrowExpression = node.expression.kind === 145 /* ArrowFunction */; emitLeadingComments(node); if (isArrowExpression) write("("); @@ -7124,7 +7346,7 @@ var ts; if (node.elseStatement) { writeLine(); emitToken(70 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 154 /* IfStatement */) { + if (node.elseStatement.kind === 155 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -7137,7 +7359,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 150 /* Block */) { + if (node.statement.kind === 151 /* Block */) { write(" "); } else { @@ -7158,7 +7380,15 @@ var ts; write(" "); endPos = emitToken(11 /* OpenParenToken */, endPos); if (node.declarations) { - emitToken(92 /* VarKeyword */, endPos); + if (node.declarations[0] && node.declarations[0].flags & 2048 /* Let */) { + emitToken(98 /* LetKeyword */, endPos); + } + else if (node.declarations[0] && node.declarations[0].flags & 4096 /* Const */) { + emitToken(64 /* ConstKeyword */, endPos); + } + else { + emitToken(92 /* VarKeyword */, endPos); + } write(" "); emitCommaList(node.declarations, false); } @@ -7177,7 +7407,12 @@ var ts; write(" "); endPos = emitToken(11 /* OpenParenToken */, endPos); if (node.declaration) { - emitToken(92 /* VarKeyword */, endPos); + if (node.declaration.flags & 2048 /* Let */) { + emitToken(98 /* LetKeyword */, endPos); + } + else { + emitToken(92 /* VarKeyword */, endPos); + } write(" "); emit(node.declaration); } @@ -7190,7 +7425,7 @@ var ts; emitEmbeddedStatement(node.statement); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 160 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */, node.pos); + emitToken(node.kind === 161 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } @@ -7222,7 +7457,7 @@ var ts; emitToken(10 /* CloseBraceToken */, node.clauses.end); } function emitCaseOrDefaultClause(node) { - if (node.kind === 164 /* CaseClause */) { + if (node.kind === 165 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -7271,7 +7506,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 179 /* ModuleDeclaration */); + } while (node && node.kind !== 181 /* ModuleDeclaration */); return node; } function emitModuleMemberName(node) { @@ -7292,8 +7527,17 @@ var ts; } function emitVariableStatement(node) { emitLeadingComments(node); - if (!(node.flags & 1 /* Export */)) - write("var "); + if (!(node.flags & 1 /* Export */)) { + if (node.flags & 2048 /* Let */) { + write("let "); + } + else if (node.flags & 4096 /* Const */) { + write("const "); + } + else { + write("var "); + } + } emitCommaList(node.declarations, false); write(";"); emitTrailingComments(node); @@ -7361,7 +7605,7 @@ var ts; } function emitAccessor(node) { emitLeadingComments(node); - write(node.kind === 122 /* GetAccessor */ ? "get " : "set "); + write(node.kind === 123 /* GetAccessor */ ? "get " : "set "); emit(node.name); emitSignatureAndBody(node); emitTrailingComments(node); @@ -7370,15 +7614,15 @@ var ts; if (!node.body) { return emitPinnedOrTripleSlashComments(node); } - if (node.kind !== 120 /* Method */) { + if (node.kind !== 121 /* Method */) { emitLeadingComments(node); } write("function "); - if (node.kind === 174 /* FunctionDeclaration */ || (node.kind === 143 /* FunctionExpression */ && node.name)) { + if (node.kind === 175 /* FunctionDeclaration */ || (node.kind === 144 /* FunctionExpression */ && node.name)) { emit(node.name); } emitSignatureAndBody(node); - if (node.kind !== 120 /* Method */) { + if (node.kind !== 121 /* Method */) { emitTrailingComments(node); } } @@ -7404,16 +7648,16 @@ var ts; write(" {"); scopeEmitStart(node); increaseIndent(); - emitDetachedComments(node.body.kind === 175 /* FunctionBlock */ ? node.body.statements : node.body); + emitDetachedComments(node.body.kind === 176 /* FunctionBlock */ ? node.body.statements : node.body); var startIndex = 0; - if (node.body.kind === 175 /* FunctionBlock */) { + if (node.body.kind === 176 /* FunctionBlock */) { startIndex = emitDirectivePrologues(node.body.statements, true); } var outPos = writer.getTextPos(); emitCaptureThisForNodeIfNecessary(node); emitDefaultValueAssignments(node); emitRestParameter(node); - if (node.body.kind !== 175 /* FunctionBlock */ && outPos === writer.getTextPos()) { + if (node.body.kind !== 176 /* FunctionBlock */ && outPos === writer.getTextPos()) { decreaseIndent(); write(" "); emitStart(node.body); @@ -7426,7 +7670,7 @@ var ts; emitEnd(node.body); } else { - if (node.body.kind === 175 /* FunctionBlock */) { + if (node.body.kind === 176 /* FunctionBlock */) { emitLinesStartingAt(node.body.statements, startIndex); } else { @@ -7438,7 +7682,7 @@ var ts; emitTrailingComments(node.body); } writeLine(); - if (node.body.kind === 175 /* FunctionBlock */) { + if (node.body.kind === 176 /* FunctionBlock */) { emitLeadingCommentsOfPosition(node.body.statements.end); decreaseIndent(); emitToken(10 /* CloseBraceToken */, node.body.statements.end); @@ -7464,9 +7708,9 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 153 /* ExpressionStatement */) { + if (statement && statement.kind === 154 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 139 /* CallExpression */) { + if (expr && expr.kind === 140 /* CallExpression */) { var func = expr.func; if (func && func.kind === 85 /* SuperKeyword */) { return statement; @@ -7504,7 +7748,7 @@ var ts; } function emitMemberAssignments(node, staticFlag) { ts.forEach(node.members, function (member) { - if (member.kind === 119 /* Property */ && (member.flags & 128 /* Static */) === staticFlag && member.initializer) { + if (member.kind === 120 /* Property */ && (member.flags & 128 /* Static */) === staticFlag && member.initializer) { writeLine(); emitLeadingComments(member); emitStart(member); @@ -7527,7 +7771,7 @@ var ts; } function emitMemberFunctions(node) { ts.forEach(node.members, function (member) { - if (member.kind === 120 /* Method */) { + if (member.kind === 121 /* Method */) { if (!member.body) { return emitPinnedOrTripleSlashComments(member); } @@ -7549,7 +7793,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 122 /* GetAccessor */ || member.kind === 123 /* SetAccessor */) { + else if (member.kind === 123 /* GetAccessor */ || member.kind === 124 /* SetAccessor */) { var accessors = getAllAccessorDeclarations(node, member); if (member === accessors.firstAccessor) { writeLine(); @@ -7652,7 +7896,7 @@ var ts; emitTrailingComments(node); function emitConstructorOfClass() { ts.forEach(node.members, function (member) { - if (member.kind === 121 /* Constructor */ && !member.body) { + if (member.kind === 122 /* Constructor */ && !member.body) { emitPinnedOrTripleSlashComments(member); } }); @@ -7780,7 +8024,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 179 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 181 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -7802,7 +8046,7 @@ var ts; write(resolver.getLocalNameOfContainer(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 180 /* ModuleBlock */) { + if (node.body.kind === 182 /* ModuleBlock */) { emit(node.body); } else { @@ -7836,7 +8080,7 @@ var ts; emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportedViaEntityName(node); } if (emitImportDeclaration) { - if (node.externalModuleName && node.parent.kind === 184 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { + if (node.externalModuleName && node.parent.kind === 186 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { if (node.flags & 1 /* Export */) { writeLine(); emitLeadingComments(node); @@ -7876,7 +8120,7 @@ var ts; function getExternalImportDeclarations(node) { var result = []; ts.forEach(node.statements, function (stat) { - if (stat.kind === 181 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { + if (stat.kind === 183 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { result.push(stat); } }); @@ -7884,7 +8128,7 @@ var ts; } function getFirstExportAssignment(sourceFile) { return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 182 /* ExportAssignment */) { + if (node.kind === 184 /* ExportAssignment */) { return node; } }); @@ -8002,10 +8246,10 @@ var ts; switch (node.kind) { case 59 /* Identifier */: return emitIdentifier(node); - case 118 /* Parameter */: + case 119 /* Parameter */: return emitParameter(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: return emitAccessor(node); case 87 /* ThisKeyword */: return emitThis(node); @@ -8021,96 +8265,96 @@ var ts; case 7 /* StringLiteral */: case 8 /* RegularExpressionLiteral */: return emitLiteral(node); - case 116 /* QualifiedName */: + case 117 /* QualifiedName */: return emitPropertyAccess(node); - case 134 /* ArrayLiteral */: + case 135 /* ArrayLiteral */: return emitArrayLiteral(node); - case 135 /* ObjectLiteral */: + case 136 /* ObjectLiteral */: return emitObjectLiteral(node); - case 136 /* PropertyAssignment */: + case 137 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 137 /* PropertyAccess */: + case 138 /* PropertyAccess */: return emitPropertyAccess(node); - case 138 /* IndexedAccess */: + case 139 /* IndexedAccess */: return emitIndexedAccess(node); - case 139 /* CallExpression */: + case 140 /* CallExpression */: return emitCallExpression(node); - case 140 /* NewExpression */: + case 141 /* NewExpression */: return emitNewExpression(node); - case 141 /* TypeAssertion */: + case 142 /* TypeAssertion */: return emit(node.operand); - case 142 /* ParenExpression */: + case 143 /* ParenExpression */: return emitParenExpression(node); - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 175 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: + case 146 /* PrefixOperator */: + case 147 /* PostfixOperator */: return emitUnaryExpression(node); - case 147 /* BinaryExpression */: + case 148 /* BinaryExpression */: return emitBinaryExpression(node); - case 148 /* ConditionalExpression */: + case 149 /* ConditionalExpression */: return emitConditionalExpression(node); - case 149 /* OmittedExpression */: + case 150 /* OmittedExpression */: return; - case 150 /* Block */: - case 169 /* TryBlock */: - case 171 /* FinallyBlock */: - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: + case 151 /* Block */: + case 170 /* TryBlock */: + case 172 /* FinallyBlock */: + case 176 /* FunctionBlock */: + case 182 /* ModuleBlock */: return emitBlock(node); - case 151 /* VariableStatement */: + case 152 /* VariableStatement */: return emitVariableStatement(node); - case 152 /* EmptyStatement */: + case 153 /* EmptyStatement */: return write(";"); - case 153 /* ExpressionStatement */: + case 154 /* ExpressionStatement */: return emitExpressionStatement(node); - case 154 /* IfStatement */: + case 155 /* IfStatement */: return emitIfStatement(node); - case 155 /* DoStatement */: + case 156 /* DoStatement */: return emitDoStatement(node); - case 156 /* WhileStatement */: + case 157 /* WhileStatement */: return emitWhileStatement(node); - case 157 /* ForStatement */: + case 158 /* ForStatement */: return emitForStatement(node); - case 158 /* ForInStatement */: + case 159 /* ForInStatement */: return emitForInStatement(node); - case 159 /* ContinueStatement */: - case 160 /* BreakStatement */: + case 160 /* ContinueStatement */: + case 161 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 161 /* ReturnStatement */: + case 162 /* ReturnStatement */: return emitReturnStatement(node); - case 162 /* WithStatement */: + case 163 /* WithStatement */: return emitWithStatement(node); - case 163 /* SwitchStatement */: + case 164 /* SwitchStatement */: return emitSwitchStatement(node); - case 164 /* CaseClause */: - case 165 /* DefaultClause */: + case 165 /* CaseClause */: + case 166 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 166 /* LabeledStatement */: + case 167 /* LabeledStatement */: return emitLabelledStatement(node); - case 167 /* ThrowStatement */: + case 168 /* ThrowStatement */: return emitThrowStatement(node); - case 168 /* TryStatement */: + case 169 /* TryStatement */: return emitTryStatement(node); - case 170 /* CatchBlock */: + case 171 /* CatchBlock */: return emitCatchBlock(node); - case 172 /* DebuggerStatement */: + case 173 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 173 /* VariableDeclaration */: + case 174 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: return emitClassDeclaration(node); - case 177 /* InterfaceDeclaration */: + case 178 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 178 /* EnumDeclaration */: + case 180 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 181 /* ImportDeclaration */: + case 183 /* ImportDeclaration */: return emitImportDeclaration(node); - case 184 /* SourceFile */: + case 186 /* SourceFile */: return emitSourceFile(node); } } @@ -8128,7 +8372,7 @@ var ts; return leadingComments; } function getLeadingCommentsToEmit(node) { - if (node.parent.kind === 184 /* SourceFile */ || node.pos !== node.parent.pos) { + if (node.parent.kind === 186 /* SourceFile */ || node.pos !== node.parent.pos) { var leadingComments; if (hasDetachedComments(node.pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); @@ -8145,7 +8389,7 @@ var ts; emitComments(leadingComments, true, writer, writeComment); } function emitTrailingDeclarationComments(node) { - if (node.parent.kind === 184 /* SourceFile */ || node.end !== node.parent.end) { + if (node.parent.kind === 186 /* SourceFile */ || node.end !== node.parent.end) { var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); emitComments(trailingComments, false, writer, writeComment); } @@ -8337,7 +8581,7 @@ var ts; if (node.flags & 1 /* Export */) { write("export "); } - if (node.kind !== 177 /* InterfaceDeclaration */) { + if (node.kind !== 178 /* InterfaceDeclaration */) { write("declare "); } } @@ -8393,7 +8637,7 @@ var ts; emitDeclarationFlags(node); write("module "); emitSourceTextOfNode(node.name); - while (node.body.kind !== 180 /* ModuleBlock */) { + while (node.body.kind !== 182 /* ModuleBlock */) { node = node.body; write("."); emitSourceTextOfNode(node.name); @@ -8410,6 +8654,27 @@ var ts; enclosingDeclaration = prevEnclosingDeclaration; } } + function emitTypeAliasDeclaration(node) { + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitDeclarationFlags(node); + write("type "); + emitSourceTextOfNode(node.name); + write(" = "); + getSymbolVisibilityDiagnosticMessage = getTypeAliasDeclarationVisibilityError; + resolver.writeTypeAtLocation(node.type, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + write(";"); + writeLine(); + } + function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1; + return { + diagnosticMessage: diagnosticMessage, + errorNode: node, + typeName: node.name + }; + } + } function emitEnumDeclaration(node) { if (resolver.isDeclarationVisible(node)) { emitJsDocComments(node); @@ -8441,30 +8706,30 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 177 /* InterfaceDeclaration */: + case 178 /* InterfaceDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 125 /* ConstructSignature */: + case 126 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 124 /* CallSignature */: + case 125 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 120 /* Method */: + case 121 /* Method */: if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 176 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 177 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 174 /* FunctionDeclaration */: + case 175 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -8480,7 +8745,7 @@ var ts; emitJsDocComments(node); decreaseIndent(); emitSourceTextOfNode(node.name); - if (node.constraint && (node.parent.kind !== 120 /* Method */ || !(node.parent.flags & 32 /* Private */))) { + if (node.constraint && (node.parent.kind !== 121 /* Method */ || !(node.parent.flags & 32 /* Private */))) { write(" extends "); getSymbolVisibilityDiagnosticMessage = getTypeParameterConstraintVisibilityError; resolver.writeTypeAtLocation(node.constraint, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); @@ -8502,7 +8767,7 @@ var ts; resolver.writeTypeAtLocation(node, enclosingDeclaration, 1 /* WriteArrayAsGenericType */ | 2 /* UseTypeOfFunction */, writer); function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.kind === 176 /* ClassDeclaration */) { + if (node.parent.kind === 177 /* ClassDeclaration */) { if (symbolAccesibilityResult.errorModuleName) { diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2; } @@ -8587,9 +8852,9 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 173 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 174 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { emitSourceTextOfNode(node.name); - if (node.kind === 119 /* Property */ && (node.flags & 4 /* QuestionMark */)) { + if (node.kind === 120 /* Property */ && (node.flags & 4 /* QuestionMark */)) { write("?"); } if (!(node.flags & 32 /* Private */)) { @@ -8600,14 +8865,14 @@ var ts; } function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 173 /* VariableDeclaration */) { + if (node.kind === 174 /* VariableDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 119 /* Property */) { + else if (node.kind === 120 /* Property */) { if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 176 /* ClassDeclaration */) { + else if (node.parent.kind === 177 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { @@ -8626,7 +8891,15 @@ var ts; if (hasDeclarationWithEmit) { emitJsDocComments(node); emitDeclarationFlags(node); - write("var "); + if (node.flags & 2048 /* Let */) { + write("let "); + } + else if (node.flags & 4096 /* Const */) { + write("const "); + } + else { + write("var "); + } emitCommaList(node.declarations, emitVariableDeclaration); write(";"); writeLine(); @@ -8649,7 +8922,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 123 /* SetAccessor */) { + if (node.kind === 124 /* SetAccessor */) { if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; } @@ -8678,14 +8951,14 @@ var ts; } } function emitFunctionDeclaration(node) { - if ((node.kind !== 174 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { + if ((node.kind !== 175 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); emitDeclarationFlags(node); - if (node.kind === 174 /* FunctionDeclaration */) { + if (node.kind === 175 /* FunctionDeclaration */) { write("function "); emitSourceTextOfNode(node.name); } - else if (node.kind === 121 /* Constructor */) { + else if (node.kind === 122 /* Constructor */) { write("constructor"); } else { @@ -8703,24 +8976,24 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { - if (node.kind === 124 /* CallSignature */ || node.kind === 126 /* IndexSignature */) { + if (node.kind === 125 /* CallSignature */ || node.kind === 127 /* IndexSignature */) { emitJsDocComments(node); } emitTypeParameters(node.typeParameters); - if (node.kind === 126 /* IndexSignature */) { + if (node.kind === 127 /* IndexSignature */) { write("["); } else { write("("); } emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 126 /* IndexSignature */) { + if (node.kind === 127 /* IndexSignature */) { write("]"); } else { write(")"); } - if (node.kind !== 121 /* Constructor */ && !(node.flags & 32 /* Private */)) { + if (node.kind !== 122 /* Constructor */ && !(node.flags & 32 /* Private */)) { write(": "); getSymbolVisibilityDiagnosticMessage = getReturnTypeVisibilityError; resolver.writeReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); @@ -8730,27 +9003,27 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 125 /* ConstructSignature */: + case 126 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 124 /* CallSignature */: + case 125 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 126 /* IndexSignature */: + case 127 /* IndexSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 120 /* Method */: + case 121 /* Method */: if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 176 /* ClassDeclaration */) { + else if (node.parent.kind === 177 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 174 /* FunctionDeclaration */: + case 175 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; break; default: @@ -8781,27 +9054,27 @@ var ts; function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 121 /* Constructor */: + case 122 /* Constructor */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; break; - case 125 /* ConstructSignature */: + case 126 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 124 /* CallSignature */: + case 125 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 120 /* Method */: + case 121 /* Method */: if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 176 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 177 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 174 /* FunctionDeclaration */: + case 175 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -8816,37 +9089,39 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 121 /* Constructor */: - case 174 /* FunctionDeclaration */: - case 120 /* Method */: + case 122 /* Constructor */: + case 175 /* FunctionDeclaration */: + case 121 /* Method */: return emitFunctionDeclaration(node); - case 125 /* ConstructSignature */: + case 126 /* ConstructSignature */: return emitConstructSignatureDeclaration(node); - case 124 /* CallSignature */: - case 126 /* IndexSignature */: + case 125 /* CallSignature */: + case 127 /* IndexSignature */: return emitSignatureDeclaration(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: return emitAccessorDeclaration(node); - case 151 /* VariableStatement */: + case 152 /* VariableStatement */: return emitVariableStatement(node); - case 119 /* Property */: + case 120 /* Property */: return emitPropertyDeclaration(node); - case 177 /* InterfaceDeclaration */: + case 178 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: return emitClassDeclaration(node); - case 183 /* EnumMember */: + case 179 /* TypeAliasDeclaration */: + return emitTypeAliasDeclaration(node); + case 185 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 178 /* EnumDeclaration */: + case 180 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 181 /* ImportDeclaration */: + case 183 /* ImportDeclaration */: return emitImportDeclaration(node); - case 182 /* ExportAssignment */: + case 184 /* ExportAssignment */: return emitExportAssignment(node); - case 184 /* SourceFile */: + case 186 /* SourceFile */: return emitSourceFile(node); } } @@ -8908,10 +9183,13 @@ var ts; } } var hasSemanticErrors = resolver.hasSemanticErrors(); + var hasEarlyErrors = resolver.hasEarlyErrors(targetSourceFile); function emitFile(jsFilePath, sourceFile) { - emitJavaScript(jsFilePath, sourceFile); - if (!hasSemanticErrors && compilerOptions.declaration) { - emitDeclarations(jsFilePath, sourceFile); + if (!hasEarlyErrors) { + emitJavaScript(jsFilePath, sourceFile); + if (!hasSemanticErrors && compilerOptions.declaration) { + emitDeclarations(jsFilePath, sourceFile); + } } } if (targetSourceFile === undefined) { @@ -8938,7 +9216,10 @@ var ts; diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); var hasEmitterError = ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1 /* Error */; }); var returnCode; - if (hasEmitterError) { + if (hasEarlyErrors) { + returnCode = 1 /* AllOutputGenerationSkipped */; + } + else if (hasEmitterError) { returnCode = 4 /* EmitErrorsEncountered */; } else if (hasSemanticErrors && compilerOptions.declaration) { @@ -9021,6 +9302,7 @@ var ts; emitFiles: invokeEmitter, getParentOfSymbol: getParentOfSymbol, getTypeOfSymbol: getTypeOfSymbol, + getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, getSignaturesOfType: getSignaturesOfType, @@ -9043,12 +9325,13 @@ var ts; isImplementationOfOverload: isImplementationOfOverload, getAliasedSymbol: resolveImport, isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, - isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; } + isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + hasEarlyErrors: hasEarlyErrors }; - var undefinedSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "undefined"); - var argumentsSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "arguments"); - var unknownSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "unknown"); - var resolvingSymbol = createSymbol(33554432 /* Transient */, "__resolving__"); + var undefinedSymbol = createSymbol(4 /* Property */ | 134217728 /* Transient */, "undefined"); + var argumentsSymbol = createSymbol(4 /* Property */ | 134217728 /* Transient */, "arguments"); + var unknownSymbol = createSymbol(4 /* Property */ | 134217728 /* Transient */, "unknown"); + var resolvingSymbol = createSymbol(134217728 /* Transient */, "__resolving__"); var anyType = createIntrinsicType(1 /* Any */, "any"); var stringType = createIntrinsicType(2 /* String */, "string"); var numberType = createIntrinsicType(4 /* Number */, "number"); @@ -9095,31 +9378,35 @@ var ts; } function getExcludedSymbolFlags(flags) { var result = 0; - if (flags & 1 /* Variable */) - result |= ts.SymbolFlags.VariableExcludes; - if (flags & 2 /* Property */) + if (flags & 2 /* BlockScopedVariable */) + result |= ts.SymbolFlags.BlockScopedVariableExcludes; + if (flags & 1 /* FunctionScopedVariable */) + result |= ts.SymbolFlags.FunctionScopedVariableExcludes; + if (flags & 4 /* Property */) result |= ts.SymbolFlags.PropertyExcludes; - if (flags & 4 /* EnumMember */) + if (flags & 8 /* EnumMember */) result |= ts.SymbolFlags.EnumMemberExcludes; - if (flags & 8 /* Function */) + if (flags & 16 /* Function */) result |= ts.SymbolFlags.FunctionExcludes; - if (flags & 16 /* Class */) + if (flags & 32 /* Class */) result |= ts.SymbolFlags.ClassExcludes; - if (flags & 32 /* Interface */) + if (flags & 64 /* Interface */) result |= ts.SymbolFlags.InterfaceExcludes; - if (flags & 64 /* Enum */) + if (flags & 128 /* Enum */) result |= ts.SymbolFlags.EnumExcludes; - if (flags & 128 /* ValueModule */) + if (flags & 256 /* ValueModule */) result |= ts.SymbolFlags.ValueModuleExcludes; - if (flags & 2048 /* Method */) + if (flags & 4096 /* Method */) result |= ts.SymbolFlags.MethodExcludes; - if (flags & 8192 /* GetAccessor */) + if (flags & 16384 /* GetAccessor */) result |= ts.SymbolFlags.GetAccessorExcludes; - if (flags & 16384 /* SetAccessor */) + if (flags & 32768 /* SetAccessor */) result |= ts.SymbolFlags.SetAccessorExcludes; - if (flags & 262144 /* TypeParameter */) + if (flags & 524288 /* TypeParameter */) result |= ts.SymbolFlags.TypeParameterExcludes; - if (flags & 4194304 /* Import */) + if (flags & 1048576 /* TypeAlias */) + result |= ts.SymbolFlags.TypeAliasExcludes; + if (flags & 16777216 /* Import */) result |= ts.SymbolFlags.ImportExcludes; return result; } @@ -9129,7 +9416,7 @@ var ts; mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 16777216 /* Merged */, symbol.name); + var result = createSymbol(symbol.flags | 67108864 /* Merged */, symbol.name); result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) @@ -9162,8 +9449,12 @@ var ts; recordMergedSymbol(target, source); } else { + var message = target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { - error(node.name ? node.name : node, ts.Diagnostics.Duplicate_identifier_0, symbolToString(source)); + error(node.name ? node.name : node, message, symbolToString(source)); + }); + ts.forEach(target.declarations, function (node) { + error(node.name ? node.name : node, message, symbolToString(source)); }); } } @@ -9184,7 +9475,7 @@ var ts; } else { var symbol = target[id]; - if (!(symbol.flags & 16777216 /* Merged */)) { + if (!(symbol.flags & 67108864 /* Merged */)) { target[id] = symbol = cloneSymbol(symbol); } extendSymbol(symbol, source[id]); @@ -9193,7 +9484,7 @@ var ts; } } function getSymbolLinks(symbol) { - if (symbol.flags & 33554432 /* Transient */) + if (symbol.flags & 134217728 /* Transient */) return symbol; if (!symbol.id) symbol.id = nextSymbolId++; @@ -9205,19 +9496,19 @@ var ts; return nodeLinks[node.id] || (nodeLinks[node.id] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 184 /* SourceFile */); + return ts.getAncestor(node, 186 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 184 /* SourceFile */ && !ts.isExternalModule(node); + return node.kind === 186 /* SourceFile */ && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { var symbol = symbols[name]; - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 33554432 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); if (symbol.flags & meaning) { return symbol; } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 16777216 /* Import */) { var target = resolveImport(symbol); if (target === unknownSymbol || target.flags & meaning) { return symbol; @@ -9239,6 +9530,23 @@ var ts; if (!s && nameNotFoundMessage) { error(errorLocation, nameNotFoundMessage, nameArg); } + if (s && s.flags & 2 /* BlockScopedVariable */) { + var declaration = ts.forEach(s.declarations, function (d) { return d.flags & ts.NodeFlags.BlockScoped ? d : undefined; }); + ts.Debug.assert(declaration, "Block-scoped variable declaration is undefined"); + var declarationSourceFile = ts.getSourceFileOfNode(declaration); + var referenceSourceFile = ts.getSourceFileOfNode(errorLocation); + if (declarationSourceFile === referenceSourceFile) { + if (declaration.pos > errorLocation.pos) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.identifierToString(declaration.name)); + } + } + else if (compilerOptions.out) { + var sourceFiles = program.getSourceFiles(); + if (sourceFiles.indexOf(referenceSourceFile) < sourceFiles.indexOf(declarationSourceFile)) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.identifierToString(declaration.name)); + } + } + } return s; } while (location) { @@ -9248,21 +9556,21 @@ var ts; } } switch (location.kind) { - case 184 /* SourceFile */: + case 186 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & ts.SymbolFlags.ModuleMember)) { return returnResolvedSymbol(result); } break; - case 178 /* EnumDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 4 /* EnumMember */)) { + case 180 /* EnumDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { return returnResolvedSymbol(result); } break; - case 119 /* Property */: - if (location.parent.kind === 176 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { + case 120 /* Property */: + if (location.parent.kind === 177 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (getSymbol(ctor.locals, name, meaning & ts.SymbolFlags.Value)) { @@ -9271,8 +9579,8 @@ var ts; } } break; - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & ts.SymbolFlags.Type)) { if (lastLocation && lastLocation.flags & 128 /* Static */) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); @@ -9283,17 +9591,17 @@ var ts; } } break; - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 174 /* FunctionDeclaration */: - case 144 /* ArrowFunction */: + case 121 /* Method */: + case 122 /* Constructor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 175 /* FunctionDeclaration */: + case 145 /* ArrowFunction */: if (name === "arguments") { return returnResolvedSymbol(argumentsSymbol); } break; - case 143 /* FunctionExpression */: + case 144 /* FunctionExpression */: if (name === "arguments") { return returnResolvedSymbol(argumentsSymbol); } @@ -9302,7 +9610,7 @@ var ts; return returnResolvedSymbol(location.symbol); } break; - case 170 /* CatchBlock */: + case 171 /* CatchBlock */: var id = location.variable; if (name === id.text) { return returnResolvedSymbol(location.symbol); @@ -9318,11 +9626,11 @@ var ts; return returnResolvedSymbol(undefined); } function resolveImport(symbol) { - ts.Debug.assert((symbol.flags & 4194304 /* Import */) !== 0, "Should only get Imports here."); + ts.Debug.assert((symbol.flags & 16777216 /* Import */) !== 0, "Should only get Imports here."); var links = getSymbolLinks(symbol); if (!links.target) { links.target = resolvingSymbol; - var node = getDeclarationOfKind(symbol, 181 /* ImportDeclaration */); + var node = getDeclarationOfKind(symbol, 183 /* ImportDeclaration */); var target = node.externalModuleName ? resolveExternalModuleName(node, node.externalModuleName) : getSymbolOfPartOfRightHandSideOfImport(node.entityName, node); if (links.target === resolvingSymbol) { links.target = target || unknownSymbol; @@ -9338,17 +9646,17 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImport(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 181 /* ImportDeclaration */); + importDeclaration = ts.getAncestor(entityName, 183 /* ImportDeclaration */); ts.Debug.assert(importDeclaration); } if (entityName.kind === 59 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 59 /* Identifier */ || entityName.parent.kind === 116 /* QualifiedName */) { + if (entityName.kind === 59 /* Identifier */ || entityName.parent.kind === 117 /* QualifiedName */) { return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Namespace); } else { - ts.Debug.assert(entityName.parent.kind === 181 /* ImportDeclaration */); + ts.Debug.assert(entityName.parent.kind === 183 /* ImportDeclaration */); return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace); } } @@ -9362,9 +9670,9 @@ var ts; return; } } - else if (name.kind === 116 /* QualifiedName */) { + else if (name.kind === 117 /* QualifiedName */) { var namespace = resolveEntityName(location, name.left, ts.SymbolFlags.Namespace); - if (!namespace || namespace === unknownSymbol || name.right.kind === 115 /* Missing */) + if (!namespace || namespace === unknownSymbol || name.right.kind === 116 /* Missing */) return; var symbol = getSymbol(namespace.exports, name.right.text, meaning); if (!symbol) { @@ -9375,7 +9683,7 @@ var ts; else { return; } - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 33554432 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); return symbol.flags & meaning ? symbol : resolveImport(symbol); } function isExternalModuleNameRelative(moduleName) { @@ -9388,7 +9696,7 @@ var ts; return; var isRelative = isExternalModuleNameRelative(moduleName); if (!isRelative) { - var symbol = getSymbol(globals, '"' + moduleName + '"', 128 /* ValueModule */); + var symbol = getSymbol(globals, '"' + moduleName + '"', 256 /* ValueModule */); if (symbol) { return getResolvedExportSymbol(symbol); } @@ -9418,7 +9726,7 @@ var ts; if (symbol.flags & (ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace)) { return symbol; } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 16777216 /* Import */) { return resolveImport(symbol); } } @@ -9453,9 +9761,9 @@ var ts; var seenExportedMember = false; var result = []; ts.forEach(symbol.declarations, function (declaration) { - var block = (declaration.kind === 184 /* SourceFile */ ? declaration : declaration.body); + var block = (declaration.kind === 186 /* SourceFile */ ? declaration : declaration.body); ts.forEach(block.statements, function (node) { - if (node.kind === 182 /* ExportAssignment */) { + if (node.kind === 184 /* ExportAssignment */) { result.push(node); } else { @@ -9479,16 +9787,16 @@ var ts; return getMergedSymbol(symbol.parent); } function getExportSymbolOfValueSymbolIfExported(symbol) { - return symbol && (symbol.flags & 524288 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; + return symbol && (symbol.flags & 2097152 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; } function symbolIsValue(symbol) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 33554432 /* Instantiated */) { return symbolIsValue(getSymbolLinks(symbol).target); } if (symbol.flags & ts.SymbolFlags.Value) { return true; } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 16777216 /* Import */) { return (resolveImport(symbol).flags & ts.SymbolFlags.Value) !== 0; } return false; @@ -9497,7 +9805,7 @@ var ts; var members = node.members; for (var i = 0; i < members.length; i++) { var member = members[i]; - if (member.kind === 121 /* Constructor */ && member.body) { + if (member.kind === 122 /* Constructor */ && member.body) { return member; } } @@ -9551,7 +9859,7 @@ var ts; return setObjectTypeMembers(createObjectType(32768 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function isOptionalProperty(propertySymbol) { - return propertySymbol.valueDeclaration && propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */ && propertySymbol.valueDeclaration.kind !== 118 /* Parameter */; + return propertySymbol.valueDeclaration && propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */ && propertySymbol.valueDeclaration.kind !== 119 /* Parameter */; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; @@ -9562,17 +9870,17 @@ var ts; } } switch (location.kind) { - case 184 /* SourceFile */: + case 186 /* SourceFile */: if (!ts.isExternalModule(location)) { break; } - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location).exports)) { return result; } break; - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location).members)) { return result; } @@ -9602,8 +9910,8 @@ var ts; return [symbol]; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 4194304 /* Import */) { - if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 181 /* ImportDeclaration */ && declaration.externalModuleName; })) { + if (symbolFromSymbolTable.flags & 16777216 /* Import */) { + if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 183 /* ImportDeclaration */ && declaration.externalModuleName; })) { var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { return [symbolFromSymbolTable]; @@ -9630,7 +9938,7 @@ var ts; if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 4194304 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 16777216 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -9640,7 +9948,7 @@ var ts; return qualify; } function isSymbolAccessible(symbol, enclosingDeclaration, meaning) { - if (symbol && enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { + if (symbol && enclosingDeclaration && !(symbol.flags & 524288 /* TypeParameter */)) { var initialSymbol = symbol; var meaningToLook = meaning; while (symbol) { @@ -9685,7 +9993,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 179 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 184 /* SourceFile */ && ts.isExternalModule(declaration)); + return (declaration.kind === 181 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 186 /* SourceFile */ && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -9695,7 +10003,7 @@ var ts; return { aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 181 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { + if (declaration.kind === 183 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { if (!ts.contains(aliasesToMakeVisible, declaration)) { @@ -9753,6 +10061,18 @@ var ts; } return result; } + function getTypeAliasForTypeLiteral(type) { + if (type.symbol && type.symbol.flags & 1024 /* TypeLiteral */) { + var node = type.symbol.declarations[0].parent; + while (node.kind === 134 /* ParenType */) { + node = node.parent; + } + if (node.kind === 179 /* TypeAliasDeclaration */) { + return getSymbolOfNode(node); + } + } + return undefined; + } var _displayBuilder; function getSymbolDisplayBuilder() { function appendSymbolNameOnly(symbol, writer) { @@ -9770,7 +10090,7 @@ var ts; function appendParentTypeArgumentsAndSymbolName(symbol) { if (parentSymbol) { if (flags & 1 /* WriteTypeParametersOrArguments */) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 33554432 /* Instantiated */) { buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); } else { @@ -9798,14 +10118,14 @@ var ts; if (!parentSymbol && ts.forEach(symbol.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); })) { return; } - if (symbol.flags & 512 /* TypeLiteral */ || symbol.flags & 1024 /* ObjectLiteral */) { + if (symbol.flags & 1024 /* TypeLiteral */ || symbol.flags & 2048 /* ObjectLiteral */) { return; } appendParentTypeArgumentsAndSymbolName(symbol); } } } - if (enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { + if (enclosingDeclaration && !(symbol.flags & 524288 /* TypeParameter */)) { walkSymbol(symbol, meaning); return; } @@ -9884,14 +10204,20 @@ var ts; } } function writeAnonymousType(type, flags) { - if (type.symbol && type.symbol.flags & (16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { + if (type.symbol && type.symbol.flags & (32 /* Class */ | 128 /* Enum */ | 256 /* ValueModule */)) { writeTypeofSymbol(type); } else if (shouldWriteTypeOfFunctionSymbol()) { writeTypeofSymbol(type); } else if (typeStack && ts.contains(typeStack, type)) { - writeKeyword(writer, 105 /* AnyKeyword */); + var typeAlias = getTypeAliasForTypeLiteral(type); + if (typeAlias) { + buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, ts.SymbolFlags.Type); + } + else { + writeKeyword(writer, 105 /* AnyKeyword */); + } } else { if (!typeStack) { @@ -9903,8 +10229,8 @@ var ts; } function shouldWriteTypeOfFunctionSymbol() { if (type.symbol) { - var isStaticMethodSymbol = !!(type.symbol.flags & 2048 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; })); - var isNonLocalFunctionSymbol = !!(type.symbol.flags & 8 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 184 /* SourceFile */ || declaration.parent.kind === 180 /* ModuleBlock */; })); + var isStaticMethodSymbol = !!(type.symbol.flags & 4096 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; })); + var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 186 /* SourceFile */ || declaration.parent.kind === 182 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2 /* UseTypeOfFunction */) || (typeStack && ts.contains(typeStack, type)); } @@ -9991,7 +10317,7 @@ var ts; for (var i = 0; i < resolved.properties.length; i++) { var p = resolved.properties[i]; var t = getTypeOfSymbol(p); - if (p.flags & (8 /* Function */ | 2048 /* Method */) && !getPropertiesOfObjectType(t).length) { + if (p.flags & (16 /* Function */ | 4096 /* Method */) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0 /* Call */); for (var j = 0; j < signatures.length; j++) { buildSymbolDisplay(p, writer); @@ -10021,7 +10347,7 @@ var ts; } function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaraiton, flags) { var targetSymbol = getTargetSymbol(symbol); - if (targetSymbol.flags & 16 /* Class */ || targetSymbol.flags & 32 /* Interface */) { + if (targetSymbol.flags & 32 /* Class */ || targetSymbol.flags & 64 /* Interface */) { buildDisplayForTypeParametersAndDelimiters(getTypeParametersOfClassOrInterface(symbol), writer, enclosingDeclaraiton, flags); } } @@ -10123,12 +10449,12 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 179 /* ModuleDeclaration */) { + if (node.kind === 181 /* ModuleDeclaration */) { if (node.name.kind === 7 /* StringLiteral */) { return node; } } - else if (node.kind === 184 /* SourceFile */) { + else if (node.kind === 186 /* SourceFile */) { return ts.isExternalModule(node) ? node : undefined; } } @@ -10144,7 +10470,7 @@ var ts; if (isSymbolUsedInExportAssignment(symbolOfNode)) { return true; } - if (symbolOfNode.flags & 4194304 /* Import */) { + if (symbolOfNode.flags & 16777216 /* Import */) { return isSymbolUsedInExportAssignment(resolveImport(symbolOfNode)); } } @@ -10152,7 +10478,7 @@ var ts; if (exportAssignmentSymbol === symbol) { return true; } - if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 4194304 /* Import */)) { + if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 16777216 /* Import */)) { resolvedExportSymbol = resolvedExportSymbol || resolveImport(exportAssignmentSymbol); if (resolvedExportSymbol === symbol) { return true; @@ -10170,31 +10496,32 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 173 /* VariableDeclaration */: - case 179 /* ModuleDeclaration */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 174 /* FunctionDeclaration */: - case 178 /* EnumDeclaration */: - case 181 /* ImportDeclaration */: - var parent = node.kind === 173 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (!(node.flags & 1 /* Export */) && !(node.kind !== 181 /* ImportDeclaration */ && parent.kind !== 184 /* SourceFile */ && ts.isInAmbientContext(parent))) { + case 174 /* VariableDeclaration */: + case 181 /* ModuleDeclaration */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 179 /* TypeAliasDeclaration */: + case 175 /* FunctionDeclaration */: + case 180 /* EnumDeclaration */: + case 183 /* ImportDeclaration */: + var parent = node.kind === 174 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (!(node.flags & 1 /* Export */) && !(node.kind !== 183 /* ImportDeclaration */ && parent.kind !== 186 /* SourceFile */ && ts.isInAmbientContext(parent))) { return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); } return isDeclarationVisible(parent); - case 119 /* Property */: - case 120 /* Method */: + case 120 /* Property */: + case 121 /* Method */: if (node.flags & (32 /* Private */ | 64 /* Protected */)) { return false; } - case 121 /* Constructor */: - case 125 /* ConstructSignature */: - case 124 /* CallSignature */: - case 126 /* IndexSignature */: - case 118 /* Parameter */: - case 180 /* ModuleBlock */: + case 122 /* Constructor */: + case 126 /* ConstructSignature */: + case 125 /* CallSignature */: + case 127 /* IndexSignature */: + case 119 /* Parameter */: + case 182 /* ModuleBlock */: return isDeclarationVisible(node.parent); - case 184 /* SourceFile */: + case 186 /* SourceFile */: return true; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + ts.SyntaxKind[node.kind]); @@ -10213,16 +10540,16 @@ var ts; return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; } function getTypeOfVariableDeclaration(declaration) { - if (declaration.parent.kind === 158 /* ForInStatement */) { + if (declaration.parent.kind === 159 /* ForInStatement */) { return anyType; } if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 118 /* Parameter */) { + if (declaration.kind === 119 /* Parameter */) { var func = declaration.parent; - if (func.kind === 123 /* SetAccessor */) { - var getter = getDeclarationOfKind(declaration.parent.symbol, 122 /* GetAccessor */); + if (func.kind === 124 /* SetAccessor */) { + var getter = getDeclarationOfKind(declaration.parent.symbol, 123 /* GetAccessor */); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -10234,7 +10561,7 @@ var ts; } if (declaration.initializer) { var type = checkAndMarkExpression(declaration.initializer); - if (declaration.kind !== 136 /* PropertyAssignment */) { + if (declaration.kind !== 137 /* PropertyAssignment */) { var unwidenedType = type; type = getWidenedType(type); if (type !== unwidenedType) { @@ -10253,14 +10580,14 @@ var ts; if (getInnermostTypeOfNestedArrayTypes(type) !== anyType) { return; } - if (isPrivateWithinAmbient(declaration) || (declaration.kind === 118 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { + if (isPrivateWithinAmbient(declaration) || (declaration.kind === 119 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { return; } switch (declaration.kind) { - case 119 /* Property */: + case 120 /* Property */: var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 118 /* Parameter */: + case 119 /* Parameter */: var diagnostic = declaration.flags & 8 /* Rest */ ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; default: @@ -10272,11 +10599,11 @@ var ts; function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.flags & 67108864 /* Prototype */) { + if (symbol.flags & 268435456 /* Prototype */) { return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.kind === 170 /* CatchBlock */) { + if (declaration.kind === 171 /* CatchBlock */) { return links.type = anyType; } links.type = resolvingType; @@ -10299,7 +10626,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 122 /* GetAccessor */) { + if (accessor.kind === 123 /* GetAccessor */) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -10318,8 +10645,8 @@ var ts; links = links || getSymbolLinks(symbol); if (!links.type) { links.type = resolvingType; - var getter = getDeclarationOfKind(symbol, 122 /* GetAccessor */); - var setter = getDeclarationOfKind(symbol, 123 /* SetAccessor */); + var getter = getDeclarationOfKind(symbol, 123 /* GetAccessor */); + var setter = getDeclarationOfKind(symbol, 124 /* SetAccessor */); var type; var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { @@ -10349,7 +10676,7 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var getter = getDeclarationOfKind(symbol, 122 /* GetAccessor */); + var getter = getDeclarationOfKind(symbol, 123 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -10383,22 +10710,22 @@ var ts; return links.type; } function getTypeOfSymbol(symbol) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 33554432 /* Instantiated */) { return getTypeOfInstantiatedSymbol(symbol); } - if (symbol.flags & (1 /* Variable */ | 2 /* Property */)) { + if (symbol.flags & (ts.SymbolFlags.Variable | 4 /* Property */)) { return getTypeOfVariableOrParameterOrProperty(symbol); } - if (symbol.flags & (8 /* Function */ | 2048 /* Method */ | 16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { + if (symbol.flags & (16 /* Function */ | 4096 /* Method */ | 32 /* Class */ | 128 /* Enum */ | 256 /* ValueModule */)) { return getTypeOfFuncClassEnumModule(symbol); } - if (symbol.flags & 4 /* EnumMember */) { + if (symbol.flags & 8 /* EnumMember */) { return getTypeOfEnumMember(symbol); } if (symbol.flags & ts.SymbolFlags.Accessor) { return getTypeOfAccessors(symbol); } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 16777216 /* Import */) { return getTypeOfImport(symbol); } return unknownType; @@ -10416,7 +10743,7 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 177 /* InterfaceDeclaration */ || node.kind === 176 /* ClassDeclaration */) { + if (node.kind === 178 /* InterfaceDeclaration */ || node.kind === 177 /* ClassDeclaration */) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -10447,7 +10774,7 @@ var ts; type.typeArguments = type.typeParameters; } type.baseTypes = []; - var declaration = getDeclarationOfKind(symbol, 176 /* ClassDeclaration */); + var declaration = getDeclarationOfKind(symbol, 177 /* ClassDeclaration */); if (declaration.baseType) { var baseType = getTypeFromTypeReferenceNode(declaration.baseType); if (baseType !== unknownType) { @@ -10487,7 +10814,7 @@ var ts; } type.baseTypes = []; ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 177 /* InterfaceDeclaration */ && declaration.baseTypes) { + if (declaration.kind === 178 /* InterfaceDeclaration */ && declaration.baseTypes) { ts.forEach(declaration.baseTypes, function (node) { var baseType = getTypeFromTypeReferenceNode(node); if (baseType !== unknownType) { @@ -10514,6 +10841,23 @@ var ts; } return links.declaredType; } + function getDeclaredTypeOfTypeAlias(symbol) { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + links.declaredType = resolvingType; + var declaration = getDeclarationOfKind(symbol, 179 /* TypeAliasDeclaration */); + var type = getTypeFromTypeNode(declaration.type); + if (links.declaredType === resolvingType) { + links.declaredType = type; + } + } + else if (links.declaredType === resolvingType) { + links.declaredType = unknownType; + var declaration = getDeclarationOfKind(symbol, 179 /* TypeAliasDeclaration */); + error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + } + return links.declaredType; + } function getDeclaredTypeOfEnum(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { @@ -10528,7 +10872,7 @@ var ts; if (!links.declaredType) { var type = createType(512 /* TypeParameter */); type.symbol = symbol; - if (!getDeclarationOfKind(symbol, 117 /* TypeParameter */).constraint) { + if (!getDeclarationOfKind(symbol, 118 /* TypeParameter */).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -10543,20 +10887,23 @@ var ts; return links.declaredType; } function getDeclaredTypeOfSymbol(symbol) { - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0); - if (symbol.flags & 16 /* Class */) { + ts.Debug.assert((symbol.flags & 33554432 /* Instantiated */) === 0); + if (symbol.flags & 32 /* Class */) { return getDeclaredTypeOfClass(symbol); } - if (symbol.flags & 32 /* Interface */) { + if (symbol.flags & 64 /* Interface */) { return getDeclaredTypeOfInterface(symbol); } - if (symbol.flags & 64 /* Enum */) { + if (symbol.flags & 1048576 /* TypeAlias */) { + return getDeclaredTypeOfTypeAlias(symbol); + } + if (symbol.flags & 128 /* Enum */) { return getDeclaredTypeOfEnum(symbol); } - if (symbol.flags & 262144 /* TypeParameter */) { + if (symbol.flags & 524288 /* TypeParameter */) { return getDeclaredTypeOfTypeParameter(symbol); } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 16777216 /* Import */) { return getDeclaredTypeOfImport(symbol); } return unknownType; @@ -10658,7 +11005,7 @@ var ts; function createTupleTypeMemberSymbols(memberTypes) { var members = {}; for (var i = 0; i < memberTypes.length; i++) { - var symbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "" + i); + var symbol = createSymbol(4 /* Property */ | 134217728 /* Transient */, "" + i); symbol.type = memberTypes[i]; members[i] = symbol; } @@ -10722,7 +11069,7 @@ var ts; } function resolveAnonymousTypeMembers(type) { var symbol = type.symbol; - if (symbol.flags & 512 /* TypeLiteral */) { + if (symbol.flags & 1024 /* TypeLiteral */) { var members = symbol.members; var callSignatures = getSignaturesOfSymbol(members["__call"]); var constructSignatures = getSignaturesOfSymbol(members["__new"]); @@ -10736,10 +11083,10 @@ var ts; if (symbol.flags & ts.SymbolFlags.HasExports) { members = symbol.exports; } - if (symbol.flags & (8 /* Function */ | 2048 /* Method */)) { + if (symbol.flags & (16 /* Function */ | 4096 /* Method */)) { callSignatures = getSignaturesOfSymbol(symbol); } - if (symbol.flags & 16 /* Class */) { + if (symbol.flags & 32 /* Class */) { var classType = getDeclaredTypeOfClass(symbol); constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); if (!constructSignatures.length) { @@ -10751,7 +11098,7 @@ var ts; } } var stringIndexType = undefined; - var numberIndexType = (symbol.flags & 64 /* Enum */) ? stringType : undefined; + var numberIndexType = (symbol.flags & 128 /* Enum */) ? stringType : undefined; } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -10855,7 +11202,7 @@ var ts; } propTypes.push(getTypeOfSymbol(prop)); } - var result = createSymbol(2 /* Property */ | 33554432 /* Transient */ | 134217728 /* UnionProperty */, name); + var result = createSymbol(4 /* Property */ | 134217728 /* Transient */ | 536870912 /* UnionProperty */, name); result.unionType = unionType; result.declarations = declarations; result.type = getUnionType(propTypes); @@ -10928,7 +11275,7 @@ var ts; function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 121 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var classType = declaration.kind === 122 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; var hasStringLiterals = false; @@ -10956,8 +11303,8 @@ var ts; returnType = getTypeFromTypeNode(declaration.type); } else { - if (declaration.kind === 122 /* GetAccessor */) { - var setter = getDeclarationOfKind(declaration.symbol, 123 /* SetAccessor */); + if (declaration.kind === 123 /* GetAccessor */) { + var setter = getDeclarationOfKind(declaration.symbol, 124 /* SetAccessor */); returnType = getAnnotatedAccessorType(setter); } if (!returnType && !declaration.body) { @@ -10975,16 +11322,16 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 174 /* FunctionDeclaration */: - case 120 /* Method */: - case 121 /* Constructor */: - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 175 /* FunctionDeclaration */: + case 121 /* Method */: + case 122 /* Constructor */: + case 125 /* CallSignature */: + case 126 /* ConstructSignature */: + case 127 /* IndexSignature */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -11053,7 +11400,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 121 /* Constructor */ || signature.declaration.kind === 125 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 122 /* Constructor */ || signature.declaration.kind === 126 /* ConstructSignature */; var type = createObjectType(32768 /* Anonymous */ | 65536 /* FromSignature */); type.members = emptySymbols; type.properties = emptyArray; @@ -11094,7 +11441,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 117 /* TypeParameter */).constraint); + type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 118 /* TypeParameter */).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -11134,17 +11481,17 @@ var ts; while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { currentNode = currentNode.parent; } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 117 /* TypeParameter */; + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 118 /* TypeParameter */; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 127 /* TypeReference */ && n.typeName.kind === 59 /* Identifier */) { + if (n.kind === 128 /* TypeReference */ && n.typeName.kind === 59 /* Identifier */) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { var symbol = resolveName(typeParameter, n.typeName.text, ts.SymbolFlags.Type, undefined, undefined); - if (symbol && (symbol.flags & 262144 /* TypeParameter */)) { + if (symbol && (symbol.flags & 524288 /* TypeParameter */)) { links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); } } @@ -11165,7 +11512,7 @@ var ts; var symbol = resolveEntityName(node, node.typeName, ts.SymbolFlags.Type); if (symbol) { var type; - if ((symbol.flags & 262144 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + if ((symbol.flags & 524288 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { type = unknownType; } else { @@ -11205,9 +11552,9 @@ var ts; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; switch (declaration.kind) { - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 180 /* EnumDeclaration */: return declaration; } } @@ -11382,22 +11729,22 @@ var ts; return voidType; case 7 /* StringLiteral */: return getTypeFromStringLiteral(node); - case 127 /* TypeReference */: + case 128 /* TypeReference */: return getTypeFromTypeReferenceNode(node); - case 128 /* TypeQuery */: + case 129 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 130 /* ArrayType */: + case 131 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 131 /* TupleType */: + case 132 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 132 /* UnionType */: + case 133 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 133 /* ParenType */: + case 134 /* ParenType */: return getTypeFromTypeNode(node.type); - case 129 /* TypeLiteral */: + case 130 /* TypeLiteral */: return getTypeFromTypeLiteralNode(node); case 59 /* Identifier */: - case 116 /* QualifiedName */: + case 117 /* QualifiedName */: var symbol = getSymbolInfo(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -11495,12 +11842,12 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 33554432 /* Instantiated */) { var links = getSymbolLinks(symbol); symbol = links.target; mapper = combineTypeMappers(links.mapper, mapper); } - var result = createSymbol(8388608 /* Instantiated */ | 33554432 /* Transient */ | symbol.flags, symbol.name); + var result = createSymbol(33554432 /* Instantiated */ | 134217728 /* Transient */ | symbol.flags, symbol.name); result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -11530,7 +11877,7 @@ var ts; return mapper(type); } if (type.flags & 32768 /* Anonymous */) { - return type.symbol && type.symbol.flags & (8 /* Function */ | 2048 /* Method */ | 512 /* TypeLiteral */ | 1024 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; + return type.symbol && type.symbol.flags & (16 /* Function */ | 4096 /* Method */ | 1024 /* TypeLiteral */ | 2048 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; } if (type.flags & 4096 /* Reference */) { return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); @@ -11546,16 +11893,16 @@ var ts; } function isContextSensitiveExpression(node) { switch (node.kind) { - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: return !node.typeParameters && !ts.forEach(node.parameters, function (p) { return p.type; }); - case 135 /* ObjectLiteral */: - return ts.forEach(node.properties, function (p) { return p.kind === 136 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); - case 134 /* ArrayLiteral */: + case 136 /* ObjectLiteral */: + return ts.forEach(node.properties, function (p) { return p.kind === 137 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); + case 135 /* ArrayLiteral */: return ts.forEach(node.elements, function (e) { return isContextSensitiveExpression(e); }); - case 148 /* ConditionalExpression */: + case 149 /* ConditionalExpression */: return isContextSensitiveExpression(node.whenTrue) || isContextSensitiveExpression(node.whenFalse); - case 147 /* BinaryExpression */: + case 148 /* BinaryExpression */: return node.operator === 44 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); } return false; @@ -11857,7 +12204,7 @@ var ts; return false; } } - else if (!(targetProp.flags & 67108864 /* Prototype */)) { + else if (!(targetProp.flags & 268435456 /* Prototype */)) { var sourceFlags = getDeclarationFlagsFromSymbol(sourceProp); var targetFlags = getDeclarationFlagsFromSymbol(targetProp); if (sourceFlags & 32 /* Private */ || targetFlags & 32 /* Private */) { @@ -11874,7 +12221,7 @@ var ts; } } else if (targetFlags & 64 /* Protected */) { - var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 16 /* Class */; + var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32 /* Class */; var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(sourceProp.parent) : undefined; var targetClass = getDeclaredTypeOfSymbol(targetProp.parent); if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { @@ -12110,7 +12457,7 @@ var ts; return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }); } function isTypeOfObjectLiteral(type) { - return (type.flags & 32768 /* Anonymous */) && type.symbol && (type.symbol.flags & 1024 /* ObjectLiteral */) ? true : false; + return (type.flags & 32768 /* Anonymous */) && type.symbol && (type.symbol.flags & 2048 /* ObjectLiteral */) ? true : false; } function isArrayType(type) { return type.flags & 4096 /* Reference */ && type.target === globalArrayType; @@ -12158,7 +12505,7 @@ var ts; var members = {}; var index = 0; ts.forEach(properties, function (p) { - var symbol = createSymbol(2 /* Property */ | 33554432 /* Transient */ | p.flags, p.name); + var symbol = createSymbol(4 /* Property */ | 134217728 /* Transient */ | p.flags, p.name); symbol.declarations = p.declarations; symbol.parent = p.parent; symbol.type = widenedTypes[index++]; @@ -12293,7 +12640,7 @@ var ts; inferFromTypes(sourceTypes[i], target); } } - else if (source.flags & ts.TypeFlags.ObjectType && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (2048 /* Method */ | 512 /* TypeLiteral */))) { + else if (source.flags & ts.TypeFlags.ObjectType && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (4096 /* Method */ | 1024 /* TypeLiteral */))) { if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { if (depth === 0) { sourceStack = []; @@ -12376,17 +12723,17 @@ var ts; function getResolvedSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { - links.resolvedSymbol = resolveName(node, node.text, ts.SymbolFlags.Value | 524288 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node)) || unknownSymbol; + links.resolvedSymbol = resolveName(node, node.text, ts.SymbolFlags.Value | 2097152 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node)) || unknownSymbol; } return links.resolvedSymbol; } function isInTypeQuery(node) { while (node) { switch (node.kind) { - case 128 /* TypeQuery */: + case 129 /* TypeQuery */: return true; case 59 /* Identifier */: - case 116 /* QualifiedName */: + case 117 /* QualifiedName */: node = node.parent; continue; default: @@ -12419,7 +12766,7 @@ var ts; function isAssignedInBinaryExpression(node) { if (node.operator >= ts.SyntaxKind.FirstAssignment && node.operator <= ts.SyntaxKind.LastAssignment) { var n = node.left; - while (n.kind === 142 /* ParenExpression */) { + while (n.kind === 143 /* ParenExpression */) { n = n.expression; } if (n.kind === 59 /* Identifier */ && getResolvedSymbol(n) === symbol) { @@ -12436,40 +12783,40 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 147 /* BinaryExpression */: + case 148 /* BinaryExpression */: return isAssignedInBinaryExpression(node); - case 173 /* VariableDeclaration */: + case 174 /* VariableDeclaration */: return isAssignedInVariableDeclaration(node); - case 134 /* ArrayLiteral */: - case 135 /* ObjectLiteral */: - case 137 /* PropertyAccess */: - case 138 /* IndexedAccess */: - case 139 /* CallExpression */: - case 140 /* NewExpression */: - case 141 /* TypeAssertion */: - case 142 /* ParenExpression */: - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: - case 148 /* ConditionalExpression */: - case 150 /* Block */: - case 151 /* VariableStatement */: - case 153 /* ExpressionStatement */: - case 154 /* IfStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 157 /* ForStatement */: - case 158 /* ForInStatement */: - case 161 /* ReturnStatement */: - case 162 /* WithStatement */: - case 163 /* SwitchStatement */: - case 164 /* CaseClause */: - case 165 /* DefaultClause */: - case 166 /* LabeledStatement */: - case 167 /* ThrowStatement */: - case 168 /* TryStatement */: - case 169 /* TryBlock */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: + case 135 /* ArrayLiteral */: + case 136 /* ObjectLiteral */: + case 138 /* PropertyAccess */: + case 139 /* IndexedAccess */: + case 140 /* CallExpression */: + case 141 /* NewExpression */: + case 142 /* TypeAssertion */: + case 143 /* ParenExpression */: + case 146 /* PrefixOperator */: + case 147 /* PostfixOperator */: + case 149 /* ConditionalExpression */: + case 151 /* Block */: + case 152 /* VariableStatement */: + case 154 /* ExpressionStatement */: + case 155 /* IfStatement */: + case 156 /* DoStatement */: + case 157 /* WhileStatement */: + case 158 /* ForStatement */: + case 159 /* ForInStatement */: + case 162 /* ReturnStatement */: + case 163 /* WithStatement */: + case 164 /* SwitchStatement */: + case 165 /* CaseClause */: + case 166 /* DefaultClause */: + case 167 /* LabeledStatement */: + case 168 /* ThrowStatement */: + case 169 /* TryStatement */: + case 170 /* TryBlock */: + case 171 /* CatchBlock */: + case 172 /* FinallyBlock */: return ts.forEachChild(node, isAssignedIn); } return false; @@ -12477,26 +12824,26 @@ var ts; } function getNarrowedTypeOfSymbol(symbol, node) { var type = getTypeOfSymbol(symbol); - if (symbol.flags & 1 /* Variable */ && type.flags & ts.TypeFlags.Structured) { + if (symbol.flags & ts.SymbolFlags.Variable && type.flags & ts.TypeFlags.Structured) { while (true) { var child = node; node = node.parent; - if (!node || node.kind === 175 /* FunctionBlock */ || node.kind === 180 /* ModuleBlock */) { + if (!node || node.kind === 176 /* FunctionBlock */ || node.kind === 182 /* ModuleBlock */) { break; } var narrowedType = type; switch (node.kind) { - case 154 /* IfStatement */: + case 155 /* IfStatement */: if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 148 /* ConditionalExpression */: + case 149 /* ConditionalExpression */: if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 147 /* BinaryExpression */: + case 148 /* BinaryExpression */: if (child === node.right) { if (node.operator === 43 /* AmpersandAmpersandToken */) { narrowedType = narrowType(type, node.left, true); @@ -12519,7 +12866,7 @@ var ts; function narrowTypeByEquality(type, expr, assumeTrue) { var left = expr.left; var right = expr.right; - if (left.kind !== 145 /* PrefixOperator */ || left.operator !== 91 /* TypeOfKeyword */ || left.operand.kind !== 59 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { + if (left.kind !== 146 /* PrefixOperator */ || left.operator !== 91 /* TypeOfKeyword */ || left.operand.kind !== 59 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { return type; } var t = right.text; @@ -12573,9 +12920,9 @@ var ts; } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 142 /* ParenExpression */: + case 143 /* ParenExpression */: return narrowType(type, expr.expression, assumeTrue); - case 147 /* BinaryExpression */: + case 148 /* BinaryExpression */: var operator = expr.operator; if (operator === 25 /* EqualsEqualsEqualsToken */ || operator === 26 /* ExclamationEqualsEqualsToken */) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -12590,7 +12937,7 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 145 /* PrefixOperator */: + case 146 /* PrefixOperator */: if (expr.operator === 41 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -12601,7 +12948,7 @@ var ts; } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 16777216 /* Import */) { getSymbolLinks(symbol).referenced = !isInTypeQuery(node); } checkCollisionWithCapturedSuperVariable(node, node); @@ -12610,9 +12957,9 @@ var ts; return getNarrowedTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol), node); } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 176 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 177 /* ClassDeclaration */ ? container.parent : undefined; getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 119 /* Property */ || container.kind === 121 /* Constructor */) { + if (container.kind === 120 /* Property */ || container.kind === 122 /* Constructor */) { getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } else { @@ -12622,23 +12969,23 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 144 /* ArrowFunction */) { + if (container.kind === 145 /* ArrowFunction */) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = true; } switch (container.kind) { - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); break; - case 178 /* EnumDeclaration */: + case 180 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 121 /* Constructor */: + case 122 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 119 /* Property */: + case 120 /* Property */: if (container.flags & 128 /* Static */) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } @@ -12647,7 +12994,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } - var classNode = container.parent && container.parent.kind === 176 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 177 /* ClassDeclaration */ ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); @@ -12660,29 +13007,29 @@ var ts; if (!node) return node; switch (node.kind) { - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 175 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: + case 120 /* Property */: + case 121 /* Method */: + case 122 /* Constructor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: return node; } } } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 118 /* Parameter */) { + if (n.kind === 119 /* Parameter */) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 139 /* CallExpression */ && node.parent.func === node; - var enclosingClass = ts.getAncestor(node, 176 /* ClassDeclaration */); + var isCallExpression = node.parent.kind === 140 /* CallExpression */ && node.parent.func === node; + var enclosingClass = ts.getAncestor(node, 177 /* ClassDeclaration */); var baseClass; if (enclosingClass && enclosingClass.baseType) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); @@ -12696,20 +13043,20 @@ var ts; if (container) { var canUseSuperExpression = false; if (isCallExpression) { - canUseSuperExpression = container.kind === 121 /* Constructor */; + canUseSuperExpression = container.kind === 122 /* Constructor */; } else { var needToCaptureLexicalThis = false; - while (container && container.kind === 144 /* ArrowFunction */) { + while (container && container.kind === 145 /* ArrowFunction */) { container = getSuperContainer(container); needToCaptureLexicalThis = true; } - if (container && container.parent && container.parent.kind === 176 /* ClassDeclaration */) { + if (container && container.parent && container.parent.kind === 177 /* ClassDeclaration */) { if (container.flags & 128 /* Static */) { - canUseSuperExpression = container.kind === 120 /* Method */ || container.kind === 122 /* GetAccessor */ || container.kind === 123 /* SetAccessor */; + canUseSuperExpression = container.kind === 121 /* Method */ || container.kind === 123 /* GetAccessor */ || container.kind === 124 /* SetAccessor */; } else { - canUseSuperExpression = container.kind === 120 /* Method */ || container.kind === 122 /* GetAccessor */ || container.kind === 123 /* SetAccessor */ || container.kind === 119 /* Property */ || container.kind === 121 /* Constructor */; + canUseSuperExpression = container.kind === 121 /* Method */ || container.kind === 123 /* GetAccessor */ || container.kind === 124 /* SetAccessor */ || container.kind === 120 /* Property */ || container.kind === 122 /* Constructor */; } } } @@ -12723,7 +13070,7 @@ var ts; getNodeLinks(node).flags |= 16 /* SuperInstance */; returnType = baseClass; } - if (container.kind === 121 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 122 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); returnType = unknownType; } @@ -12743,7 +13090,7 @@ var ts; } function getContextuallyTypedParameterType(parameter) { var func = parameter.parent; - if (func.kind === 143 /* FunctionExpression */ || func.kind === 144 /* ArrowFunction */) { + if (func.kind === 144 /* FunctionExpression */ || func.kind === 145 /* ArrowFunction */) { if (isContextSensitiveExpression(func)) { var contextualSignature = getContextualSignature(func); if (contextualSignature) { @@ -12767,7 +13114,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 118 /* Parameter */) { + if (declaration.kind === 119 /* Parameter */) { return getContextuallyTypedParameterType(declaration); } } @@ -12776,7 +13123,7 @@ var ts; function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); if (func) { - if (func.type || func.kind === 121 /* Constructor */ || func.kind === 122 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 123 /* SetAccessor */))) { + if (func.type || func.kind === 122 /* Constructor */ || func.kind === 123 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 124 /* SetAccessor */))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } var signature = getContextualSignature(func); @@ -12882,25 +13229,25 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 173 /* VariableDeclaration */: - case 118 /* Parameter */: - case 119 /* Property */: + case 174 /* VariableDeclaration */: + case 119 /* Parameter */: + case 120 /* Property */: return getContextualTypeForInitializerExpression(node); - case 144 /* ArrowFunction */: - case 161 /* ReturnStatement */: + case 145 /* ArrowFunction */: + case 162 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 139 /* CallExpression */: - case 140 /* NewExpression */: + case 140 /* CallExpression */: + case 141 /* NewExpression */: return getContextualTypeForArgument(node); - case 141 /* TypeAssertion */: + case 142 /* TypeAssertion */: return getTypeFromTypeNode(parent.type); - case 147 /* BinaryExpression */: + case 148 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 136 /* PropertyAssignment */: + case 137 /* PropertyAssignment */: return getContextualTypeForPropertyExpression(node); - case 134 /* ArrayLiteral */: + case 135 /* ArrayLiteral */: return getContextualTypeForElementExpression(node); - case 148 /* ConditionalExpression */: + case 149 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); } return undefined; @@ -12962,9 +13309,9 @@ var ts; for (var id in members) { if (ts.hasProperty(members, id)) { var member = members[id]; - if (member.flags & 2 /* Property */) { + if (member.flags & 4 /* Property */) { var type = checkExpression(member.declarations[0].initializer, contextualMapper); - var prop = createSymbol(2 /* Property */ | 33554432 /* Transient */ | member.flags, member.name); + var prop = createSymbol(4 /* Property */ | 134217728 /* Transient */ | member.flags, member.name); prop.declarations = member.declarations; prop.parent = member.parent; if (member.valueDeclaration) @@ -12974,11 +13321,11 @@ var ts; member = prop; } else { - var getAccessor = getDeclarationOfKind(member, 122 /* GetAccessor */); + var getAccessor = getDeclarationOfKind(member, 123 /* GetAccessor */); if (getAccessor) { checkAccessorDeclaration(getAccessor); } - var setAccessor = getDeclarationOfKind(member, 123 /* SetAccessor */); + var setAccessor = getDeclarationOfKind(member, 124 /* SetAccessor */); if (setAccessor) { checkAccessorDeclaration(setAccessor); } @@ -13008,17 +13355,17 @@ var ts; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 119 /* Property */; + return s.valueDeclaration ? s.valueDeclaration.kind : 120 /* Property */; } function getDeclarationFlagsFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & 67108864 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; + return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & 268435456 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; } function checkClassPropertyAccess(node, type, prop) { var flags = getDeclarationFlagsFromSymbol(prop); if (!(flags & (32 /* Private */ | 64 /* Protected */))) { return; } - var enclosingClassDeclaration = ts.getAncestor(node, 176 /* ClassDeclaration */); + var enclosingClassDeclaration = ts.getAncestor(node, 177 /* ClassDeclaration */); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (flags & 32 /* Private */) { @@ -13058,8 +13405,8 @@ var ts; return unknownType; } getNodeLinks(node).resolvedSymbol = prop; - if (prop.parent && prop.parent.flags & 16 /* Class */) { - if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 120 /* Method */) { + if (prop.parent && prop.parent.flags & 32 /* Class */) { + if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 121 /* Method */) { error(node.right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } else { @@ -13074,8 +13421,8 @@ var ts; var type = checkExpression(node.left); if (type !== unknownType && type !== anyType) { var prop = getPropertyOfType(getWidenedType(type), propertyName); - if (prop && prop.parent && prop.parent.flags & 16 /* Class */) { - if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 120 /* Method */) { + if (prop && prop.parent && prop.parent.flags & 32 /* Class */) { + if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 121 /* Method */) { return false; } else { @@ -13164,7 +13511,7 @@ var ts; var context = createInferenceContext(typeParameters, false); var mapper = createInferenceMapper(context); for (var i = 0; i < args.length; i++) { - if (args[i].kind === 149 /* OmittedExpression */) { + if (args[i].kind === 150 /* OmittedExpression */) { continue; } if (!excludeArgument || excludeArgument[i] === undefined) { @@ -13174,7 +13521,7 @@ var ts; } if (excludeArgument) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 149 /* OmittedExpression */) { + if (args[i].kind === 150 /* OmittedExpression */) { continue; } if (excludeArgument[i] === false) { @@ -13204,7 +13551,7 @@ var ts; if (node.arguments) { for (var i = 0; i < node.arguments.length; i++) { var arg = node.arguments[i]; - if (arg.kind === 149 /* OmittedExpression */) { + if (arg.kind === 150 /* OmittedExpression */) { continue; } var paramType = getTypeAtPosition(signature, i); @@ -13377,7 +13724,7 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - links.resolvedSignature = node.kind === 139 /* CallExpression */ ? resolveCallExpression(node, candidatesOutArray) : resolveNewExpression(node, candidatesOutArray); + links.resolvedSignature = node.kind === 140 /* CallExpression */ ? resolveCallExpression(node, candidatesOutArray) : resolveNewExpression(node, candidatesOutArray); } return links.resolvedSignature; } @@ -13386,9 +13733,9 @@ var ts; if (node.func.kind === 85 /* SuperKeyword */) { return voidType; } - if (node.kind === 140 /* NewExpression */) { + if (node.kind === 141 /* NewExpression */) { var declaration = signature.declaration; - if (declaration && (declaration.kind !== 121 /* Constructor */ && declaration.kind !== 125 /* ConstructSignature */)) { + if (declaration && (declaration.kind !== 122 /* Constructor */ && declaration.kind !== 126 /* ConstructSignature */)) { if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -13426,7 +13773,7 @@ var ts; } function getReturnTypeFromBody(func, contextualMapper) { var contextualSignature = getContextualSignature(func); - if (func.body.kind !== 175 /* FunctionBlock */) { + if (func.body.kind !== 176 /* FunctionBlock */) { var unwidenedType = checkAndMarkExpression(func.body, contextualMapper); var widenedType = getWidenedType(unwidenedType); if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { @@ -13474,7 +13821,7 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 167 /* ThrowStatement */); + return (body.statements.length === 1) && (body.statements[0].kind === 168 /* ThrowStatement */); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!fullTypeCheck) { @@ -13483,7 +13830,7 @@ var ts; if (returnType === voidType || returnType === anyType) { return; } - if (!func.body || func.body.kind !== 175 /* FunctionBlock */) { + if (!func.body || func.body.kind !== 176 /* FunctionBlock */) { return; } var bodyBlock = func.body; @@ -13527,7 +13874,7 @@ var ts; if (node.type) { checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } - if (node.body.kind === 175 /* FunctionBlock */) { + if (node.body.kind === 176 /* FunctionBlock */) { checkSourceElement(node.body); } else { @@ -13545,7 +13892,7 @@ var ts; } return true; } - function checkReferenceExpression(n, message) { + function checkReferenceExpression(n, invalidReferenceMessage, constantVarianleMessage) { function findSymbol(n) { var symbol = getNodeLinks(n).resolvedSymbol; return symbol && getExportSymbolOfValueSymbolIfExported(symbol); @@ -13554,20 +13901,45 @@ var ts; switch (n.kind) { case 59 /* Identifier */: var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 1 /* Variable */) !== 0; - case 137 /* PropertyAccess */: + return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & ts.SymbolFlags.Variable) !== 0; + case 138 /* PropertyAccess */: var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || (symbol.flags & ~4 /* EnumMember */) !== 0; - case 138 /* IndexedAccess */: + return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0; + case 139 /* IndexedAccess */: return true; - case 142 /* ParenExpression */: + case 143 /* ParenExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; } } + function isConstVariableReference(n) { + switch (n.kind) { + case 59 /* Identifier */: + case 138 /* PropertyAccess */: + var symbol = findSymbol(n); + return symbol && (symbol.flags & ts.SymbolFlags.Variable) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 4096 /* Const */) !== 0; + case 139 /* IndexedAccess */: + var index = n.index; + var symbol = findSymbol(n.object); + if (symbol && index.kind === 7 /* StringLiteral */) { + var name = index.text; + var prop = getPropertyOfType(getTypeOfSymbol(symbol), name); + return prop && (prop.flags & ts.SymbolFlags.Variable) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 4096 /* Const */) !== 0; + } + return false; + case 143 /* ParenExpression */: + return isConstVariableReference(n.expression); + default: + return false; + } + } if (!isReferenceOrErrorExpression(n)) { - error(n, message); + error(n, invalidReferenceMessage); + return false; + } + if (isConstVariableReference(n)) { + error(n, constantVarianleMessage); return false; } return true; @@ -13590,7 +13962,7 @@ var ts; case 34 /* MinusMinusToken */: var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; } @@ -13600,7 +13972,7 @@ var ts; var operandType = checkExpression(node.operand); var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; } @@ -13736,7 +14108,7 @@ var ts; } function checkAssignmentOperator(valueType) { if (fullTypeCheck && operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { - var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression); + var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); if (ok) { checkTypeAssignableTo(valueType, leftType, node.left, undefined, undefined); } @@ -13799,35 +14171,35 @@ var ts; return stringType; case 8 /* RegularExpressionLiteral */: return globalRegExpType; - case 116 /* QualifiedName */: + case 117 /* QualifiedName */: return checkPropertyAccess(node); - case 134 /* ArrayLiteral */: + case 135 /* ArrayLiteral */: return checkArrayLiteral(node, contextualMapper); - case 135 /* ObjectLiteral */: + case 136 /* ObjectLiteral */: return checkObjectLiteral(node, contextualMapper); - case 137 /* PropertyAccess */: + case 138 /* PropertyAccess */: return checkPropertyAccess(node); - case 138 /* IndexedAccess */: + case 139 /* IndexedAccess */: return checkIndexedAccess(node); - case 139 /* CallExpression */: - case 140 /* NewExpression */: + case 140 /* CallExpression */: + case 141 /* NewExpression */: return checkCallExpression(node); - case 141 /* TypeAssertion */: + case 142 /* TypeAssertion */: return checkTypeAssertion(node); - case 142 /* ParenExpression */: + case 143 /* ParenExpression */: return checkExpression(node.expression); - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: return checkFunctionExpression(node, contextualMapper); - case 145 /* PrefixOperator */: + case 146 /* PrefixOperator */: return checkPrefixExpression(node); - case 146 /* PostfixOperator */: + case 147 /* PostfixOperator */: return checkPostfixExpression(node); - case 147 /* BinaryExpression */: + case 148 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 148 /* ConditionalExpression */: + case 149 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); - case 149 /* OmittedExpression */: + case 150 /* OmittedExpression */: return undefinedType; } return unknownType; @@ -13843,7 +14215,7 @@ var ts; checkVariableDeclaration(parameterDeclaration); if (fullTypeCheck) { checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); - if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */) && !(parameterDeclaration.parent.kind === 121 /* Constructor */ && parameterDeclaration.parent.body)) { + if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */) && !(parameterDeclaration.parent.kind === 122 /* Constructor */ && parameterDeclaration.parent.body)) { error(parameterDeclaration, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } if (parameterDeclaration.flags & 8 /* Rest */) { @@ -13861,7 +14233,7 @@ var ts; if (n.kind === 59 /* Identifier */) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, ts.SymbolFlags.Value) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 118 /* Parameter */) { + if (referencedSymbol.valueDeclaration.kind === 119 /* Parameter */) { if (referencedSymbol.valueDeclaration === parameterDeclaration) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.identifierToString(parameterDeclaration.name)); return; @@ -13895,10 +14267,10 @@ var ts; checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 125 /* ConstructSignature */: + case 126 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 124 /* CallSignature */: + case 125 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -13907,7 +14279,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 177 /* InterfaceDeclaration */) { + if (node.kind === 178 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -13963,17 +14335,17 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 139 /* CallExpression */ && n.func.kind === 85 /* SuperKeyword */; + return n.kind === 140 /* CallExpression */ && n.func.kind === 85 /* SuperKeyword */; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 143 /* FunctionExpression */: - case 174 /* FunctionDeclaration */: - case 144 /* ArrowFunction */: - case 135 /* ObjectLiteral */: + case 144 /* FunctionExpression */: + case 175 /* FunctionDeclaration */: + case 145 /* ArrowFunction */: + case 136 /* ObjectLiteral */: return false; default: return ts.forEachChild(n, containsSuperCall); @@ -13983,19 +14355,19 @@ var ts; if (n.kind === 87 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 143 /* FunctionExpression */ && n.kind !== 174 /* FunctionDeclaration */) { + else if (n.kind !== 144 /* FunctionExpression */ && n.kind !== 175 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 119 /* Property */ && !(n.flags & 128 /* Static */) && !!n.initializer; + return n.kind === 120 /* Property */ && !(n.flags & 128 /* Static */) && !!n.initializer; } if (node.parent.baseType) { if (containsSuperCall(node.body)) { var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */); }); if (superCallShouldBeFirst) { var statements = node.body.statements; - if (!statements.length || statements[0].kind !== 153 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 154 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); } else { @@ -14010,12 +14382,12 @@ var ts; } function checkAccessorDeclaration(node) { if (fullTypeCheck) { - if (node.kind === 122 /* GetAccessor */) { + if (node.kind === 123 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && node.body && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); } } - var otherKind = node.kind === 122 /* GetAccessor */ ? 123 /* SetAccessor */ : 122 /* GetAccessor */; + var otherKind = node.kind === 123 /* GetAccessor */ ? 124 /* SetAccessor */ : 123 /* GetAccessor */; var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if (((node.flags & ts.NodeFlags.AccessibilityModifier) !== (otherAccessor.flags & ts.NodeFlags.AccessibilityModifier))) { @@ -14084,9 +14456,9 @@ var ts; } var symbol = getSymbolOfNode(signatureDeclarationNode); var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 177 /* InterfaceDeclaration */) { - ts.Debug.assert(signatureDeclarationNode.kind === 124 /* CallSignature */ || signatureDeclarationNode.kind === 125 /* ConstructSignature */); - var signatureKind = signatureDeclarationNode.kind === 124 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 178 /* InterfaceDeclaration */) { + ts.Debug.assert(signatureDeclarationNode.kind === 125 /* CallSignature */ || signatureDeclarationNode.kind === 126 /* ConstructSignature */); + var signatureKind = signatureDeclarationNode.kind === 125 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -14104,7 +14476,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = n.flags; - if (n.parent.kind !== 177 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 178 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { if (!(flags & 2 /* Ambient */)) { flags |= 1 /* Export */; } @@ -14146,9 +14518,9 @@ var ts; var lastSeenNonAmbientDeclaration; var previousDeclaration; var declarations = symbol.declarations; - var isConstructor = (symbol.flags & 4096 /* Constructor */) !== 0; + var isConstructor = (symbol.flags & 8192 /* Constructor */) !== 0; function reportImplementationExpectedError(node) { - if (node.name && node.name.kind === 115 /* Missing */) { + if (node.name && node.name.kind === 116 /* Missing */) { return; } var seen = false; @@ -14164,7 +14536,7 @@ var ts; if (subsequentNode.kind === node.kind) { var errorNode = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - ts.Debug.assert(node.kind === 120 /* Method */); + ts.Debug.assert(node.kind === 121 /* Method */); ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */)); var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode, diagnostic); @@ -14190,11 +14562,11 @@ var ts; for (var i = 0; i < declarations.length; i++) { var node = declarations[i]; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 177 /* InterfaceDeclaration */ || node.parent.kind === 129 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 178 /* InterfaceDeclaration */ || node.parent.kind === 130 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 174 /* FunctionDeclaration */ || node.kind === 120 /* Method */ || node.kind === 121 /* Constructor */) { + if (node.kind === 175 /* FunctionDeclaration */ || node.kind === 121 /* Method */ || node.kind === 122 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -14288,14 +14660,14 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 177 /* InterfaceDeclaration */: - return 1048576 /* ExportType */; - case 179 /* ModuleDeclaration */: - return d.name.kind === 7 /* StringLiteral */ || ts.isInstantiated(d) ? 2097152 /* ExportNamespace */ | 524288 /* ExportValue */ : 2097152 /* ExportNamespace */; - case 176 /* ClassDeclaration */: - case 178 /* EnumDeclaration */: - return 1048576 /* ExportType */ | 524288 /* ExportValue */; - case 181 /* ImportDeclaration */: + case 178 /* InterfaceDeclaration */: + return 4194304 /* ExportType */; + case 181 /* ModuleDeclaration */: + return d.name.kind === 7 /* StringLiteral */ || ts.isInstantiated(d) ? 8388608 /* ExportNamespace */ | 2097152 /* ExportValue */ : 8388608 /* ExportNamespace */; + case 177 /* ClassDeclaration */: + case 180 /* EnumDeclaration */: + return 4194304 /* ExportType */ | 2097152 /* ExportValue */; + case 183 /* ImportDeclaration */: var result = 0; var target = resolveImport(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { @@ -14303,7 +14675,7 @@ var ts; }); return result; default: - return 524288 /* ExportValue */; + return 2097152 /* ExportValue */; } } } @@ -14353,7 +14725,7 @@ var ts; if (!(name && name.text === "_i")) { return; } - if (node.kind === 118 /* Parameter */) { + if (node.kind === 119 /* Parameter */) { if (node.parent.body && ts.hasRestParameters(node.parent) && !ts.isInAmbientContext(node)) { error(node, ts.Diagnostics.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter); } @@ -14370,11 +14742,11 @@ var ts; return; } switch (current.kind) { - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 120 /* Method */: - case 144 /* ArrowFunction */: - case 121 /* Constructor */: + case 175 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: + case 121 /* Method */: + case 145 /* ArrowFunction */: + case 122 /* Constructor */: if (ts.hasRestParameters(current)) { error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter); return; @@ -14388,13 +14760,13 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 119 /* Property */ || node.kind === 120 /* Method */ || node.kind === 122 /* GetAccessor */ || node.kind === 123 /* SetAccessor */) { + if (node.kind === 120 /* Property */ || node.kind === 121 /* Method */ || node.kind === 123 /* GetAccessor */ || node.kind === 124 /* SetAccessor */) { return false; } if (ts.isInAmbientContext(node)) { return false; } - if (node.kind === 118 /* Parameter */ && !node.parent.body) { + if (node.kind === 119 /* Parameter */ && !node.parent.body) { return false; } return true; @@ -14425,7 +14797,7 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = ts.getAncestor(node, 176 /* ClassDeclaration */); + var enclosingClass = ts.getAncestor(node, 177 /* ClassDeclaration */); if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } @@ -14443,14 +14815,27 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 179 /* ModuleDeclaration */ && !ts.isInstantiated(node)) { + if (node.kind === 181 /* ModuleDeclaration */ && !ts.isInstantiated(node)) { return; } - var parent = node.kind === 173 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (parent.kind === 184 /* SourceFile */ && ts.isExternalModule(parent)) { + var parent = node.kind === 174 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (parent.kind === 186 /* SourceFile */ && ts.isExternalModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, name.text, name.text); } } + function checkCollisionWithConstDeclarations(node) { + if (node.initializer && (node.flags & ts.NodeFlags.BlockScoped) === 0) { + var symbol = getSymbolOfNode(node); + if (symbol.flags & 1 /* FunctionScopedVariable */) { + var localDeclarationSymbol = resolveName(node, node.name.text, ts.SymbolFlags.Variable, undefined, undefined); + if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { + if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 4096 /* Const */) { + error(node, ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0, symbolToString(localDeclarationSymbol)); + } + } + } + } + } function checkVariableDeclaration(node) { checkSourceElement(node.type); checkExportsOnMergedDeclarations(node); @@ -14469,6 +14854,7 @@ var ts; if (!(getNodeLinks(node.initializer).flags & 1 /* TypeChecked */)) { checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, undefined, undefined); } + checkCollisionWithConstDeclarations(node); } checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); @@ -14523,7 +14909,7 @@ var ts; error(node.variable, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); } else { - checkReferenceExpression(node.variable, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement); + checkReferenceExpression(node.variable, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); } } var exprType = checkExpression(node.expression); @@ -14538,18 +14924,18 @@ var ts; if (node.expression && !(getNodeLinks(node.expression).flags & 1 /* TypeChecked */)) { var func = ts.getContainingFunction(node); if (func) { - if (func.kind === 123 /* SetAccessor */) { + if (func.kind === 124 /* SetAccessor */) { if (node.expression) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } } else { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); - var checkAssignability = func.type || (func.kind === 122 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 123 /* SetAccessor */))); + var checkAssignability = func.type || (func.kind === 123 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 124 /* SetAccessor */))); if (checkAssignability) { checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, undefined, undefined); } - else if (func.kind == 121 /* Constructor */) { + else if (func.kind == 122 /* Constructor */) { if (!isTypeAssignableTo(checkExpression(node.expression), returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -14709,13 +15095,13 @@ var ts; } } function getTargetSymbol(s) { - return s.flags & 8388608 /* Instantiated */ ? getSymbolLinks(s).target : s; + return s.flags & 33554432 /* Instantiated */ ? getSymbolLinks(s).target : s; } function checkKindsOfPropertyMemberOverrides(type, baseType) { var baseProperties = getPropertiesOfObjectType(baseType); for (var i = 0, len = baseProperties.length; i < len; ++i) { var base = getTargetSymbol(baseProperties[i]); - if (base.flags & 67108864 /* Prototype */) { + if (base.flags & 268435456 /* Prototype */) { continue; } var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); @@ -14728,26 +15114,26 @@ var ts; if ((baseDeclarationFlags & 128 /* Static */) !== (derivedDeclarationFlags & 128 /* Static */)) { continue; } - if ((base.flags & derived.flags & 2048 /* Method */) || ((base.flags & ts.SymbolFlags.PropertyOrAccessor) && (derived.flags & ts.SymbolFlags.PropertyOrAccessor))) { + if ((base.flags & derived.flags & 4096 /* Method */) || ((base.flags & ts.SymbolFlags.PropertyOrAccessor) && (derived.flags & ts.SymbolFlags.PropertyOrAccessor))) { continue; } var errorMessage; - if (base.flags & 2048 /* Method */) { + if (base.flags & 4096 /* Method */) { if (derived.flags & ts.SymbolFlags.Accessor) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - ts.Debug.assert(derived.flags & 2 /* Property */); + ts.Debug.assert(derived.flags & 4 /* Property */); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } - else if (base.flags & 2 /* Property */) { - ts.Debug.assert(derived.flags & 2048 /* Method */); + else if (base.flags & 4 /* Property */) { + ts.Debug.assert(derived.flags & 4096 /* Method */); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { ts.Debug.assert(base.flags & ts.SymbolFlags.Accessor); - ts.Debug.assert(derived.flags & 2048 /* Method */); + ts.Debug.assert(derived.flags & 4096 /* Method */); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); @@ -14755,7 +15141,7 @@ var ts; } } function isAccessor(kind) { - return kind === 122 /* GetAccessor */ || kind === 123 /* SetAccessor */; + return kind === 123 /* GetAccessor */ || kind === 124 /* SetAccessor */; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -14788,7 +15174,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = getDeclarationOfKind(symbol, 177 /* InterfaceDeclaration */); + var firstInterfaceDecl = getDeclarationOfKind(symbol, 178 /* InterfaceDeclaration */); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); @@ -14810,9 +15196,12 @@ var ts; checkTypeForDuplicateIndexSignatures(node); } } + function checkTypeAliasDeclaration(node) { + checkSourceElement(node.type); + } function getConstantValueForExpression(node) { var isNegative = false; - if (node.kind === 145 /* PrefixOperator */) { + if (node.kind === 146 /* PrefixOperator */) { var unaryExpression = node; if (unaryExpression.operator === 29 /* MinusToken */ || unaryExpression.operator === 28 /* PlusToken */) { node = unaryExpression.operand; @@ -14867,7 +15256,7 @@ var ts; if (node === firstDeclaration) { var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 178 /* EnumDeclaration */) { + if (declaration.kind !== 180 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -14890,7 +15279,7 @@ var ts; var declarations = symbol.declarations; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; - if ((declaration.kind === 176 /* ClassDeclaration */ || (declaration.kind === 174 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 177 /* ClassDeclaration */ || (declaration.kind === 175 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { return declaration; } } @@ -14902,7 +15291,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - if (symbol.flags & 128 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { + if (symbol.flags & 256 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (classOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { @@ -14925,7 +15314,7 @@ var ts; checkSourceElement(node.body); } function getFirstIdentifier(node) { - while (node.kind === 116 /* QualifiedName */) { + while (node.kind === 117 /* QualifiedName */) { node = node.left; } return node; @@ -14953,10 +15342,10 @@ var ts; } } else { - if (node.parent.kind === 184 /* SourceFile */) { + if (node.parent.kind === 186 /* SourceFile */) { target = resolveImport(symbol); } - else if (node.parent.kind === 180 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { + else if (node.parent.kind === 182 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { if (isExternalModuleNameRelative(node.externalModuleName.text)) { error(node, ts.Diagnostics.Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); target = unknownSymbol; @@ -14978,7 +15367,7 @@ var ts; } function checkExportAssignment(node) { var container = node.parent; - if (container.kind !== 184 /* SourceFile */) { + if (container.kind !== 186 /* SourceFile */) { container = container.parent; } checkTypeOfExportAssignmentSymbol(getSymbolOfNode(container)); @@ -14987,148 +15376,150 @@ var ts; if (!node) return; switch (node.kind) { - case 117 /* TypeParameter */: + case 118 /* TypeParameter */: return checkTypeParameter(node); - case 118 /* Parameter */: + case 119 /* Parameter */: return checkParameter(node); - case 119 /* Property */: + case 120 /* Property */: return checkPropertyDeclaration(node); - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: + case 125 /* CallSignature */: + case 126 /* ConstructSignature */: + case 127 /* IndexSignature */: return checkSignatureDeclaration(node); - case 120 /* Method */: + case 121 /* Method */: return checkMethodDeclaration(node); - case 121 /* Constructor */: + case 122 /* Constructor */: return checkConstructorDeclaration(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: return checkAccessorDeclaration(node); - case 127 /* TypeReference */: + case 128 /* TypeReference */: return checkTypeReference(node); - case 128 /* TypeQuery */: + case 129 /* TypeQuery */: return checkTypeQuery(node); - case 129 /* TypeLiteral */: + case 130 /* TypeLiteral */: return checkTypeLiteral(node); - case 130 /* ArrayType */: + case 131 /* ArrayType */: return checkArrayType(node); - case 131 /* TupleType */: + case 132 /* TupleType */: return checkTupleType(node); - case 132 /* UnionType */: + case 133 /* UnionType */: return checkUnionType(node); - case 133 /* ParenType */: + case 134 /* ParenType */: return checkSourceElement(node.type); - case 174 /* FunctionDeclaration */: + case 175 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 150 /* Block */: + case 151 /* Block */: return checkBlock(node); - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: + case 176 /* FunctionBlock */: + case 182 /* ModuleBlock */: return checkBody(node); - case 151 /* VariableStatement */: + case 152 /* VariableStatement */: return checkVariableStatement(node); - case 153 /* ExpressionStatement */: + case 154 /* ExpressionStatement */: return checkExpressionStatement(node); - case 154 /* IfStatement */: + case 155 /* IfStatement */: return checkIfStatement(node); - case 155 /* DoStatement */: + case 156 /* DoStatement */: return checkDoStatement(node); - case 156 /* WhileStatement */: + case 157 /* WhileStatement */: return checkWhileStatement(node); - case 157 /* ForStatement */: + case 158 /* ForStatement */: return checkForStatement(node); - case 158 /* ForInStatement */: + case 159 /* ForInStatement */: return checkForInStatement(node); - case 159 /* ContinueStatement */: - case 160 /* BreakStatement */: + case 160 /* ContinueStatement */: + case 161 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 161 /* ReturnStatement */: + case 162 /* ReturnStatement */: return checkReturnStatement(node); - case 162 /* WithStatement */: + case 163 /* WithStatement */: return checkWithStatement(node); - case 163 /* SwitchStatement */: + case 164 /* SwitchStatement */: return checkSwitchStatement(node); - case 166 /* LabeledStatement */: + case 167 /* LabeledStatement */: return checkLabeledStatement(node); - case 167 /* ThrowStatement */: + case 168 /* ThrowStatement */: return checkThrowStatement(node); - case 168 /* TryStatement */: + case 169 /* TryStatement */: return checkTryStatement(node); - case 173 /* VariableDeclaration */: + case 174 /* VariableDeclaration */: return ts.Debug.fail("Checker encountered variable declaration"); - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: return checkClassDeclaration(node); - case 177 /* InterfaceDeclaration */: + case 178 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 178 /* EnumDeclaration */: + case 179 /* TypeAliasDeclaration */: + return checkTypeAliasDeclaration(node); + case 180 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 181 /* ImportDeclaration */: + case 183 /* ImportDeclaration */: return checkImportDeclaration(node); - case 182 /* ExportAssignment */: + case 184 /* ExportAssignment */: return checkExportAssignment(node); } } function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionBody(node); break; - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 174 /* FunctionDeclaration */: + case 121 /* Method */: + case 122 /* Constructor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 175 /* FunctionDeclaration */: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 162 /* WithStatement */: + case 163 /* WithStatement */: checkFunctionExpressionBodies(node.expression); break; - case 118 /* Parameter */: - case 119 /* Property */: - case 134 /* ArrayLiteral */: - case 135 /* ObjectLiteral */: - case 136 /* PropertyAssignment */: - case 137 /* PropertyAccess */: - case 138 /* IndexedAccess */: - case 139 /* CallExpression */: - case 140 /* NewExpression */: - case 141 /* TypeAssertion */: - case 142 /* ParenExpression */: - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: - case 147 /* BinaryExpression */: - case 148 /* ConditionalExpression */: - case 150 /* Block */: - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: - case 151 /* VariableStatement */: - case 153 /* ExpressionStatement */: - case 154 /* IfStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 157 /* ForStatement */: - case 158 /* ForInStatement */: - case 159 /* ContinueStatement */: - case 160 /* BreakStatement */: - case 161 /* ReturnStatement */: - case 163 /* SwitchStatement */: - case 164 /* CaseClause */: - case 165 /* DefaultClause */: - case 166 /* LabeledStatement */: - case 167 /* ThrowStatement */: - case 168 /* TryStatement */: - case 169 /* TryBlock */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: - case 173 /* VariableDeclaration */: - case 176 /* ClassDeclaration */: - case 178 /* EnumDeclaration */: - case 183 /* EnumMember */: - case 184 /* SourceFile */: + case 119 /* Parameter */: + case 120 /* Property */: + case 135 /* ArrayLiteral */: + case 136 /* ObjectLiteral */: + case 137 /* PropertyAssignment */: + case 138 /* PropertyAccess */: + case 139 /* IndexedAccess */: + case 140 /* CallExpression */: + case 141 /* NewExpression */: + case 142 /* TypeAssertion */: + case 143 /* ParenExpression */: + case 146 /* PrefixOperator */: + case 147 /* PostfixOperator */: + case 148 /* BinaryExpression */: + case 149 /* ConditionalExpression */: + case 151 /* Block */: + case 176 /* FunctionBlock */: + case 182 /* ModuleBlock */: + case 152 /* VariableStatement */: + case 154 /* ExpressionStatement */: + case 155 /* IfStatement */: + case 156 /* DoStatement */: + case 157 /* WhileStatement */: + case 158 /* ForStatement */: + case 159 /* ForInStatement */: + case 160 /* ContinueStatement */: + case 161 /* BreakStatement */: + case 162 /* ReturnStatement */: + case 164 /* SwitchStatement */: + case 165 /* CaseClause */: + case 166 /* DefaultClause */: + case 167 /* LabeledStatement */: + case 168 /* ThrowStatement */: + case 169 /* TryStatement */: + case 170 /* TryBlock */: + case 171 /* CatchBlock */: + case 172 /* FinallyBlock */: + case 174 /* VariableDeclaration */: + case 177 /* ClassDeclaration */: + case 180 /* EnumDeclaration */: + case 185 /* EnumMember */: + case 186 /* SourceFile */: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -15145,7 +15536,7 @@ var ts; checkBody(node); if (ts.isExternalModule(node)) { var symbol = getExportAssignmentSymbol(node.symbol); - if (symbol && symbol.flags & 4194304 /* Import */) { + if (symbol && symbol.flags & 16777216 /* Import */) { getSymbolLinks(symbol).referenced = true; } } @@ -15199,7 +15590,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 162 /* WithStatement */ && node.parent.statement === node) { + if (node.parent.kind === 163 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -15235,27 +15626,27 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 184 /* SourceFile */: + case 186 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & ts.SymbolFlags.ModuleMember); break; - case 178 /* EnumDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & 4 /* EnumMember */); + case 180 /* EnumDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: if (!(memberFlags & 128 /* Static */)) { copySymbols(getSymbolOfNode(location).members, meaning & ts.SymbolFlags.Type); } break; - case 143 /* FunctionExpression */: + case 144 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } break; - case 170 /* CatchBlock */: + case 171 /* CatchBlock */: if (location.variable.text) { copySymbol(location.symbol, meaning); } @@ -15272,85 +15663,19 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 117 /* TypeParameter */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: + case 118 /* TypeParameter */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 179 /* TypeAliasDeclaration */: + case 180 /* EnumDeclaration */: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 116 /* QualifiedName */) + while (node.parent && node.parent.kind === 117 /* QualifiedName */) node = node.parent; - return node.parent && node.parent.kind === 127 /* TypeReference */; - } - function isExpression(node) { - switch (node.kind) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: - case 8 /* RegularExpressionLiteral */: - case 134 /* ArrayLiteral */: - case 135 /* ObjectLiteral */: - case 137 /* PropertyAccess */: - case 138 /* IndexedAccess */: - case 139 /* CallExpression */: - case 140 /* NewExpression */: - case 141 /* TypeAssertion */: - case 142 /* ParenExpression */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: - case 147 /* BinaryExpression */: - case 148 /* ConditionalExpression */: - case 149 /* OmittedExpression */: - return true; - case 116 /* QualifiedName */: - while (node.parent.kind === 116 /* QualifiedName */) - node = node.parent; - return node.parent.kind === 128 /* TypeQuery */; - case 59 /* Identifier */: - if (node.parent.kind === 128 /* TypeQuery */) { - return true; - } - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - var parent = node.parent; - switch (parent.kind) { - case 173 /* VariableDeclaration */: - case 118 /* Parameter */: - case 119 /* Property */: - case 183 /* EnumMember */: - case 136 /* PropertyAssignment */: - return parent.initializer === node; - case 153 /* ExpressionStatement */: - case 154 /* IfStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 161 /* ReturnStatement */: - case 162 /* WithStatement */: - case 163 /* SwitchStatement */: - case 164 /* CaseClause */: - case 167 /* ThrowStatement */: - case 163 /* SwitchStatement */: - return parent.expression === node; - case 157 /* ForStatement */: - return parent.initializer === node || parent.condition === node || parent.iterator === node; - case 158 /* ForInStatement */: - return parent.variable === node || parent.expression === node; - case 141 /* TypeAssertion */: - return node === parent.operand; - default: - if (isExpression(parent)) { - return true; - } - } - } - return false; + return node.parent && node.parent.kind === 128 /* TypeReference */; } function isTypeNode(node) { if (ts.SyntaxKind.FirstTypeNode <= node.kind && node.kind <= ts.SyntaxKind.LastTypeNode) { @@ -15363,71 +15688,71 @@ var ts; case 106 /* BooleanKeyword */: return true; case 93 /* VoidKeyword */: - return node.parent.kind !== 145 /* PrefixOperator */; + return node.parent.kind !== 146 /* PrefixOperator */; case 7 /* StringLiteral */: - return node.parent.kind === 118 /* Parameter */; + return node.parent.kind === 119 /* Parameter */; case 59 /* Identifier */: - if (node.parent.kind === 116 /* QualifiedName */) { + if (node.parent.kind === 117 /* QualifiedName */) { node = node.parent; } - case 116 /* QualifiedName */: - ts.Debug.assert(node.kind === 59 /* Identifier */ || node.kind === 116 /* QualifiedName */, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); + case 117 /* QualifiedName */: + ts.Debug.assert(node.kind === 59 /* Identifier */ || node.kind === 117 /* QualifiedName */, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); var parent = node.parent; - if (parent.kind === 128 /* TypeQuery */) { + if (parent.kind === 129 /* TypeQuery */) { return false; } if (ts.SyntaxKind.FirstTypeNode <= parent.kind && parent.kind <= ts.SyntaxKind.LastTypeNode) { return true; } switch (parent.kind) { - case 117 /* TypeParameter */: + case 118 /* TypeParameter */: return node === parent.constraint; - case 119 /* Property */: - case 118 /* Parameter */: - case 173 /* VariableDeclaration */: + case 120 /* Property */: + case 119 /* Parameter */: + case 174 /* VariableDeclaration */: return node === parent.type; - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - case 121 /* Constructor */: - case 120 /* Method */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 175 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: + case 122 /* Constructor */: + case 121 /* Method */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: return node === parent.type; - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: + case 125 /* CallSignature */: + case 126 /* ConstructSignature */: + case 127 /* IndexSignature */: return node === parent.type; - case 141 /* TypeAssertion */: + case 142 /* TypeAssertion */: return node === parent.type; - case 139 /* CallExpression */: - case 140 /* NewExpression */: + case 140 /* CallExpression */: + case 141 /* NewExpression */: return parent.typeArguments && parent.typeArguments.indexOf(node) >= 0; } } return false; } function isInRightSideOfImportOrExportAssignment(node) { - while (node.parent.kind === 116 /* QualifiedName */) { + while (node.parent.kind === 117 /* QualifiedName */) { node = node.parent; } - if (node.parent.kind === 181 /* ImportDeclaration */) { + if (node.parent.kind === 183 /* ImportDeclaration */) { return node.parent.entityName === node; } - if (node.parent.kind === 182 /* ExportAssignment */) { + if (node.parent.kind === 184 /* ExportAssignment */) { return node.parent.exportName === node; } return false; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 116 /* QualifiedName */ || node.parent.kind === 137 /* PropertyAccess */) && node.parent.right === node; + return (node.parent.kind === 117 /* QualifiedName */ || node.parent.kind === 138 /* PropertyAccess */) && node.parent.right === node; } function getSymbolOfEntityName(entityName) { if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 182 /* ExportAssignment */) { - return resolveEntityName(entityName.parent.parent, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace | 4194304 /* Import */); + if (entityName.parent.kind === 184 /* ExportAssignment */) { + return resolveEntityName(entityName.parent.parent, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace | 16777216 /* Import */); } if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImport(entityName); @@ -15435,12 +15760,12 @@ var ts; if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (isExpression(entityName)) { + if (ts.isExpression(entityName)) { if (entityName.kind === 59 /* Identifier */) { - var meaning = ts.SymbolFlags.Value | 4194304 /* Import */; + var meaning = ts.SymbolFlags.Value | 16777216 /* Import */; return resolveEntityName(entityName, entityName, meaning); } - else if (entityName.kind === 116 /* QualifiedName */ || entityName.kind === 137 /* PropertyAccess */) { + else if (entityName.kind === 117 /* QualifiedName */ || entityName.kind === 138 /* PropertyAccess */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccess(entityName); @@ -15452,8 +15777,8 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 127 /* TypeReference */ ? ts.SymbolFlags.Type : ts.SymbolFlags.Namespace; - meaning |= 4194304 /* Import */; + var meaning = entityName.parent.kind === 128 /* TypeReference */ ? ts.SymbolFlags.Type : ts.SymbolFlags.Namespace; + meaning |= 16777216 /* Import */; return resolveEntityName(entityName, entityName, meaning); } return undefined; @@ -15466,12 +15791,12 @@ var ts; return getSymbolOfNode(node.parent); } if (node.kind === 59 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 182 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); + return node.parent.kind === 184 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); } switch (node.kind) { case 59 /* Identifier */: - case 137 /* PropertyAccess */: - case 116 /* QualifiedName */: + case 138 /* PropertyAccess */: + case 117 /* QualifiedName */: return getSymbolOfEntityName(node); case 87 /* ThisKeyword */: case 85 /* SuperKeyword */: @@ -15479,18 +15804,18 @@ var ts; return type.symbol; case 107 /* ConstructorKeyword */: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 121 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 122 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; case 7 /* StringLiteral */: - if (node.parent.kind === 181 /* ImportDeclaration */ && node.parent.externalModuleName === node) { + if (node.parent.kind === 183 /* ImportDeclaration */ && node.parent.externalModuleName === node) { var importSymbol = getSymbolOfNode(node.parent); var moduleType = getTypeOfSymbol(importSymbol); return moduleType ? moduleType.symbol : undefined; } case 6 /* NumericLiteral */: - if (node.parent.kind == 138 /* IndexedAccess */ && node.parent.index === node) { + if (node.parent.kind == 139 /* IndexedAccess */ && node.parent.index === node) { var objectType = checkExpression(node.parent.object); if (objectType === unknownType) return undefined; @@ -15507,7 +15832,7 @@ var ts; if (isInsideWithStatementBody(node)) { return unknownType; } - if (isExpression(node)) { + if (ts.isExpression(node)) { return getTypeOfExpression(node); } if (isTypeNode(node)) { @@ -15555,7 +15880,7 @@ var ts; return getNamedMembers(propsByName); } function getRootSymbols(symbol) { - if (symbol.flags & 134217728 /* UnionProperty */) { + if (symbol.flags & 536870912 /* UnionProperty */) { var symbols = []; var name = symbol.name; ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { @@ -15563,7 +15888,7 @@ var ts; }); return symbols; } - else if (symbol.flags & 33554432 /* Transient */) { + else if (symbol.flags & 134217728 /* Transient */) { var target = getSymbolLinks(symbol).target; if (target) { return [target]; @@ -15572,7 +15897,7 @@ var ts; return [symbol]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 128 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 184 /* SourceFile */; + return symbol.flags & 256 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 186 /* SourceFile */; } function isNodeDescendentOf(node, ancestor) { while (node) { @@ -15584,7 +15909,7 @@ var ts; } function isUniqueLocalName(name, container) { for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (ts.SymbolFlags.Value | 524288 /* ExportValue */)) { + if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (ts.SymbolFlags.Value | 2097152 /* ExportValue */)) { return false; } } @@ -15605,7 +15930,7 @@ var ts; function getLocalNameForSymbol(symbol, location) { var node = location; while (node) { - if ((node.kind === 179 /* ModuleDeclaration */ || node.kind === 178 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { + if ((node.kind === 181 /* ModuleDeclaration */ || node.kind === 180 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { return getLocalNameOfContainer(node); } node = node.parent; @@ -15629,7 +15954,7 @@ var ts; return symbol && symbolIsValue(symbol) ? symbolToString(symbol) : undefined; } function isTopLevelValueImportedViaEntityName(node) { - if (node.parent.kind !== 184 /* SourceFile */ || !node.entityName) { + if (node.parent.kind !== 186 /* SourceFile */ || !node.entityName) { return false; } var symbol = getSymbolOfNode(node); @@ -15639,6 +15964,9 @@ var ts; function hasSemanticErrors() { return getDiagnostics().length > 0 || getGlobalDiagnostics().length > 0; } + function hasEarlyErrors(sourceFile) { + return ts.forEach(getDiagnostics(sourceFile), function (d) { return d.isEarly; }); + } function isReferencedImportDeclaration(node) { var symbol = getSymbolOfNode(node); if (getSymbolLinks(symbol).referenced) { @@ -15669,10 +15997,10 @@ var ts; } function getConstantValue(node) { var symbol = getNodeLinks(node).resolvedSymbol; - if (symbol && (symbol.flags & 4 /* EnumMember */)) { + if (symbol && (symbol.flags & 8 /* EnumMember */)) { var declaration = symbol.valueDeclaration; var constantValue; - if (declaration.kind === 183 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { + if (declaration.kind === 185 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { return constantValue; } } @@ -15680,7 +16008,7 @@ var ts; } function writeTypeAtLocation(location, enclosingDeclaration, flags, writer) { var symbol = getSymbolOfNode(location); - var type = symbol && !(symbol.flags & 512 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); + var type = symbol && !(symbol.flags & 1024 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { @@ -15698,6 +16026,7 @@ var ts; getEnumMemberValue: getEnumMemberValue, isTopLevelValueImportedViaEntityName: isTopLevelValueImportedViaEntityName, hasSemanticErrors: hasSemanticErrors, + hasEarlyErrors: hasEarlyErrors, isDeclarationVisible: isDeclarationVisible, isImplementationOfOverload: isImplementationOfOverload, writeTypeAtLocation: writeTypeAtLocation, @@ -15837,10 +16166,10 @@ var ts; { name: "target", shortName: "t", - type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */ }, - description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_or_ES5, + type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */, "es6": 2 /* ES6 */ }, + description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: ts.Diagnostics.VERSION, - error: ts.Diagnostics.Argument_for_target_option_must_be_es3_or_es5 + error: ts.Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6 }, { name: "version", @@ -15904,9 +16233,10 @@ var ts; options[opt.name] = args[i++] || ""; break; default: - var value = (args[i++] || "").toLowerCase(); - if (ts.hasProperty(opt.type, value)) { - options[opt.name] = opt.type[value]; + var map = opt.type; + var key = (args[i++] || "").toLowerCase(); + if (ts.hasProperty(map, key)) { + options[opt.name] = map[key]; } else { errors.push(ts.createCompilerDiagnostic(opt.error)); @@ -16222,13 +16552,18 @@ var ts; else { var checker = program.getTypeChecker(true); var checkStart = new Date().getTime(); - var semanticErrors = checker.getDiagnostics(); - var emitStart = new Date().getTime(); - var emitOutput = checker.emitFiles(); - var emitErrors = emitOutput.errors; - exitStatus = emitOutput.emitResultStatus; - var reportStart = new Date().getTime(); - errors = ts.concatenate(semanticErrors, emitErrors); + errors = checker.getDiagnostics(); + if (!checker.hasEarlyErrors()) { + var emitStart = new Date().getTime(); + var emitOutput = checker.emitFiles(); + var emitErrors = emitOutput.errors; + exitStatus = emitOutput.emitResultStatus; + var reportStart = new Date().getTime(); + errors = ts.concatenate(errors, emitErrors); + } + else { + exitStatus = 1 /* AllOutputGenerationSkipped */; + } } reportDiagnostics(errors); if (commandLine.options.diagnostics) { diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index 6bd9677a26a..661017b48b7 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -128,7 +128,13 @@ var ts; 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: 1150, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - An_enum_member_cannot_have_a_numeric_name: { code: 1151, category: 1 /* Error */, key: "An enum member cannot have a numeric name." }, + var_let_or_const_expected: { code: 1152, category: 1 /* Error */, key: "'var', 'let' or 'const' expected." }, + let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1 /* Error */, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1 /* Error */, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_must_be_initialized: { code: 1155, category: 1 /* Error */, key: "'const' declarations must be initialized" }, + const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1 /* Error */, key: "'const' declarations can only be declared inside a block." }, + let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1 /* Error */, key: "'let' declarations can only be declared inside a block." }, + Aliased_type_cannot_be_an_object_type_literal_Use_an_interface_declaration_instead: { code: 1158, category: 1 /* Error */, key: "Aliased type cannot be an object type literal. Use an interface declaration 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." }, @@ -275,6 +281,12 @@ var ts; Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1 /* Error */, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, + Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: 1 /* Error */, key: "Block-scoped variable '{0}' used before its declaration.", isEarly: true }, + The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: 1 /* Error */, key: "The operand of an increment or decrement operator cannot be a constant.", isEarly: true }, + Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: 1 /* Error */, key: "Left-hand side of assignment expression cannot be a constant.", isEarly: true }, + Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: 1 /* Error */, key: "Cannot redeclare block-scoped variable '{0}'.", isEarly: true }, + An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: 1 /* Error */, key: "An enum member cannot have a numeric name." }, + Type_alias_0_circularly_references_itself: { code: 2453, category: 1 /* Error */, key: "Type alias '{0}' circularly references itself." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1 /* Error */, key: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, @@ -354,6 +366,9 @@ var ts; Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, + Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4079, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2: { code: 4080, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using private name '{1}'." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: 1 /* Error */, key: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1 /* Error */, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: 1 /* Error */, key: "Cannot read file '{0}': {1}" }, @@ -369,7 +384,7 @@ var ts; Watch_input_files: { code: 6005, category: 2 /* Message */, key: "Watch input files." }, Redirect_output_structure_to_the_directory: { code: 6006, category: 2 /* Message */, key: "Redirect output structure to the directory." }, Do_not_emit_comments_to_output: { code: 6009, category: 2 /* Message */, key: "Do not emit comments to output." }, - Specify_ECMAScript_target_version_Colon_ES3_default_or_ES5: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), or 'ES5'" }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2 /* Message */, key: "Specify module code generation: 'commonjs' or 'amd'" }, Print_this_message: { code: 6017, category: 2 /* Message */, key: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: 2 /* Message */, key: "Print the compiler's version." }, @@ -391,7 +406,7 @@ var ts; Compiler_option_0_expects_an_argument: { code: 6044, category: 1 /* Error */, key: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1 /* Error */, key: "Unterminated quoted string in response file '{0}'." }, Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_or_es5: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3' or 'es5'." }, + Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: 1 /* Error */, key: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: 1 /* Error */, key: "Unable to open file '{0}'." }, @@ -470,6 +485,7 @@ var ts; "throw": 88 /* ThrowKeyword */, "true": 89 /* TrueKeyword */, "try": 90 /* TryKeyword */, + "type": 115 /* TypeKeyword */, "typeof": 91 /* TypeOfKeyword */, "var": 92 /* VarKeyword */, "void": 93 /* VoidKeyword */, @@ -1476,85 +1492,87 @@ var ts; SyntaxKind[SyntaxKind["NumberKeyword"] = 112] = "NumberKeyword"; SyntaxKind[SyntaxKind["SetKeyword"] = 113] = "SetKeyword"; SyntaxKind[SyntaxKind["StringKeyword"] = 114] = "StringKeyword"; - SyntaxKind[SyntaxKind["Missing"] = 115] = "Missing"; - SyntaxKind[SyntaxKind["QualifiedName"] = 116] = "QualifiedName"; - SyntaxKind[SyntaxKind["TypeParameter"] = 117] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 118] = "Parameter"; - SyntaxKind[SyntaxKind["Property"] = 119] = "Property"; - SyntaxKind[SyntaxKind["Method"] = 120] = "Method"; - SyntaxKind[SyntaxKind["Constructor"] = 121] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 122] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 123] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 124] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 125] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 126] = "IndexSignature"; - SyntaxKind[SyntaxKind["TypeReference"] = 127] = "TypeReference"; - SyntaxKind[SyntaxKind["TypeQuery"] = 128] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 129] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 130] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 131] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 132] = "UnionType"; - SyntaxKind[SyntaxKind["ParenType"] = 133] = "ParenType"; - SyntaxKind[SyntaxKind["ArrayLiteral"] = 134] = "ArrayLiteral"; - SyntaxKind[SyntaxKind["ObjectLiteral"] = 135] = "ObjectLiteral"; - SyntaxKind[SyntaxKind["PropertyAssignment"] = 136] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["PropertyAccess"] = 137] = "PropertyAccess"; - SyntaxKind[SyntaxKind["IndexedAccess"] = 138] = "IndexedAccess"; - SyntaxKind[SyntaxKind["CallExpression"] = 139] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 140] = "NewExpression"; - SyntaxKind[SyntaxKind["TypeAssertion"] = 141] = "TypeAssertion"; - SyntaxKind[SyntaxKind["ParenExpression"] = 142] = "ParenExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 143] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 144] = "ArrowFunction"; - SyntaxKind[SyntaxKind["PrefixOperator"] = 145] = "PrefixOperator"; - SyntaxKind[SyntaxKind["PostfixOperator"] = 146] = "PostfixOperator"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 147] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 148] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 149] = "OmittedExpression"; - SyntaxKind[SyntaxKind["Block"] = 150] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 151] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 152] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 153] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 154] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 155] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 156] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 157] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 158] = "ForInStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 159] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 160] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 161] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 162] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 163] = "SwitchStatement"; - SyntaxKind[SyntaxKind["CaseClause"] = 164] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 165] = "DefaultClause"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 166] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 167] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 168] = "TryStatement"; - SyntaxKind[SyntaxKind["TryBlock"] = 169] = "TryBlock"; - SyntaxKind[SyntaxKind["CatchBlock"] = 170] = "CatchBlock"; - SyntaxKind[SyntaxKind["FinallyBlock"] = 171] = "FinallyBlock"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 172] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 173] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 174] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["FunctionBlock"] = 175] = "FunctionBlock"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 176] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 177] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 178] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 179] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 180] = "ModuleBlock"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 181] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 182] = "ExportAssignment"; - SyntaxKind[SyntaxKind["EnumMember"] = 183] = "EnumMember"; - SyntaxKind[SyntaxKind["SourceFile"] = 184] = "SourceFile"; - SyntaxKind[SyntaxKind["Program"] = 185] = "Program"; - SyntaxKind[SyntaxKind["SyntaxList"] = 186] = "SyntaxList"; - SyntaxKind[SyntaxKind["Count"] = 187] = "Count"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 115] = "TypeKeyword"; + SyntaxKind[SyntaxKind["Missing"] = 116] = "Missing"; + SyntaxKind[SyntaxKind["QualifiedName"] = 117] = "QualifiedName"; + SyntaxKind[SyntaxKind["TypeParameter"] = 118] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 119] = "Parameter"; + SyntaxKind[SyntaxKind["Property"] = 120] = "Property"; + SyntaxKind[SyntaxKind["Method"] = 121] = "Method"; + SyntaxKind[SyntaxKind["Constructor"] = 122] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 123] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 124] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 125] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 126] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 127] = "IndexSignature"; + SyntaxKind[SyntaxKind["TypeReference"] = 128] = "TypeReference"; + SyntaxKind[SyntaxKind["TypeQuery"] = 129] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 130] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 131] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 132] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 133] = "UnionType"; + SyntaxKind[SyntaxKind["ParenType"] = 134] = "ParenType"; + SyntaxKind[SyntaxKind["ArrayLiteral"] = 135] = "ArrayLiteral"; + SyntaxKind[SyntaxKind["ObjectLiteral"] = 136] = "ObjectLiteral"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 137] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["PropertyAccess"] = 138] = "PropertyAccess"; + SyntaxKind[SyntaxKind["IndexedAccess"] = 139] = "IndexedAccess"; + SyntaxKind[SyntaxKind["CallExpression"] = 140] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 141] = "NewExpression"; + SyntaxKind[SyntaxKind["TypeAssertion"] = 142] = "TypeAssertion"; + SyntaxKind[SyntaxKind["ParenExpression"] = 143] = "ParenExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 144] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 145] = "ArrowFunction"; + SyntaxKind[SyntaxKind["PrefixOperator"] = 146] = "PrefixOperator"; + SyntaxKind[SyntaxKind["PostfixOperator"] = 147] = "PostfixOperator"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 148] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 149] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 150] = "OmittedExpression"; + SyntaxKind[SyntaxKind["Block"] = 151] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 152] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 153] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 154] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 155] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 156] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 157] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 158] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 159] = "ForInStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 160] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 161] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 162] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 163] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 164] = "SwitchStatement"; + SyntaxKind[SyntaxKind["CaseClause"] = 165] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 166] = "DefaultClause"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 167] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 168] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 169] = "TryStatement"; + SyntaxKind[SyntaxKind["TryBlock"] = 170] = "TryBlock"; + SyntaxKind[SyntaxKind["CatchBlock"] = 171] = "CatchBlock"; + SyntaxKind[SyntaxKind["FinallyBlock"] = 172] = "FinallyBlock"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 173] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 174] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 175] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["FunctionBlock"] = 176] = "FunctionBlock"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 177] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 178] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 179] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 180] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 181] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 182] = "ModuleBlock"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 183] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 184] = "ExportAssignment"; + SyntaxKind[SyntaxKind["EnumMember"] = 185] = "EnumMember"; + SyntaxKind[SyntaxKind["SourceFile"] = 186] = "SourceFile"; + SyntaxKind[SyntaxKind["Program"] = 187] = "Program"; + SyntaxKind[SyntaxKind["SyntaxList"] = 188] = "SyntaxList"; + SyntaxKind[SyntaxKind["Count"] = 189] = "Count"; SyntaxKind[SyntaxKind["FirstAssignment"] = SyntaxKind.EqualsToken] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = SyntaxKind.CaretEqualsToken] = "LastAssignment"; SyntaxKind[SyntaxKind["FirstReservedWord"] = SyntaxKind.BreakKeyword] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = SyntaxKind.WithKeyword] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = SyntaxKind.BreakKeyword] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.StringKeyword] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.TypeKeyword] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = SyntaxKind.YieldKeyword] = "LastFutureReservedWord"; SyntaxKind[SyntaxKind["FirstTypeNode"] = SyntaxKind.TypeReference] = "FirstTypeNode"; @@ -1562,7 +1580,7 @@ var ts; SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.CaretEqualsToken] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = SyntaxKind.EndOfFileToken] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = SyntaxKind.StringKeyword] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = SyntaxKind.TypeKeyword] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = SyntaxKind.SingleLineCommentTrivia] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = SyntaxKind.WhitespaceTrivia] = "LastTriviaToken"; })(ts.SyntaxKind || (ts.SyntaxKind = {})); @@ -1579,8 +1597,11 @@ var ts; NodeFlags[NodeFlags["MultiLine"] = 0x00000100] = "MultiLine"; NodeFlags[NodeFlags["Synthetic"] = 0x00000200] = "Synthetic"; NodeFlags[NodeFlags["DeclarationFile"] = 0x00000400] = "DeclarationFile"; + NodeFlags[NodeFlags["Let"] = 0x00000800] = "Let"; + NodeFlags[NodeFlags["Const"] = 0x00001000] = "Const"; NodeFlags[NodeFlags["Modifier"] = NodeFlags.Export | NodeFlags.Ambient | NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected | NodeFlags.Static] = "Modifier"; NodeFlags[NodeFlags["AccessibilityModifier"] = NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected] = "AccessibilityModifier"; + NodeFlags[NodeFlags["BlockScoped"] = NodeFlags.Let | NodeFlags.Const] = "BlockScoped"; })(ts.NodeFlags || (ts.NodeFlags = {})); var NodeFlags = ts.NodeFlags; (function (EmitReturnStatus) { @@ -1616,42 +1637,46 @@ var ts; })(ts.SymbolAccessibility || (ts.SymbolAccessibility = {})); var SymbolAccessibility = ts.SymbolAccessibility; (function (SymbolFlags) { - SymbolFlags[SymbolFlags["Variable"] = 0x00000001] = "Variable"; - SymbolFlags[SymbolFlags["Property"] = 0x00000002] = "Property"; - SymbolFlags[SymbolFlags["EnumMember"] = 0x00000004] = "EnumMember"; - SymbolFlags[SymbolFlags["Function"] = 0x00000008] = "Function"; - SymbolFlags[SymbolFlags["Class"] = 0x00000010] = "Class"; - SymbolFlags[SymbolFlags["Interface"] = 0x00000020] = "Interface"; - SymbolFlags[SymbolFlags["Enum"] = 0x00000040] = "Enum"; - SymbolFlags[SymbolFlags["ValueModule"] = 0x00000080] = "ValueModule"; - SymbolFlags[SymbolFlags["NamespaceModule"] = 0x00000100] = "NamespaceModule"; - SymbolFlags[SymbolFlags["TypeLiteral"] = 0x00000200] = "TypeLiteral"; - SymbolFlags[SymbolFlags["ObjectLiteral"] = 0x00000400] = "ObjectLiteral"; - SymbolFlags[SymbolFlags["Method"] = 0x00000800] = "Method"; - SymbolFlags[SymbolFlags["Constructor"] = 0x00001000] = "Constructor"; - SymbolFlags[SymbolFlags["GetAccessor"] = 0x00002000] = "GetAccessor"; - SymbolFlags[SymbolFlags["SetAccessor"] = 0x00004000] = "SetAccessor"; - SymbolFlags[SymbolFlags["CallSignature"] = 0x00008000] = "CallSignature"; - SymbolFlags[SymbolFlags["ConstructSignature"] = 0x00010000] = "ConstructSignature"; - SymbolFlags[SymbolFlags["IndexSignature"] = 0x00020000] = "IndexSignature"; - SymbolFlags[SymbolFlags["TypeParameter"] = 0x00040000] = "TypeParameter"; - SymbolFlags[SymbolFlags["ExportValue"] = 0x00080000] = "ExportValue"; - SymbolFlags[SymbolFlags["ExportType"] = 0x00100000] = "ExportType"; - SymbolFlags[SymbolFlags["ExportNamespace"] = 0x00200000] = "ExportNamespace"; - SymbolFlags[SymbolFlags["Import"] = 0x00400000] = "Import"; - SymbolFlags[SymbolFlags["Instantiated"] = 0x00800000] = "Instantiated"; - SymbolFlags[SymbolFlags["Merged"] = 0x01000000] = "Merged"; - SymbolFlags[SymbolFlags["Transient"] = 0x02000000] = "Transient"; - SymbolFlags[SymbolFlags["Prototype"] = 0x04000000] = "Prototype"; - SymbolFlags[SymbolFlags["UnionProperty"] = 0x08000000] = "UnionProperty"; + SymbolFlags[SymbolFlags["FunctionScopedVariable"] = 0x00000001] = "FunctionScopedVariable"; + SymbolFlags[SymbolFlags["BlockScopedVariable"] = 0x00000002] = "BlockScopedVariable"; + SymbolFlags[SymbolFlags["Property"] = 0x00000004] = "Property"; + SymbolFlags[SymbolFlags["EnumMember"] = 0x00000008] = "EnumMember"; + SymbolFlags[SymbolFlags["Function"] = 0x00000010] = "Function"; + SymbolFlags[SymbolFlags["Class"] = 0x00000020] = "Class"; + SymbolFlags[SymbolFlags["Interface"] = 0x00000040] = "Interface"; + SymbolFlags[SymbolFlags["Enum"] = 0x00000080] = "Enum"; + SymbolFlags[SymbolFlags["ValueModule"] = 0x00000100] = "ValueModule"; + SymbolFlags[SymbolFlags["NamespaceModule"] = 0x00000200] = "NamespaceModule"; + SymbolFlags[SymbolFlags["TypeLiteral"] = 0x00000400] = "TypeLiteral"; + SymbolFlags[SymbolFlags["ObjectLiteral"] = 0x00000800] = "ObjectLiteral"; + SymbolFlags[SymbolFlags["Method"] = 0x00001000] = "Method"; + SymbolFlags[SymbolFlags["Constructor"] = 0x00002000] = "Constructor"; + SymbolFlags[SymbolFlags["GetAccessor"] = 0x00004000] = "GetAccessor"; + SymbolFlags[SymbolFlags["SetAccessor"] = 0x00008000] = "SetAccessor"; + SymbolFlags[SymbolFlags["CallSignature"] = 0x00010000] = "CallSignature"; + SymbolFlags[SymbolFlags["ConstructSignature"] = 0x00020000] = "ConstructSignature"; + SymbolFlags[SymbolFlags["IndexSignature"] = 0x00040000] = "IndexSignature"; + SymbolFlags[SymbolFlags["TypeParameter"] = 0x00080000] = "TypeParameter"; + SymbolFlags[SymbolFlags["TypeAlias"] = 0x00100000] = "TypeAlias"; + SymbolFlags[SymbolFlags["ExportValue"] = 0x00200000] = "ExportValue"; + SymbolFlags[SymbolFlags["ExportType"] = 0x00400000] = "ExportType"; + SymbolFlags[SymbolFlags["ExportNamespace"] = 0x00800000] = "ExportNamespace"; + SymbolFlags[SymbolFlags["Import"] = 0x01000000] = "Import"; + SymbolFlags[SymbolFlags["Instantiated"] = 0x02000000] = "Instantiated"; + SymbolFlags[SymbolFlags["Merged"] = 0x04000000] = "Merged"; + SymbolFlags[SymbolFlags["Transient"] = 0x08000000] = "Transient"; + SymbolFlags[SymbolFlags["Prototype"] = 0x10000000] = "Prototype"; + SymbolFlags[SymbolFlags["UnionProperty"] = 0x20000000] = "UnionProperty"; + SymbolFlags[SymbolFlags["Variable"] = SymbolFlags.FunctionScopedVariable | SymbolFlags.BlockScopedVariable] = "Variable"; SymbolFlags[SymbolFlags["Value"] = SymbolFlags.Variable | SymbolFlags.Property | SymbolFlags.EnumMember | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule | SymbolFlags.Method | SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Value"; - SymbolFlags[SymbolFlags["Type"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral | SymbolFlags.TypeParameter] = "Type"; + SymbolFlags[SymbolFlags["Type"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral | SymbolFlags.TypeParameter | SymbolFlags.TypeAlias] = "Type"; SymbolFlags[SymbolFlags["Namespace"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Namespace"; SymbolFlags[SymbolFlags["Module"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Module"; SymbolFlags[SymbolFlags["Accessor"] = SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Accessor"; SymbolFlags[SymbolFlags["Signature"] = SymbolFlags.CallSignature | SymbolFlags.ConstructSignature | SymbolFlags.IndexSignature] = "Signature"; + SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = SymbolFlags.Value & ~SymbolFlags.FunctionScopedVariable] = "FunctionScopedVariableExcludes"; + SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = SymbolFlags.Value] = "BlockScopedVariableExcludes"; SymbolFlags[SymbolFlags["ParameterExcludes"] = SymbolFlags.Value] = "ParameterExcludes"; - SymbolFlags[SymbolFlags["VariableExcludes"] = SymbolFlags.Value & ~SymbolFlags.Variable] = "VariableExcludes"; SymbolFlags[SymbolFlags["PropertyExcludes"] = SymbolFlags.Value] = "PropertyExcludes"; SymbolFlags[SymbolFlags["EnumMemberExcludes"] = SymbolFlags.Value] = "EnumMemberExcludes"; SymbolFlags[SymbolFlags["FunctionExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.ValueModule)] = "FunctionExcludes"; @@ -1664,8 +1689,9 @@ var ts; SymbolFlags[SymbolFlags["GetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.SetAccessor] = "GetAccessorExcludes"; SymbolFlags[SymbolFlags["SetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.GetAccessor] = "SetAccessorExcludes"; SymbolFlags[SymbolFlags["TypeParameterExcludes"] = SymbolFlags.Type & ~SymbolFlags.TypeParameter] = "TypeParameterExcludes"; + SymbolFlags[SymbolFlags["TypeAliasExcludes"] = SymbolFlags.Type] = "TypeAliasExcludes"; SymbolFlags[SymbolFlags["ImportExcludes"] = SymbolFlags.Import] = "ImportExcludes"; - SymbolFlags[SymbolFlags["ModuleMember"] = SymbolFlags.Variable | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.Module | SymbolFlags.Import] = "ModuleMember"; + SymbolFlags[SymbolFlags["ModuleMember"] = SymbolFlags.Variable | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.Module | SymbolFlags.TypeAlias | SymbolFlags.Import] = "ModuleMember"; SymbolFlags[SymbolFlags["ExportHasLocal"] = SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule] = "ExportHasLocal"; SymbolFlags[SymbolFlags["HasLocals"] = SymbolFlags.Function | SymbolFlags.Module | SymbolFlags.Method | SymbolFlags.Constructor | SymbolFlags.Accessor | SymbolFlags.Signature] = "HasLocals"; SymbolFlags[SymbolFlags["HasExports"] = SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.Module] = "HasExports"; @@ -1736,6 +1762,8 @@ var ts; (function (ScriptTarget) { ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; + ScriptTarget[ScriptTarget["ES6"] = 2] = "ES6"; + ScriptTarget[ScriptTarget["Latest"] = ScriptTarget.ES6] = "Latest"; })(ts.ScriptTarget || (ts.ScriptTarget = {})); var ScriptTarget = ts.ScriptTarget; (function (CharacterCodes) { @@ -2068,7 +2096,8 @@ var ts; length: length, messageText: text, category: message.category, - code: message.code + code: message.code, + isEarly: message.isEarly }; } ts.createFileDiagnostic = createFileDiagnostic; @@ -2083,7 +2112,8 @@ var ts; length: undefined, messageText: text, category: message.category, - code: message.code + code: message.code, + isEarly: message.isEarly }; } ts.createCompilerDiagnostic = createCompilerDiagnostic; @@ -2414,7 +2444,7 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var nodeConstructors = new Array(187 /* Count */); + var nodeConstructors = new Array(189 /* Count */); function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); } @@ -2427,7 +2457,7 @@ var ts; return node; } function getSourceFileOfNode(node) { - while (node && node.kind !== 184 /* SourceFile */) + while (node && node.kind !== 186 /* SourceFile */) node = node.parent; return node; } @@ -2464,13 +2494,81 @@ var ts; } ts.unescapeIdentifier = unescapeIdentifier; function identifierToString(identifier) { - return identifier.kind === 115 /* Missing */ ? "(Missing)" : getTextOfNode(identifier); + return identifier.kind === 116 /* Missing */ ? "(Missing)" : getTextOfNode(identifier); } ts.identifierToString = identifierToString; + function isExpression(node) { + switch (node.kind) { + case 87 /* ThisKeyword */: + case 85 /* SuperKeyword */: + case 83 /* NullKeyword */: + case 89 /* TrueKeyword */: + case 74 /* FalseKeyword */: + case 8 /* RegularExpressionLiteral */: + case 135 /* ArrayLiteral */: + case 136 /* ObjectLiteral */: + case 138 /* PropertyAccess */: + case 139 /* IndexedAccess */: + case 140 /* CallExpression */: + case 141 /* NewExpression */: + case 142 /* TypeAssertion */: + case 143 /* ParenExpression */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: + case 146 /* PrefixOperator */: + case 147 /* PostfixOperator */: + case 148 /* BinaryExpression */: + case 149 /* ConditionalExpression */: + case 150 /* OmittedExpression */: + return true; + case 117 /* QualifiedName */: + while (node.parent.kind === 117 /* QualifiedName */) + node = node.parent; + return node.parent.kind === 129 /* TypeQuery */; + case 59 /* Identifier */: + if (node.parent.kind === 129 /* TypeQuery */) { + return true; + } + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + var parent = node.parent; + switch (parent.kind) { + case 174 /* VariableDeclaration */: + case 119 /* Parameter */: + case 120 /* Property */: + case 185 /* EnumMember */: + case 137 /* PropertyAssignment */: + return parent.initializer === node; + case 154 /* ExpressionStatement */: + case 155 /* IfStatement */: + case 156 /* DoStatement */: + case 157 /* WhileStatement */: + case 162 /* ReturnStatement */: + case 163 /* WithStatement */: + case 164 /* SwitchStatement */: + case 165 /* CaseClause */: + case 168 /* ThrowStatement */: + case 164 /* SwitchStatement */: + return parent.expression === node; + case 158 /* ForStatement */: + return parent.initializer === node || parent.condition === node || parent.iterator === node; + case 159 /* ForInStatement */: + return parent.variable === node || parent.expression === node; + case 142 /* TypeAssertion */: + return node === parent.operand; + default: + if (isExpression(parent)) { + return true; + } + } + } + return false; + } + ts.isExpression = isExpression; function createDiagnosticForNode(node, message, arg0, arg1, arg2) { node = getErrorSpanForNode(node); var file = getSourceFileOfNode(node); - var start = node.kind === 115 /* Missing */ ? node.pos : ts.skipTrivia(file.text, node.pos); + var start = node.kind === 116 /* Missing */ ? node.pos : ts.skipTrivia(file.text, node.pos); var length = node.end - start; return ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); } @@ -2486,12 +2584,12 @@ var ts; function getErrorSpanForNode(node) { var errorSpan; switch (node.kind) { - case 173 /* VariableDeclaration */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 179 /* ModuleDeclaration */: - case 178 /* EnumDeclaration */: - case 183 /* EnumMember */: + case 174 /* VariableDeclaration */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 181 /* ModuleDeclaration */: + case 180 /* EnumDeclaration */: + case 185 /* EnumMember */: errorSpan = node.name; break; } @@ -2507,7 +2605,7 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isPrologueDirective(node) { - return node.kind === 153 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; + return node.kind === 154 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function isEvalOrArgumentsIdentifier(node) { @@ -2519,7 +2617,7 @@ var ts; } function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { sourceFileOfNode = sourceFileOfNode || getSourceFileOfNode(node); - if (node.kind === 118 /* Parameter */ || node.kind === 117 /* TypeParameter */) { + if (node.kind === 119 /* Parameter */ || node.kind === 118 /* TypeParameter */) { return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); } else { @@ -2555,119 +2653,121 @@ var ts; if (!node) return; switch (node.kind) { - case 116 /* QualifiedName */: + case 117 /* QualifiedName */: return child(node.left) || child(node.right); - case 117 /* TypeParameter */: + case 118 /* TypeParameter */: return child(node.name) || child(node.constraint); - case 118 /* Parameter */: + case 119 /* Parameter */: return child(node.name) || child(node.type) || child(node.initializer); - case 119 /* Property */: - case 136 /* PropertyAssignment */: + case 120 /* Property */: + case 137 /* PropertyAssignment */: return child(node.name) || child(node.type) || child(node.initializer); - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: + case 125 /* CallSignature */: + case 126 /* ConstructSignature */: + case 127 /* IndexSignature */: return children(node.typeParameters) || children(node.parameters) || child(node.type); - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 143 /* FunctionExpression */: - case 174 /* FunctionDeclaration */: - case 144 /* ArrowFunction */: + case 121 /* Method */: + case 122 /* Constructor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 144 /* FunctionExpression */: + case 175 /* FunctionDeclaration */: + case 145 /* ArrowFunction */: return child(node.name) || children(node.typeParameters) || children(node.parameters) || child(node.type) || child(node.body); - case 127 /* TypeReference */: + case 128 /* TypeReference */: return child(node.typeName) || children(node.typeArguments); - case 128 /* TypeQuery */: + case 129 /* TypeQuery */: return child(node.exprName); - case 129 /* TypeLiteral */: + case 130 /* TypeLiteral */: return children(node.members); - case 130 /* ArrayType */: + case 131 /* ArrayType */: return child(node.elementType); - case 131 /* TupleType */: + case 132 /* TupleType */: return children(node.elementTypes); - case 132 /* UnionType */: + case 133 /* UnionType */: return children(node.types); - case 133 /* ParenType */: + case 134 /* ParenType */: return child(node.type); - case 134 /* ArrayLiteral */: + case 135 /* ArrayLiteral */: return children(node.elements); - case 135 /* ObjectLiteral */: + case 136 /* ObjectLiteral */: return children(node.properties); - case 137 /* PropertyAccess */: + case 138 /* PropertyAccess */: return child(node.left) || child(node.right); - case 138 /* IndexedAccess */: + case 139 /* IndexedAccess */: return child(node.object) || child(node.index); - case 139 /* CallExpression */: - case 140 /* NewExpression */: + case 140 /* CallExpression */: + case 141 /* NewExpression */: return child(node.func) || children(node.typeArguments) || children(node.arguments); - case 141 /* TypeAssertion */: + case 142 /* TypeAssertion */: return child(node.type) || child(node.operand); - case 142 /* ParenExpression */: + case 143 /* ParenExpression */: return child(node.expression); - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: + case 146 /* PrefixOperator */: + case 147 /* PostfixOperator */: return child(node.operand); - case 147 /* BinaryExpression */: + case 148 /* BinaryExpression */: return child(node.left) || child(node.right); - case 148 /* ConditionalExpression */: + case 149 /* ConditionalExpression */: return child(node.condition) || child(node.whenTrue) || child(node.whenFalse); - case 150 /* Block */: - case 169 /* TryBlock */: - case 171 /* FinallyBlock */: - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: - case 184 /* SourceFile */: + case 151 /* Block */: + case 170 /* TryBlock */: + case 172 /* FinallyBlock */: + case 176 /* FunctionBlock */: + case 182 /* ModuleBlock */: + case 186 /* SourceFile */: return children(node.statements); - case 151 /* VariableStatement */: + case 152 /* VariableStatement */: return children(node.declarations); - case 153 /* ExpressionStatement */: + case 154 /* ExpressionStatement */: return child(node.expression); - case 154 /* IfStatement */: + case 155 /* IfStatement */: return child(node.expression) || child(node.thenStatement) || child(node.elseStatement); - case 155 /* DoStatement */: + case 156 /* DoStatement */: return child(node.statement) || child(node.expression); - case 156 /* WhileStatement */: + case 157 /* WhileStatement */: return child(node.expression) || child(node.statement); - case 157 /* ForStatement */: + case 158 /* ForStatement */: return children(node.declarations) || child(node.initializer) || child(node.condition) || child(node.iterator) || child(node.statement); - case 158 /* ForInStatement */: + case 159 /* ForInStatement */: return child(node.declaration) || child(node.variable) || child(node.expression) || child(node.statement); - case 159 /* ContinueStatement */: - case 160 /* BreakStatement */: + case 160 /* ContinueStatement */: + case 161 /* BreakStatement */: return child(node.label); - case 161 /* ReturnStatement */: + case 162 /* ReturnStatement */: return child(node.expression); - case 162 /* WithStatement */: + case 163 /* WithStatement */: return child(node.expression) || child(node.statement); - case 163 /* SwitchStatement */: + case 164 /* SwitchStatement */: return child(node.expression) || children(node.clauses); - case 164 /* CaseClause */: - case 165 /* DefaultClause */: + case 165 /* CaseClause */: + case 166 /* DefaultClause */: return child(node.expression) || children(node.statements); - case 166 /* LabeledStatement */: + case 167 /* LabeledStatement */: return child(node.label) || child(node.statement); - case 167 /* ThrowStatement */: + case 168 /* ThrowStatement */: return child(node.expression); - case 168 /* TryStatement */: + case 169 /* TryStatement */: return child(node.tryBlock) || child(node.catchBlock) || child(node.finallyBlock); - case 170 /* CatchBlock */: + case 171 /* CatchBlock */: return child(node.variable) || children(node.statements); - case 173 /* VariableDeclaration */: + case 174 /* VariableDeclaration */: return child(node.name) || child(node.type) || child(node.initializer); - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: return child(node.name) || children(node.typeParameters) || child(node.baseType) || children(node.implementedTypes) || children(node.members); - case 177 /* InterfaceDeclaration */: + case 178 /* InterfaceDeclaration */: return child(node.name) || children(node.typeParameters) || children(node.baseTypes) || children(node.members); - case 178 /* EnumDeclaration */: + case 179 /* TypeAliasDeclaration */: + return child(node.name) || child(node.type); + case 180 /* EnumDeclaration */: return child(node.name) || children(node.members); - case 183 /* EnumMember */: + case 185 /* EnumMember */: return child(node.name) || child(node.initializer); - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: return child(node.name) || child(node.body); - case 181 /* ImportDeclaration */: + case 183 /* ImportDeclaration */: return child(node.name) || child(node.entityName) || child(node.externalModuleName); - case 182 /* ExportAssignment */: + case 184 /* ExportAssignment */: return child(node.exportName); } } @@ -2676,24 +2776,24 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 161 /* ReturnStatement */: + case 162 /* ReturnStatement */: return visitor(node); - case 150 /* Block */: - case 175 /* FunctionBlock */: - case 154 /* IfStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 157 /* ForStatement */: - case 158 /* ForInStatement */: - case 162 /* WithStatement */: - case 163 /* SwitchStatement */: - case 164 /* CaseClause */: - case 165 /* DefaultClause */: - case 166 /* LabeledStatement */: - case 168 /* TryStatement */: - case 169 /* TryBlock */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: + case 151 /* Block */: + case 176 /* FunctionBlock */: + case 155 /* IfStatement */: + case 156 /* DoStatement */: + case 157 /* WhileStatement */: + case 158 /* ForStatement */: + case 159 /* ForInStatement */: + case 163 /* WithStatement */: + case 164 /* SwitchStatement */: + case 165 /* CaseClause */: + case 166 /* DefaultClause */: + case 167 /* LabeledStatement */: + case 169 /* TryStatement */: + case 170 /* TryBlock */: + case 171 /* CatchBlock */: + case 172 /* FinallyBlock */: return forEachChild(node, traverse); } } @@ -2702,13 +2802,13 @@ var ts; function isAnyFunction(node) { if (node) { switch (node.kind) { - case 143 /* FunctionExpression */: - case 174 /* FunctionDeclaration */: - case 144 /* ArrowFunction */: - case 120 /* Method */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 121 /* Constructor */: + case 144 /* FunctionExpression */: + case 175 /* FunctionDeclaration */: + case 145 /* ArrowFunction */: + case 121 /* Method */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 122 /* Constructor */: return true; } } @@ -2731,20 +2831,20 @@ var ts; return undefined; } switch (node.kind) { - case 144 /* ArrowFunction */: + case 145 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 179 /* ModuleDeclaration */: - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 178 /* EnumDeclaration */: - case 184 /* SourceFile */: + case 175 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: + case 181 /* ModuleDeclaration */: + case 120 /* Property */: + case 121 /* Method */: + case 122 /* Constructor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 180 /* EnumDeclaration */: + case 186 /* SourceFile */: return node; } } @@ -2757,11 +2857,11 @@ var ts; return undefined; } switch (node.kind) { - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 120 /* Property */: + case 121 /* Method */: + case 122 /* Constructor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: return node; } } @@ -2782,21 +2882,22 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 117 /* TypeParameter */: - case 118 /* Parameter */: - case 173 /* VariableDeclaration */: - case 119 /* Property */: - case 136 /* PropertyAssignment */: - case 183 /* EnumMember */: - case 120 /* Method */: - case 174 /* FunctionDeclaration */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: - case 179 /* ModuleDeclaration */: - case 181 /* ImportDeclaration */: + case 118 /* TypeParameter */: + case 119 /* Parameter */: + case 174 /* VariableDeclaration */: + case 120 /* Property */: + case 137 /* PropertyAssignment */: + case 185 /* EnumMember */: + case 121 /* Method */: + case 175 /* FunctionDeclaration */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 179 /* TypeAliasDeclaration */: + case 180 /* EnumDeclaration */: + case 181 /* ModuleDeclaration */: + case 183 /* ImportDeclaration */: return true; } return false; @@ -2804,24 +2905,24 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 160 /* BreakStatement */: - case 159 /* ContinueStatement */: - case 172 /* DebuggerStatement */: - case 155 /* DoStatement */: - case 153 /* ExpressionStatement */: - case 152 /* EmptyStatement */: - case 158 /* ForInStatement */: - case 157 /* ForStatement */: - case 154 /* IfStatement */: - case 166 /* LabeledStatement */: - case 161 /* ReturnStatement */: - case 163 /* SwitchStatement */: + case 161 /* BreakStatement */: + case 160 /* ContinueStatement */: + case 173 /* DebuggerStatement */: + case 156 /* DoStatement */: + case 154 /* ExpressionStatement */: + case 153 /* EmptyStatement */: + case 159 /* ForInStatement */: + case 158 /* ForStatement */: + case 155 /* IfStatement */: + case 167 /* LabeledStatement */: + case 162 /* ReturnStatement */: + case 164 /* SwitchStatement */: case 88 /* ThrowKeyword */: - case 168 /* TryStatement */: - case 151 /* VariableStatement */: - case 156 /* WhileStatement */: - case 162 /* WithStatement */: - case 182 /* ExportAssignment */: + case 169 /* TryStatement */: + case 152 /* VariableStatement */: + case 157 /* WhileStatement */: + case 163 /* WithStatement */: + case 184 /* ExportAssignment */: return true; default: return false; @@ -2833,10 +2934,10 @@ var ts; return false; } var parent = name.parent; - if (isDeclaration(parent) || parent.kind === 143 /* FunctionExpression */) { + if (isDeclaration(parent) || parent.kind === 144 /* FunctionExpression */) { return parent.name === name; } - if (parent.kind === 170 /* CatchBlock */) { + if (parent.kind === 171 /* CatchBlock */) { return parent.variable === name; } return false; @@ -2844,15 +2945,16 @@ var ts; ts.isDeclarationOrFunctionExpressionOrCatchVariableName = isDeclarationOrFunctionExpressionOrCatchVariableName; function getAncestor(node, kind) { switch (kind) { - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: while (node) { switch (node.kind) { - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: return node; - case 178 /* EnumDeclaration */: - case 177 /* InterfaceDeclaration */: - case 179 /* ModuleDeclaration */: - case 181 /* ImportDeclaration */: + case 180 /* EnumDeclaration */: + case 178 /* InterfaceDeclaration */: + case 179 /* TypeAliasDeclaration */: + case 181 /* ModuleDeclaration */: + case 183 /* ImportDeclaration */: return undefined; default: node = node.parent; @@ -3210,7 +3312,7 @@ var ts; return node; } function createMissingNode() { - return createNode(115 /* Missing */); + return createNode(116 /* Missing */); } function internIdentifier(text) { return ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); @@ -3446,7 +3548,7 @@ var ts; function parseEntityName(allowReservedWords) { var entity = parseIdentifier(); while (parseOptional(15 /* DotToken */)) { - var node = createNode(116 /* QualifiedName */, entity.pos); + var node = createNode(117 /* QualifiedName */, entity.pos); node.left = entity; node.right = allowReservedWords ? parseIdentifierName() : parseIdentifier(); entity = finishNode(node); @@ -3482,7 +3584,7 @@ var ts; return createMissingNode(); } function parseTypeReference() { - var node = createNode(127 /* TypeReference */); + var node = createNode(128 /* TypeReference */); node.typeName = parseEntityName(false); if (!scanner.hasPrecedingLineBreak() && token === 19 /* LessThanToken */) { node.typeArguments = parseTypeArguments(); @@ -3490,13 +3592,13 @@ var ts; return finishNode(node); } function parseTypeQuery() { - var node = createNode(128 /* TypeQuery */); + var node = createNode(129 /* TypeQuery */); parseExpected(91 /* TypeOfKeyword */); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(117 /* TypeParameter */); + var node = createNode(118 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(73 /* ExtendsKeyword */)) { if (isType() || !isExpression()) { @@ -3529,13 +3631,13 @@ var ts; } function parseParameter(flags) { if (flags === void 0) { flags = 0; } - var node = createNode(118 /* Parameter */); + var node = createNode(119 /* Parameter */); node.flags |= parseAndCheckModifiers(3 /* Parameters */); if (parseOptional(16 /* DotDotDotToken */)) { node.flags |= 8 /* Rest */; } node.name = parseIdentifier(); - if (node.name.kind === 115 /* Missing */ && node.flags === 0 && isModifier(token)) { + if (node.name.kind === 116 /* Missing */ && node.flags === 0 && isModifier(token)) { nextToken(); } if (parseOptional(45 /* QuestionToken */)) { @@ -3546,7 +3648,7 @@ var ts; return finishNode(node); } function parseSignature(kind, returnToken, returnTokenRequired) { - if (kind === 125 /* ConstructSignature */) { + if (kind === 126 /* ConstructSignature */) { parseExpected(82 /* NewKeyword */); } var typeParameters = parseTypeParameters(); @@ -3617,7 +3719,7 @@ var ts; return finishNode(node); } function parseIndexSignatureMember() { - var node = createNode(126 /* IndexSignature */); + var node = createNode(127 /* IndexSignature */); var errorCountBeforeIndexSignature = file.syntacticErrors.length; var indexerStart = scanner.getTokenPos(); node.parameters = parseParameterList(13 /* OpenBracketToken */, 14 /* CloseBracketToken */); @@ -3677,14 +3779,14 @@ var ts; node.flags |= 4 /* QuestionMark */; } if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - node.kind = 120 /* Method */; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + node.kind = 121 /* Method */; + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; } else { - node.kind = 119 /* Property */; + node.kind = 120 /* Property */; node.type = parseTypeAnnotation(); } parseSemicolon(); @@ -3704,12 +3806,12 @@ var ts; switch (token) { case 11 /* OpenParenToken */: case 19 /* LessThanToken */: - return parseSignatureMember(124 /* CallSignature */, 46 /* ColonToken */); + return parseSignatureMember(125 /* CallSignature */, 46 /* ColonToken */); case 13 /* OpenBracketToken */: return parseIndexSignatureMember(); case 82 /* NewKeyword */: if (lookAhead(function () { return nextToken() === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */; })) { - return parseSignatureMember(125 /* ConstructSignature */, 46 /* ColonToken */); + return parseSignatureMember(126 /* ConstructSignature */, 46 /* ColonToken */); } case 7 /* StringLiteral */: case 6 /* NumericLiteral */: @@ -3721,7 +3823,7 @@ var ts; } } function parseTypeLiteral() { - var node = createNode(129 /* TypeLiteral */); + var node = createNode(130 /* TypeLiteral */); if (parseExpected(9 /* OpenBraceToken */)) { node.members = parseList(5 /* TypeMembers */, false, parseTypeMember); parseExpected(10 /* CloseBraceToken */); @@ -3732,7 +3834,7 @@ var ts; return finishNode(node); } function parseTupleType() { - var node = createNode(131 /* TupleType */); + var node = createNode(132 /* TupleType */); var startTokenPos = scanner.getTokenPos(); var startErrorCount = file.syntacticErrors.length; node.elementTypes = parseBracketedList(16 /* TupleElementTypes */, parseType, 13 /* OpenBracketToken */, 14 /* CloseBracketToken */); @@ -3742,14 +3844,14 @@ var ts; return finishNode(node); } function parseParenType() { - var node = createNode(133 /* ParenType */); + var node = createNode(134 /* ParenType */); parseExpected(11 /* OpenParenToken */); node.type = parseType(); parseExpected(12 /* CloseParenToken */); return finishNode(node); } function parseFunctionType(signatureKind) { - var node = createNode(129 /* TypeLiteral */); + var node = createNode(130 /* TypeLiteral */); var member = createNode(signatureKind); var sig = parseSignature(signatureKind, 27 /* EqualsGreaterThanToken */, true); member.typeParameters = sig.typeParameters; @@ -3814,7 +3916,7 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(13 /* OpenBracketToken */)) { parseExpected(14 /* CloseBracketToken */); - var node = createNode(130 /* ArrayType */, type.pos); + var node = createNode(131 /* ArrayType */, type.pos); node.elementType = type; type = finishNode(node); } @@ -3829,7 +3931,7 @@ var ts; types.push(parsePrimaryType()); } types.end = getNodeEnd(); - var node = createNode(132 /* UnionType */, type.pos); + var node = createNode(133 /* UnionType */, type.pos); node.types = types; type = finishNode(node); } @@ -3858,10 +3960,10 @@ var ts; } function parseType() { if (isFunctionType()) { - return parseFunctionType(124 /* CallSignature */); + return parseFunctionType(125 /* CallSignature */); } if (token === 82 /* NewKeyword */) { - return parseFunctionType(125 /* ConstructSignature */); + return parseFunctionType(126 /* ConstructSignature */); } return parseUnionType(); } @@ -3941,16 +4043,16 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 137 /* PropertyAccess */: - case 138 /* IndexedAccess */: - case 140 /* NewExpression */: - case 139 /* CallExpression */: - case 134 /* ArrayLiteral */: - case 142 /* ParenExpression */: - case 135 /* ObjectLiteral */: - case 143 /* FunctionExpression */: + case 138 /* PropertyAccess */: + case 139 /* IndexedAccess */: + case 141 /* NewExpression */: + case 140 /* CallExpression */: + case 135 /* ArrayLiteral */: + case 143 /* ParenExpression */: + case 136 /* ObjectLiteral */: + case 144 /* FunctionExpression */: case 59 /* Identifier */: - case 115 /* Missing */: + case 116 /* Missing */: case 8 /* RegularExpressionLiteral */: case 6 /* NumericLiteral */: case 7 /* StringLiteral */: @@ -3967,7 +4069,7 @@ var ts; function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 27 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); parseExpected(27 /* EqualsGreaterThanToken */); - var parameter = createNode(118 /* Parameter */, identifier.pos); + var parameter = createNode(119 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); var parameters = []; @@ -3984,12 +4086,12 @@ var ts; } var pos = getNodePos(); if (triState === 1 /* True */) { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); if (parseExpected(27 /* EqualsGreaterThanToken */) || token === 9 /* OpenBraceToken */) { return parseArrowExpressionTail(pos, sig, false); } else { - return makeFunctionExpression(144 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); + return makeFunctionExpression(145 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); } } var sig = tryParseSignatureIfArrowOrBraceFollows(); @@ -4045,7 +4147,7 @@ var ts; } function tryParseSignatureIfArrowOrBraceFollows() { return tryParse(function () { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); if (token === 27 /* EqualsGreaterThanToken */ || token === 9 /* OpenBraceToken */) { return sig; } @@ -4063,7 +4165,7 @@ var ts; else { body = parseAssignmentExpression(noIn); } - return makeFunctionExpression(144 /* ArrowFunction */, pos, undefined, sig, body); + return makeFunctionExpression(145 /* ArrowFunction */, pos, undefined, sig, body); } function isAssignmentOperator() { return token >= ts.SyntaxKind.FirstAssignment && token <= ts.SyntaxKind.LastAssignment; @@ -4071,7 +4173,7 @@ var ts; function parseConditionalExpression(noIn) { var expr = parseBinaryExpression(noIn); while (parseOptional(45 /* QuestionToken */)) { - var node = createNode(148 /* ConditionalExpression */, expr.pos); + var node = createNode(149 /* ConditionalExpression */, expr.pos); node.condition = expr; node.whenTrue = parseAssignmentExpression(false); parseExpected(46 /* ColonToken */); @@ -4135,7 +4237,7 @@ var ts; return undefined; } function makeBinaryExpression(left, operator, right) { - var node = createNode(147 /* BinaryExpression */, left.pos); + var node = createNode(148 /* BinaryExpression */, left.pos); node.left = left; node.operator = operator; node.right = right; @@ -4164,7 +4266,7 @@ var ts; grammarErrorOnNode(operand, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); } } - return makeUnaryExpression(145 /* PrefixOperator */, pos, operator, operand); + return makeUnaryExpression(146 /* PrefixOperator */, pos, operator, operand); case 19 /* LessThanToken */: return parseTypeAssertion(); } @@ -4181,12 +4283,12 @@ var ts; } var operator = token; nextToken(); - expr = makeUnaryExpression(146 /* PostfixOperator */, expr.pos, operator, expr); + expr = makeUnaryExpression(147 /* PostfixOperator */, expr.pos, operator, expr); } return expr; } function parseTypeAssertion() { - var node = createNode(141 /* TypeAssertion */); + var node = createNode(142 /* TypeAssertion */); parseExpected(19 /* LessThanToken */); node.type = parseType(); parseExpected(20 /* GreaterThanToken */); @@ -4203,7 +4305,7 @@ var ts; while (true) { var dotStart = scanner.getTokenPos(); if (parseOptional(15 /* DotToken */)) { - var propertyAccess = createNode(137 /* PropertyAccess */, expr.pos); + var propertyAccess = createNode(138 /* PropertyAccess */, expr.pos); if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord() && lookAhead(function () { return scanner.isReservedWord(); })) { grammarErrorAtPos(dotStart, scanner.getStartPos() - dotStart, ts.Diagnostics.Identifier_expected); var id = createMissingNode(); @@ -4218,7 +4320,7 @@ var ts; } var bracketStart = scanner.getTokenPos(); if (parseOptional(13 /* OpenBracketToken */)) { - var indexedAccess = createNode(138 /* IndexedAccess */, expr.pos); + var indexedAccess = createNode(139 /* IndexedAccess */, expr.pos); indexedAccess.object = expr; if (inNewExpression && parseOptional(14 /* CloseBracketToken */)) { indexedAccess.index = createMissingNode(); @@ -4236,7 +4338,7 @@ var ts; continue; } if ((token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) && !inNewExpression) { - var callExpr = createNode(139 /* CallExpression */, expr.pos); + var callExpr = createNode(140 /* CallExpression */, expr.pos); callExpr.func = expr; if (token === 19 /* LessThanToken */) { if (!(callExpr.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) @@ -4272,7 +4374,7 @@ var ts; var errorStart = scanner.getTokenPos(); var errorLength = scanner.getTextPos() - errorStart; grammarErrorAtPos(errorStart, errorLength, ts.Diagnostics.Type_expected); - return createNode(115 /* Missing */); + return createNode(116 /* Missing */); } return parseType(); } @@ -4312,7 +4414,7 @@ var ts; return createMissingNode(); } function parseParenExpression() { - var node = createNode(142 /* ParenExpression */); + var node = createNode(143 /* ParenExpression */); parseExpected(11 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(12 /* CloseParenToken */); @@ -4325,7 +4427,7 @@ var ts; var errorLength = scanner.getTextPos() - errorStart; grammarErrorAtPos(errorStart, errorLength, omittedExpressionDiagnostic); } - return createNode(149 /* OmittedExpression */); + return createNode(150 /* OmittedExpression */); } return parseAssignmentExpression(); } @@ -4336,7 +4438,7 @@ var ts; return parseAssignmentExpressionOrOmittedExpression(ts.Diagnostics.Argument_expression_expected); } function parseArrayLiteral() { - var node = createNode(134 /* ArrayLiteral */); + var node = createNode(135 /* ArrayLiteral */); parseExpected(13 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) node.flags |= 256 /* MultiLine */; @@ -4345,12 +4447,12 @@ var ts; return finishNode(node); } function parsePropertyAssignment() { - var node = createNode(136 /* PropertyAssignment */); + var node = createNode(137 /* PropertyAssignment */); node.name = parsePropertyName(); if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); var body = parseBody(false); - node.initializer = makeFunctionExpression(143 /* FunctionExpression */, node.pos, undefined, sig, body); + node.initializer = makeFunctionExpression(144 /* FunctionExpression */, node.pos, undefined, sig, body); } else { parseExpected(46 /* ColonToken */); @@ -4362,13 +4464,13 @@ var ts; var initialPos = getNodePos(); var initialToken = token; if (parseContextualModifier(109 /* GetKeyword */) || parseContextualModifier(113 /* SetKeyword */)) { - var kind = initialToken === 109 /* GetKeyword */ ? 122 /* GetAccessor */ : 123 /* SetAccessor */; + var kind = initialToken === 109 /* GetKeyword */ ? 123 /* GetAccessor */ : 124 /* SetAccessor */; return parseAndCheckMemberAccessorDeclaration(kind, initialPos, 0); } return parsePropertyAssignment(); } function parseObjectLiteral() { - var node = createNode(135 /* ObjectLiteral */); + var node = createNode(136 /* ObjectLiteral */); parseExpected(9 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.flags |= 256 /* MultiLine */; @@ -4381,17 +4483,17 @@ var ts; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; ts.forEach(node.properties, function (p) { - if (p.kind === 149 /* OmittedExpression */) { + if (p.kind === 150 /* OmittedExpression */) { return; } var currentKind; - if (p.kind === 136 /* PropertyAssignment */) { + if (p.kind === 137 /* PropertyAssignment */) { currentKind = Property; } - else if (p.kind === 122 /* GetAccessor */) { + else if (p.kind === 123 /* GetAccessor */) { currentKind = GetAccessor; } - else if (p.kind === 123 /* SetAccessor */) { + else if (p.kind === 124 /* SetAccessor */) { currentKind = SetAccesor; } else { @@ -4426,12 +4528,12 @@ var ts; var pos = getNodePos(); parseExpected(77 /* FunctionKeyword */); var name = isIdentifier() ? parseIdentifier() : undefined; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); var body = parseBody(false); if (name && isInStrictMode && isEvalOrArgumentsIdentifier(name)) { reportInvalidUseInStrictMode(name); } - return makeFunctionExpression(143 /* FunctionExpression */, pos, name, sig, body); + return makeFunctionExpression(144 /* FunctionExpression */, pos, name, sig, body); } function makeFunctionExpression(kind, pos, name, sig, body) { var node = createNode(kind, pos); @@ -4443,7 +4545,7 @@ var ts; return finishNode(node); } function parseNewExpression() { - var node = createNode(140 /* NewExpression */); + var node = createNode(141 /* NewExpression */); parseExpected(82 /* NewKeyword */); node.func = parseCallAndAccess(parsePrimaryExpression(), true); if (parseOptional(11 /* OpenParenToken */) || token === 19 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { @@ -4452,10 +4554,13 @@ var ts; } return finishNode(node); } + function parseStatementAllowingLetDeclaration() { + return parseStatement(true); + } function parseBlock(ignoreMissingOpenBrace, checkForStrictMode) { - var node = createNode(150 /* Block */); + var node = createNode(151 /* Block */); if (parseExpected(9 /* OpenBraceToken */) || ignoreMissingOpenBrace) { - node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatement); + node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatementAllowingLetDeclaration); parseExpected(10 /* CloseBraceToken */); } else { @@ -4476,7 +4581,7 @@ var ts; } labelledStatementInfo.pushFunctionBoundary(); var block = parseBlock(ignoreMissingOpenBrace, true); - block.kind = 175 /* FunctionBlock */; + block.kind = 176 /* FunctionBlock */; labelledStatementInfo.pop(); inFunctionBody = saveInFunctionBody; inSwitchStatement = saveInSwitchStatement; @@ -4484,26 +4589,26 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(152 /* EmptyStatement */); + var node = createNode(153 /* EmptyStatement */); parseExpected(17 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(154 /* IfStatement */); + var node = createNode(155 /* IfStatement */); parseExpected(78 /* IfKeyword */); parseExpected(11 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(12 /* CloseParenToken */); - node.thenStatement = parseStatement(); - node.elseStatement = parseOptional(70 /* ElseKeyword */) ? parseStatement() : undefined; + node.thenStatement = parseStatement(false); + node.elseStatement = parseOptional(70 /* ElseKeyword */) ? parseStatement(false) : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(155 /* DoStatement */); + var node = createNode(156 /* DoStatement */); parseExpected(69 /* DoKeyword */); var saveInIterationStatement = inIterationStatement; inIterationStatement = 1 /* Nested */; - node.statement = parseStatement(); + node.statement = parseStatement(false); inIterationStatement = saveInIterationStatement; parseExpected(94 /* WhileKeyword */); parseExpected(11 /* OpenParenToken */); @@ -4513,14 +4618,14 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(156 /* WhileStatement */); + var node = createNode(157 /* WhileStatement */); parseExpected(94 /* WhileKeyword */); parseExpected(11 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(12 /* CloseParenToken */); var saveInIterationStatement = inIterationStatement; inIterationStatement = 1 /* Nested */; - node.statement = parseStatement(); + node.statement = parseStatement(false); inIterationStatement = saveInIterationStatement; return finishNode(node); } @@ -4535,13 +4640,31 @@ var ts; error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); } } + else if (parseOptional(98 /* LetKeyword */)) { + var declarations = parseVariableDeclarationList(2048 /* Let */, true); + if (!declarations.length) { + error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); + } + if (languageVersion < 2 /* ES6 */) { + grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + else if (parseOptional(64 /* ConstKeyword */)) { + var declarations = parseVariableDeclarationList(4096 /* Const */, true); + if (!declarations.length) { + error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); + } + if (languageVersion < 2 /* ES6 */) { + grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } else { var varOrInit = parseExpression(true); } } var forOrForInStatement; if (parseOptional(80 /* InKeyword */)) { - var forInStatement = createNode(158 /* ForInStatement */, pos); + var forInStatement = createNode(159 /* ForInStatement */, pos); if (declarations) { if (declarations.length > 1) { error(ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); @@ -4556,7 +4679,7 @@ var ts; forOrForInStatement = forInStatement; } else { - var forStatement = createNode(157 /* ForStatement */, pos); + var forStatement = createNode(158 /* ForStatement */, pos); if (declarations) forStatement.declarations = declarations; if (varOrInit) @@ -4574,14 +4697,14 @@ var ts; } var saveInIterationStatement = inIterationStatement; inIterationStatement = 1 /* Nested */; - forOrForInStatement.statement = parseStatement(); + forOrForInStatement.statement = parseStatement(false); inIterationStatement = saveInIterationStatement; return finishNode(forOrForInStatement); } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); var errorCountBeforeStatement = file.syntacticErrors.length; - parseExpected(kind === 160 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */); + parseExpected(kind === 161 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */); if (!canParseSemicolon()) node.label = parseIdentifier(); parseSemicolon(); @@ -4597,7 +4720,7 @@ var ts; return node; } function checkBareBreakOrContinueStatement(node) { - if (node.kind === 160 /* BreakStatement */) { + if (node.kind === 161 /* BreakStatement */) { if (inIterationStatement === 1 /* Nested */ || inSwitchStatement === 1 /* Nested */) { return; } @@ -4606,7 +4729,7 @@ var ts; return; } } - else if (node.kind === 159 /* ContinueStatement */) { + else if (node.kind === 160 /* ContinueStatement */) { if (inIterationStatement === 1 /* Nested */) { return; } @@ -4622,7 +4745,7 @@ var ts; grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } function checkBreakOrContinueStatementWithLabel(node) { - var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 159 /* ContinueStatement */, false); + var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 160 /* ContinueStatement */, false); if (nodeIsNestedInLabel === 1 /* Nested */) { return; } @@ -4630,10 +4753,10 @@ var ts; grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); return; } - if (node.kind === 159 /* ContinueStatement */) { + if (node.kind === 160 /* ContinueStatement */) { grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); } - else if (node.kind === 160 /* BreakStatement */) { + else if (node.kind === 161 /* BreakStatement */) { grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement); } else { @@ -4641,7 +4764,7 @@ var ts; } } function parseReturnStatement() { - var node = createNode(161 /* ReturnStatement */); + var node = createNode(162 /* ReturnStatement */); var errorCountBeforeReturnStatement = file.syntacticErrors.length; var returnTokenStart = scanner.getTokenPos(); var returnTokenLength = scanner.getTextPos() - returnTokenStart; @@ -4655,14 +4778,14 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(162 /* WithStatement */); + var node = createNode(163 /* WithStatement */); var startPos = scanner.getTokenPos(); parseExpected(95 /* WithKeyword */); var endPos = scanner.getStartPos(); parseExpected(11 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(12 /* CloseParenToken */); - node.statement = parseStatement(); + node.statement = parseStatement(false); node = finishNode(node); if (isInStrictMode) { grammarErrorAtPos(startPos, endPos - startPos, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); @@ -4670,25 +4793,25 @@ var ts; return node; } function parseCaseClause() { - var node = createNode(164 /* CaseClause */); + var node = createNode(165 /* CaseClause */); parseExpected(61 /* CaseKeyword */); node.expression = parseExpression(); parseExpected(46 /* ColonToken */); - node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); + node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatementAllowingLetDeclaration); return finishNode(node); } function parseDefaultClause() { - var node = createNode(165 /* DefaultClause */); + var node = createNode(166 /* DefaultClause */); parseExpected(67 /* DefaultKeyword */); parseExpected(46 /* ColonToken */); - node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); + node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatementAllowingLetDeclaration); return finishNode(node); } function parseCaseOrDefaultClause() { return token === 61 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(163 /* SwitchStatement */); + var node = createNode(164 /* SwitchStatement */); parseExpected(86 /* SwitchKeyword */); parseExpected(11 /* OpenParenToken */); node.expression = parseExpression(); @@ -4699,7 +4822,7 @@ var ts; node.clauses = parseList(3 /* SwitchClauses */, false, parseCaseOrDefaultClause); inSwitchStatement = saveInSwitchStatement; parseExpected(10 /* CloseBraceToken */); - var defaultClauses = ts.filter(node.clauses, function (clause) { return clause.kind === 165 /* DefaultClause */; }); + var defaultClauses = ts.filter(node.clauses, function (clause) { return clause.kind === 166 /* DefaultClause */; }); for (var i = 1, n = defaultClauses.length; i < n; i++) { var clause = defaultClauses[i]; var start = ts.skipTrivia(file.text, clause.pos); @@ -4709,7 +4832,7 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(167 /* ThrowStatement */); + var node = createNode(168 /* ThrowStatement */); parseExpected(88 /* ThrowKeyword */); if (scanner.hasPrecedingLineBreak()) { error(ts.Diagnostics.Line_break_not_permitted_here); @@ -4719,13 +4842,13 @@ var ts; return finishNode(node); } function parseTryStatement() { - var node = createNode(168 /* TryStatement */); - node.tryBlock = parseTokenAndBlock(90 /* TryKeyword */, 169 /* TryBlock */); + var node = createNode(169 /* TryStatement */); + node.tryBlock = parseTokenAndBlock(90 /* TryKeyword */, 170 /* TryBlock */); if (token === 62 /* CatchKeyword */) { node.catchBlock = parseCatchBlock(); } if (token === 75 /* FinallyKeyword */) { - node.finallyBlock = parseTokenAndBlock(75 /* FinallyKeyword */, 171 /* FinallyBlock */); + node.finallyBlock = parseTokenAndBlock(75 /* FinallyKeyword */, 172 /* FinallyBlock */); } if (!(node.catchBlock || node.finallyBlock)) { error(ts.Diagnostics.catch_or_finally_expected); @@ -4750,7 +4873,7 @@ var ts; var typeAnnotation = parseTypeAnnotation(); parseExpected(12 /* CloseParenToken */); var result = parseBlock(false, false); - result.kind = 170 /* CatchBlock */; + result.kind = 171 /* CatchBlock */; result.pos = pos; result.variable = variable; if (typeAnnotation) { @@ -4762,7 +4885,7 @@ var ts; return result; } function parseDebuggerStatement() { - var node = createNode(172 /* DebuggerStatement */); + var node = createNode(173 /* DebuggerStatement */); parseExpected(66 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -4770,28 +4893,28 @@ var ts; function isIterationStatementStart() { return token === 94 /* WhileKeyword */ || token === 69 /* DoKeyword */ || token === 76 /* ForKeyword */; } - function parseStatementWithLabelSet() { + function parseStatementWithLabelSet(allowLetAndConstDeclarations) { labelledStatementInfo.pushCurrentLabelSet(isIterationStatementStart()); - var statement = parseStatement(); + var statement = parseStatement(allowLetAndConstDeclarations); labelledStatementInfo.pop(); return statement; } function isLabel() { return isIdentifier() && lookAhead(function () { return nextToken() === 46 /* ColonToken */; }); } - function parseLabelledStatement() { - var node = createNode(166 /* LabeledStatement */); + function parseLabeledStatement(allowLetAndConstDeclarations) { + var node = createNode(167 /* LabeledStatement */); node.label = parseIdentifier(); parseExpected(46 /* ColonToken */); if (labelledStatementInfo.nodeIsNestedInLabel(node.label, false, true)) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); } labelledStatementInfo.addLabel(node.label); - node.statement = isLabel() ? parseLabelledStatement() : parseStatementWithLabelSet(); + node.statement = isLabel() ? parseLabeledStatement(allowLetAndConstDeclarations) : parseStatementWithLabelSet(allowLetAndConstDeclarations); return finishNode(node); } function parseExpressionStatement() { - var node = createNode(153 /* ExpressionStatement */); + var node = createNode(154 /* ExpressionStatement */); node.expression = parseExpression(); parseSemicolon(); return finishNode(node); @@ -4802,6 +4925,8 @@ var ts; return !inErrorRecovery; case 9 /* OpenBraceToken */: case 92 /* VarKeyword */: + case 98 /* LetKeyword */: + case 64 /* ConstKeyword */: case 77 /* FunctionKeyword */: case 78 /* IfKeyword */: case 69 /* DoKeyword */: @@ -4822,6 +4947,7 @@ var ts; case 63 /* ClassKeyword */: case 110 /* ModuleKeyword */: case 71 /* EnumKeyword */: + case 115 /* TypeKeyword */: if (isDeclaration()) { return false; } @@ -4836,12 +4962,14 @@ var ts; return isExpression(); } } - function parseStatement() { + function parseStatement(allowLetAndConstDeclarations) { switch (token) { case 9 /* OpenBraceToken */: return parseBlock(false, false); case 92 /* VarKeyword */: - return parseVariableStatement(); + case 98 /* LetKeyword */: + case 64 /* ConstKeyword */: + return parseVariableStatement(allowLetAndConstDeclarations); case 77 /* FunctionKeyword */: return parseFunctionDeclaration(); case 17 /* SemicolonToken */: @@ -4855,9 +4983,9 @@ var ts; case 76 /* ForKeyword */: return parseForOrForInStatement(); case 65 /* ContinueKeyword */: - return parseBreakOrContinueStatement(159 /* ContinueStatement */); + return parseBreakOrContinueStatement(160 /* ContinueStatement */); case 60 /* BreakKeyword */: - return parseBreakOrContinueStatement(160 /* BreakStatement */); + return parseBreakOrContinueStatement(161 /* BreakStatement */); case 84 /* ReturnKeyword */: return parseReturnStatement(); case 95 /* WithKeyword */: @@ -4874,14 +5002,11 @@ var ts; return parseDebuggerStatement(); default: if (isLabel()) { - return parseLabelledStatement(); + return parseLabeledStatement(allowLetAndConstDeclarations); } return parseExpressionStatement(); } } - function parseStatementOrFunction() { - return token === 77 /* FunctionKeyword */ ? parseFunctionDeclaration() : parseStatement(); - } function parseAndCheckFunctionBody(isConstructor) { var initialPosition = scanner.getTokenPos(); var errorCountBeforeBody = file.syntacticErrors.length; @@ -4900,7 +5025,7 @@ var ts; error(ts.Diagnostics.Block_or_expected); } function parseVariableDeclaration(flags, noIn) { - var node = createNode(173 /* VariableDeclaration */); + var node = createNode(174 /* VariableDeclaration */); node.flags = flags; var errorCountBeforeVariableDeclaration = file.syntacticErrors.length; node.name = parseIdentifier(); @@ -4911,6 +5036,9 @@ var ts; if (inAmbientContext && node.initializer && errorCountBeforeVariableDeclaration === file.syntacticErrors.length) { grammarErrorAtPos(initializerStart, initializerFirstTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } + if (!inAmbientContext && !node.initializer && flags & 4096 /* Const */) { + grammarErrorOnNode(node, ts.Diagnostics.const_declarations_must_be_initialized); + } if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { reportInvalidUseInStrictMode(node.name); } @@ -4919,27 +5047,52 @@ var ts; function parseVariableDeclarationList(flags, noIn) { return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }, false); } - function parseVariableStatement(pos, flags) { - var node = createNode(151 /* VariableStatement */, pos); + function parseVariableStatement(allowLetAndConstDeclarations, pos, flags) { + var node = createNode(152 /* VariableStatement */, pos); if (flags) node.flags = flags; var errorCountBeforeVarStatement = file.syntacticErrors.length; - parseExpected(92 /* VarKeyword */); - node.declarations = parseVariableDeclarationList(flags, false); + if (token === 98 /* LetKeyword */) { + node.flags |= 2048 /* Let */; + } + else if (token === 64 /* ConstKeyword */) { + node.flags |= 4096 /* Const */; + } + else if (token !== 92 /* VarKeyword */) { + error(ts.Diagnostics.var_let_or_const_expected); + } + nextToken(); + node.declarations = parseVariableDeclarationList(node.flags, false); parseSemicolon(); finishNode(node); if (!node.declarations.length && file.syntacticErrors.length === errorCountBeforeVarStatement) { grammarErrorOnNode(node, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); } + if (languageVersion < 2 /* ES6 */) { + if (node.flags & 2048 /* Let */) { + grammarErrorOnNode(node, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + else if (node.flags & 4096 /* Const */) { + grammarErrorOnNode(node, ts.Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + else if (!allowLetAndConstDeclarations) { + if (node.flags & 2048 /* Let */) { + grammarErrorOnNode(node, ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block); + } + else if (node.flags & 4096 /* Const */) { + grammarErrorOnNode(node, ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block); + } + } return node; } function parseFunctionDeclaration(pos, flags) { - var node = createNode(174 /* FunctionDeclaration */, pos); + var node = createNode(175 /* FunctionDeclaration */, pos); if (flags) node.flags = flags; parseExpected(77 /* FunctionKeyword */); node.name = parseIdentifier(); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -4950,10 +5103,10 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(pos, flags) { - var node = createNode(121 /* Constructor */, pos); + var node = createNode(122 /* Constructor */, pos); node.flags = flags; parseExpected(107 /* ConstructorKeyword */); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -4974,10 +5127,10 @@ var ts; errorAtPos(questionStart, scanner.getStartPos() - questionStart, ts.Diagnostics.A_class_member_cannot_be_declared_optional); } if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - var method = createNode(120 /* Method */, pos); + var method = createNode(121 /* Method */, pos); method.flags = flags; method.name = name; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); method.typeParameters = sig.typeParameters; method.parameters = sig.parameters; method.type = sig.type; @@ -4985,7 +5138,7 @@ var ts; return finishNode(method); } else { - var property = createNode(119 /* Property */, pos); + var property = createNode(120 /* Property */, pos); property.flags = flags; property.name = name; property.type = parseTypeAnnotation(); @@ -5012,10 +5165,10 @@ var ts; else if (accessor.typeParameters) { grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 122 /* GetAccessor */ && accessor.parameters.length) { + else if (kind === 123 /* GetAccessor */ && accessor.parameters.length) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 123 /* SetAccessor */) { + else if (kind === 124 /* SetAccessor */) { if (accessor.type) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -5045,7 +5198,7 @@ var ts; var node = createNode(kind, pos); node.flags = flags; node.name = parsePropertyName(); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -5223,10 +5376,10 @@ var ts; var pos = getNodePos(); var flags = parseAndCheckModifiers(2 /* ClassMembers */); if (parseContextualModifier(109 /* GetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(122 /* GetAccessor */, pos, flags); + return parseAndCheckMemberAccessorDeclaration(123 /* GetAccessor */, pos, flags); } if (parseContextualModifier(113 /* SetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(123 /* SetAccessor */, pos, flags); + return parseAndCheckMemberAccessorDeclaration(124 /* SetAccessor */, pos, flags); } if (token === 107 /* ConstructorKeyword */) { return parseConstructorDeclaration(pos, flags); @@ -5245,7 +5398,7 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassDeclaration(pos, flags) { - var node = createNode(176 /* ClassDeclaration */, pos); + var node = createNode(177 /* ClassDeclaration */, pos); node.flags = flags; var errorCountBeforeClassDeclaration = file.syntacticErrors.length; parseExpected(63 /* ClassKeyword */); @@ -5272,7 +5425,7 @@ var ts; return finishNode(node); } function parseInterfaceDeclaration(pos, flags) { - var node = createNode(177 /* InterfaceDeclaration */, pos); + var node = createNode(178 /* InterfaceDeclaration */, pos); node.flags = flags; var errorCountBeforeInterfaceDeclaration = file.syntacticErrors.length; parseExpected(97 /* InterfaceKeyword */); @@ -5291,12 +5444,29 @@ var ts; } return finishNode(node); } + function parseTypeAliasDeclaration(pos, flags) { + var node = createNode(179 /* TypeAliasDeclaration */, pos); + node.flags = flags; + parseExpected(115 /* TypeKeyword */); + node.name = parseIdentifier(); + parseExpected(47 /* EqualsToken */); + node.type = parseType(); + parseSemicolon(); + var n = node.type; + while (n.kind === 134 /* ParenType */) { + n = n.type; + } + if (n.kind === 130 /* TypeLiteral */ && (n.pos !== n.members.pos || n.end !== n.members.end)) { + grammarErrorOnNode(node.type, ts.Diagnostics.Aliased_type_cannot_be_an_object_type_literal_Use_an_interface_declaration_instead); + } + return finishNode(node); + } function parseAndCheckEnumDeclaration(pos, flags) { function isIntegerLiteral(expression) { function isInteger(literalExpression) { return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); } - if (expression.kind === 145 /* PrefixOperator */) { + if (expression.kind === 146 /* PrefixOperator */) { var unaryExpression = expression; if (unaryExpression.operator === 28 /* PlusToken */ || unaryExpression.operator === 29 /* MinusToken */) { expression = unaryExpression.operand; @@ -5309,7 +5479,7 @@ var ts; } var inConstantEnumMemberSection = true; function parseAndCheckEnumMember() { - var node = createNode(183 /* EnumMember */); + var node = createNode(185 /* EnumMember */); var errorCountBeforeEnumMember = file.syntacticErrors.length; node.name = parsePropertyName(); node.initializer = parseInitializer(false); @@ -5326,7 +5496,7 @@ var ts; } return finishNode(node); } - var node = createNode(178 /* EnumDeclaration */, pos); + var node = createNode(180 /* EnumDeclaration */, pos); node.flags = flags; parseExpected(71 /* EnumKeyword */); node.name = parseIdentifier(); @@ -5340,7 +5510,7 @@ var ts; return finishNode(node); } function parseModuleBody() { - var node = createNode(180 /* ModuleBlock */); + var node = createNode(182 /* ModuleBlock */); if (parseExpected(9 /* OpenBraceToken */)) { node.statements = parseList(1 /* ModuleElements */, false, parseModuleElement); parseExpected(10 /* CloseBraceToken */); @@ -5351,7 +5521,7 @@ var ts; return finishNode(node); } function parseInternalModuleTail(pos, flags) { - var node = createNode(179 /* ModuleDeclaration */, pos); + var node = createNode(181 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseIdentifier(); if (parseOptional(15 /* DotToken */)) { @@ -5360,10 +5530,10 @@ var ts; else { node.body = parseModuleBody(); ts.forEach(node.body.statements, function (s) { - if (s.kind === 182 /* ExportAssignment */) { + if (s.kind === 184 /* ExportAssignment */) { grammarErrorOnNode(s, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); } - else if (s.kind === 181 /* ImportDeclaration */ && s.externalModuleName) { + else if (s.kind === 183 /* ImportDeclaration */ && s.externalModuleName) { grammarErrorOnNode(s, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); } }); @@ -5371,7 +5541,7 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(pos, flags) { - var node = createNode(179 /* ModuleDeclaration */, pos); + var node = createNode(181 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseStringLiteral(); if (!inAmbientContext) { @@ -5391,7 +5561,7 @@ var ts; return token === 7 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); } function parseImportDeclaration(pos, flags) { - var node = createNode(181 /* ImportDeclaration */, pos); + var node = createNode(183 /* ImportDeclaration */, pos); node.flags = flags; parseExpected(79 /* ImportKeyword */); node.name = parseIdentifier(); @@ -5408,7 +5578,7 @@ var ts; return finishNode(node); } function parseExportAssignmentTail(pos) { - var node = createNode(182 /* ExportAssignment */, pos); + var node = createNode(184 /* ExportAssignment */, pos); node.exportName = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -5416,12 +5586,15 @@ var ts; function isDeclaration() { switch (token) { case 92 /* VarKeyword */: + case 98 /* LetKeyword */: + case 64 /* ConstKeyword */: case 77 /* FunctionKeyword */: return true; case 63 /* ClassKeyword */: case 97 /* InterfaceKeyword */: case 71 /* EnumKeyword */: case 79 /* ImportKeyword */: + case 115 /* TypeKeyword */: return lookAhead(function () { return nextToken() >= 59 /* Identifier */; }); case 110 /* ModuleKeyword */: return lookAhead(function () { return nextToken() >= 59 /* Identifier */ || token === 7 /* StringLiteral */; }); @@ -5461,7 +5634,9 @@ var ts; var result; switch (token) { case 92 /* VarKeyword */: - result = parseVariableStatement(pos, flags); + case 98 /* LetKeyword */: + case 64 /* ConstKeyword */: + result = parseVariableStatement(true, pos, flags); break; case 77 /* FunctionKeyword */: result = parseFunctionDeclaration(pos, flags); @@ -5472,6 +5647,9 @@ var ts; case 97 /* InterfaceKeyword */: result = parseInterfaceDeclaration(pos, flags); break; + case 115 /* TypeKeyword */: + result = parseTypeAliasDeclaration(pos, flags); + break; case 71 /* EnumKeyword */: result = parseAndCheckEnumDeclaration(pos, flags); break; @@ -5503,7 +5681,7 @@ var ts; var statementStart = scanner.getTokenPos(); var statementFirstTokenLength = scanner.getTextPos() - statementStart; var errorCountBeforeStatement = file.syntacticErrors.length; - var statement = parseStatement(); + var statement = parseStatement(true); if (inAmbientContext && file.syntacticErrors.length === errorCountBeforeStatement) { grammarErrorAtPos(statementStart, statementFirstTokenLength, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); } @@ -5555,7 +5733,7 @@ var ts; }; } function getExternalModuleIndicator() { - return ts.forEach(file.statements, function (node) { return node.flags & 1 /* Export */ || node.kind === 181 /* ImportDeclaration */ && node.externalModuleName || node.kind === 182 /* ExportAssignment */ ? node : undefined; }); + return ts.forEach(file.statements, function (node) { return node.flags & 1 /* Export */ || node.kind === 183 /* ImportDeclaration */ && node.externalModuleName || node.kind === 184 /* ExportAssignment */ ? node : undefined; }); } scanner = ts.createScanner(languageVersion, true, sourceText, scanError, onComment); var rootNodeFlags = 0; @@ -5563,7 +5741,7 @@ var ts; rootNodeFlags = 1024 /* DeclarationFile */; inAmbientContext = true; } - file = createRootNode(184 /* SourceFile */, 0, sourceText.length, rootNodeFlags); + file = createRootNode(186 /* SourceFile */, 0, sourceText.length, rootNodeFlags); file.filename = ts.normalizePath(filename); file.text = sourceText; file.getLineAndCharacterFromPosition = getLineAndCharacterlFromSourcePosition; @@ -5696,7 +5874,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 181 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 183 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5714,9 +5892,9 @@ var ts; } } } - else if (node.kind === 179 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { + else if (node.kind === 181 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { forEachChild(node.body, function (node) { - if (node.kind === 181 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 183 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5789,16 +5967,16 @@ var ts; var ts; (function (ts) { function isInstantiated(node) { - if (node.kind === 177 /* InterfaceDeclaration */) { + if (node.kind === 178 /* InterfaceDeclaration */) { return false; } - else if (node.kind === 181 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { + else if (node.kind === 183 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { return false; } - else if (node.kind === 180 /* ModuleBlock */ && !ts.forEachChild(node, isInstantiated)) { + else if (node.kind === 182 /* ModuleBlock */ && !ts.forEachChild(node, isInstantiated)) { return false; } - else if (node.kind === 179 /* ModuleDeclaration */ && !isInstantiated(node.body)) { + else if (node.kind === 181 /* ModuleDeclaration */ && !isInstantiated(node.body)) { return false; } else { @@ -5809,12 +5987,13 @@ var ts; function bindSourceFile(file) { var parent; var container; + var blockScopeContainer; var lastContainer; var symbolCount = 0; var Symbol = ts.objectAllocator.getSymbolConstructor(); if (!file.locals) { file.locals = {}; - container = file; + container = blockScopeContainer = file; bind(file); file.symbolCount = symbolCount; } @@ -5837,19 +6016,19 @@ var ts; } function getDeclarationName(node) { if (node.name) { - if (node.kind === 179 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { + if (node.kind === 181 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { return '"' + node.name.text + '"'; } return node.name.text; } switch (node.kind) { - case 121 /* Constructor */: + case 122 /* Constructor */: return "__constructor"; - case 124 /* CallSignature */: + case 125 /* CallSignature */: return "__call"; - case 125 /* ConstructSignature */: + case 126 /* ConstructSignature */: return "__new"; - case 126 /* IndexSignature */: + case 127 /* IndexSignature */: return "__index"; } } @@ -5864,10 +6043,11 @@ var ts; if (node.name) { node.name.parent = node; } + var message = symbol.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(symbol.declarations, function (declaration) { - file.semanticErrors.push(ts.createDiagnosticForNode(declaration.name, ts.Diagnostics.Duplicate_identifier_0, getDisplayName(declaration))); + file.semanticErrors.push(ts.createDiagnosticForNode(declaration.name, message, getDisplayName(declaration))); }); - file.semanticErrors.push(ts.createDiagnosticForNode(node.name, ts.Diagnostics.Duplicate_identifier_0, getDisplayName(node))); + file.semanticErrors.push(ts.createDiagnosticForNode(node.name, message, getDisplayName(node))); symbol = createSymbol(0, name); } } @@ -5876,8 +6056,8 @@ var ts; } addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if (node.kind === 176 /* ClassDeclaration */ && symbol.exports) { - var prototypeSymbol = createSymbol(2 /* Property */ | 67108864 /* Prototype */, "prototype"); + if (node.kind === 177 /* ClassDeclaration */ && symbol.exports) { + var prototypeSymbol = createSymbol(4 /* Property */ | 268435456 /* Prototype */, "prototype"); if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { if (node.name) { node.name.parent = node; @@ -5900,15 +6080,15 @@ var ts; function declareModuleMember(node, symbolKind, symbolExcludes) { var exportKind = 0; if (symbolKind & ts.SymbolFlags.Value) { - exportKind |= 524288 /* ExportValue */; + exportKind |= 2097152 /* ExportValue */; } if (symbolKind & ts.SymbolFlags.Type) { - exportKind |= 1048576 /* ExportType */; + exportKind |= 4194304 /* ExportType */; } if (symbolKind & ts.SymbolFlags.Namespace) { - exportKind |= 2097152 /* ExportNamespace */; + exportKind |= 8388608 /* ExportNamespace */; } - if (node.flags & 1 /* Export */ || (node.kind !== 181 /* ImportDeclaration */ && isAmbientContext(container))) { + if (node.flags & 1 /* Export */ || (node.kind !== 183 /* ImportDeclaration */ && isAmbientContext(container))) { if (exportKind) { var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); @@ -5922,12 +6102,13 @@ var ts; declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); } } - function bindChildren(node, symbolKind) { + function bindChildren(node, symbolKind, isBlockScopeContainer) { if (symbolKind & ts.SymbolFlags.HasLocals) { node.locals = {}; } var saveParent = parent; var saveContainer = container; + var savedBlockScopeContainer = blockScopeContainer; parent = node; if (symbolKind & ts.SymbolFlags.IsContainer) { container = node; @@ -5938,156 +6119,197 @@ var ts; lastContainer = container; } } + if (isBlockScopeContainer) { + blockScopeContainer = node; + } ts.forEachChild(node, bind); container = saveContainer; parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; } - function bindDeclaration(node, symbolKind, symbolExcludes) { + function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { switch (container.kind) { - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 184 /* SourceFile */: + case 186 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; } - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 125 /* CallSignature */: + case 126 /* ConstructSignature */: + case 127 /* IndexSignature */: + case 121 /* Method */: + case 122 /* Constructor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 175 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: if (node.flags & 128 /* Static */) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - case 129 /* TypeLiteral */: - case 135 /* ObjectLiteral */: - case 177 /* InterfaceDeclaration */: + case 130 /* TypeLiteral */: + case 136 /* ObjectLiteral */: + case 178 /* InterfaceDeclaration */: declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); break; - case 178 /* EnumDeclaration */: + case 180 /* EnumDeclaration */: declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - bindChildren(node, symbolKind); + bindChildren(node, symbolKind, isBlockScopeContainer); } function bindConstructorDeclaration(node) { - bindDeclaration(node, 4096 /* Constructor */, 0); + bindDeclaration(node, 8192 /* Constructor */, 0, true); ts.forEach(node.parameters, function (p) { if (p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */)) { - bindDeclaration(p, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); + bindDeclaration(p, 4 /* Property */, ts.SymbolFlags.PropertyExcludes, false); } }); } function bindModuleDeclaration(node) { if (node.name.kind === 7 /* StringLiteral */) { - bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); + bindDeclaration(node, 256 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes, true); } else if (isInstantiated(node)) { - bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); + bindDeclaration(node, 256 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes, true); } else { - bindDeclaration(node, 256 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); + bindDeclaration(node, 512 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */, true); } } - function bindAnonymousDeclaration(node, symbolKind, name) { + function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { var symbol = createSymbol(symbolKind, name); addDeclarationToSymbol(symbol, node, symbolKind); - bindChildren(node, symbolKind); + bindChildren(node, symbolKind, isBlockScopeContainer); } function bindCatchVariableDeclaration(node) { - var symbol = createSymbol(1 /* Variable */, node.variable.text || "__missing"); - addDeclarationToSymbol(symbol, node, 1 /* Variable */); + var symbol = createSymbol(1 /* FunctionScopedVariable */, node.variable.text || "__missing"); + addDeclarationToSymbol(symbol, node, 1 /* FunctionScopedVariable */); var saveParent = parent; - parent = node; + var savedBlockScopeContainer = blockScopeContainer; + parent = blockScopeContainer = node; ts.forEachChild(node, bind); parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; + } + function bindBlockScopedVariableDeclaration(node) { + switch (blockScopeContainer.kind) { + case 181 /* ModuleDeclaration */: + declareModuleMember(node, 2 /* BlockScopedVariable */, ts.SymbolFlags.BlockScopedVariableExcludes); + break; + case 186 /* SourceFile */: + if (ts.isExternalModule(container)) { + declareModuleMember(node, 2 /* BlockScopedVariable */, ts.SymbolFlags.BlockScopedVariableExcludes); + break; + } + default: + if (!blockScopeContainer.locals) { + blockScopeContainer.locals = {}; + } + declareSymbol(blockScopeContainer.locals, undefined, node, 2 /* BlockScopedVariable */, ts.SymbolFlags.BlockScopedVariableExcludes); + } + bindChildren(node, 2 /* BlockScopedVariable */, false); } function bind(node) { node.parent = parent; switch (node.kind) { - case 117 /* TypeParameter */: - bindDeclaration(node, 262144 /* TypeParameter */, ts.SymbolFlags.TypeParameterExcludes); + case 118 /* TypeParameter */: + bindDeclaration(node, 524288 /* TypeParameter */, ts.SymbolFlags.TypeParameterExcludes, false); break; - case 118 /* Parameter */: - bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.ParameterExcludes); + case 119 /* Parameter */: + bindDeclaration(node, 1 /* FunctionScopedVariable */, ts.SymbolFlags.ParameterExcludes, false); break; - case 173 /* VariableDeclaration */: - bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.VariableExcludes); + case 174 /* VariableDeclaration */: + if (node.flags & ts.NodeFlags.BlockScoped) { + bindBlockScopedVariableDeclaration(node); + } + else { + bindDeclaration(node, 1 /* FunctionScopedVariable */, ts.SymbolFlags.FunctionScopedVariableExcludes, false); + } break; - case 119 /* Property */: - case 136 /* PropertyAssignment */: - bindDeclaration(node, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); + case 120 /* Property */: + case 137 /* PropertyAssignment */: + bindDeclaration(node, 4 /* Property */, ts.SymbolFlags.PropertyExcludes, false); break; - case 183 /* EnumMember */: - bindDeclaration(node, 4 /* EnumMember */, ts.SymbolFlags.EnumMemberExcludes); + case 185 /* EnumMember */: + bindDeclaration(node, 8 /* EnumMember */, ts.SymbolFlags.EnumMemberExcludes, false); break; - case 124 /* CallSignature */: - bindDeclaration(node, 32768 /* CallSignature */, 0); + case 125 /* CallSignature */: + bindDeclaration(node, 65536 /* CallSignature */, 0, false); break; - case 120 /* Method */: - bindDeclaration(node, 2048 /* Method */, ts.SymbolFlags.MethodExcludes); + case 121 /* Method */: + bindDeclaration(node, 4096 /* Method */, ts.SymbolFlags.MethodExcludes, true); break; - case 125 /* ConstructSignature */: - bindDeclaration(node, 65536 /* ConstructSignature */, 0); + case 126 /* ConstructSignature */: + bindDeclaration(node, 131072 /* ConstructSignature */, 0, true); break; - case 126 /* IndexSignature */: - bindDeclaration(node, 131072 /* IndexSignature */, 0); + case 127 /* IndexSignature */: + bindDeclaration(node, 262144 /* IndexSignature */, 0, false); break; - case 174 /* FunctionDeclaration */: - bindDeclaration(node, 8 /* Function */, ts.SymbolFlags.FunctionExcludes); + case 175 /* FunctionDeclaration */: + bindDeclaration(node, 16 /* Function */, ts.SymbolFlags.FunctionExcludes, true); break; - case 121 /* Constructor */: + case 122 /* Constructor */: bindConstructorDeclaration(node); break; - case 122 /* GetAccessor */: - bindDeclaration(node, 8192 /* GetAccessor */, ts.SymbolFlags.GetAccessorExcludes); + case 123 /* GetAccessor */: + bindDeclaration(node, 16384 /* GetAccessor */, ts.SymbolFlags.GetAccessorExcludes, true); break; - case 123 /* SetAccessor */: - bindDeclaration(node, 16384 /* SetAccessor */, ts.SymbolFlags.SetAccessorExcludes); + case 124 /* SetAccessor */: + bindDeclaration(node, 32768 /* SetAccessor */, ts.SymbolFlags.SetAccessorExcludes, true); break; - case 129 /* TypeLiteral */: - bindAnonymousDeclaration(node, 512 /* TypeLiteral */, "__type"); + case 130 /* TypeLiteral */: + bindAnonymousDeclaration(node, 1024 /* TypeLiteral */, "__type", false); break; - case 135 /* ObjectLiteral */: - bindAnonymousDeclaration(node, 1024 /* ObjectLiteral */, "__object"); + case 136 /* ObjectLiteral */: + bindAnonymousDeclaration(node, 2048 /* ObjectLiteral */, "__object", false); break; - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - bindAnonymousDeclaration(node, 8 /* Function */, "__function"); + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: + bindAnonymousDeclaration(node, 16 /* Function */, "__function", true); break; - case 170 /* CatchBlock */: + case 171 /* CatchBlock */: bindCatchVariableDeclaration(node); break; - case 176 /* ClassDeclaration */: - bindDeclaration(node, 16 /* Class */, ts.SymbolFlags.ClassExcludes); + case 177 /* ClassDeclaration */: + bindDeclaration(node, 32 /* Class */, ts.SymbolFlags.ClassExcludes, false); break; - case 177 /* InterfaceDeclaration */: - bindDeclaration(node, 32 /* Interface */, ts.SymbolFlags.InterfaceExcludes); + case 178 /* InterfaceDeclaration */: + bindDeclaration(node, 64 /* Interface */, ts.SymbolFlags.InterfaceExcludes, false); break; - case 178 /* EnumDeclaration */: - bindDeclaration(node, 64 /* Enum */, ts.SymbolFlags.EnumExcludes); + case 179 /* TypeAliasDeclaration */: + bindDeclaration(node, 1048576 /* TypeAlias */, ts.SymbolFlags.TypeAliasExcludes, false); break; - case 179 /* ModuleDeclaration */: + case 180 /* EnumDeclaration */: + bindDeclaration(node, 128 /* Enum */, ts.SymbolFlags.EnumExcludes, false); + break; + case 181 /* ModuleDeclaration */: bindModuleDeclaration(node); break; - case 181 /* ImportDeclaration */: - bindDeclaration(node, 4194304 /* Import */, ts.SymbolFlags.ImportExcludes); + case 183 /* ImportDeclaration */: + bindDeclaration(node, 16777216 /* Import */, ts.SymbolFlags.ImportExcludes, false); break; - case 184 /* SourceFile */: + case 186 /* SourceFile */: if (ts.isExternalModule(node)) { - bindAnonymousDeclaration(node, 128 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"'); + bindAnonymousDeclaration(node, 256 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"', true); break; } + case 151 /* Block */: + case 170 /* TryBlock */: + case 171 /* CatchBlock */: + case 172 /* FinallyBlock */: + case 158 /* ForStatement */: + case 159 /* ForInStatement */: + case 164 /* SwitchStatement */: + bindChildren(node, 0, true); + break; default: var saveParent = parent; parent = node; @@ -6148,7 +6370,7 @@ var ts; } function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 121 /* Constructor */ && member.body) { + if (member.kind === 122 /* Constructor */ && member.body) { return member; } }); @@ -6158,14 +6380,14 @@ var ts; var getAccessor; var setAccessor; ts.forEach(node.members, function (member) { - if ((member.kind === 122 /* GetAccessor */ || member.kind === 123 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { + if ((member.kind === 123 /* GetAccessor */ || member.kind === 124 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { if (!firstAccessor) { firstAccessor = member; } - if (member.kind === 122 /* GetAccessor */ && !getAccessor) { + if (member.kind === 123 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 123 /* SetAccessor */ && !setAccessor) { + if (member.kind === 124 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -6488,7 +6710,7 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 174 /* FunctionDeclaration */ || node.kind === 143 /* FunctionExpression */ || node.kind === 120 /* Method */ || node.kind === 122 /* GetAccessor */ || node.kind === 123 /* SetAccessor */ || node.kind === 179 /* ModuleDeclaration */ || node.kind === 176 /* ClassDeclaration */ || node.kind === 178 /* EnumDeclaration */) { + else if (node.kind === 175 /* FunctionDeclaration */ || node.kind === 144 /* FunctionExpression */ || node.kind === 121 /* Method */ || node.kind === 123 /* GetAccessor */ || node.kind === 124 /* SetAccessor */ || node.kind === 181 /* ModuleDeclaration */ || node.kind === 177 /* ClassDeclaration */ || node.kind === 180 /* EnumDeclaration */) { if (node.name) { scopeName = node.name.text; } @@ -6570,7 +6792,7 @@ var ts; } function emitNodeWithMap(node) { if (node) { - if (node.kind != 184 /* SourceFile */) { + if (node.kind != 186 /* SourceFile */) { recordEmitNodeStartSpan(node); emitNode(node); recordEmitNodeEndSpan(node); @@ -6683,29 +6905,29 @@ var ts; function isNonExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 118 /* Parameter */: - case 173 /* VariableDeclaration */: - case 119 /* Property */: - case 136 /* PropertyAssignment */: - case 183 /* EnumMember */: - case 120 /* Method */: - case 174 /* FunctionDeclaration */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 143 /* FunctionExpression */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: - case 179 /* ModuleDeclaration */: - case 181 /* ImportDeclaration */: + case 119 /* Parameter */: + case 174 /* VariableDeclaration */: + case 120 /* Property */: + case 137 /* PropertyAssignment */: + case 185 /* EnumMember */: + case 121 /* Method */: + case 175 /* FunctionDeclaration */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 144 /* FunctionExpression */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 180 /* EnumDeclaration */: + case 181 /* ModuleDeclaration */: + case 183 /* ImportDeclaration */: return parent.name === node; - case 160 /* BreakStatement */: - case 159 /* ContinueStatement */: - case 182 /* ExportAssignment */: + case 161 /* BreakStatement */: + case 160 /* ContinueStatement */: + case 184 /* ExportAssignment */: return false; - case 166 /* LabeledStatement */: + case 167 /* LabeledStatement */: return node.parent.label === node; - case 170 /* CatchBlock */: + case 171 /* CatchBlock */: return node.parent.variable === node; } } @@ -6804,7 +7026,7 @@ var ts; } else { emit(node.func); - superCall = node.func.kind === 137 /* PropertyAccess */ && node.func.left.kind === 85 /* SuperKeyword */; + superCall = node.func.kind === 138 /* PropertyAccess */ && node.func.left.kind === 85 /* SuperKeyword */; } if (superCall) { write(".call("); @@ -6831,12 +7053,12 @@ var ts; } } function emitParenExpression(node) { - if (node.expression.kind === 141 /* TypeAssertion */) { + if (node.expression.kind === 142 /* TypeAssertion */) { var operand = node.expression.operand; - while (operand.kind == 141 /* TypeAssertion */) { + while (operand.kind == 142 /* TypeAssertion */) { operand = operand.operand; } - if (operand.kind !== 145 /* PrefixOperator */ && operand.kind !== 146 /* PostfixOperator */ && operand.kind !== 140 /* NewExpression */ && !(operand.kind === 139 /* CallExpression */ && node.parent.kind === 140 /* NewExpression */) && !(operand.kind === 143 /* FunctionExpression */ && node.parent.kind === 139 /* CallExpression */)) { + if (operand.kind !== 146 /* PrefixOperator */ && operand.kind !== 147 /* PostfixOperator */ && operand.kind !== 141 /* NewExpression */ && !(operand.kind === 140 /* CallExpression */ && node.parent.kind === 141 /* NewExpression */) && !(operand.kind === 144 /* FunctionExpression */ && node.parent.kind === 140 /* CallExpression */)) { emit(operand); return; } @@ -6846,13 +7068,13 @@ var ts; write(")"); } function emitUnaryExpression(node) { - if (node.kind === 145 /* PrefixOperator */) { + if (node.kind === 146 /* PrefixOperator */) { write(ts.tokenToString(node.operator)); } if (node.operator >= 59 /* Identifier */) { write(" "); } - else if (node.kind === 145 /* PrefixOperator */ && node.operand.kind === 145 /* PrefixOperator */) { + else if (node.kind === 146 /* PrefixOperator */ && node.operand.kind === 146 /* PrefixOperator */) { var operand = node.operand; if (node.operator === 28 /* PlusToken */ && (operand.operator === 28 /* PlusToken */ || operand.operator === 33 /* PlusPlusToken */)) { write(" "); @@ -6862,7 +7084,7 @@ var ts; } } emit(node.operand); - if (node.kind === 146 /* PostfixOperator */) { + if (node.kind === 147 /* PostfixOperator */) { write(ts.tokenToString(node.operator)); } } @@ -6885,8 +7107,8 @@ var ts; emitToken(9 /* OpenBraceToken */, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 180 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 179 /* ModuleDeclaration */); + if (node.kind === 182 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 181 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); @@ -6896,7 +7118,7 @@ var ts; scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 150 /* Block */) { + if (node.kind === 151 /* Block */) { write(" "); emit(node); } @@ -6908,7 +7130,7 @@ var ts; } } function emitExpressionStatement(node) { - var isArrowExpression = node.expression.kind === 144 /* ArrowFunction */; + var isArrowExpression = node.expression.kind === 145 /* ArrowFunction */; emitLeadingComments(node); if (isArrowExpression) write("("); @@ -6929,7 +7151,7 @@ var ts; if (node.elseStatement) { writeLine(); emitToken(70 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 154 /* IfStatement */) { + if (node.elseStatement.kind === 155 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -6942,7 +7164,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 150 /* Block */) { + if (node.statement.kind === 151 /* Block */) { write(" "); } else { @@ -6963,7 +7185,15 @@ var ts; write(" "); endPos = emitToken(11 /* OpenParenToken */, endPos); if (node.declarations) { - emitToken(92 /* VarKeyword */, endPos); + if (node.declarations[0] && node.declarations[0].flags & 2048 /* Let */) { + emitToken(98 /* LetKeyword */, endPos); + } + else if (node.declarations[0] && node.declarations[0].flags & 4096 /* Const */) { + emitToken(64 /* ConstKeyword */, endPos); + } + else { + emitToken(92 /* VarKeyword */, endPos); + } write(" "); emitCommaList(node.declarations, false); } @@ -6982,7 +7212,12 @@ var ts; write(" "); endPos = emitToken(11 /* OpenParenToken */, endPos); if (node.declaration) { - emitToken(92 /* VarKeyword */, endPos); + if (node.declaration.flags & 2048 /* Let */) { + emitToken(98 /* LetKeyword */, endPos); + } + else { + emitToken(92 /* VarKeyword */, endPos); + } write(" "); emit(node.declaration); } @@ -6995,7 +7230,7 @@ var ts; emitEmbeddedStatement(node.statement); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 160 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */, node.pos); + emitToken(node.kind === 161 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } @@ -7027,7 +7262,7 @@ var ts; emitToken(10 /* CloseBraceToken */, node.clauses.end); } function emitCaseOrDefaultClause(node) { - if (node.kind === 164 /* CaseClause */) { + if (node.kind === 165 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -7076,7 +7311,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 179 /* ModuleDeclaration */); + } while (node && node.kind !== 181 /* ModuleDeclaration */); return node; } function emitModuleMemberName(node) { @@ -7097,8 +7332,17 @@ var ts; } function emitVariableStatement(node) { emitLeadingComments(node); - if (!(node.flags & 1 /* Export */)) - write("var "); + if (!(node.flags & 1 /* Export */)) { + if (node.flags & 2048 /* Let */) { + write("let "); + } + else if (node.flags & 4096 /* Const */) { + write("const "); + } + else { + write("var "); + } + } emitCommaList(node.declarations, false); write(";"); emitTrailingComments(node); @@ -7166,7 +7410,7 @@ var ts; } function emitAccessor(node) { emitLeadingComments(node); - write(node.kind === 122 /* GetAccessor */ ? "get " : "set "); + write(node.kind === 123 /* GetAccessor */ ? "get " : "set "); emit(node.name); emitSignatureAndBody(node); emitTrailingComments(node); @@ -7175,15 +7419,15 @@ var ts; if (!node.body) { return emitPinnedOrTripleSlashComments(node); } - if (node.kind !== 120 /* Method */) { + if (node.kind !== 121 /* Method */) { emitLeadingComments(node); } write("function "); - if (node.kind === 174 /* FunctionDeclaration */ || (node.kind === 143 /* FunctionExpression */ && node.name)) { + if (node.kind === 175 /* FunctionDeclaration */ || (node.kind === 144 /* FunctionExpression */ && node.name)) { emit(node.name); } emitSignatureAndBody(node); - if (node.kind !== 120 /* Method */) { + if (node.kind !== 121 /* Method */) { emitTrailingComments(node); } } @@ -7209,16 +7453,16 @@ var ts; write(" {"); scopeEmitStart(node); increaseIndent(); - emitDetachedComments(node.body.kind === 175 /* FunctionBlock */ ? node.body.statements : node.body); + emitDetachedComments(node.body.kind === 176 /* FunctionBlock */ ? node.body.statements : node.body); var startIndex = 0; - if (node.body.kind === 175 /* FunctionBlock */) { + if (node.body.kind === 176 /* FunctionBlock */) { startIndex = emitDirectivePrologues(node.body.statements, true); } var outPos = writer.getTextPos(); emitCaptureThisForNodeIfNecessary(node); emitDefaultValueAssignments(node); emitRestParameter(node); - if (node.body.kind !== 175 /* FunctionBlock */ && outPos === writer.getTextPos()) { + if (node.body.kind !== 176 /* FunctionBlock */ && outPos === writer.getTextPos()) { decreaseIndent(); write(" "); emitStart(node.body); @@ -7231,7 +7475,7 @@ var ts; emitEnd(node.body); } else { - if (node.body.kind === 175 /* FunctionBlock */) { + if (node.body.kind === 176 /* FunctionBlock */) { emitLinesStartingAt(node.body.statements, startIndex); } else { @@ -7243,7 +7487,7 @@ var ts; emitTrailingComments(node.body); } writeLine(); - if (node.body.kind === 175 /* FunctionBlock */) { + if (node.body.kind === 176 /* FunctionBlock */) { emitLeadingCommentsOfPosition(node.body.statements.end); decreaseIndent(); emitToken(10 /* CloseBraceToken */, node.body.statements.end); @@ -7269,9 +7513,9 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 153 /* ExpressionStatement */) { + if (statement && statement.kind === 154 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 139 /* CallExpression */) { + if (expr && expr.kind === 140 /* CallExpression */) { var func = expr.func; if (func && func.kind === 85 /* SuperKeyword */) { return statement; @@ -7309,7 +7553,7 @@ var ts; } function emitMemberAssignments(node, staticFlag) { ts.forEach(node.members, function (member) { - if (member.kind === 119 /* Property */ && (member.flags & 128 /* Static */) === staticFlag && member.initializer) { + if (member.kind === 120 /* Property */ && (member.flags & 128 /* Static */) === staticFlag && member.initializer) { writeLine(); emitLeadingComments(member); emitStart(member); @@ -7332,7 +7576,7 @@ var ts; } function emitMemberFunctions(node) { ts.forEach(node.members, function (member) { - if (member.kind === 120 /* Method */) { + if (member.kind === 121 /* Method */) { if (!member.body) { return emitPinnedOrTripleSlashComments(member); } @@ -7354,7 +7598,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 122 /* GetAccessor */ || member.kind === 123 /* SetAccessor */) { + else if (member.kind === 123 /* GetAccessor */ || member.kind === 124 /* SetAccessor */) { var accessors = getAllAccessorDeclarations(node, member); if (member === accessors.firstAccessor) { writeLine(); @@ -7457,7 +7701,7 @@ var ts; emitTrailingComments(node); function emitConstructorOfClass() { ts.forEach(node.members, function (member) { - if (member.kind === 121 /* Constructor */ && !member.body) { + if (member.kind === 122 /* Constructor */ && !member.body) { emitPinnedOrTripleSlashComments(member); } }); @@ -7585,7 +7829,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 179 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 181 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -7607,7 +7851,7 @@ var ts; write(resolver.getLocalNameOfContainer(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 180 /* ModuleBlock */) { + if (node.body.kind === 182 /* ModuleBlock */) { emit(node.body); } else { @@ -7641,7 +7885,7 @@ var ts; emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportedViaEntityName(node); } if (emitImportDeclaration) { - if (node.externalModuleName && node.parent.kind === 184 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { + if (node.externalModuleName && node.parent.kind === 186 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { if (node.flags & 1 /* Export */) { writeLine(); emitLeadingComments(node); @@ -7681,7 +7925,7 @@ var ts; function getExternalImportDeclarations(node) { var result = []; ts.forEach(node.statements, function (stat) { - if (stat.kind === 181 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { + if (stat.kind === 183 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { result.push(stat); } }); @@ -7689,7 +7933,7 @@ var ts; } function getFirstExportAssignment(sourceFile) { return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 182 /* ExportAssignment */) { + if (node.kind === 184 /* ExportAssignment */) { return node; } }); @@ -7807,10 +8051,10 @@ var ts; switch (node.kind) { case 59 /* Identifier */: return emitIdentifier(node); - case 118 /* Parameter */: + case 119 /* Parameter */: return emitParameter(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: return emitAccessor(node); case 87 /* ThisKeyword */: return emitThis(node); @@ -7826,96 +8070,96 @@ var ts; case 7 /* StringLiteral */: case 8 /* RegularExpressionLiteral */: return emitLiteral(node); - case 116 /* QualifiedName */: + case 117 /* QualifiedName */: return emitPropertyAccess(node); - case 134 /* ArrayLiteral */: + case 135 /* ArrayLiteral */: return emitArrayLiteral(node); - case 135 /* ObjectLiteral */: + case 136 /* ObjectLiteral */: return emitObjectLiteral(node); - case 136 /* PropertyAssignment */: + case 137 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 137 /* PropertyAccess */: + case 138 /* PropertyAccess */: return emitPropertyAccess(node); - case 138 /* IndexedAccess */: + case 139 /* IndexedAccess */: return emitIndexedAccess(node); - case 139 /* CallExpression */: + case 140 /* CallExpression */: return emitCallExpression(node); - case 140 /* NewExpression */: + case 141 /* NewExpression */: return emitNewExpression(node); - case 141 /* TypeAssertion */: + case 142 /* TypeAssertion */: return emit(node.operand); - case 142 /* ParenExpression */: + case 143 /* ParenExpression */: return emitParenExpression(node); - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 175 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: + case 146 /* PrefixOperator */: + case 147 /* PostfixOperator */: return emitUnaryExpression(node); - case 147 /* BinaryExpression */: + case 148 /* BinaryExpression */: return emitBinaryExpression(node); - case 148 /* ConditionalExpression */: + case 149 /* ConditionalExpression */: return emitConditionalExpression(node); - case 149 /* OmittedExpression */: + case 150 /* OmittedExpression */: return; - case 150 /* Block */: - case 169 /* TryBlock */: - case 171 /* FinallyBlock */: - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: + case 151 /* Block */: + case 170 /* TryBlock */: + case 172 /* FinallyBlock */: + case 176 /* FunctionBlock */: + case 182 /* ModuleBlock */: return emitBlock(node); - case 151 /* VariableStatement */: + case 152 /* VariableStatement */: return emitVariableStatement(node); - case 152 /* EmptyStatement */: + case 153 /* EmptyStatement */: return write(";"); - case 153 /* ExpressionStatement */: + case 154 /* ExpressionStatement */: return emitExpressionStatement(node); - case 154 /* IfStatement */: + case 155 /* IfStatement */: return emitIfStatement(node); - case 155 /* DoStatement */: + case 156 /* DoStatement */: return emitDoStatement(node); - case 156 /* WhileStatement */: + case 157 /* WhileStatement */: return emitWhileStatement(node); - case 157 /* ForStatement */: + case 158 /* ForStatement */: return emitForStatement(node); - case 158 /* ForInStatement */: + case 159 /* ForInStatement */: return emitForInStatement(node); - case 159 /* ContinueStatement */: - case 160 /* BreakStatement */: + case 160 /* ContinueStatement */: + case 161 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 161 /* ReturnStatement */: + case 162 /* ReturnStatement */: return emitReturnStatement(node); - case 162 /* WithStatement */: + case 163 /* WithStatement */: return emitWithStatement(node); - case 163 /* SwitchStatement */: + case 164 /* SwitchStatement */: return emitSwitchStatement(node); - case 164 /* CaseClause */: - case 165 /* DefaultClause */: + case 165 /* CaseClause */: + case 166 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 166 /* LabeledStatement */: + case 167 /* LabeledStatement */: return emitLabelledStatement(node); - case 167 /* ThrowStatement */: + case 168 /* ThrowStatement */: return emitThrowStatement(node); - case 168 /* TryStatement */: + case 169 /* TryStatement */: return emitTryStatement(node); - case 170 /* CatchBlock */: + case 171 /* CatchBlock */: return emitCatchBlock(node); - case 172 /* DebuggerStatement */: + case 173 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 173 /* VariableDeclaration */: + case 174 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: return emitClassDeclaration(node); - case 177 /* InterfaceDeclaration */: + case 178 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 178 /* EnumDeclaration */: + case 180 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 181 /* ImportDeclaration */: + case 183 /* ImportDeclaration */: return emitImportDeclaration(node); - case 184 /* SourceFile */: + case 186 /* SourceFile */: return emitSourceFile(node); } } @@ -7933,7 +8177,7 @@ var ts; return leadingComments; } function getLeadingCommentsToEmit(node) { - if (node.parent.kind === 184 /* SourceFile */ || node.pos !== node.parent.pos) { + if (node.parent.kind === 186 /* SourceFile */ || node.pos !== node.parent.pos) { var leadingComments; if (hasDetachedComments(node.pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); @@ -7950,7 +8194,7 @@ var ts; emitComments(leadingComments, true, writer, writeComment); } function emitTrailingDeclarationComments(node) { - if (node.parent.kind === 184 /* SourceFile */ || node.end !== node.parent.end) { + if (node.parent.kind === 186 /* SourceFile */ || node.end !== node.parent.end) { var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); emitComments(trailingComments, false, writer, writeComment); } @@ -8142,7 +8386,7 @@ var ts; if (node.flags & 1 /* Export */) { write("export "); } - if (node.kind !== 177 /* InterfaceDeclaration */) { + if (node.kind !== 178 /* InterfaceDeclaration */) { write("declare "); } } @@ -8198,7 +8442,7 @@ var ts; emitDeclarationFlags(node); write("module "); emitSourceTextOfNode(node.name); - while (node.body.kind !== 180 /* ModuleBlock */) { + while (node.body.kind !== 182 /* ModuleBlock */) { node = node.body; write("."); emitSourceTextOfNode(node.name); @@ -8215,6 +8459,27 @@ var ts; enclosingDeclaration = prevEnclosingDeclaration; } } + function emitTypeAliasDeclaration(node) { + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitDeclarationFlags(node); + write("type "); + emitSourceTextOfNode(node.name); + write(" = "); + getSymbolVisibilityDiagnosticMessage = getTypeAliasDeclarationVisibilityError; + resolver.writeTypeAtLocation(node.type, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + write(";"); + writeLine(); + } + function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1; + return { + diagnosticMessage: diagnosticMessage, + errorNode: node, + typeName: node.name + }; + } + } function emitEnumDeclaration(node) { if (resolver.isDeclarationVisible(node)) { emitJsDocComments(node); @@ -8246,30 +8511,30 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 177 /* InterfaceDeclaration */: + case 178 /* InterfaceDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 125 /* ConstructSignature */: + case 126 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 124 /* CallSignature */: + case 125 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 120 /* Method */: + case 121 /* Method */: if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 176 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 177 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 174 /* FunctionDeclaration */: + case 175 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -8285,7 +8550,7 @@ var ts; emitJsDocComments(node); decreaseIndent(); emitSourceTextOfNode(node.name); - if (node.constraint && (node.parent.kind !== 120 /* Method */ || !(node.parent.flags & 32 /* Private */))) { + if (node.constraint && (node.parent.kind !== 121 /* Method */ || !(node.parent.flags & 32 /* Private */))) { write(" extends "); getSymbolVisibilityDiagnosticMessage = getTypeParameterConstraintVisibilityError; resolver.writeTypeAtLocation(node.constraint, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); @@ -8307,7 +8572,7 @@ var ts; resolver.writeTypeAtLocation(node, enclosingDeclaration, 1 /* WriteArrayAsGenericType */ | 2 /* UseTypeOfFunction */, writer); function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.kind === 176 /* ClassDeclaration */) { + if (node.parent.kind === 177 /* ClassDeclaration */) { if (symbolAccesibilityResult.errorModuleName) { diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2; } @@ -8392,9 +8657,9 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 173 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 174 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { emitSourceTextOfNode(node.name); - if (node.kind === 119 /* Property */ && (node.flags & 4 /* QuestionMark */)) { + if (node.kind === 120 /* Property */ && (node.flags & 4 /* QuestionMark */)) { write("?"); } if (!(node.flags & 32 /* Private */)) { @@ -8405,14 +8670,14 @@ var ts; } function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 173 /* VariableDeclaration */) { + if (node.kind === 174 /* VariableDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 119 /* Property */) { + else if (node.kind === 120 /* Property */) { if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 176 /* ClassDeclaration */) { + else if (node.parent.kind === 177 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { @@ -8431,7 +8696,15 @@ var ts; if (hasDeclarationWithEmit) { emitJsDocComments(node); emitDeclarationFlags(node); - write("var "); + if (node.flags & 2048 /* Let */) { + write("let "); + } + else if (node.flags & 4096 /* Const */) { + write("const "); + } + else { + write("var "); + } emitCommaList(node.declarations, emitVariableDeclaration); write(";"); writeLine(); @@ -8454,7 +8727,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 123 /* SetAccessor */) { + if (node.kind === 124 /* SetAccessor */) { if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; } @@ -8483,14 +8756,14 @@ var ts; } } function emitFunctionDeclaration(node) { - if ((node.kind !== 174 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { + if ((node.kind !== 175 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); emitDeclarationFlags(node); - if (node.kind === 174 /* FunctionDeclaration */) { + if (node.kind === 175 /* FunctionDeclaration */) { write("function "); emitSourceTextOfNode(node.name); } - else if (node.kind === 121 /* Constructor */) { + else if (node.kind === 122 /* Constructor */) { write("constructor"); } else { @@ -8508,24 +8781,24 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { - if (node.kind === 124 /* CallSignature */ || node.kind === 126 /* IndexSignature */) { + if (node.kind === 125 /* CallSignature */ || node.kind === 127 /* IndexSignature */) { emitJsDocComments(node); } emitTypeParameters(node.typeParameters); - if (node.kind === 126 /* IndexSignature */) { + if (node.kind === 127 /* IndexSignature */) { write("["); } else { write("("); } emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 126 /* IndexSignature */) { + if (node.kind === 127 /* IndexSignature */) { write("]"); } else { write(")"); } - if (node.kind !== 121 /* Constructor */ && !(node.flags & 32 /* Private */)) { + if (node.kind !== 122 /* Constructor */ && !(node.flags & 32 /* Private */)) { write(": "); getSymbolVisibilityDiagnosticMessage = getReturnTypeVisibilityError; resolver.writeReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); @@ -8535,27 +8808,27 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 125 /* ConstructSignature */: + case 126 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 124 /* CallSignature */: + case 125 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 126 /* IndexSignature */: + case 127 /* IndexSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 120 /* Method */: + case 121 /* Method */: if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 176 /* ClassDeclaration */) { + else if (node.parent.kind === 177 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 174 /* FunctionDeclaration */: + case 175 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; break; default: @@ -8586,27 +8859,27 @@ var ts; function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 121 /* Constructor */: + case 122 /* Constructor */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; break; - case 125 /* ConstructSignature */: + case 126 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 124 /* CallSignature */: + case 125 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 120 /* Method */: + case 121 /* Method */: if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 176 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 177 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 174 /* FunctionDeclaration */: + case 175 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -8621,37 +8894,39 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 121 /* Constructor */: - case 174 /* FunctionDeclaration */: - case 120 /* Method */: + case 122 /* Constructor */: + case 175 /* FunctionDeclaration */: + case 121 /* Method */: return emitFunctionDeclaration(node); - case 125 /* ConstructSignature */: + case 126 /* ConstructSignature */: return emitConstructSignatureDeclaration(node); - case 124 /* CallSignature */: - case 126 /* IndexSignature */: + case 125 /* CallSignature */: + case 127 /* IndexSignature */: return emitSignatureDeclaration(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: return emitAccessorDeclaration(node); - case 151 /* VariableStatement */: + case 152 /* VariableStatement */: return emitVariableStatement(node); - case 119 /* Property */: + case 120 /* Property */: return emitPropertyDeclaration(node); - case 177 /* InterfaceDeclaration */: + case 178 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: return emitClassDeclaration(node); - case 183 /* EnumMember */: + case 179 /* TypeAliasDeclaration */: + return emitTypeAliasDeclaration(node); + case 185 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 178 /* EnumDeclaration */: + case 180 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 181 /* ImportDeclaration */: + case 183 /* ImportDeclaration */: return emitImportDeclaration(node); - case 182 /* ExportAssignment */: + case 184 /* ExportAssignment */: return emitExportAssignment(node); - case 184 /* SourceFile */: + case 186 /* SourceFile */: return emitSourceFile(node); } } @@ -8713,10 +8988,13 @@ var ts; } } var hasSemanticErrors = resolver.hasSemanticErrors(); + var hasEarlyErrors = resolver.hasEarlyErrors(targetSourceFile); function emitFile(jsFilePath, sourceFile) { - emitJavaScript(jsFilePath, sourceFile); - if (!hasSemanticErrors && compilerOptions.declaration) { - emitDeclarations(jsFilePath, sourceFile); + if (!hasEarlyErrors) { + emitJavaScript(jsFilePath, sourceFile); + if (!hasSemanticErrors && compilerOptions.declaration) { + emitDeclarations(jsFilePath, sourceFile); + } } } if (targetSourceFile === undefined) { @@ -8743,7 +9021,10 @@ var ts; diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); var hasEmitterError = ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1 /* Error */; }); var returnCode; - if (hasEmitterError) { + if (hasEarlyErrors) { + returnCode = 1 /* AllOutputGenerationSkipped */; + } + else if (hasEmitterError) { returnCode = 4 /* EmitErrorsEncountered */; } else if (hasSemanticErrors && compilerOptions.declaration) { @@ -8826,6 +9107,7 @@ var ts; emitFiles: invokeEmitter, getParentOfSymbol: getParentOfSymbol, getTypeOfSymbol: getTypeOfSymbol, + getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, getSignaturesOfType: getSignaturesOfType, @@ -8848,12 +9130,13 @@ var ts; isImplementationOfOverload: isImplementationOfOverload, getAliasedSymbol: resolveImport, isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, - isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; } + isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + hasEarlyErrors: hasEarlyErrors }; - var undefinedSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "undefined"); - var argumentsSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "arguments"); - var unknownSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "unknown"); - var resolvingSymbol = createSymbol(33554432 /* Transient */, "__resolving__"); + var undefinedSymbol = createSymbol(4 /* Property */ | 134217728 /* Transient */, "undefined"); + var argumentsSymbol = createSymbol(4 /* Property */ | 134217728 /* Transient */, "arguments"); + var unknownSymbol = createSymbol(4 /* Property */ | 134217728 /* Transient */, "unknown"); + var resolvingSymbol = createSymbol(134217728 /* Transient */, "__resolving__"); var anyType = createIntrinsicType(1 /* Any */, "any"); var stringType = createIntrinsicType(2 /* String */, "string"); var numberType = createIntrinsicType(4 /* Number */, "number"); @@ -8900,31 +9183,35 @@ var ts; } function getExcludedSymbolFlags(flags) { var result = 0; - if (flags & 1 /* Variable */) - result |= ts.SymbolFlags.VariableExcludes; - if (flags & 2 /* Property */) + if (flags & 2 /* BlockScopedVariable */) + result |= ts.SymbolFlags.BlockScopedVariableExcludes; + if (flags & 1 /* FunctionScopedVariable */) + result |= ts.SymbolFlags.FunctionScopedVariableExcludes; + if (flags & 4 /* Property */) result |= ts.SymbolFlags.PropertyExcludes; - if (flags & 4 /* EnumMember */) + if (flags & 8 /* EnumMember */) result |= ts.SymbolFlags.EnumMemberExcludes; - if (flags & 8 /* Function */) + if (flags & 16 /* Function */) result |= ts.SymbolFlags.FunctionExcludes; - if (flags & 16 /* Class */) + if (flags & 32 /* Class */) result |= ts.SymbolFlags.ClassExcludes; - if (flags & 32 /* Interface */) + if (flags & 64 /* Interface */) result |= ts.SymbolFlags.InterfaceExcludes; - if (flags & 64 /* Enum */) + if (flags & 128 /* Enum */) result |= ts.SymbolFlags.EnumExcludes; - if (flags & 128 /* ValueModule */) + if (flags & 256 /* ValueModule */) result |= ts.SymbolFlags.ValueModuleExcludes; - if (flags & 2048 /* Method */) + if (flags & 4096 /* Method */) result |= ts.SymbolFlags.MethodExcludes; - if (flags & 8192 /* GetAccessor */) + if (flags & 16384 /* GetAccessor */) result |= ts.SymbolFlags.GetAccessorExcludes; - if (flags & 16384 /* SetAccessor */) + if (flags & 32768 /* SetAccessor */) result |= ts.SymbolFlags.SetAccessorExcludes; - if (flags & 262144 /* TypeParameter */) + if (flags & 524288 /* TypeParameter */) result |= ts.SymbolFlags.TypeParameterExcludes; - if (flags & 4194304 /* Import */) + if (flags & 1048576 /* TypeAlias */) + result |= ts.SymbolFlags.TypeAliasExcludes; + if (flags & 16777216 /* Import */) result |= ts.SymbolFlags.ImportExcludes; return result; } @@ -8934,7 +9221,7 @@ var ts; mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 16777216 /* Merged */, symbol.name); + var result = createSymbol(symbol.flags | 67108864 /* Merged */, symbol.name); result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) @@ -8967,8 +9254,12 @@ var ts; recordMergedSymbol(target, source); } else { + var message = target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { - error(node.name ? node.name : node, ts.Diagnostics.Duplicate_identifier_0, symbolToString(source)); + error(node.name ? node.name : node, message, symbolToString(source)); + }); + ts.forEach(target.declarations, function (node) { + error(node.name ? node.name : node, message, symbolToString(source)); }); } } @@ -8989,7 +9280,7 @@ var ts; } else { var symbol = target[id]; - if (!(symbol.flags & 16777216 /* Merged */)) { + if (!(symbol.flags & 67108864 /* Merged */)) { target[id] = symbol = cloneSymbol(symbol); } extendSymbol(symbol, source[id]); @@ -8998,7 +9289,7 @@ var ts; } } function getSymbolLinks(symbol) { - if (symbol.flags & 33554432 /* Transient */) + if (symbol.flags & 134217728 /* Transient */) return symbol; if (!symbol.id) symbol.id = nextSymbolId++; @@ -9010,19 +9301,19 @@ var ts; return nodeLinks[node.id] || (nodeLinks[node.id] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 184 /* SourceFile */); + return ts.getAncestor(node, 186 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 184 /* SourceFile */ && !ts.isExternalModule(node); + return node.kind === 186 /* SourceFile */ && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { var symbol = symbols[name]; - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 33554432 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); if (symbol.flags & meaning) { return symbol; } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 16777216 /* Import */) { var target = resolveImport(symbol); if (target === unknownSymbol || target.flags & meaning) { return symbol; @@ -9044,6 +9335,23 @@ var ts; if (!s && nameNotFoundMessage) { error(errorLocation, nameNotFoundMessage, nameArg); } + if (s && s.flags & 2 /* BlockScopedVariable */) { + var declaration = ts.forEach(s.declarations, function (d) { return d.flags & ts.NodeFlags.BlockScoped ? d : undefined; }); + ts.Debug.assert(declaration, "Block-scoped variable declaration is undefined"); + var declarationSourceFile = ts.getSourceFileOfNode(declaration); + var referenceSourceFile = ts.getSourceFileOfNode(errorLocation); + if (declarationSourceFile === referenceSourceFile) { + if (declaration.pos > errorLocation.pos) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.identifierToString(declaration.name)); + } + } + else if (compilerOptions.out) { + var sourceFiles = program.getSourceFiles(); + if (sourceFiles.indexOf(referenceSourceFile) < sourceFiles.indexOf(declarationSourceFile)) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.identifierToString(declaration.name)); + } + } + } return s; } while (location) { @@ -9053,21 +9361,21 @@ var ts; } } switch (location.kind) { - case 184 /* SourceFile */: + case 186 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & ts.SymbolFlags.ModuleMember)) { return returnResolvedSymbol(result); } break; - case 178 /* EnumDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 4 /* EnumMember */)) { + case 180 /* EnumDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { return returnResolvedSymbol(result); } break; - case 119 /* Property */: - if (location.parent.kind === 176 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { + case 120 /* Property */: + if (location.parent.kind === 177 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (getSymbol(ctor.locals, name, meaning & ts.SymbolFlags.Value)) { @@ -9076,8 +9384,8 @@ var ts; } } break; - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & ts.SymbolFlags.Type)) { if (lastLocation && lastLocation.flags & 128 /* Static */) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); @@ -9088,17 +9396,17 @@ var ts; } } break; - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 174 /* FunctionDeclaration */: - case 144 /* ArrowFunction */: + case 121 /* Method */: + case 122 /* Constructor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 175 /* FunctionDeclaration */: + case 145 /* ArrowFunction */: if (name === "arguments") { return returnResolvedSymbol(argumentsSymbol); } break; - case 143 /* FunctionExpression */: + case 144 /* FunctionExpression */: if (name === "arguments") { return returnResolvedSymbol(argumentsSymbol); } @@ -9107,7 +9415,7 @@ var ts; return returnResolvedSymbol(location.symbol); } break; - case 170 /* CatchBlock */: + case 171 /* CatchBlock */: var id = location.variable; if (name === id.text) { return returnResolvedSymbol(location.symbol); @@ -9123,11 +9431,11 @@ var ts; return returnResolvedSymbol(undefined); } function resolveImport(symbol) { - ts.Debug.assert((symbol.flags & 4194304 /* Import */) !== 0, "Should only get Imports here."); + ts.Debug.assert((symbol.flags & 16777216 /* Import */) !== 0, "Should only get Imports here."); var links = getSymbolLinks(symbol); if (!links.target) { links.target = resolvingSymbol; - var node = getDeclarationOfKind(symbol, 181 /* ImportDeclaration */); + var node = getDeclarationOfKind(symbol, 183 /* ImportDeclaration */); var target = node.externalModuleName ? resolveExternalModuleName(node, node.externalModuleName) : getSymbolOfPartOfRightHandSideOfImport(node.entityName, node); if (links.target === resolvingSymbol) { links.target = target || unknownSymbol; @@ -9143,17 +9451,17 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImport(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 181 /* ImportDeclaration */); + importDeclaration = ts.getAncestor(entityName, 183 /* ImportDeclaration */); ts.Debug.assert(importDeclaration); } if (entityName.kind === 59 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 59 /* Identifier */ || entityName.parent.kind === 116 /* QualifiedName */) { + if (entityName.kind === 59 /* Identifier */ || entityName.parent.kind === 117 /* QualifiedName */) { return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Namespace); } else { - ts.Debug.assert(entityName.parent.kind === 181 /* ImportDeclaration */); + ts.Debug.assert(entityName.parent.kind === 183 /* ImportDeclaration */); return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace); } } @@ -9167,9 +9475,9 @@ var ts; return; } } - else if (name.kind === 116 /* QualifiedName */) { + else if (name.kind === 117 /* QualifiedName */) { var namespace = resolveEntityName(location, name.left, ts.SymbolFlags.Namespace); - if (!namespace || namespace === unknownSymbol || name.right.kind === 115 /* Missing */) + if (!namespace || namespace === unknownSymbol || name.right.kind === 116 /* Missing */) return; var symbol = getSymbol(namespace.exports, name.right.text, meaning); if (!symbol) { @@ -9180,7 +9488,7 @@ var ts; else { return; } - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 33554432 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); return symbol.flags & meaning ? symbol : resolveImport(symbol); } function isExternalModuleNameRelative(moduleName) { @@ -9193,7 +9501,7 @@ var ts; return; var isRelative = isExternalModuleNameRelative(moduleName); if (!isRelative) { - var symbol = getSymbol(globals, '"' + moduleName + '"', 128 /* ValueModule */); + var symbol = getSymbol(globals, '"' + moduleName + '"', 256 /* ValueModule */); if (symbol) { return getResolvedExportSymbol(symbol); } @@ -9223,7 +9531,7 @@ var ts; if (symbol.flags & (ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace)) { return symbol; } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 16777216 /* Import */) { return resolveImport(symbol); } } @@ -9258,9 +9566,9 @@ var ts; var seenExportedMember = false; var result = []; ts.forEach(symbol.declarations, function (declaration) { - var block = (declaration.kind === 184 /* SourceFile */ ? declaration : declaration.body); + var block = (declaration.kind === 186 /* SourceFile */ ? declaration : declaration.body); ts.forEach(block.statements, function (node) { - if (node.kind === 182 /* ExportAssignment */) { + if (node.kind === 184 /* ExportAssignment */) { result.push(node); } else { @@ -9284,16 +9592,16 @@ var ts; return getMergedSymbol(symbol.parent); } function getExportSymbolOfValueSymbolIfExported(symbol) { - return symbol && (symbol.flags & 524288 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; + return symbol && (symbol.flags & 2097152 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; } function symbolIsValue(symbol) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 33554432 /* Instantiated */) { return symbolIsValue(getSymbolLinks(symbol).target); } if (symbol.flags & ts.SymbolFlags.Value) { return true; } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 16777216 /* Import */) { return (resolveImport(symbol).flags & ts.SymbolFlags.Value) !== 0; } return false; @@ -9302,7 +9610,7 @@ var ts; var members = node.members; for (var i = 0; i < members.length; i++) { var member = members[i]; - if (member.kind === 121 /* Constructor */ && member.body) { + if (member.kind === 122 /* Constructor */ && member.body) { return member; } } @@ -9356,7 +9664,7 @@ var ts; return setObjectTypeMembers(createObjectType(32768 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function isOptionalProperty(propertySymbol) { - return propertySymbol.valueDeclaration && propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */ && propertySymbol.valueDeclaration.kind !== 118 /* Parameter */; + return propertySymbol.valueDeclaration && propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */ && propertySymbol.valueDeclaration.kind !== 119 /* Parameter */; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; @@ -9367,17 +9675,17 @@ var ts; } } switch (location.kind) { - case 184 /* SourceFile */: + case 186 /* SourceFile */: if (!ts.isExternalModule(location)) { break; } - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location).exports)) { return result; } break; - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location).members)) { return result; } @@ -9407,8 +9715,8 @@ var ts; return [symbol]; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 4194304 /* Import */) { - if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 181 /* ImportDeclaration */ && declaration.externalModuleName; })) { + if (symbolFromSymbolTable.flags & 16777216 /* Import */) { + if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 183 /* ImportDeclaration */ && declaration.externalModuleName; })) { var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { return [symbolFromSymbolTable]; @@ -9435,7 +9743,7 @@ var ts; if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 4194304 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 16777216 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -9445,7 +9753,7 @@ var ts; return qualify; } function isSymbolAccessible(symbol, enclosingDeclaration, meaning) { - if (symbol && enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { + if (symbol && enclosingDeclaration && !(symbol.flags & 524288 /* TypeParameter */)) { var initialSymbol = symbol; var meaningToLook = meaning; while (symbol) { @@ -9490,7 +9798,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 179 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 184 /* SourceFile */ && ts.isExternalModule(declaration)); + return (declaration.kind === 181 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 186 /* SourceFile */ && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -9500,7 +9808,7 @@ var ts; return { aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 181 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { + if (declaration.kind === 183 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { if (!ts.contains(aliasesToMakeVisible, declaration)) { @@ -9558,6 +9866,18 @@ var ts; } return result; } + function getTypeAliasForTypeLiteral(type) { + if (type.symbol && type.symbol.flags & 1024 /* TypeLiteral */) { + var node = type.symbol.declarations[0].parent; + while (node.kind === 134 /* ParenType */) { + node = node.parent; + } + if (node.kind === 179 /* TypeAliasDeclaration */) { + return getSymbolOfNode(node); + } + } + return undefined; + } var _displayBuilder; function getSymbolDisplayBuilder() { function appendSymbolNameOnly(symbol, writer) { @@ -9575,7 +9895,7 @@ var ts; function appendParentTypeArgumentsAndSymbolName(symbol) { if (parentSymbol) { if (flags & 1 /* WriteTypeParametersOrArguments */) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 33554432 /* Instantiated */) { buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); } else { @@ -9603,14 +9923,14 @@ var ts; if (!parentSymbol && ts.forEach(symbol.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); })) { return; } - if (symbol.flags & 512 /* TypeLiteral */ || symbol.flags & 1024 /* ObjectLiteral */) { + if (symbol.flags & 1024 /* TypeLiteral */ || symbol.flags & 2048 /* ObjectLiteral */) { return; } appendParentTypeArgumentsAndSymbolName(symbol); } } } - if (enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { + if (enclosingDeclaration && !(symbol.flags & 524288 /* TypeParameter */)) { walkSymbol(symbol, meaning); return; } @@ -9689,14 +10009,20 @@ var ts; } } function writeAnonymousType(type, flags) { - if (type.symbol && type.symbol.flags & (16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { + if (type.symbol && type.symbol.flags & (32 /* Class */ | 128 /* Enum */ | 256 /* ValueModule */)) { writeTypeofSymbol(type); } else if (shouldWriteTypeOfFunctionSymbol()) { writeTypeofSymbol(type); } else if (typeStack && ts.contains(typeStack, type)) { - writeKeyword(writer, 105 /* AnyKeyword */); + var typeAlias = getTypeAliasForTypeLiteral(type); + if (typeAlias) { + buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, ts.SymbolFlags.Type); + } + else { + writeKeyword(writer, 105 /* AnyKeyword */); + } } else { if (!typeStack) { @@ -9708,8 +10034,8 @@ var ts; } function shouldWriteTypeOfFunctionSymbol() { if (type.symbol) { - var isStaticMethodSymbol = !!(type.symbol.flags & 2048 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; })); - var isNonLocalFunctionSymbol = !!(type.symbol.flags & 8 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 184 /* SourceFile */ || declaration.parent.kind === 180 /* ModuleBlock */; })); + var isStaticMethodSymbol = !!(type.symbol.flags & 4096 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; })); + var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 186 /* SourceFile */ || declaration.parent.kind === 182 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2 /* UseTypeOfFunction */) || (typeStack && ts.contains(typeStack, type)); } @@ -9796,7 +10122,7 @@ var ts; for (var i = 0; i < resolved.properties.length; i++) { var p = resolved.properties[i]; var t = getTypeOfSymbol(p); - if (p.flags & (8 /* Function */ | 2048 /* Method */) && !getPropertiesOfObjectType(t).length) { + if (p.flags & (16 /* Function */ | 4096 /* Method */) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0 /* Call */); for (var j = 0; j < signatures.length; j++) { buildSymbolDisplay(p, writer); @@ -9826,7 +10152,7 @@ var ts; } function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaraiton, flags) { var targetSymbol = getTargetSymbol(symbol); - if (targetSymbol.flags & 16 /* Class */ || targetSymbol.flags & 32 /* Interface */) { + if (targetSymbol.flags & 32 /* Class */ || targetSymbol.flags & 64 /* Interface */) { buildDisplayForTypeParametersAndDelimiters(getTypeParametersOfClassOrInterface(symbol), writer, enclosingDeclaraiton, flags); } } @@ -9928,12 +10254,12 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 179 /* ModuleDeclaration */) { + if (node.kind === 181 /* ModuleDeclaration */) { if (node.name.kind === 7 /* StringLiteral */) { return node; } } - else if (node.kind === 184 /* SourceFile */) { + else if (node.kind === 186 /* SourceFile */) { return ts.isExternalModule(node) ? node : undefined; } } @@ -9949,7 +10275,7 @@ var ts; if (isSymbolUsedInExportAssignment(symbolOfNode)) { return true; } - if (symbolOfNode.flags & 4194304 /* Import */) { + if (symbolOfNode.flags & 16777216 /* Import */) { return isSymbolUsedInExportAssignment(resolveImport(symbolOfNode)); } } @@ -9957,7 +10283,7 @@ var ts; if (exportAssignmentSymbol === symbol) { return true; } - if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 4194304 /* Import */)) { + if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 16777216 /* Import */)) { resolvedExportSymbol = resolvedExportSymbol || resolveImport(exportAssignmentSymbol); if (resolvedExportSymbol === symbol) { return true; @@ -9975,31 +10301,32 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 173 /* VariableDeclaration */: - case 179 /* ModuleDeclaration */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 174 /* FunctionDeclaration */: - case 178 /* EnumDeclaration */: - case 181 /* ImportDeclaration */: - var parent = node.kind === 173 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (!(node.flags & 1 /* Export */) && !(node.kind !== 181 /* ImportDeclaration */ && parent.kind !== 184 /* SourceFile */ && ts.isInAmbientContext(parent))) { + case 174 /* VariableDeclaration */: + case 181 /* ModuleDeclaration */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 179 /* TypeAliasDeclaration */: + case 175 /* FunctionDeclaration */: + case 180 /* EnumDeclaration */: + case 183 /* ImportDeclaration */: + var parent = node.kind === 174 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (!(node.flags & 1 /* Export */) && !(node.kind !== 183 /* ImportDeclaration */ && parent.kind !== 186 /* SourceFile */ && ts.isInAmbientContext(parent))) { return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); } return isDeclarationVisible(parent); - case 119 /* Property */: - case 120 /* Method */: + case 120 /* Property */: + case 121 /* Method */: if (node.flags & (32 /* Private */ | 64 /* Protected */)) { return false; } - case 121 /* Constructor */: - case 125 /* ConstructSignature */: - case 124 /* CallSignature */: - case 126 /* IndexSignature */: - case 118 /* Parameter */: - case 180 /* ModuleBlock */: + case 122 /* Constructor */: + case 126 /* ConstructSignature */: + case 125 /* CallSignature */: + case 127 /* IndexSignature */: + case 119 /* Parameter */: + case 182 /* ModuleBlock */: return isDeclarationVisible(node.parent); - case 184 /* SourceFile */: + case 186 /* SourceFile */: return true; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + ts.SyntaxKind[node.kind]); @@ -10018,16 +10345,16 @@ var ts; return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; } function getTypeOfVariableDeclaration(declaration) { - if (declaration.parent.kind === 158 /* ForInStatement */) { + if (declaration.parent.kind === 159 /* ForInStatement */) { return anyType; } if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 118 /* Parameter */) { + if (declaration.kind === 119 /* Parameter */) { var func = declaration.parent; - if (func.kind === 123 /* SetAccessor */) { - var getter = getDeclarationOfKind(declaration.parent.symbol, 122 /* GetAccessor */); + if (func.kind === 124 /* SetAccessor */) { + var getter = getDeclarationOfKind(declaration.parent.symbol, 123 /* GetAccessor */); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -10039,7 +10366,7 @@ var ts; } if (declaration.initializer) { var type = checkAndMarkExpression(declaration.initializer); - if (declaration.kind !== 136 /* PropertyAssignment */) { + if (declaration.kind !== 137 /* PropertyAssignment */) { var unwidenedType = type; type = getWidenedType(type); if (type !== unwidenedType) { @@ -10058,14 +10385,14 @@ var ts; if (getInnermostTypeOfNestedArrayTypes(type) !== anyType) { return; } - if (isPrivateWithinAmbient(declaration) || (declaration.kind === 118 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { + if (isPrivateWithinAmbient(declaration) || (declaration.kind === 119 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { return; } switch (declaration.kind) { - case 119 /* Property */: + case 120 /* Property */: var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 118 /* Parameter */: + case 119 /* Parameter */: var diagnostic = declaration.flags & 8 /* Rest */ ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; default: @@ -10077,11 +10404,11 @@ var ts; function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.flags & 67108864 /* Prototype */) { + if (symbol.flags & 268435456 /* Prototype */) { return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.kind === 170 /* CatchBlock */) { + if (declaration.kind === 171 /* CatchBlock */) { return links.type = anyType; } links.type = resolvingType; @@ -10104,7 +10431,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 122 /* GetAccessor */) { + if (accessor.kind === 123 /* GetAccessor */) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -10123,8 +10450,8 @@ var ts; links = links || getSymbolLinks(symbol); if (!links.type) { links.type = resolvingType; - var getter = getDeclarationOfKind(symbol, 122 /* GetAccessor */); - var setter = getDeclarationOfKind(symbol, 123 /* SetAccessor */); + var getter = getDeclarationOfKind(symbol, 123 /* GetAccessor */); + var setter = getDeclarationOfKind(symbol, 124 /* SetAccessor */); var type; var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { @@ -10154,7 +10481,7 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var getter = getDeclarationOfKind(symbol, 122 /* GetAccessor */); + var getter = getDeclarationOfKind(symbol, 123 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -10188,22 +10515,22 @@ var ts; return links.type; } function getTypeOfSymbol(symbol) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 33554432 /* Instantiated */) { return getTypeOfInstantiatedSymbol(symbol); } - if (symbol.flags & (1 /* Variable */ | 2 /* Property */)) { + if (symbol.flags & (ts.SymbolFlags.Variable | 4 /* Property */)) { return getTypeOfVariableOrParameterOrProperty(symbol); } - if (symbol.flags & (8 /* Function */ | 2048 /* Method */ | 16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { + if (symbol.flags & (16 /* Function */ | 4096 /* Method */ | 32 /* Class */ | 128 /* Enum */ | 256 /* ValueModule */)) { return getTypeOfFuncClassEnumModule(symbol); } - if (symbol.flags & 4 /* EnumMember */) { + if (symbol.flags & 8 /* EnumMember */) { return getTypeOfEnumMember(symbol); } if (symbol.flags & ts.SymbolFlags.Accessor) { return getTypeOfAccessors(symbol); } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 16777216 /* Import */) { return getTypeOfImport(symbol); } return unknownType; @@ -10221,7 +10548,7 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 177 /* InterfaceDeclaration */ || node.kind === 176 /* ClassDeclaration */) { + if (node.kind === 178 /* InterfaceDeclaration */ || node.kind === 177 /* ClassDeclaration */) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -10252,7 +10579,7 @@ var ts; type.typeArguments = type.typeParameters; } type.baseTypes = []; - var declaration = getDeclarationOfKind(symbol, 176 /* ClassDeclaration */); + var declaration = getDeclarationOfKind(symbol, 177 /* ClassDeclaration */); if (declaration.baseType) { var baseType = getTypeFromTypeReferenceNode(declaration.baseType); if (baseType !== unknownType) { @@ -10292,7 +10619,7 @@ var ts; } type.baseTypes = []; ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 177 /* InterfaceDeclaration */ && declaration.baseTypes) { + if (declaration.kind === 178 /* InterfaceDeclaration */ && declaration.baseTypes) { ts.forEach(declaration.baseTypes, function (node) { var baseType = getTypeFromTypeReferenceNode(node); if (baseType !== unknownType) { @@ -10319,6 +10646,23 @@ var ts; } return links.declaredType; } + function getDeclaredTypeOfTypeAlias(symbol) { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + links.declaredType = resolvingType; + var declaration = getDeclarationOfKind(symbol, 179 /* TypeAliasDeclaration */); + var type = getTypeFromTypeNode(declaration.type); + if (links.declaredType === resolvingType) { + links.declaredType = type; + } + } + else if (links.declaredType === resolvingType) { + links.declaredType = unknownType; + var declaration = getDeclarationOfKind(symbol, 179 /* TypeAliasDeclaration */); + error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + } + return links.declaredType; + } function getDeclaredTypeOfEnum(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { @@ -10333,7 +10677,7 @@ var ts; if (!links.declaredType) { var type = createType(512 /* TypeParameter */); type.symbol = symbol; - if (!getDeclarationOfKind(symbol, 117 /* TypeParameter */).constraint) { + if (!getDeclarationOfKind(symbol, 118 /* TypeParameter */).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -10348,20 +10692,23 @@ var ts; return links.declaredType; } function getDeclaredTypeOfSymbol(symbol) { - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0); - if (symbol.flags & 16 /* Class */) { + ts.Debug.assert((symbol.flags & 33554432 /* Instantiated */) === 0); + if (symbol.flags & 32 /* Class */) { return getDeclaredTypeOfClass(symbol); } - if (symbol.flags & 32 /* Interface */) { + if (symbol.flags & 64 /* Interface */) { return getDeclaredTypeOfInterface(symbol); } - if (symbol.flags & 64 /* Enum */) { + if (symbol.flags & 1048576 /* TypeAlias */) { + return getDeclaredTypeOfTypeAlias(symbol); + } + if (symbol.flags & 128 /* Enum */) { return getDeclaredTypeOfEnum(symbol); } - if (symbol.flags & 262144 /* TypeParameter */) { + if (symbol.flags & 524288 /* TypeParameter */) { return getDeclaredTypeOfTypeParameter(symbol); } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 16777216 /* Import */) { return getDeclaredTypeOfImport(symbol); } return unknownType; @@ -10463,7 +10810,7 @@ var ts; function createTupleTypeMemberSymbols(memberTypes) { var members = {}; for (var i = 0; i < memberTypes.length; i++) { - var symbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "" + i); + var symbol = createSymbol(4 /* Property */ | 134217728 /* Transient */, "" + i); symbol.type = memberTypes[i]; members[i] = symbol; } @@ -10527,7 +10874,7 @@ var ts; } function resolveAnonymousTypeMembers(type) { var symbol = type.symbol; - if (symbol.flags & 512 /* TypeLiteral */) { + if (symbol.flags & 1024 /* TypeLiteral */) { var members = symbol.members; var callSignatures = getSignaturesOfSymbol(members["__call"]); var constructSignatures = getSignaturesOfSymbol(members["__new"]); @@ -10541,10 +10888,10 @@ var ts; if (symbol.flags & ts.SymbolFlags.HasExports) { members = symbol.exports; } - if (symbol.flags & (8 /* Function */ | 2048 /* Method */)) { + if (symbol.flags & (16 /* Function */ | 4096 /* Method */)) { callSignatures = getSignaturesOfSymbol(symbol); } - if (symbol.flags & 16 /* Class */) { + if (symbol.flags & 32 /* Class */) { var classType = getDeclaredTypeOfClass(symbol); constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); if (!constructSignatures.length) { @@ -10556,7 +10903,7 @@ var ts; } } var stringIndexType = undefined; - var numberIndexType = (symbol.flags & 64 /* Enum */) ? stringType : undefined; + var numberIndexType = (symbol.flags & 128 /* Enum */) ? stringType : undefined; } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -10660,7 +11007,7 @@ var ts; } propTypes.push(getTypeOfSymbol(prop)); } - var result = createSymbol(2 /* Property */ | 33554432 /* Transient */ | 134217728 /* UnionProperty */, name); + var result = createSymbol(4 /* Property */ | 134217728 /* Transient */ | 536870912 /* UnionProperty */, name); result.unionType = unionType; result.declarations = declarations; result.type = getUnionType(propTypes); @@ -10733,7 +11080,7 @@ var ts; function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 121 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var classType = declaration.kind === 122 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; var hasStringLiterals = false; @@ -10761,8 +11108,8 @@ var ts; returnType = getTypeFromTypeNode(declaration.type); } else { - if (declaration.kind === 122 /* GetAccessor */) { - var setter = getDeclarationOfKind(declaration.symbol, 123 /* SetAccessor */); + if (declaration.kind === 123 /* GetAccessor */) { + var setter = getDeclarationOfKind(declaration.symbol, 124 /* SetAccessor */); returnType = getAnnotatedAccessorType(setter); } if (!returnType && !declaration.body) { @@ -10780,16 +11127,16 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 174 /* FunctionDeclaration */: - case 120 /* Method */: - case 121 /* Constructor */: - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 175 /* FunctionDeclaration */: + case 121 /* Method */: + case 122 /* Constructor */: + case 125 /* CallSignature */: + case 126 /* ConstructSignature */: + case 127 /* IndexSignature */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -10858,7 +11205,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 121 /* Constructor */ || signature.declaration.kind === 125 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 122 /* Constructor */ || signature.declaration.kind === 126 /* ConstructSignature */; var type = createObjectType(32768 /* Anonymous */ | 65536 /* FromSignature */); type.members = emptySymbols; type.properties = emptyArray; @@ -10899,7 +11246,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 117 /* TypeParameter */).constraint); + type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 118 /* TypeParameter */).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -10939,17 +11286,17 @@ var ts; while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { currentNode = currentNode.parent; } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 117 /* TypeParameter */; + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 118 /* TypeParameter */; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 127 /* TypeReference */ && n.typeName.kind === 59 /* Identifier */) { + if (n.kind === 128 /* TypeReference */ && n.typeName.kind === 59 /* Identifier */) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { var symbol = resolveName(typeParameter, n.typeName.text, ts.SymbolFlags.Type, undefined, undefined); - if (symbol && (symbol.flags & 262144 /* TypeParameter */)) { + if (symbol && (symbol.flags & 524288 /* TypeParameter */)) { links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); } } @@ -10970,7 +11317,7 @@ var ts; var symbol = resolveEntityName(node, node.typeName, ts.SymbolFlags.Type); if (symbol) { var type; - if ((symbol.flags & 262144 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + if ((symbol.flags & 524288 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { type = unknownType; } else { @@ -11010,9 +11357,9 @@ var ts; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; switch (declaration.kind) { - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 180 /* EnumDeclaration */: return declaration; } } @@ -11187,22 +11534,22 @@ var ts; return voidType; case 7 /* StringLiteral */: return getTypeFromStringLiteral(node); - case 127 /* TypeReference */: + case 128 /* TypeReference */: return getTypeFromTypeReferenceNode(node); - case 128 /* TypeQuery */: + case 129 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 130 /* ArrayType */: + case 131 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 131 /* TupleType */: + case 132 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 132 /* UnionType */: + case 133 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 133 /* ParenType */: + case 134 /* ParenType */: return getTypeFromTypeNode(node.type); - case 129 /* TypeLiteral */: + case 130 /* TypeLiteral */: return getTypeFromTypeLiteralNode(node); case 59 /* Identifier */: - case 116 /* QualifiedName */: + case 117 /* QualifiedName */: var symbol = getSymbolInfo(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -11300,12 +11647,12 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 33554432 /* Instantiated */) { var links = getSymbolLinks(symbol); symbol = links.target; mapper = combineTypeMappers(links.mapper, mapper); } - var result = createSymbol(8388608 /* Instantiated */ | 33554432 /* Transient */ | symbol.flags, symbol.name); + var result = createSymbol(33554432 /* Instantiated */ | 134217728 /* Transient */ | symbol.flags, symbol.name); result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -11335,7 +11682,7 @@ var ts; return mapper(type); } if (type.flags & 32768 /* Anonymous */) { - return type.symbol && type.symbol.flags & (8 /* Function */ | 2048 /* Method */ | 512 /* TypeLiteral */ | 1024 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; + return type.symbol && type.symbol.flags & (16 /* Function */ | 4096 /* Method */ | 1024 /* TypeLiteral */ | 2048 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; } if (type.flags & 4096 /* Reference */) { return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); @@ -11351,16 +11698,16 @@ var ts; } function isContextSensitiveExpression(node) { switch (node.kind) { - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: return !node.typeParameters && !ts.forEach(node.parameters, function (p) { return p.type; }); - case 135 /* ObjectLiteral */: - return ts.forEach(node.properties, function (p) { return p.kind === 136 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); - case 134 /* ArrayLiteral */: + case 136 /* ObjectLiteral */: + return ts.forEach(node.properties, function (p) { return p.kind === 137 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); + case 135 /* ArrayLiteral */: return ts.forEach(node.elements, function (e) { return isContextSensitiveExpression(e); }); - case 148 /* ConditionalExpression */: + case 149 /* ConditionalExpression */: return isContextSensitiveExpression(node.whenTrue) || isContextSensitiveExpression(node.whenFalse); - case 147 /* BinaryExpression */: + case 148 /* BinaryExpression */: return node.operator === 44 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); } return false; @@ -11662,7 +12009,7 @@ var ts; return false; } } - else if (!(targetProp.flags & 67108864 /* Prototype */)) { + else if (!(targetProp.flags & 268435456 /* Prototype */)) { var sourceFlags = getDeclarationFlagsFromSymbol(sourceProp); var targetFlags = getDeclarationFlagsFromSymbol(targetProp); if (sourceFlags & 32 /* Private */ || targetFlags & 32 /* Private */) { @@ -11679,7 +12026,7 @@ var ts; } } else if (targetFlags & 64 /* Protected */) { - var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 16 /* Class */; + var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32 /* Class */; var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(sourceProp.parent) : undefined; var targetClass = getDeclaredTypeOfSymbol(targetProp.parent); if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { @@ -11915,7 +12262,7 @@ var ts; return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }); } function isTypeOfObjectLiteral(type) { - return (type.flags & 32768 /* Anonymous */) && type.symbol && (type.symbol.flags & 1024 /* ObjectLiteral */) ? true : false; + return (type.flags & 32768 /* Anonymous */) && type.symbol && (type.symbol.flags & 2048 /* ObjectLiteral */) ? true : false; } function isArrayType(type) { return type.flags & 4096 /* Reference */ && type.target === globalArrayType; @@ -11963,7 +12310,7 @@ var ts; var members = {}; var index = 0; ts.forEach(properties, function (p) { - var symbol = createSymbol(2 /* Property */ | 33554432 /* Transient */ | p.flags, p.name); + var symbol = createSymbol(4 /* Property */ | 134217728 /* Transient */ | p.flags, p.name); symbol.declarations = p.declarations; symbol.parent = p.parent; symbol.type = widenedTypes[index++]; @@ -12098,7 +12445,7 @@ var ts; inferFromTypes(sourceTypes[i], target); } } - else if (source.flags & ts.TypeFlags.ObjectType && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (2048 /* Method */ | 512 /* TypeLiteral */))) { + else if (source.flags & ts.TypeFlags.ObjectType && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (4096 /* Method */ | 1024 /* TypeLiteral */))) { if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { if (depth === 0) { sourceStack = []; @@ -12181,17 +12528,17 @@ var ts; function getResolvedSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { - links.resolvedSymbol = resolveName(node, node.text, ts.SymbolFlags.Value | 524288 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node)) || unknownSymbol; + links.resolvedSymbol = resolveName(node, node.text, ts.SymbolFlags.Value | 2097152 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node)) || unknownSymbol; } return links.resolvedSymbol; } function isInTypeQuery(node) { while (node) { switch (node.kind) { - case 128 /* TypeQuery */: + case 129 /* TypeQuery */: return true; case 59 /* Identifier */: - case 116 /* QualifiedName */: + case 117 /* QualifiedName */: node = node.parent; continue; default: @@ -12224,7 +12571,7 @@ var ts; function isAssignedInBinaryExpression(node) { if (node.operator >= ts.SyntaxKind.FirstAssignment && node.operator <= ts.SyntaxKind.LastAssignment) { var n = node.left; - while (n.kind === 142 /* ParenExpression */) { + while (n.kind === 143 /* ParenExpression */) { n = n.expression; } if (n.kind === 59 /* Identifier */ && getResolvedSymbol(n) === symbol) { @@ -12241,40 +12588,40 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 147 /* BinaryExpression */: + case 148 /* BinaryExpression */: return isAssignedInBinaryExpression(node); - case 173 /* VariableDeclaration */: + case 174 /* VariableDeclaration */: return isAssignedInVariableDeclaration(node); - case 134 /* ArrayLiteral */: - case 135 /* ObjectLiteral */: - case 137 /* PropertyAccess */: - case 138 /* IndexedAccess */: - case 139 /* CallExpression */: - case 140 /* NewExpression */: - case 141 /* TypeAssertion */: - case 142 /* ParenExpression */: - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: - case 148 /* ConditionalExpression */: - case 150 /* Block */: - case 151 /* VariableStatement */: - case 153 /* ExpressionStatement */: - case 154 /* IfStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 157 /* ForStatement */: - case 158 /* ForInStatement */: - case 161 /* ReturnStatement */: - case 162 /* WithStatement */: - case 163 /* SwitchStatement */: - case 164 /* CaseClause */: - case 165 /* DefaultClause */: - case 166 /* LabeledStatement */: - case 167 /* ThrowStatement */: - case 168 /* TryStatement */: - case 169 /* TryBlock */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: + case 135 /* ArrayLiteral */: + case 136 /* ObjectLiteral */: + case 138 /* PropertyAccess */: + case 139 /* IndexedAccess */: + case 140 /* CallExpression */: + case 141 /* NewExpression */: + case 142 /* TypeAssertion */: + case 143 /* ParenExpression */: + case 146 /* PrefixOperator */: + case 147 /* PostfixOperator */: + case 149 /* ConditionalExpression */: + case 151 /* Block */: + case 152 /* VariableStatement */: + case 154 /* ExpressionStatement */: + case 155 /* IfStatement */: + case 156 /* DoStatement */: + case 157 /* WhileStatement */: + case 158 /* ForStatement */: + case 159 /* ForInStatement */: + case 162 /* ReturnStatement */: + case 163 /* WithStatement */: + case 164 /* SwitchStatement */: + case 165 /* CaseClause */: + case 166 /* DefaultClause */: + case 167 /* LabeledStatement */: + case 168 /* ThrowStatement */: + case 169 /* TryStatement */: + case 170 /* TryBlock */: + case 171 /* CatchBlock */: + case 172 /* FinallyBlock */: return ts.forEachChild(node, isAssignedIn); } return false; @@ -12282,26 +12629,26 @@ var ts; } function getNarrowedTypeOfSymbol(symbol, node) { var type = getTypeOfSymbol(symbol); - if (symbol.flags & 1 /* Variable */ && type.flags & ts.TypeFlags.Structured) { + if (symbol.flags & ts.SymbolFlags.Variable && type.flags & ts.TypeFlags.Structured) { while (true) { var child = node; node = node.parent; - if (!node || node.kind === 175 /* FunctionBlock */ || node.kind === 180 /* ModuleBlock */) { + if (!node || node.kind === 176 /* FunctionBlock */ || node.kind === 182 /* ModuleBlock */) { break; } var narrowedType = type; switch (node.kind) { - case 154 /* IfStatement */: + case 155 /* IfStatement */: if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 148 /* ConditionalExpression */: + case 149 /* ConditionalExpression */: if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 147 /* BinaryExpression */: + case 148 /* BinaryExpression */: if (child === node.right) { if (node.operator === 43 /* AmpersandAmpersandToken */) { narrowedType = narrowType(type, node.left, true); @@ -12324,7 +12671,7 @@ var ts; function narrowTypeByEquality(type, expr, assumeTrue) { var left = expr.left; var right = expr.right; - if (left.kind !== 145 /* PrefixOperator */ || left.operator !== 91 /* TypeOfKeyword */ || left.operand.kind !== 59 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { + if (left.kind !== 146 /* PrefixOperator */ || left.operator !== 91 /* TypeOfKeyword */ || left.operand.kind !== 59 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { return type; } var t = right.text; @@ -12378,9 +12725,9 @@ var ts; } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 142 /* ParenExpression */: + case 143 /* ParenExpression */: return narrowType(type, expr.expression, assumeTrue); - case 147 /* BinaryExpression */: + case 148 /* BinaryExpression */: var operator = expr.operator; if (operator === 25 /* EqualsEqualsEqualsToken */ || operator === 26 /* ExclamationEqualsEqualsToken */) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -12395,7 +12742,7 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 145 /* PrefixOperator */: + case 146 /* PrefixOperator */: if (expr.operator === 41 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -12406,7 +12753,7 @@ var ts; } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 16777216 /* Import */) { getSymbolLinks(symbol).referenced = !isInTypeQuery(node); } checkCollisionWithCapturedSuperVariable(node, node); @@ -12415,9 +12762,9 @@ var ts; return getNarrowedTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol), node); } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 176 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 177 /* ClassDeclaration */ ? container.parent : undefined; getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 119 /* Property */ || container.kind === 121 /* Constructor */) { + if (container.kind === 120 /* Property */ || container.kind === 122 /* Constructor */) { getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } else { @@ -12427,23 +12774,23 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 144 /* ArrowFunction */) { + if (container.kind === 145 /* ArrowFunction */) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = true; } switch (container.kind) { - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); break; - case 178 /* EnumDeclaration */: + case 180 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 121 /* Constructor */: + case 122 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 119 /* Property */: + case 120 /* Property */: if (container.flags & 128 /* Static */) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } @@ -12452,7 +12799,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } - var classNode = container.parent && container.parent.kind === 176 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 177 /* ClassDeclaration */ ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); @@ -12465,29 +12812,29 @@ var ts; if (!node) return node; switch (node.kind) { - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 175 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: + case 120 /* Property */: + case 121 /* Method */: + case 122 /* Constructor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: return node; } } } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 118 /* Parameter */) { + if (n.kind === 119 /* Parameter */) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 139 /* CallExpression */ && node.parent.func === node; - var enclosingClass = ts.getAncestor(node, 176 /* ClassDeclaration */); + var isCallExpression = node.parent.kind === 140 /* CallExpression */ && node.parent.func === node; + var enclosingClass = ts.getAncestor(node, 177 /* ClassDeclaration */); var baseClass; if (enclosingClass && enclosingClass.baseType) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); @@ -12501,20 +12848,20 @@ var ts; if (container) { var canUseSuperExpression = false; if (isCallExpression) { - canUseSuperExpression = container.kind === 121 /* Constructor */; + canUseSuperExpression = container.kind === 122 /* Constructor */; } else { var needToCaptureLexicalThis = false; - while (container && container.kind === 144 /* ArrowFunction */) { + while (container && container.kind === 145 /* ArrowFunction */) { container = getSuperContainer(container); needToCaptureLexicalThis = true; } - if (container && container.parent && container.parent.kind === 176 /* ClassDeclaration */) { + if (container && container.parent && container.parent.kind === 177 /* ClassDeclaration */) { if (container.flags & 128 /* Static */) { - canUseSuperExpression = container.kind === 120 /* Method */ || container.kind === 122 /* GetAccessor */ || container.kind === 123 /* SetAccessor */; + canUseSuperExpression = container.kind === 121 /* Method */ || container.kind === 123 /* GetAccessor */ || container.kind === 124 /* SetAccessor */; } else { - canUseSuperExpression = container.kind === 120 /* Method */ || container.kind === 122 /* GetAccessor */ || container.kind === 123 /* SetAccessor */ || container.kind === 119 /* Property */ || container.kind === 121 /* Constructor */; + canUseSuperExpression = container.kind === 121 /* Method */ || container.kind === 123 /* GetAccessor */ || container.kind === 124 /* SetAccessor */ || container.kind === 120 /* Property */ || container.kind === 122 /* Constructor */; } } } @@ -12528,7 +12875,7 @@ var ts; getNodeLinks(node).flags |= 16 /* SuperInstance */; returnType = baseClass; } - if (container.kind === 121 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 122 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); returnType = unknownType; } @@ -12548,7 +12895,7 @@ var ts; } function getContextuallyTypedParameterType(parameter) { var func = parameter.parent; - if (func.kind === 143 /* FunctionExpression */ || func.kind === 144 /* ArrowFunction */) { + if (func.kind === 144 /* FunctionExpression */ || func.kind === 145 /* ArrowFunction */) { if (isContextSensitiveExpression(func)) { var contextualSignature = getContextualSignature(func); if (contextualSignature) { @@ -12572,7 +12919,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 118 /* Parameter */) { + if (declaration.kind === 119 /* Parameter */) { return getContextuallyTypedParameterType(declaration); } } @@ -12581,7 +12928,7 @@ var ts; function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); if (func) { - if (func.type || func.kind === 121 /* Constructor */ || func.kind === 122 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 123 /* SetAccessor */))) { + if (func.type || func.kind === 122 /* Constructor */ || func.kind === 123 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 124 /* SetAccessor */))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } var signature = getContextualSignature(func); @@ -12687,25 +13034,25 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 173 /* VariableDeclaration */: - case 118 /* Parameter */: - case 119 /* Property */: + case 174 /* VariableDeclaration */: + case 119 /* Parameter */: + case 120 /* Property */: return getContextualTypeForInitializerExpression(node); - case 144 /* ArrowFunction */: - case 161 /* ReturnStatement */: + case 145 /* ArrowFunction */: + case 162 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 139 /* CallExpression */: - case 140 /* NewExpression */: + case 140 /* CallExpression */: + case 141 /* NewExpression */: return getContextualTypeForArgument(node); - case 141 /* TypeAssertion */: + case 142 /* TypeAssertion */: return getTypeFromTypeNode(parent.type); - case 147 /* BinaryExpression */: + case 148 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 136 /* PropertyAssignment */: + case 137 /* PropertyAssignment */: return getContextualTypeForPropertyExpression(node); - case 134 /* ArrayLiteral */: + case 135 /* ArrayLiteral */: return getContextualTypeForElementExpression(node); - case 148 /* ConditionalExpression */: + case 149 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); } return undefined; @@ -12767,9 +13114,9 @@ var ts; for (var id in members) { if (ts.hasProperty(members, id)) { var member = members[id]; - if (member.flags & 2 /* Property */) { + if (member.flags & 4 /* Property */) { var type = checkExpression(member.declarations[0].initializer, contextualMapper); - var prop = createSymbol(2 /* Property */ | 33554432 /* Transient */ | member.flags, member.name); + var prop = createSymbol(4 /* Property */ | 134217728 /* Transient */ | member.flags, member.name); prop.declarations = member.declarations; prop.parent = member.parent; if (member.valueDeclaration) @@ -12779,11 +13126,11 @@ var ts; member = prop; } else { - var getAccessor = getDeclarationOfKind(member, 122 /* GetAccessor */); + var getAccessor = getDeclarationOfKind(member, 123 /* GetAccessor */); if (getAccessor) { checkAccessorDeclaration(getAccessor); } - var setAccessor = getDeclarationOfKind(member, 123 /* SetAccessor */); + var setAccessor = getDeclarationOfKind(member, 124 /* SetAccessor */); if (setAccessor) { checkAccessorDeclaration(setAccessor); } @@ -12813,17 +13160,17 @@ var ts; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 119 /* Property */; + return s.valueDeclaration ? s.valueDeclaration.kind : 120 /* Property */; } function getDeclarationFlagsFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & 67108864 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; + return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & 268435456 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; } function checkClassPropertyAccess(node, type, prop) { var flags = getDeclarationFlagsFromSymbol(prop); if (!(flags & (32 /* Private */ | 64 /* Protected */))) { return; } - var enclosingClassDeclaration = ts.getAncestor(node, 176 /* ClassDeclaration */); + var enclosingClassDeclaration = ts.getAncestor(node, 177 /* ClassDeclaration */); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (flags & 32 /* Private */) { @@ -12863,8 +13210,8 @@ var ts; return unknownType; } getNodeLinks(node).resolvedSymbol = prop; - if (prop.parent && prop.parent.flags & 16 /* Class */) { - if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 120 /* Method */) { + if (prop.parent && prop.parent.flags & 32 /* Class */) { + if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 121 /* Method */) { error(node.right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } else { @@ -12879,8 +13226,8 @@ var ts; var type = checkExpression(node.left); if (type !== unknownType && type !== anyType) { var prop = getPropertyOfType(getWidenedType(type), propertyName); - if (prop && prop.parent && prop.parent.flags & 16 /* Class */) { - if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 120 /* Method */) { + if (prop && prop.parent && prop.parent.flags & 32 /* Class */) { + if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 121 /* Method */) { return false; } else { @@ -12969,7 +13316,7 @@ var ts; var context = createInferenceContext(typeParameters, false); var mapper = createInferenceMapper(context); for (var i = 0; i < args.length; i++) { - if (args[i].kind === 149 /* OmittedExpression */) { + if (args[i].kind === 150 /* OmittedExpression */) { continue; } if (!excludeArgument || excludeArgument[i] === undefined) { @@ -12979,7 +13326,7 @@ var ts; } if (excludeArgument) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 149 /* OmittedExpression */) { + if (args[i].kind === 150 /* OmittedExpression */) { continue; } if (excludeArgument[i] === false) { @@ -13009,7 +13356,7 @@ var ts; if (node.arguments) { for (var i = 0; i < node.arguments.length; i++) { var arg = node.arguments[i]; - if (arg.kind === 149 /* OmittedExpression */) { + if (arg.kind === 150 /* OmittedExpression */) { continue; } var paramType = getTypeAtPosition(signature, i); @@ -13182,7 +13529,7 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - links.resolvedSignature = node.kind === 139 /* CallExpression */ ? resolveCallExpression(node, candidatesOutArray) : resolveNewExpression(node, candidatesOutArray); + links.resolvedSignature = node.kind === 140 /* CallExpression */ ? resolveCallExpression(node, candidatesOutArray) : resolveNewExpression(node, candidatesOutArray); } return links.resolvedSignature; } @@ -13191,9 +13538,9 @@ var ts; if (node.func.kind === 85 /* SuperKeyword */) { return voidType; } - if (node.kind === 140 /* NewExpression */) { + if (node.kind === 141 /* NewExpression */) { var declaration = signature.declaration; - if (declaration && (declaration.kind !== 121 /* Constructor */ && declaration.kind !== 125 /* ConstructSignature */)) { + if (declaration && (declaration.kind !== 122 /* Constructor */ && declaration.kind !== 126 /* ConstructSignature */)) { if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -13231,7 +13578,7 @@ var ts; } function getReturnTypeFromBody(func, contextualMapper) { var contextualSignature = getContextualSignature(func); - if (func.body.kind !== 175 /* FunctionBlock */) { + if (func.body.kind !== 176 /* FunctionBlock */) { var unwidenedType = checkAndMarkExpression(func.body, contextualMapper); var widenedType = getWidenedType(unwidenedType); if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { @@ -13279,7 +13626,7 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 167 /* ThrowStatement */); + return (body.statements.length === 1) && (body.statements[0].kind === 168 /* ThrowStatement */); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!fullTypeCheck) { @@ -13288,7 +13635,7 @@ var ts; if (returnType === voidType || returnType === anyType) { return; } - if (!func.body || func.body.kind !== 175 /* FunctionBlock */) { + if (!func.body || func.body.kind !== 176 /* FunctionBlock */) { return; } var bodyBlock = func.body; @@ -13332,7 +13679,7 @@ var ts; if (node.type) { checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } - if (node.body.kind === 175 /* FunctionBlock */) { + if (node.body.kind === 176 /* FunctionBlock */) { checkSourceElement(node.body); } else { @@ -13350,7 +13697,7 @@ var ts; } return true; } - function checkReferenceExpression(n, message) { + function checkReferenceExpression(n, invalidReferenceMessage, constantVarianleMessage) { function findSymbol(n) { var symbol = getNodeLinks(n).resolvedSymbol; return symbol && getExportSymbolOfValueSymbolIfExported(symbol); @@ -13359,20 +13706,45 @@ var ts; switch (n.kind) { case 59 /* Identifier */: var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 1 /* Variable */) !== 0; - case 137 /* PropertyAccess */: + return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & ts.SymbolFlags.Variable) !== 0; + case 138 /* PropertyAccess */: var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || (symbol.flags & ~4 /* EnumMember */) !== 0; - case 138 /* IndexedAccess */: + return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0; + case 139 /* IndexedAccess */: return true; - case 142 /* ParenExpression */: + case 143 /* ParenExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; } } + function isConstVariableReference(n) { + switch (n.kind) { + case 59 /* Identifier */: + case 138 /* PropertyAccess */: + var symbol = findSymbol(n); + return symbol && (symbol.flags & ts.SymbolFlags.Variable) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 4096 /* Const */) !== 0; + case 139 /* IndexedAccess */: + var index = n.index; + var symbol = findSymbol(n.object); + if (symbol && index.kind === 7 /* StringLiteral */) { + var name = index.text; + var prop = getPropertyOfType(getTypeOfSymbol(symbol), name); + return prop && (prop.flags & ts.SymbolFlags.Variable) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 4096 /* Const */) !== 0; + } + return false; + case 143 /* ParenExpression */: + return isConstVariableReference(n.expression); + default: + return false; + } + } if (!isReferenceOrErrorExpression(n)) { - error(n, message); + error(n, invalidReferenceMessage); + return false; + } + if (isConstVariableReference(n)) { + error(n, constantVarianleMessage); return false; } return true; @@ -13395,7 +13767,7 @@ var ts; case 34 /* MinusMinusToken */: var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; } @@ -13405,7 +13777,7 @@ var ts; var operandType = checkExpression(node.operand); var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; } @@ -13541,7 +13913,7 @@ var ts; } function checkAssignmentOperator(valueType) { if (fullTypeCheck && operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { - var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression); + var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); if (ok) { checkTypeAssignableTo(valueType, leftType, node.left, undefined, undefined); } @@ -13604,35 +13976,35 @@ var ts; return stringType; case 8 /* RegularExpressionLiteral */: return globalRegExpType; - case 116 /* QualifiedName */: + case 117 /* QualifiedName */: return checkPropertyAccess(node); - case 134 /* ArrayLiteral */: + case 135 /* ArrayLiteral */: return checkArrayLiteral(node, contextualMapper); - case 135 /* ObjectLiteral */: + case 136 /* ObjectLiteral */: return checkObjectLiteral(node, contextualMapper); - case 137 /* PropertyAccess */: + case 138 /* PropertyAccess */: return checkPropertyAccess(node); - case 138 /* IndexedAccess */: + case 139 /* IndexedAccess */: return checkIndexedAccess(node); - case 139 /* CallExpression */: - case 140 /* NewExpression */: + case 140 /* CallExpression */: + case 141 /* NewExpression */: return checkCallExpression(node); - case 141 /* TypeAssertion */: + case 142 /* TypeAssertion */: return checkTypeAssertion(node); - case 142 /* ParenExpression */: + case 143 /* ParenExpression */: return checkExpression(node.expression); - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: return checkFunctionExpression(node, contextualMapper); - case 145 /* PrefixOperator */: + case 146 /* PrefixOperator */: return checkPrefixExpression(node); - case 146 /* PostfixOperator */: + case 147 /* PostfixOperator */: return checkPostfixExpression(node); - case 147 /* BinaryExpression */: + case 148 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 148 /* ConditionalExpression */: + case 149 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); - case 149 /* OmittedExpression */: + case 150 /* OmittedExpression */: return undefinedType; } return unknownType; @@ -13648,7 +14020,7 @@ var ts; checkVariableDeclaration(parameterDeclaration); if (fullTypeCheck) { checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); - if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */) && !(parameterDeclaration.parent.kind === 121 /* Constructor */ && parameterDeclaration.parent.body)) { + if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */) && !(parameterDeclaration.parent.kind === 122 /* Constructor */ && parameterDeclaration.parent.body)) { error(parameterDeclaration, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } if (parameterDeclaration.flags & 8 /* Rest */) { @@ -13666,7 +14038,7 @@ var ts; if (n.kind === 59 /* Identifier */) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, ts.SymbolFlags.Value) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 118 /* Parameter */) { + if (referencedSymbol.valueDeclaration.kind === 119 /* Parameter */) { if (referencedSymbol.valueDeclaration === parameterDeclaration) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.identifierToString(parameterDeclaration.name)); return; @@ -13700,10 +14072,10 @@ var ts; checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 125 /* ConstructSignature */: + case 126 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 124 /* CallSignature */: + case 125 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -13712,7 +14084,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 177 /* InterfaceDeclaration */) { + if (node.kind === 178 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -13768,17 +14140,17 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 139 /* CallExpression */ && n.func.kind === 85 /* SuperKeyword */; + return n.kind === 140 /* CallExpression */ && n.func.kind === 85 /* SuperKeyword */; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 143 /* FunctionExpression */: - case 174 /* FunctionDeclaration */: - case 144 /* ArrowFunction */: - case 135 /* ObjectLiteral */: + case 144 /* FunctionExpression */: + case 175 /* FunctionDeclaration */: + case 145 /* ArrowFunction */: + case 136 /* ObjectLiteral */: return false; default: return ts.forEachChild(n, containsSuperCall); @@ -13788,19 +14160,19 @@ var ts; if (n.kind === 87 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 143 /* FunctionExpression */ && n.kind !== 174 /* FunctionDeclaration */) { + else if (n.kind !== 144 /* FunctionExpression */ && n.kind !== 175 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 119 /* Property */ && !(n.flags & 128 /* Static */) && !!n.initializer; + return n.kind === 120 /* Property */ && !(n.flags & 128 /* Static */) && !!n.initializer; } if (node.parent.baseType) { if (containsSuperCall(node.body)) { var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */); }); if (superCallShouldBeFirst) { var statements = node.body.statements; - if (!statements.length || statements[0].kind !== 153 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 154 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); } else { @@ -13815,12 +14187,12 @@ var ts; } function checkAccessorDeclaration(node) { if (fullTypeCheck) { - if (node.kind === 122 /* GetAccessor */) { + if (node.kind === 123 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && node.body && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); } } - var otherKind = node.kind === 122 /* GetAccessor */ ? 123 /* SetAccessor */ : 122 /* GetAccessor */; + var otherKind = node.kind === 123 /* GetAccessor */ ? 124 /* SetAccessor */ : 123 /* GetAccessor */; var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if (((node.flags & ts.NodeFlags.AccessibilityModifier) !== (otherAccessor.flags & ts.NodeFlags.AccessibilityModifier))) { @@ -13889,9 +14261,9 @@ var ts; } var symbol = getSymbolOfNode(signatureDeclarationNode); var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 177 /* InterfaceDeclaration */) { - ts.Debug.assert(signatureDeclarationNode.kind === 124 /* CallSignature */ || signatureDeclarationNode.kind === 125 /* ConstructSignature */); - var signatureKind = signatureDeclarationNode.kind === 124 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 178 /* InterfaceDeclaration */) { + ts.Debug.assert(signatureDeclarationNode.kind === 125 /* CallSignature */ || signatureDeclarationNode.kind === 126 /* ConstructSignature */); + var signatureKind = signatureDeclarationNode.kind === 125 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -13909,7 +14281,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = n.flags; - if (n.parent.kind !== 177 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 178 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { if (!(flags & 2 /* Ambient */)) { flags |= 1 /* Export */; } @@ -13951,9 +14323,9 @@ var ts; var lastSeenNonAmbientDeclaration; var previousDeclaration; var declarations = symbol.declarations; - var isConstructor = (symbol.flags & 4096 /* Constructor */) !== 0; + var isConstructor = (symbol.flags & 8192 /* Constructor */) !== 0; function reportImplementationExpectedError(node) { - if (node.name && node.name.kind === 115 /* Missing */) { + if (node.name && node.name.kind === 116 /* Missing */) { return; } var seen = false; @@ -13969,7 +14341,7 @@ var ts; if (subsequentNode.kind === node.kind) { var errorNode = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - ts.Debug.assert(node.kind === 120 /* Method */); + ts.Debug.assert(node.kind === 121 /* Method */); ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */)); var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode, diagnostic); @@ -13995,11 +14367,11 @@ var ts; for (var i = 0; i < declarations.length; i++) { var node = declarations[i]; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 177 /* InterfaceDeclaration */ || node.parent.kind === 129 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 178 /* InterfaceDeclaration */ || node.parent.kind === 130 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 174 /* FunctionDeclaration */ || node.kind === 120 /* Method */ || node.kind === 121 /* Constructor */) { + if (node.kind === 175 /* FunctionDeclaration */ || node.kind === 121 /* Method */ || node.kind === 122 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -14093,14 +14465,14 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 177 /* InterfaceDeclaration */: - return 1048576 /* ExportType */; - case 179 /* ModuleDeclaration */: - return d.name.kind === 7 /* StringLiteral */ || ts.isInstantiated(d) ? 2097152 /* ExportNamespace */ | 524288 /* ExportValue */ : 2097152 /* ExportNamespace */; - case 176 /* ClassDeclaration */: - case 178 /* EnumDeclaration */: - return 1048576 /* ExportType */ | 524288 /* ExportValue */; - case 181 /* ImportDeclaration */: + case 178 /* InterfaceDeclaration */: + return 4194304 /* ExportType */; + case 181 /* ModuleDeclaration */: + return d.name.kind === 7 /* StringLiteral */ || ts.isInstantiated(d) ? 8388608 /* ExportNamespace */ | 2097152 /* ExportValue */ : 8388608 /* ExportNamespace */; + case 177 /* ClassDeclaration */: + case 180 /* EnumDeclaration */: + return 4194304 /* ExportType */ | 2097152 /* ExportValue */; + case 183 /* ImportDeclaration */: var result = 0; var target = resolveImport(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { @@ -14108,7 +14480,7 @@ var ts; }); return result; default: - return 524288 /* ExportValue */; + return 2097152 /* ExportValue */; } } } @@ -14158,7 +14530,7 @@ var ts; if (!(name && name.text === "_i")) { return; } - if (node.kind === 118 /* Parameter */) { + if (node.kind === 119 /* Parameter */) { if (node.parent.body && ts.hasRestParameters(node.parent) && !ts.isInAmbientContext(node)) { error(node, ts.Diagnostics.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter); } @@ -14175,11 +14547,11 @@ var ts; return; } switch (current.kind) { - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 120 /* Method */: - case 144 /* ArrowFunction */: - case 121 /* Constructor */: + case 175 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: + case 121 /* Method */: + case 145 /* ArrowFunction */: + case 122 /* Constructor */: if (ts.hasRestParameters(current)) { error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter); return; @@ -14193,13 +14565,13 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 119 /* Property */ || node.kind === 120 /* Method */ || node.kind === 122 /* GetAccessor */ || node.kind === 123 /* SetAccessor */) { + if (node.kind === 120 /* Property */ || node.kind === 121 /* Method */ || node.kind === 123 /* GetAccessor */ || node.kind === 124 /* SetAccessor */) { return false; } if (ts.isInAmbientContext(node)) { return false; } - if (node.kind === 118 /* Parameter */ && !node.parent.body) { + if (node.kind === 119 /* Parameter */ && !node.parent.body) { return false; } return true; @@ -14230,7 +14602,7 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = ts.getAncestor(node, 176 /* ClassDeclaration */); + var enclosingClass = ts.getAncestor(node, 177 /* ClassDeclaration */); if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } @@ -14248,14 +14620,27 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 179 /* ModuleDeclaration */ && !ts.isInstantiated(node)) { + if (node.kind === 181 /* ModuleDeclaration */ && !ts.isInstantiated(node)) { return; } - var parent = node.kind === 173 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (parent.kind === 184 /* SourceFile */ && ts.isExternalModule(parent)) { + var parent = node.kind === 174 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (parent.kind === 186 /* SourceFile */ && ts.isExternalModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, name.text, name.text); } } + function checkCollisionWithConstDeclarations(node) { + if (node.initializer && (node.flags & ts.NodeFlags.BlockScoped) === 0) { + var symbol = getSymbolOfNode(node); + if (symbol.flags & 1 /* FunctionScopedVariable */) { + var localDeclarationSymbol = resolveName(node, node.name.text, ts.SymbolFlags.Variable, undefined, undefined); + if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { + if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 4096 /* Const */) { + error(node, ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0, symbolToString(localDeclarationSymbol)); + } + } + } + } + } function checkVariableDeclaration(node) { checkSourceElement(node.type); checkExportsOnMergedDeclarations(node); @@ -14274,6 +14659,7 @@ var ts; if (!(getNodeLinks(node.initializer).flags & 1 /* TypeChecked */)) { checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, undefined, undefined); } + checkCollisionWithConstDeclarations(node); } checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); @@ -14328,7 +14714,7 @@ var ts; error(node.variable, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); } else { - checkReferenceExpression(node.variable, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement); + checkReferenceExpression(node.variable, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); } } var exprType = checkExpression(node.expression); @@ -14343,18 +14729,18 @@ var ts; if (node.expression && !(getNodeLinks(node.expression).flags & 1 /* TypeChecked */)) { var func = ts.getContainingFunction(node); if (func) { - if (func.kind === 123 /* SetAccessor */) { + if (func.kind === 124 /* SetAccessor */) { if (node.expression) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } } else { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); - var checkAssignability = func.type || (func.kind === 122 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 123 /* SetAccessor */))); + var checkAssignability = func.type || (func.kind === 123 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 124 /* SetAccessor */))); if (checkAssignability) { checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, undefined, undefined); } - else if (func.kind == 121 /* Constructor */) { + else if (func.kind == 122 /* Constructor */) { if (!isTypeAssignableTo(checkExpression(node.expression), returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -14514,13 +14900,13 @@ var ts; } } function getTargetSymbol(s) { - return s.flags & 8388608 /* Instantiated */ ? getSymbolLinks(s).target : s; + return s.flags & 33554432 /* Instantiated */ ? getSymbolLinks(s).target : s; } function checkKindsOfPropertyMemberOverrides(type, baseType) { var baseProperties = getPropertiesOfObjectType(baseType); for (var i = 0, len = baseProperties.length; i < len; ++i) { var base = getTargetSymbol(baseProperties[i]); - if (base.flags & 67108864 /* Prototype */) { + if (base.flags & 268435456 /* Prototype */) { continue; } var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); @@ -14533,26 +14919,26 @@ var ts; if ((baseDeclarationFlags & 128 /* Static */) !== (derivedDeclarationFlags & 128 /* Static */)) { continue; } - if ((base.flags & derived.flags & 2048 /* Method */) || ((base.flags & ts.SymbolFlags.PropertyOrAccessor) && (derived.flags & ts.SymbolFlags.PropertyOrAccessor))) { + if ((base.flags & derived.flags & 4096 /* Method */) || ((base.flags & ts.SymbolFlags.PropertyOrAccessor) && (derived.flags & ts.SymbolFlags.PropertyOrAccessor))) { continue; } var errorMessage; - if (base.flags & 2048 /* Method */) { + if (base.flags & 4096 /* Method */) { if (derived.flags & ts.SymbolFlags.Accessor) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - ts.Debug.assert(derived.flags & 2 /* Property */); + ts.Debug.assert(derived.flags & 4 /* Property */); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } - else if (base.flags & 2 /* Property */) { - ts.Debug.assert(derived.flags & 2048 /* Method */); + else if (base.flags & 4 /* Property */) { + ts.Debug.assert(derived.flags & 4096 /* Method */); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { ts.Debug.assert(base.flags & ts.SymbolFlags.Accessor); - ts.Debug.assert(derived.flags & 2048 /* Method */); + ts.Debug.assert(derived.flags & 4096 /* Method */); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); @@ -14560,7 +14946,7 @@ var ts; } } function isAccessor(kind) { - return kind === 122 /* GetAccessor */ || kind === 123 /* SetAccessor */; + return kind === 123 /* GetAccessor */ || kind === 124 /* SetAccessor */; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -14593,7 +14979,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = getDeclarationOfKind(symbol, 177 /* InterfaceDeclaration */); + var firstInterfaceDecl = getDeclarationOfKind(symbol, 178 /* InterfaceDeclaration */); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); @@ -14615,9 +15001,12 @@ var ts; checkTypeForDuplicateIndexSignatures(node); } } + function checkTypeAliasDeclaration(node) { + checkSourceElement(node.type); + } function getConstantValueForExpression(node) { var isNegative = false; - if (node.kind === 145 /* PrefixOperator */) { + if (node.kind === 146 /* PrefixOperator */) { var unaryExpression = node; if (unaryExpression.operator === 29 /* MinusToken */ || unaryExpression.operator === 28 /* PlusToken */) { node = unaryExpression.operand; @@ -14672,7 +15061,7 @@ var ts; if (node === firstDeclaration) { var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 178 /* EnumDeclaration */) { + if (declaration.kind !== 180 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -14695,7 +15084,7 @@ var ts; var declarations = symbol.declarations; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; - if ((declaration.kind === 176 /* ClassDeclaration */ || (declaration.kind === 174 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 177 /* ClassDeclaration */ || (declaration.kind === 175 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { return declaration; } } @@ -14707,7 +15096,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - if (symbol.flags & 128 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { + if (symbol.flags & 256 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (classOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { @@ -14730,7 +15119,7 @@ var ts; checkSourceElement(node.body); } function getFirstIdentifier(node) { - while (node.kind === 116 /* QualifiedName */) { + while (node.kind === 117 /* QualifiedName */) { node = node.left; } return node; @@ -14758,10 +15147,10 @@ var ts; } } else { - if (node.parent.kind === 184 /* SourceFile */) { + if (node.parent.kind === 186 /* SourceFile */) { target = resolveImport(symbol); } - else if (node.parent.kind === 180 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { + else if (node.parent.kind === 182 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { if (isExternalModuleNameRelative(node.externalModuleName.text)) { error(node, ts.Diagnostics.Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); target = unknownSymbol; @@ -14783,7 +15172,7 @@ var ts; } function checkExportAssignment(node) { var container = node.parent; - if (container.kind !== 184 /* SourceFile */) { + if (container.kind !== 186 /* SourceFile */) { container = container.parent; } checkTypeOfExportAssignmentSymbol(getSymbolOfNode(container)); @@ -14792,148 +15181,150 @@ var ts; if (!node) return; switch (node.kind) { - case 117 /* TypeParameter */: + case 118 /* TypeParameter */: return checkTypeParameter(node); - case 118 /* Parameter */: + case 119 /* Parameter */: return checkParameter(node); - case 119 /* Property */: + case 120 /* Property */: return checkPropertyDeclaration(node); - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: + case 125 /* CallSignature */: + case 126 /* ConstructSignature */: + case 127 /* IndexSignature */: return checkSignatureDeclaration(node); - case 120 /* Method */: + case 121 /* Method */: return checkMethodDeclaration(node); - case 121 /* Constructor */: + case 122 /* Constructor */: return checkConstructorDeclaration(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: return checkAccessorDeclaration(node); - case 127 /* TypeReference */: + case 128 /* TypeReference */: return checkTypeReference(node); - case 128 /* TypeQuery */: + case 129 /* TypeQuery */: return checkTypeQuery(node); - case 129 /* TypeLiteral */: + case 130 /* TypeLiteral */: return checkTypeLiteral(node); - case 130 /* ArrayType */: + case 131 /* ArrayType */: return checkArrayType(node); - case 131 /* TupleType */: + case 132 /* TupleType */: return checkTupleType(node); - case 132 /* UnionType */: + case 133 /* UnionType */: return checkUnionType(node); - case 133 /* ParenType */: + case 134 /* ParenType */: return checkSourceElement(node.type); - case 174 /* FunctionDeclaration */: + case 175 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 150 /* Block */: + case 151 /* Block */: return checkBlock(node); - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: + case 176 /* FunctionBlock */: + case 182 /* ModuleBlock */: return checkBody(node); - case 151 /* VariableStatement */: + case 152 /* VariableStatement */: return checkVariableStatement(node); - case 153 /* ExpressionStatement */: + case 154 /* ExpressionStatement */: return checkExpressionStatement(node); - case 154 /* IfStatement */: + case 155 /* IfStatement */: return checkIfStatement(node); - case 155 /* DoStatement */: + case 156 /* DoStatement */: return checkDoStatement(node); - case 156 /* WhileStatement */: + case 157 /* WhileStatement */: return checkWhileStatement(node); - case 157 /* ForStatement */: + case 158 /* ForStatement */: return checkForStatement(node); - case 158 /* ForInStatement */: + case 159 /* ForInStatement */: return checkForInStatement(node); - case 159 /* ContinueStatement */: - case 160 /* BreakStatement */: + case 160 /* ContinueStatement */: + case 161 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 161 /* ReturnStatement */: + case 162 /* ReturnStatement */: return checkReturnStatement(node); - case 162 /* WithStatement */: + case 163 /* WithStatement */: return checkWithStatement(node); - case 163 /* SwitchStatement */: + case 164 /* SwitchStatement */: return checkSwitchStatement(node); - case 166 /* LabeledStatement */: + case 167 /* LabeledStatement */: return checkLabeledStatement(node); - case 167 /* ThrowStatement */: + case 168 /* ThrowStatement */: return checkThrowStatement(node); - case 168 /* TryStatement */: + case 169 /* TryStatement */: return checkTryStatement(node); - case 173 /* VariableDeclaration */: + case 174 /* VariableDeclaration */: return ts.Debug.fail("Checker encountered variable declaration"); - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: return checkClassDeclaration(node); - case 177 /* InterfaceDeclaration */: + case 178 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 178 /* EnumDeclaration */: + case 179 /* TypeAliasDeclaration */: + return checkTypeAliasDeclaration(node); + case 180 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 181 /* ImportDeclaration */: + case 183 /* ImportDeclaration */: return checkImportDeclaration(node); - case 182 /* ExportAssignment */: + case 184 /* ExportAssignment */: return checkExportAssignment(node); } } function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionBody(node); break; - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 174 /* FunctionDeclaration */: + case 121 /* Method */: + case 122 /* Constructor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 175 /* FunctionDeclaration */: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 162 /* WithStatement */: + case 163 /* WithStatement */: checkFunctionExpressionBodies(node.expression); break; - case 118 /* Parameter */: - case 119 /* Property */: - case 134 /* ArrayLiteral */: - case 135 /* ObjectLiteral */: - case 136 /* PropertyAssignment */: - case 137 /* PropertyAccess */: - case 138 /* IndexedAccess */: - case 139 /* CallExpression */: - case 140 /* NewExpression */: - case 141 /* TypeAssertion */: - case 142 /* ParenExpression */: - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: - case 147 /* BinaryExpression */: - case 148 /* ConditionalExpression */: - case 150 /* Block */: - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: - case 151 /* VariableStatement */: - case 153 /* ExpressionStatement */: - case 154 /* IfStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 157 /* ForStatement */: - case 158 /* ForInStatement */: - case 159 /* ContinueStatement */: - case 160 /* BreakStatement */: - case 161 /* ReturnStatement */: - case 163 /* SwitchStatement */: - case 164 /* CaseClause */: - case 165 /* DefaultClause */: - case 166 /* LabeledStatement */: - case 167 /* ThrowStatement */: - case 168 /* TryStatement */: - case 169 /* TryBlock */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: - case 173 /* VariableDeclaration */: - case 176 /* ClassDeclaration */: - case 178 /* EnumDeclaration */: - case 183 /* EnumMember */: - case 184 /* SourceFile */: + case 119 /* Parameter */: + case 120 /* Property */: + case 135 /* ArrayLiteral */: + case 136 /* ObjectLiteral */: + case 137 /* PropertyAssignment */: + case 138 /* PropertyAccess */: + case 139 /* IndexedAccess */: + case 140 /* CallExpression */: + case 141 /* NewExpression */: + case 142 /* TypeAssertion */: + case 143 /* ParenExpression */: + case 146 /* PrefixOperator */: + case 147 /* PostfixOperator */: + case 148 /* BinaryExpression */: + case 149 /* ConditionalExpression */: + case 151 /* Block */: + case 176 /* FunctionBlock */: + case 182 /* ModuleBlock */: + case 152 /* VariableStatement */: + case 154 /* ExpressionStatement */: + case 155 /* IfStatement */: + case 156 /* DoStatement */: + case 157 /* WhileStatement */: + case 158 /* ForStatement */: + case 159 /* ForInStatement */: + case 160 /* ContinueStatement */: + case 161 /* BreakStatement */: + case 162 /* ReturnStatement */: + case 164 /* SwitchStatement */: + case 165 /* CaseClause */: + case 166 /* DefaultClause */: + case 167 /* LabeledStatement */: + case 168 /* ThrowStatement */: + case 169 /* TryStatement */: + case 170 /* TryBlock */: + case 171 /* CatchBlock */: + case 172 /* FinallyBlock */: + case 174 /* VariableDeclaration */: + case 177 /* ClassDeclaration */: + case 180 /* EnumDeclaration */: + case 185 /* EnumMember */: + case 186 /* SourceFile */: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -14950,7 +15341,7 @@ var ts; checkBody(node); if (ts.isExternalModule(node)) { var symbol = getExportAssignmentSymbol(node.symbol); - if (symbol && symbol.flags & 4194304 /* Import */) { + if (symbol && symbol.flags & 16777216 /* Import */) { getSymbolLinks(symbol).referenced = true; } } @@ -15004,7 +15395,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 162 /* WithStatement */ && node.parent.statement === node) { + if (node.parent.kind === 163 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -15040,27 +15431,27 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 184 /* SourceFile */: + case 186 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & ts.SymbolFlags.ModuleMember); break; - case 178 /* EnumDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & 4 /* EnumMember */); + case 180 /* EnumDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: if (!(memberFlags & 128 /* Static */)) { copySymbols(getSymbolOfNode(location).members, meaning & ts.SymbolFlags.Type); } break; - case 143 /* FunctionExpression */: + case 144 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } break; - case 170 /* CatchBlock */: + case 171 /* CatchBlock */: if (location.variable.text) { copySymbol(location.symbol, meaning); } @@ -15077,85 +15468,19 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 117 /* TypeParameter */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: + case 118 /* TypeParameter */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 179 /* TypeAliasDeclaration */: + case 180 /* EnumDeclaration */: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 116 /* QualifiedName */) + while (node.parent && node.parent.kind === 117 /* QualifiedName */) node = node.parent; - return node.parent && node.parent.kind === 127 /* TypeReference */; - } - function isExpression(node) { - switch (node.kind) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: - case 8 /* RegularExpressionLiteral */: - case 134 /* ArrayLiteral */: - case 135 /* ObjectLiteral */: - case 137 /* PropertyAccess */: - case 138 /* IndexedAccess */: - case 139 /* CallExpression */: - case 140 /* NewExpression */: - case 141 /* TypeAssertion */: - case 142 /* ParenExpression */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: - case 147 /* BinaryExpression */: - case 148 /* ConditionalExpression */: - case 149 /* OmittedExpression */: - return true; - case 116 /* QualifiedName */: - while (node.parent.kind === 116 /* QualifiedName */) - node = node.parent; - return node.parent.kind === 128 /* TypeQuery */; - case 59 /* Identifier */: - if (node.parent.kind === 128 /* TypeQuery */) { - return true; - } - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - var parent = node.parent; - switch (parent.kind) { - case 173 /* VariableDeclaration */: - case 118 /* Parameter */: - case 119 /* Property */: - case 183 /* EnumMember */: - case 136 /* PropertyAssignment */: - return parent.initializer === node; - case 153 /* ExpressionStatement */: - case 154 /* IfStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 161 /* ReturnStatement */: - case 162 /* WithStatement */: - case 163 /* SwitchStatement */: - case 164 /* CaseClause */: - case 167 /* ThrowStatement */: - case 163 /* SwitchStatement */: - return parent.expression === node; - case 157 /* ForStatement */: - return parent.initializer === node || parent.condition === node || parent.iterator === node; - case 158 /* ForInStatement */: - return parent.variable === node || parent.expression === node; - case 141 /* TypeAssertion */: - return node === parent.operand; - default: - if (isExpression(parent)) { - return true; - } - } - } - return false; + return node.parent && node.parent.kind === 128 /* TypeReference */; } function isTypeNode(node) { if (ts.SyntaxKind.FirstTypeNode <= node.kind && node.kind <= ts.SyntaxKind.LastTypeNode) { @@ -15168,71 +15493,71 @@ var ts; case 106 /* BooleanKeyword */: return true; case 93 /* VoidKeyword */: - return node.parent.kind !== 145 /* PrefixOperator */; + return node.parent.kind !== 146 /* PrefixOperator */; case 7 /* StringLiteral */: - return node.parent.kind === 118 /* Parameter */; + return node.parent.kind === 119 /* Parameter */; case 59 /* Identifier */: - if (node.parent.kind === 116 /* QualifiedName */) { + if (node.parent.kind === 117 /* QualifiedName */) { node = node.parent; } - case 116 /* QualifiedName */: - ts.Debug.assert(node.kind === 59 /* Identifier */ || node.kind === 116 /* QualifiedName */, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); + case 117 /* QualifiedName */: + ts.Debug.assert(node.kind === 59 /* Identifier */ || node.kind === 117 /* QualifiedName */, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); var parent = node.parent; - if (parent.kind === 128 /* TypeQuery */) { + if (parent.kind === 129 /* TypeQuery */) { return false; } if (ts.SyntaxKind.FirstTypeNode <= parent.kind && parent.kind <= ts.SyntaxKind.LastTypeNode) { return true; } switch (parent.kind) { - case 117 /* TypeParameter */: + case 118 /* TypeParameter */: return node === parent.constraint; - case 119 /* Property */: - case 118 /* Parameter */: - case 173 /* VariableDeclaration */: + case 120 /* Property */: + case 119 /* Parameter */: + case 174 /* VariableDeclaration */: return node === parent.type; - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - case 121 /* Constructor */: - case 120 /* Method */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 175 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: + case 122 /* Constructor */: + case 121 /* Method */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: return node === parent.type; - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: + case 125 /* CallSignature */: + case 126 /* ConstructSignature */: + case 127 /* IndexSignature */: return node === parent.type; - case 141 /* TypeAssertion */: + case 142 /* TypeAssertion */: return node === parent.type; - case 139 /* CallExpression */: - case 140 /* NewExpression */: + case 140 /* CallExpression */: + case 141 /* NewExpression */: return parent.typeArguments && parent.typeArguments.indexOf(node) >= 0; } } return false; } function isInRightSideOfImportOrExportAssignment(node) { - while (node.parent.kind === 116 /* QualifiedName */) { + while (node.parent.kind === 117 /* QualifiedName */) { node = node.parent; } - if (node.parent.kind === 181 /* ImportDeclaration */) { + if (node.parent.kind === 183 /* ImportDeclaration */) { return node.parent.entityName === node; } - if (node.parent.kind === 182 /* ExportAssignment */) { + if (node.parent.kind === 184 /* ExportAssignment */) { return node.parent.exportName === node; } return false; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 116 /* QualifiedName */ || node.parent.kind === 137 /* PropertyAccess */) && node.parent.right === node; + return (node.parent.kind === 117 /* QualifiedName */ || node.parent.kind === 138 /* PropertyAccess */) && node.parent.right === node; } function getSymbolOfEntityName(entityName) { if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 182 /* ExportAssignment */) { - return resolveEntityName(entityName.parent.parent, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace | 4194304 /* Import */); + if (entityName.parent.kind === 184 /* ExportAssignment */) { + return resolveEntityName(entityName.parent.parent, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace | 16777216 /* Import */); } if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImport(entityName); @@ -15240,12 +15565,12 @@ var ts; if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (isExpression(entityName)) { + if (ts.isExpression(entityName)) { if (entityName.kind === 59 /* Identifier */) { - var meaning = ts.SymbolFlags.Value | 4194304 /* Import */; + var meaning = ts.SymbolFlags.Value | 16777216 /* Import */; return resolveEntityName(entityName, entityName, meaning); } - else if (entityName.kind === 116 /* QualifiedName */ || entityName.kind === 137 /* PropertyAccess */) { + else if (entityName.kind === 117 /* QualifiedName */ || entityName.kind === 138 /* PropertyAccess */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccess(entityName); @@ -15257,8 +15582,8 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 127 /* TypeReference */ ? ts.SymbolFlags.Type : ts.SymbolFlags.Namespace; - meaning |= 4194304 /* Import */; + var meaning = entityName.parent.kind === 128 /* TypeReference */ ? ts.SymbolFlags.Type : ts.SymbolFlags.Namespace; + meaning |= 16777216 /* Import */; return resolveEntityName(entityName, entityName, meaning); } return undefined; @@ -15271,12 +15596,12 @@ var ts; return getSymbolOfNode(node.parent); } if (node.kind === 59 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 182 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); + return node.parent.kind === 184 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); } switch (node.kind) { case 59 /* Identifier */: - case 137 /* PropertyAccess */: - case 116 /* QualifiedName */: + case 138 /* PropertyAccess */: + case 117 /* QualifiedName */: return getSymbolOfEntityName(node); case 87 /* ThisKeyword */: case 85 /* SuperKeyword */: @@ -15284,18 +15609,18 @@ var ts; return type.symbol; case 107 /* ConstructorKeyword */: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 121 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 122 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; case 7 /* StringLiteral */: - if (node.parent.kind === 181 /* ImportDeclaration */ && node.parent.externalModuleName === node) { + if (node.parent.kind === 183 /* ImportDeclaration */ && node.parent.externalModuleName === node) { var importSymbol = getSymbolOfNode(node.parent); var moduleType = getTypeOfSymbol(importSymbol); return moduleType ? moduleType.symbol : undefined; } case 6 /* NumericLiteral */: - if (node.parent.kind == 138 /* IndexedAccess */ && node.parent.index === node) { + if (node.parent.kind == 139 /* IndexedAccess */ && node.parent.index === node) { var objectType = checkExpression(node.parent.object); if (objectType === unknownType) return undefined; @@ -15312,7 +15637,7 @@ var ts; if (isInsideWithStatementBody(node)) { return unknownType; } - if (isExpression(node)) { + if (ts.isExpression(node)) { return getTypeOfExpression(node); } if (isTypeNode(node)) { @@ -15360,7 +15685,7 @@ var ts; return getNamedMembers(propsByName); } function getRootSymbols(symbol) { - if (symbol.flags & 134217728 /* UnionProperty */) { + if (symbol.flags & 536870912 /* UnionProperty */) { var symbols = []; var name = symbol.name; ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { @@ -15368,7 +15693,7 @@ var ts; }); return symbols; } - else if (symbol.flags & 33554432 /* Transient */) { + else if (symbol.flags & 134217728 /* Transient */) { var target = getSymbolLinks(symbol).target; if (target) { return [target]; @@ -15377,7 +15702,7 @@ var ts; return [symbol]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 128 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 184 /* SourceFile */; + return symbol.flags & 256 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 186 /* SourceFile */; } function isNodeDescendentOf(node, ancestor) { while (node) { @@ -15389,7 +15714,7 @@ var ts; } function isUniqueLocalName(name, container) { for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (ts.SymbolFlags.Value | 524288 /* ExportValue */)) { + if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (ts.SymbolFlags.Value | 2097152 /* ExportValue */)) { return false; } } @@ -15410,7 +15735,7 @@ var ts; function getLocalNameForSymbol(symbol, location) { var node = location; while (node) { - if ((node.kind === 179 /* ModuleDeclaration */ || node.kind === 178 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { + if ((node.kind === 181 /* ModuleDeclaration */ || node.kind === 180 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { return getLocalNameOfContainer(node); } node = node.parent; @@ -15434,7 +15759,7 @@ var ts; return symbol && symbolIsValue(symbol) ? symbolToString(symbol) : undefined; } function isTopLevelValueImportedViaEntityName(node) { - if (node.parent.kind !== 184 /* SourceFile */ || !node.entityName) { + if (node.parent.kind !== 186 /* SourceFile */ || !node.entityName) { return false; } var symbol = getSymbolOfNode(node); @@ -15444,6 +15769,9 @@ var ts; function hasSemanticErrors() { return getDiagnostics().length > 0 || getGlobalDiagnostics().length > 0; } + function hasEarlyErrors(sourceFile) { + return ts.forEach(getDiagnostics(sourceFile), function (d) { return d.isEarly; }); + } function isReferencedImportDeclaration(node) { var symbol = getSymbolOfNode(node); if (getSymbolLinks(symbol).referenced) { @@ -15474,10 +15802,10 @@ var ts; } function getConstantValue(node) { var symbol = getNodeLinks(node).resolvedSymbol; - if (symbol && (symbol.flags & 4 /* EnumMember */)) { + if (symbol && (symbol.flags & 8 /* EnumMember */)) { var declaration = symbol.valueDeclaration; var constantValue; - if (declaration.kind === 183 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { + if (declaration.kind === 185 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { return constantValue; } } @@ -15485,7 +15813,7 @@ var ts; } function writeTypeAtLocation(location, enclosingDeclaration, flags, writer) { var symbol = getSymbolOfNode(location); - var type = symbol && !(symbol.flags & 512 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); + var type = symbol && !(symbol.flags & 1024 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { @@ -15503,6 +15831,7 @@ var ts; getEnumMemberValue: getEnumMemberValue, isTopLevelValueImportedViaEntityName: isTopLevelValueImportedViaEntityName, hasSemanticErrors: hasSemanticErrors, + hasEarlyErrors: hasEarlyErrors, isDeclarationVisible: isDeclarationVisible, isImplementationOfOverload: isImplementationOfOverload, writeTypeAtLocation: writeTypeAtLocation, @@ -18208,7 +18537,7 @@ var TypeScript; Scanner.isContextualToken = isContextualToken; var lastTokenInfo = { leadingTriviaWidth: -1, width: -1 }; var lastTokenInfoTokenID = -1; - var triviaScanner = createScannerInternal(1 /* ES5 */, TypeScript.SimpleText.fromString(""), function () { + var triviaScanner = createScannerInternal(ts.ScriptTarget.Latest, TypeScript.SimpleText.fromString(""), function () { }); function fillSizeInfo(token, text) { if (lastTokenInfoTokenID !== TypeScript.syntaxID(token)) { @@ -26889,7 +27218,7 @@ var TypeScript; if (languageVersion === 0 /* ES3 */) { return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES3IdentifierStart); } - else if (languageVersion === 1 /* ES5 */) { + else if (languageVersion >= 1 /* ES5 */) { return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES5IdentifierStart); } else { @@ -26900,7 +27229,7 @@ var TypeScript; if (languageVersion === 0 /* ES3 */) { return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES3IdentifierPart); } - else if (languageVersion === 1 /* ES5 */) { + else if (languageVersion >= 1 /* ES5 */) { return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES5IdentifierPart); } else { @@ -27339,10 +27668,10 @@ var ts; } function autoCollapse(node) { switch (node.kind) { - case 180 /* ModuleBlock */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: + case 182 /* ModuleBlock */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 180 /* EnumDeclaration */: return false; } return true; @@ -27354,11 +27683,11 @@ var ts; return; } switch (n.kind) { - case 150 /* Block */: + case 151 /* Block */: var parent = n.parent; var openBrace = ts.findChildOfKind(n, 9 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 10 /* CloseBraceToken */, sourceFile); - if (parent.kind === 155 /* DoStatement */ || parent.kind === 158 /* ForInStatement */ || parent.kind === 157 /* ForStatement */ || parent.kind === 154 /* IfStatement */ || parent.kind === 156 /* WhileStatement */ || parent.kind === 162 /* WithStatement */) { + if (parent.kind === 156 /* DoStatement */ || parent.kind === 159 /* ForInStatement */ || parent.kind === 158 /* ForStatement */ || parent.kind === 155 /* IfStatement */ || parent.kind === 157 /* WhileStatement */ || parent.kind === 163 /* WithStatement */) { addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); } else { @@ -27371,25 +27700,25 @@ var ts; }); } break; - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: - case 169 /* TryBlock */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: + case 176 /* FunctionBlock */: + case 182 /* ModuleBlock */: + case 170 /* TryBlock */: + case 171 /* CatchBlock */: + case 172 /* FinallyBlock */: var openBrace = ts.findChildOfKind(n, 9 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 10 /* CloseBraceToken */, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: - case 135 /* ObjectLiteral */: - case 163 /* SwitchStatement */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 180 /* EnumDeclaration */: + case 136 /* ObjectLiteral */: + case 164 /* SwitchStatement */: var openBrace = ts.findChildOfKind(n, 9 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 10 /* CloseBraceToken */, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; - case 134 /* ArrayLiteral */: + case 135 /* ArrayLiteral */: var openBracket = ts.findChildOfKind(n, 13 /* OpenBracketToken */, sourceFile); var closeBracket = ts.findChildOfKind(n, 14 /* CloseBracketToken */, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -27417,14 +27746,14 @@ var ts; var current = node.parent; while (current) { switch (current.kind) { - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: do { current = current.parent; - } while (current.kind === 179 /* ModuleDeclaration */); - case 176 /* ClassDeclaration */: - case 178 /* EnumDeclaration */: - case 177 /* InterfaceDeclaration */: - case 174 /* FunctionDeclaration */: + } while (current.kind === 181 /* ModuleDeclaration */); + case 177 /* ClassDeclaration */: + case 180 /* EnumDeclaration */: + case 178 /* InterfaceDeclaration */: + case 175 /* FunctionDeclaration */: indent++; } current = current.parent; @@ -27435,10 +27764,10 @@ var ts; var childNodes = []; for (var i = 0, n = nodes.length; i < n; i++) { var node = nodes[i]; - if (node.kind === 176 /* ClassDeclaration */ || node.kind === 178 /* EnumDeclaration */ || node.kind === 177 /* InterfaceDeclaration */ || node.kind === 179 /* ModuleDeclaration */ || node.kind === 174 /* FunctionDeclaration */) { + if (node.kind === 177 /* ClassDeclaration */ || node.kind === 180 /* EnumDeclaration */ || node.kind === 178 /* InterfaceDeclaration */ || node.kind === 181 /* ModuleDeclaration */ || node.kind === 175 /* FunctionDeclaration */) { childNodes.push(node); } - else if (node.kind === 151 /* VariableStatement */) { + else if (node.kind === 152 /* VariableStatement */) { childNodes.push.apply(childNodes, node.declarations); } } @@ -27471,17 +27800,17 @@ var ts; for (var i = 0, n = nodes.length; i < n; i++) { var node = nodes[i]; switch (node.kind) { - case 176 /* ClassDeclaration */: - case 178 /* EnumDeclaration */: - case 177 /* InterfaceDeclaration */: + case 177 /* ClassDeclaration */: + case 180 /* EnumDeclaration */: + case 178 /* InterfaceDeclaration */: topLevelNodes.push(node); break; - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 174 /* FunctionDeclaration */: + case 175 /* FunctionDeclaration */: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -27492,12 +27821,12 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 174 /* FunctionDeclaration */) { - if (functionDeclaration.body && functionDeclaration.body.kind === 175 /* FunctionBlock */) { - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 174 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { + if (functionDeclaration.kind === 175 /* FunctionDeclaration */) { + if (functionDeclaration.body && functionDeclaration.body.kind === 176 /* FunctionBlock */) { + if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 175 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { return true; } - if (functionDeclaration.parent.kind !== 175 /* FunctionBlock */) { + if (functionDeclaration.parent.kind !== 176 /* FunctionBlock */) { return true; } } @@ -27547,32 +27876,37 @@ var ts; } function createChildItem(node) { switch (node.kind) { - case 118 /* Parameter */: + case 119 /* Parameter */: if ((node.flags & ts.NodeFlags.Modifier) === 0) { return undefined; } return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 120 /* Method */: + case 121 /* Method */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberFunctionElement); - case 122 /* GetAccessor */: + case 123 /* GetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); - case 123 /* SetAccessor */: + case 124 /* SetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); - case 126 /* IndexSignature */: + case 127 /* IndexSignature */: return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 183 /* EnumMember */: + case 185 /* EnumMember */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 124 /* CallSignature */: + case 125 /* CallSignature */: return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); - case 125 /* ConstructSignature */: + case 126 /* ConstructSignature */: return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); - case 119 /* Property */: + case 120 /* Property */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 174 /* FunctionDeclaration */: + case 175 /* FunctionDeclaration */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 173 /* VariableDeclaration */: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.variableElement); - case 121 /* Constructor */: + case 174 /* VariableDeclaration */: + if (node.flags & 4096 /* Const */) { + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.constantElement); + } + else { + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.variableElement); + } + case 122 /* Constructor */: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); } return undefined; @@ -27602,17 +27936,17 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 184 /* SourceFile */: + case 186 /* SourceFile */: return createSourceFileItem(node); - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: return createClassItem(node); - case 178 /* EnumDeclaration */: + case 180 /* EnumDeclaration */: return createEnumItem(node); - case 177 /* InterfaceDeclaration */: + case 178 /* InterfaceDeclaration */: return createIterfaceItem(node); - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: return createModuleItem(node); - case 174 /* FunctionDeclaration */: + case 175 /* FunctionDeclaration */: return createFunctionItem(node); } return undefined; @@ -27622,7 +27956,7 @@ var ts; } var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 179 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 181 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -27634,7 +27968,7 @@ var ts; return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createFunctionItem(node) { - if (node.name && node.body && node.body.kind === 175 /* FunctionBlock */) { + if (node.name && node.body && node.body.kind === 176 /* FunctionBlock */) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); return getNavigationBarItem(node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } @@ -27653,7 +27987,7 @@ var ts; var childItems; if (node.members) { var constructor = ts.forEach(node.members, function (member) { - return member.kind === 121 /* Constructor */ && member; + return member.kind === 122 /* Constructor */ && member; }); var nodes = constructor ? constructor.parameters.concat(node.members) : node.members; var childItems = getItemsWorker(sortNodes(nodes), createChildItem); @@ -27670,13 +28004,13 @@ var ts; } } function getInnermostModule(node) { - while (node.body.kind === 179 /* ModuleDeclaration */) { + while (node.body.kind === 181 /* ModuleDeclaration */) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 184 /* SourceFile */ ? TypeScript.TextSpan.fromBounds(node.getFullStart(), node.getEnd()) : TypeScript.TextSpan.fromBounds(node.getStart(), node.getEnd()); + return node.kind === 186 /* SourceFile */ ? TypeScript.TextSpan.fromBounds(node.getFullStart(), node.getEnd()) : TypeScript.TextSpan.fromBounds(node.getStart(), node.getEnd()); } function getTextOfNode(node) { return ts.getTextOfNodeFromSourceText(sourceFile.text, node); @@ -27686,894 +28020,6 @@ var ts; })(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {})); })(ts || (ts = {})); var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Breakpoints; - (function (Breakpoints) { - function createBreakpointSpanInfo(parentElement) { - var childElements = []; - for (var _i = 1; _i < arguments.length; _i++) { - childElements[_i - 1] = arguments[_i]; - } - if (!parentElement) { - return null; - } - if (childElements.length == 0) { - return TypeScript.TextSpan.fromBounds(TypeScript.start(parentElement), TypeScript.end(parentElement)); - } - var start; - var end; - for (var i = 0; i < childElements.length; i++) { - var element = childElements[i]; - if (element && !TypeScript.isShared(element)) { - if (start == undefined) { - start = TypeScript.start(element); - } - end = TypeScript.end(element); - } - } - return TypeScript.TextSpan.fromBounds(start, end); - } - function createBreakpointSpanInfoWithLimChar(startElement, limChar) { - return TypeScript.TextSpan.fromBounds(TypeScript.start(startElement), limChar); - } - var BreakpointResolver = (function () { - function BreakpointResolver(posLine, lineMap) { - this.posLine = posLine; - this.lineMap = lineMap; - } - BreakpointResolver.prototype.breakpointSpanOfToken = function (positionedToken) { - switch (positionedToken.kind()) { - case 70 /* OpenBraceToken */: - return this.breakpointSpanOfOpenBrace(positionedToken); - case 71 /* CloseBraceToken */: - return this.breakpointSpanOfCloseBrace(positionedToken); - case 79 /* CommaToken */: - return this.breakpointSpanOfComma(positionedToken); - case 78 /* SemicolonToken */: - case 10 /* EndOfFileToken */: - return this.breakpointSpanIfStartsOnSameLine(TypeScript.previousToken(positionedToken)); - case 73 /* CloseParenToken */: - return this.breakpointSpanOfCloseParen(positionedToken); - case 22 /* DoKeyword */: - var parentElement = positionedToken.parent; - if (parentElement && parentElement.kind() == 162 /* DoStatement */) { - return this.breakpointSpanIfStartsOnSameLine(TypeScript.nextToken(positionedToken)); - } - break; - } - return this.breakpointSpanOfContainingNode(positionedToken); - }; - BreakpointResolver.prototype.breakpointSpanOfOpenBrace = function (openBraceToken) { - var container = TypeScript.Syntax.containingNode(openBraceToken); - if (container) { - var originalContainer = container; - if (container && container.kind() == 147 /* Block */) { - container = TypeScript.Syntax.containingNode(container); - if (!container) { - container = originalContainer; - } - } - switch (container.kind()) { - case 147 /* Block */: - if (!this.canHaveBreakpointInBlock(container)) { - return null; - } - return this.breakpointSpanOfFirstStatementInBlock(container); - break; - case 131 /* ModuleDeclaration */: - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 223 /* FunctionExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 220 /* SimpleArrowFunctionExpression */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstChildOfSyntaxList(this.getSyntaxListOfDeclarationWithElements(container)); - } - else { - return this.breakpointSpanOf(container); - } - case 133 /* EnumDeclaration */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstEnumElement(container); - } - else { - return this.breakpointSpanOf(container); - } - case 148 /* IfStatement */: - case 156 /* ForInStatement */: - case 159 /* WhileStatement */: - case 237 /* CatchClause */: - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - } - else { - return this.breakpointSpanOf(container); - } - case 162 /* DoStatement */: - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - case 155 /* ForStatement */: - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - } - else { - return this.breakpointSpanOf(TypeScript.previousToken(openBraceToken)); - } - case 236 /* ElseClause */: - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: - case 164 /* WithStatement */: - case 160 /* TryStatement */: - case 238 /* FinallyClause */: - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - case 152 /* SwitchStatement */: - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstStatementOfFirstCaseClause(container); - } - else { - return this.breakpointSpanOf(container); - } - } - } - return null; - }; - BreakpointResolver.prototype.breakpointSpanOfCloseBrace = function (closeBraceToken) { - var container = TypeScript.Syntax.containingNode(closeBraceToken); - if (container) { - var originalContainer = container; - if (container.kind() == 147 /* Block */) { - container = TypeScript.Syntax.containingNode(container); - if (!container) { - container = originalContainer; - } - } - switch (container.kind()) { - case 147 /* Block */: - if (!this.canHaveBreakpointInBlock(container)) { - return null; - } - return this.breakpointSpanOfLastStatementInBlock(container); - break; - case 131 /* ModuleDeclaration */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - var moduleSyntax = container; - if (moduleSyntax.moduleElements && moduleSyntax.moduleElements.length > 0) { - return createBreakpointSpanInfo(closeBraceToken); - } - else { - return null; - } - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 223 /* FunctionExpression */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - return createBreakpointSpanInfo(closeBraceToken); - case 133 /* EnumDeclaration */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - return createBreakpointSpanInfo(closeBraceToken); - case 148 /* IfStatement */: - case 236 /* ElseClause */: - case 156 /* ForInStatement */: - case 155 /* ForStatement */: - case 159 /* WhileStatement */: - case 162 /* DoStatement */: - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: - case 164 /* WithStatement */: - case 160 /* TryStatement */: - case 237 /* CatchClause */: - case 238 /* FinallyClause */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 220 /* SimpleArrowFunctionExpression */: - return this.breakpointSpanOfLastStatementInBlock(originalContainer); - case 152 /* SwitchStatement */: - return this.breakpointSpanOfLastStatementOfLastCaseClause(container); - } - } - return null; - }; - BreakpointResolver.prototype.breakpointSpanOfComma = function (commaToken) { - var commaParent = commaToken.parent; - if (TypeScript.isSeparatedList(commaParent)) { - var grandParent = commaParent.parent; - if (grandParent) { - switch (grandParent.kind()) { - case 225 /* VariableDeclaration */: - case 133 /* EnumDeclaration */: - case 228 /* ParameterList */: - var index = TypeScript.Syntax.childIndex(commaParent, commaToken); - if (index > 0) { - var child = TypeScript.childAt(commaParent, index - 1); - return this.breakpointSpanOf(child); - } - if (grandParent.kind() == 133 /* EnumDeclaration */) { - return null; - } - break; - } - } - } - return this.breakpointSpanOfContainingNode(commaToken); - }; - BreakpointResolver.prototype.breakpointSpanOfCloseParen = function (closeParenToken) { - var closeParenParent = closeParenToken.parent; - if (closeParenParent) { - switch (closeParenParent.kind()) { - case 155 /* ForStatement */: - case 228 /* ParameterList */: - return this.breakpointSpanOf(TypeScript.previousToken(closeParenToken)); - } - } - return this.breakpointSpanOfContainingNode(closeParenToken); - }; - BreakpointResolver.prototype.canHaveBreakpointInBlock = function (blockNode) { - if (!blockNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(blockNode)) { - return false; - } - var blockSyntax = blockNode; - return blockSyntax.statements && blockSyntax.statements.length != 0; - }; - BreakpointResolver.prototype.breakpointSpanOfFirstStatementInBlock = function (blockNode) { - if (!blockNode) { - return null; - } - var blockSyntax = blockNode; - var statementsNode = blockSyntax.statements; - if (!statementsNode || statementsNode.length == 0) { - return null; - } - var firstStatement = TypeScript.childAt(statementsNode, 0); - if (firstStatement && firstStatement.kind() == 147 /* Block */) { - if (this.canHaveBreakpointInBlock(firstStatement)) { - return this.breakpointSpanOfFirstStatementInBlock(firstStatement); - } - return null; - } - else { - return this.breakpointSpanOf(firstStatement); - } - }; - BreakpointResolver.prototype.breakpointSpanOfLastStatementInBlock = function (blockNode) { - if (!blockNode) { - return null; - } - var blockSyntax = blockNode; - var statementsNode = blockSyntax.statements; - if (!statementsNode || statementsNode.length == 0) { - return null; - } - var lastStatement = TypeScript.childAt(statementsNode, statementsNode.length - 1); - if (lastStatement && lastStatement.kind() == 147 /* Block */) { - if (this.canHaveBreakpointInBlock(lastStatement)) { - return this.breakpointSpanOfLastStatementInBlock(lastStatement); - } - return null; - } - else { - return this.breakpointSpanOf(lastStatement); - } - }; - BreakpointResolver.prototype.breakpointSpanOfFirstChildOfSyntaxList = function (positionedList) { - if (!positionedList) { - return null; - } - var listSyntax = positionedList; - if (listSyntax.length == 0) { - return null; - } - var firstStatement = TypeScript.childAt(positionedList, 0); - if (firstStatement && firstStatement.kind() == 147 /* Block */) { - if (this.canHaveBreakpointInBlock(firstStatement)) { - return this.breakpointSpanOfFirstStatementInBlock(firstStatement); - } - return null; - } - else { - return this.breakpointSpanOf(firstStatement); - } - }; - BreakpointResolver.prototype.breakpointSpanOfLastChildOfSyntaxList = function (positionedList) { - if (!positionedList) { - return null; - } - var listSyntax = positionedList; - if (listSyntax.length == 0) { - return null; - } - var lastStatement = TypeScript.childAt(positionedList, 0); - if (lastStatement && lastStatement.kind() == 147 /* Block */) { - if (this.canHaveBreakpointInBlock(lastStatement)) { - return this.breakpointSpanOfLastStatementInBlock(lastStatement); - } - return null; - } - else { - return this.breakpointSpanOf(lastStatement); - } - }; - BreakpointResolver.prototype.breakpointSpanOfNode = function (positionedNode) { - var node = positionedNode; - switch (node.kind()) { - case 131 /* ModuleDeclaration */: - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 223 /* FunctionExpression */: - return this.breakpointSpanOfDeclarationWithElements(positionedNode); - case 226 /* VariableDeclarator */: - return this.breakpointSpanOfVariableDeclarator(positionedNode); - case 225 /* VariableDeclaration */: - return this.breakpointSpanOfVariableDeclaration(positionedNode); - case 149 /* VariableStatement */: - return this.breakpointSpanOfVariableStatement(positionedNode); - case 243 /* Parameter */: - return this.breakpointSpanOfParameter(positionedNode); - case 137 /* MemberVariableDeclaration */: - return this.breakpointSpanOfMemberVariableDeclaration(positionedNode); - case 134 /* ImportDeclaration */: - return this.breakpointSpanOfImportDeclaration(positionedNode); - case 133 /* EnumDeclaration */: - return this.breakpointSpanOfEnumDeclaration(positionedNode); - case 244 /* EnumElement */: - return this.breakpointSpanOfEnumElement(positionedNode); - case 148 /* IfStatement */: - return this.breakpointSpanOfIfStatement(positionedNode); - case 236 /* ElseClause */: - return this.breakpointSpanOfElseClause(positionedNode); - case 156 /* ForInStatement */: - return this.breakpointSpanOfForInStatement(positionedNode); - case 155 /* ForStatement */: - return this.breakpointSpanOfForStatement(positionedNode); - case 159 /* WhileStatement */: - return this.breakpointSpanOfWhileStatement(positionedNode); - case 162 /* DoStatement */: - return this.breakpointSpanOfDoStatement(positionedNode); - case 152 /* SwitchStatement */: - return this.breakpointSpanOfSwitchStatement(positionedNode); - case 234 /* CaseSwitchClause */: - return this.breakpointSpanOfCaseSwitchClause(positionedNode); - case 235 /* DefaultSwitchClause */: - return this.breakpointSpanOfDefaultSwitchClause(positionedNode); - case 164 /* WithStatement */: - return this.breakpointSpanOfWithStatement(positionedNode); - case 160 /* TryStatement */: - return this.breakpointSpanOfTryStatement(positionedNode); - case 237 /* CatchClause */: - return this.breakpointSpanOfCatchClause(positionedNode); - case 238 /* FinallyClause */: - return this.breakpointSpanOfFinallyClause(positionedNode); - case 219 /* ParenthesizedArrowFunctionExpression */: - return this.breakpointSpanOfParenthesizedArrowFunctionExpression(positionedNode); - case 220 /* SimpleArrowFunctionExpression */: - return this.breakpointSpanOfSimpleArrowFunctionExpression(positionedNode); - default: - if (TypeScript.SyntaxUtilities.isStatement(node)) { - return this.breakpointSpanOfStatement(positionedNode); - } - else { - return this.breakpointOfExpression(positionedNode); - } - } - }; - BreakpointResolver.prototype.isExpressionOfArrowExpressions = function (expression) { - if (!expression) { - return false; - } - var expressionParent = expression.parent; - if (expressionParent) { - if (expressionParent.kind() == 219 /* ParenthesizedArrowFunctionExpression */) { - var parenthesizedArrowExpression = expressionParent; - var expressionOfParenthesizedArrowExpression = parenthesizedArrowExpression.expression; - return expressionOfParenthesizedArrowExpression == expression; - } - else if (expressionParent.kind() == 220 /* SimpleArrowFunctionExpression */) { - var simpleArrowExpression = expressionParent; - var expressionOfSimpleArrowExpression = simpleArrowExpression.expression; - return expressionOfSimpleArrowExpression == expression; - } - else if (expressionParent.kind() == 174 /* CommaExpression */) { - return this.isExpressionOfArrowExpressions(expressionParent); - } - } - return false; - }; - BreakpointResolver.prototype.isInitializerOfForStatement = function (expressionNode) { - if (!expressionNode) { - return false; - } - var expressionParent = expressionNode.parent; - if (expressionParent && expressionParent.kind() == 155 /* ForStatement */) { - var expression = expressionNode; - var forStatement = expressionParent; - var initializer = forStatement.initializer; - return initializer === expression; - } - else if (expressionParent && expressionParent.kind() == 174 /* CommaExpression */) { - return this.isInitializerOfForStatement(expressionParent); - } - return false; - }; - BreakpointResolver.prototype.isConditionOfForStatement = function (expressionNode) { - if (!expressionNode) { - return false; - } - var expressionParent = expressionNode.parent; - if (expressionParent && expressionParent.kind() == 155 /* ForStatement */) { - var expression = expressionNode; - var forStatement = expressionParent; - var condition = forStatement.condition; - return condition === expression; - } - else if (expressionParent && expressionParent.kind() == 174 /* CommaExpression */) { - return this.isConditionOfForStatement(expressionParent); - } - return false; - }; - BreakpointResolver.prototype.isIncrememtorOfForStatement = function (expressionNode) { - if (!expressionNode) { - return false; - } - var expressionParent = expressionNode.parent; - if (expressionParent && expressionParent.kind() == 155 /* ForStatement */) { - var expression = expressionNode; - var forStatement = expressionParent; - var incrementor = forStatement.incrementor; - return incrementor === expression; - } - else if (expressionParent && expressionParent.kind() == 174 /* CommaExpression */) { - return this.isIncrememtorOfForStatement(expressionParent); - } - return false; - }; - BreakpointResolver.prototype.breakpointOfLeftOfCommaExpression = function (commaExpressionNode) { - var commaExpression = commaExpressionNode; - return this.breakpointSpanOf(commaExpression.left); - }; - BreakpointResolver.prototype.breakpointOfExpression = function (expressionNode) { - if (this.isInitializerOfForStatement(expressionNode) || this.isConditionOfForStatement(expressionNode) || this.isIncrememtorOfForStatement(expressionNode)) { - if (expressionNode.kind() == 174 /* CommaExpression */) { - return this.breakpointOfLeftOfCommaExpression(expressionNode); - } - return createBreakpointSpanInfo(expressionNode); - } - if (this.isExpressionOfArrowExpressions(expressionNode)) { - if (expressionNode.kind() == 174 /* CommaExpression */) { - return this.breakpointOfLeftOfCommaExpression(expressionNode); - } - return createBreakpointSpanInfo(expressionNode); - } - if (expressionNode.kind() == 135 /* ExportAssignment */) { - var exportAssignmentSyntax = expressionNode; - return createBreakpointSpanInfo(expressionNode, exportAssignmentSyntax.exportKeyword, exportAssignmentSyntax.equalsToken, exportAssignmentSyntax.identifier); - } - return this.breakpointSpanOfContainingNode(expressionNode); - }; - BreakpointResolver.prototype.breakpointSpanOfStatement = function (statementNode) { - var statement = statementNode; - if (statement.kind() == 157 /* EmptyStatement */) { - return null; - } - var containingNode = TypeScript.Syntax.containingNode(statementNode); - if (TypeScript.SyntaxUtilities.isStatement(containingNode)) { - var useNodeForBreakpoint = false; - switch (containingNode.kind()) { - case 131 /* ModuleDeclaration */: - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 147 /* Block */: - case 148 /* IfStatement */: - case 236 /* ElseClause */: - case 156 /* ForInStatement */: - case 155 /* ForStatement */: - case 159 /* WhileStatement */: - case 162 /* DoStatement */: - case 152 /* SwitchStatement */: - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: - case 164 /* WithStatement */: - case 160 /* TryStatement */: - case 237 /* CatchClause */: - case 238 /* FinallyClause */: - case 147 /* Block */: - useNodeForBreakpoint = true; - } - if (!useNodeForBreakpoint) { - return this.breakpointSpanOfContainingNode(statementNode); - } - } - switch (statement.kind()) { - case 150 /* ExpressionStatement */: - var expressionSyntax = statement; - return createBreakpointSpanInfo(expressionSyntax.expression); - case 151 /* ReturnStatement */: - var returnStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, returnStatementSyntax.returnKeyword, returnStatementSyntax.expression); - case 158 /* ThrowStatement */: - var throwStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, throwStatementSyntax.throwKeyword, throwStatementSyntax.expression); - case 153 /* BreakStatement */: - var breakStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, breakStatementSyntax.breakKeyword, breakStatementSyntax.identifier); - case 154 /* ContinueStatement */: - var continueStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, continueStatementSyntax.continueKeyword, continueStatementSyntax.identifier); - case 163 /* DebuggerStatement */: - var debuggerStatementSyntax = statement; - return createBreakpointSpanInfo(debuggerStatementSyntax.debuggerKeyword); - case 161 /* LabeledStatement */: - var labeledStatementSyntax = statement; - return this.breakpointSpanOf(labeledStatementSyntax.statement); - } - return null; - }; - BreakpointResolver.prototype.getSyntaxListOfDeclarationWithElements = function (positionedNode) { - var node = positionedNode; - var elementsList; - var block; - switch (node.kind()) { - case 131 /* ModuleDeclaration */: - elementsList = node.moduleElements; - break; - case 132 /* ClassDeclaration */: - elementsList = node.classElements; - break; - case 130 /* FunctionDeclaration */: - block = node.block; - break; - case 138 /* ConstructorDeclaration */: - block = node.block; - break; - case 136 /* MemberFunctionDeclaration */: - block = node.block; - break; - case 140 /* GetAccessor */: - block = node.block; - break; - case 141 /* SetAccessor */: - block = node.block; - break; - case 223 /* FunctionExpression */: - block = node.block; - break; - case 219 /* ParenthesizedArrowFunctionExpression */: - block = node.block; - break; - case 220 /* SimpleArrowFunctionExpression */: - block = node.block; - break; - default: - throw TypeScript.Errors.argument('positionNode', 'unknown node kind in getSyntaxListOfDeclarationWithElements'); - } - var parentElement = positionedNode; - if (block) { - parentElement = block; - elementsList = block.statements; - } - return elementsList; - }; - BreakpointResolver.prototype.canHaveBreakpointInDeclaration = function (positionedNode) { - return positionedNode && !TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(positionedNode); - }; - BreakpointResolver.prototype.breakpointSpanOfDeclarationWithElements = function (positionedNode) { - if (!this.canHaveBreakpointInDeclaration(positionedNode)) { - return null; - } - var node = positionedNode; - var moduleSyntax = positionedNode; - if ((TypeScript.SyntaxUtilities.isModuleElement(node) && TypeScript.Syntax.containingNode(positionedNode).kind() != 120 /* SourceUnit */) || TypeScript.SyntaxUtilities.isClassElement(node) || (moduleSyntax.kind() == 131 /* ModuleDeclaration */ && moduleSyntax.name && moduleSyntax.name.kind() == 121 /* QualifiedName */)) { - return createBreakpointSpanInfo(positionedNode); - } - else { - return this.breakpointSpanOfFirstChildOfSyntaxList(this.getSyntaxListOfDeclarationWithElements(positionedNode)); - } - }; - BreakpointResolver.prototype.canHaveBreakpointInVariableDeclarator = function (varDeclaratorNode) { - if (!varDeclaratorNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(varDeclaratorNode)) { - return false; - } - var varDeclaratorSyntax = varDeclaratorNode; - return !!varDeclaratorSyntax.equalsValueClause; - }; - BreakpointResolver.prototype.breakpointSpanOfVariableDeclarator = function (varDeclaratorNode) { - if (!this.canHaveBreakpointInVariableDeclarator(varDeclaratorNode)) { - return null; - } - var container = TypeScript.Syntax.containingNode(varDeclaratorNode); - if (container && container.kind() == 225 /* VariableDeclaration */) { - var parentDeclaratorsList = varDeclaratorNode.parent; - if (parentDeclaratorsList && TypeScript.childAt(parentDeclaratorsList, 0) == varDeclaratorNode) { - return this.breakpointSpanOfVariableDeclaration(container); - } - if (this.canHaveBreakpointInVariableDeclarator(varDeclaratorNode)) { - return createBreakpointSpanInfo(varDeclaratorNode); - } - else { - return null; - } - } - else if (container) { - return this.breakpointSpanOfMemberVariableDeclaration(container); - } - return null; - }; - BreakpointResolver.prototype.canHaveBreakpointInVariableDeclaration = function (varDeclarationNode) { - if (!varDeclarationNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(varDeclarationNode)) { - return false; - } - var varDeclarationSyntax = varDeclarationNode; - var containerChildren = varDeclarationSyntax.variableDeclarators; - if (!containerChildren || TypeScript.childCount(containerChildren) == 0) { - return false; - } - var child = TypeScript.childAt(containerChildren, 0); - if (TypeScript.isNode(child)) { - return this.canHaveBreakpointInVariableDeclarator(child); - } - return false; - }; - BreakpointResolver.prototype.breakpointSpanOfVariableDeclaration = function (varDeclarationNode) { - if (!this.canHaveBreakpointInDeclaration(varDeclarationNode)) { - return null; - } - var container = TypeScript.Syntax.containingNode(varDeclarationNode); - var varDeclarationSyntax = varDeclarationNode; - var varDeclarators = varDeclarationSyntax.variableDeclarators; - if (container && container.kind() == 149 /* VariableStatement */) { - return this.breakpointSpanOfVariableStatement(container); - } - if (this.canHaveBreakpointInVariableDeclaration(varDeclarationNode)) { - return createBreakpointSpanInfoWithLimChar(varDeclarationNode, TypeScript.end(TypeScript.childAt(varDeclarators, 0))); - } - else { - return null; - } - }; - BreakpointResolver.prototype.canHaveBreakpointInVariableStatement = function (varStatementNode) { - if (!varStatementNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(varStatementNode)) { - return false; - } - var variableStatement = varStatementNode; - return this.canHaveBreakpointInVariableDeclaration(variableStatement.variableDeclaration); - }; - BreakpointResolver.prototype.breakpointSpanOfVariableStatement = function (varStatementNode) { - if (!this.canHaveBreakpointInVariableStatement(varStatementNode)) { - return null; - } - var variableStatement = varStatementNode; - var variableDeclaration = variableStatement.variableDeclaration; - var varDeclarationSyntax = variableDeclaration; - var varDeclarators = varDeclarationSyntax.variableDeclarators; - return createBreakpointSpanInfoWithLimChar(varStatementNode, TypeScript.end(TypeScript.childAt(varDeclarators, 0))); - }; - BreakpointResolver.prototype.breakpointSpanOfParameter = function (parameterNode) { - if (parameterNode.parent.kind() === 220 /* SimpleArrowFunctionExpression */) { - return this.breakpointSpanOfNode(parameterNode.parent); - } - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(parameterNode)) { - return null; - } - var parameterSyntax = parameterNode; - if (parameterSyntax.dotDotDotToken || parameterSyntax.equalsValueClause || parameterSyntax.modifiers.length > 0) { - return createBreakpointSpanInfo(parameterNode); - } - else { - return null; - } - }; - BreakpointResolver.prototype.breakpointSpanOfMemberVariableDeclaration = function (memberVarDeclarationNode) { - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(memberVarDeclarationNode)) { - return null; - } - var memberVariableDeclaration = memberVarDeclarationNode; - if (this.canHaveBreakpointInVariableDeclarator(memberVariableDeclaration.variableDeclarator)) { - return createBreakpointSpanInfo(memberVarDeclarationNode, memberVariableDeclaration.modifiers, memberVariableDeclaration.variableDeclarator); - } - else { - return null; - } - }; - BreakpointResolver.prototype.breakpointSpanOfImportDeclaration = function (importDeclarationNode) { - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(importDeclarationNode)) { - return null; - } - var importSyntax = importDeclarationNode; - return createBreakpointSpanInfo(importDeclarationNode, importSyntax.modifiers, importSyntax.importKeyword, importSyntax.identifier, importSyntax.equalsToken, importSyntax.moduleReference); - }; - BreakpointResolver.prototype.breakpointSpanOfEnumDeclaration = function (enumDeclarationNode) { - if (!this.canHaveBreakpointInDeclaration(enumDeclarationNode)) { - return null; - } - return createBreakpointSpanInfo(enumDeclarationNode); - }; - BreakpointResolver.prototype.breakpointSpanOfFirstEnumElement = function (enumDeclarationNode) { - var enumDeclarationSyntax = enumDeclarationNode; - var enumElements = enumDeclarationSyntax.enumElements; - if (enumElements && TypeScript.childCount(enumElements)) { - return this.breakpointSpanOf(TypeScript.childAt(enumElements, 0)); - } - return null; - }; - BreakpointResolver.prototype.breakpointSpanOfEnumElement = function (enumElementNode) { - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(enumElementNode)) { - return null; - } - return createBreakpointSpanInfo(enumElementNode); - }; - BreakpointResolver.prototype.breakpointSpanOfIfStatement = function (ifStatementNode) { - var ifStatement = ifStatementNode; - return createBreakpointSpanInfo(ifStatementNode, ifStatement.ifKeyword, ifStatement.openParenToken, ifStatement.condition, ifStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfElseClause = function (elseClauseNode) { - var elseClause = elseClauseNode; - return this.breakpointSpanOf(elseClause.statement); - }; - BreakpointResolver.prototype.breakpointSpanOfForInStatement = function (forInStatementNode) { - var forInStatement = forInStatementNode; - return createBreakpointSpanInfo(forInStatementNode, forInStatement.forKeyword, forInStatement.openParenToken, forInStatement.variableDeclaration, forInStatement.left, forInStatement.inKeyword, forInStatement.expression, forInStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfForStatement = function (forStatementNode) { - var forStatement = forStatementNode; - return this.breakpointSpanOf(forStatement.variableDeclaration ? forStatement.variableDeclaration : forStatement.initializer); - }; - BreakpointResolver.prototype.breakpointSpanOfWhileStatement = function (whileStatementNode) { - var whileStatement = whileStatementNode; - return createBreakpointSpanInfo(whileStatementNode, whileStatement.whileKeyword, whileStatement.openParenToken, whileStatement.condition, whileStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfDoStatement = function (doStatementNode) { - var doStatement = doStatementNode; - return createBreakpointSpanInfo(doStatementNode, doStatement.whileKeyword, doStatement.openParenToken, doStatement.condition, doStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfSwitchStatement = function (switchStatementNode) { - var switchStatement = switchStatementNode; - return createBreakpointSpanInfo(switchStatementNode, switchStatement.switchKeyword, switchStatement.openParenToken, switchStatement.expression, switchStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfFirstStatementOfFirstCaseClause = function (switchStatementNode) { - var switchStatement = switchStatementNode; - if (switchStatement.switchClauses && switchStatement.switchClauses.length == 0) { - return null; - } - var switchClauses = switchStatement.switchClauses; - if (switchClauses.length == 0) { - return null; - } - var firstCaseClause = switchClauses[0]; - var statements = firstCaseClause.statements; - return this.breakpointSpanOfFirstChildOfSyntaxList(statements); - }; - BreakpointResolver.prototype.breakpointSpanOfLastStatementOfLastCaseClause = function (switchStatementNode) { - var switchStatement = switchStatementNode; - if (switchStatement.switchClauses && switchStatement.switchClauses.length == 0) { - return null; - } - var switchClauses = switchStatement.switchClauses; - if (switchClauses.length == 0) { - return null; - } - var lastClauseNode = switchClauses[switchClauses.length - 1]; - var statements = lastClauseNode.statements; - return this.breakpointSpanOfLastChildOfSyntaxList(statements); - }; - BreakpointResolver.prototype.breakpointSpanOfCaseSwitchClause = function (caseClauseNode) { - var caseSwitchClause = caseClauseNode; - return this.breakpointSpanOfFirstChildOfSyntaxList(caseSwitchClause.statements); - }; - BreakpointResolver.prototype.breakpointSpanOfDefaultSwitchClause = function (defaultSwithClauseNode) { - var defaultSwitchClause = defaultSwithClauseNode; - return this.breakpointSpanOfFirstChildOfSyntaxList(defaultSwitchClause.statements); - }; - BreakpointResolver.prototype.breakpointSpanOfWithStatement = function (withStatementNode) { - var withStatement = withStatementNode; - return this.breakpointSpanOf(withStatement.statement); - }; - BreakpointResolver.prototype.breakpointSpanOfTryStatement = function (tryStatementNode) { - var tryStatement = tryStatementNode; - return this.breakpointSpanOfFirstStatementInBlock(tryStatement.block); - }; - BreakpointResolver.prototype.breakpointSpanOfCatchClause = function (catchClauseNode) { - var catchClause = catchClauseNode; - return createBreakpointSpanInfo(catchClauseNode, catchClause.catchKeyword, catchClause.openParenToken, catchClause.identifier, catchClause.typeAnnotation, catchClause.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfFinallyClause = function (finallyClauseNode) { - var finallyClause = finallyClauseNode; - return this.breakpointSpanOfFirstStatementInBlock(finallyClause.block); - }; - BreakpointResolver.prototype.breakpointSpanOfParenthesizedArrowFunctionExpression = function (arrowFunctionExpression) { - if (arrowFunctionExpression.block) { - return this.breakpointSpanOfFirstStatementInBlock(arrowFunctionExpression.block); - } - else { - return this.breakpointSpanOf(arrowFunctionExpression.expression); - } - }; - BreakpointResolver.prototype.breakpointSpanOfSimpleArrowFunctionExpression = function (arrowFunctionExpression) { - if (arrowFunctionExpression.block) { - return this.breakpointSpanOfFirstStatementInBlock(arrowFunctionExpression.block); - } - else { - return this.breakpointSpanOf(arrowFunctionExpression.expression); - } - }; - BreakpointResolver.prototype.breakpointSpanOfContainingNode = function (positionedElement) { - var current = positionedElement.parent; - while (!TypeScript.isNode(current)) { - current = current.parent; - } - return this.breakpointSpanOf(current); - }; - BreakpointResolver.prototype.breakpointSpanIfStartsOnSameLine = function (positionedElement) { - if (positionedElement && this.posLine == this.lineMap.getLineNumberFromPosition(TypeScript.start(positionedElement))) { - return this.breakpointSpanOf(positionedElement); - } - return null; - }; - BreakpointResolver.prototype.breakpointSpanOf = function (positionedElement) { - if (!positionedElement) { - return null; - } - for (var containingNode = TypeScript.Syntax.containingNode(positionedElement); containingNode != null; containingNode = TypeScript.Syntax.containingNode(containingNode)) { - if (containingNode.kind() == 245 /* TypeAnnotation */) { - return this.breakpointSpanIfStartsOnSameLine(containingNode); - } - } - var element = positionedElement; - if (TypeScript.isNode(element)) { - return this.breakpointSpanOfNode(positionedElement); - } - if (TypeScript.isToken(element)) { - return this.breakpointSpanOfToken(positionedElement); - } - return this.breakpointSpanOfContainingNode(positionedElement); - }; - return BreakpointResolver; - })(); - function getBreakpointLocation(syntaxTree, askedPos) { - if (TypeScript.isDTSFile(syntaxTree.fileName())) { - return null; - } - var sourceUnit = syntaxTree.sourceUnit(); - var positionedToken = TypeScript.findToken(sourceUnit, askedPos); - var lineMap = syntaxTree.lineMap(); - var posLine = lineMap.getLineNumberFromPosition(askedPos); - var tokenStartLine = lineMap.getLineNumberFromPosition(TypeScript.start(positionedToken)); - if (posLine < tokenStartLine) { - return null; - } - var breakpointResolver = new BreakpointResolver(posLine, lineMap); - return breakpointResolver.breakpointSpanOf(positionedToken); - } - Breakpoints.getBreakpointLocation = getBreakpointLocation; - })(Breakpoints = Services.Breakpoints || (Services.Breakpoints = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; (function (TypeScript) { var Indentation; (function (Indentation) { @@ -28697,7 +28143,7 @@ var ts; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); function getImmediatelyContainingArgumentInfo(node) { - if (node.parent.kind !== 139 /* CallExpression */ && node.parent.kind !== 140 /* NewExpression */) { + if (node.parent.kind !== 140 /* CallExpression */ && node.parent.kind !== 141 /* NewExpression */) { return undefined; } var parent = node.parent; @@ -28715,8 +28161,8 @@ var ts; return ts.findListItemInfo(node); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 184 /* SourceFile */; n = n.parent) { - if (n.kind === 175 /* FunctionBlock */) { + for (var n = node; n.kind !== 186 /* SourceFile */; n = n.parent) { + if (n.kind === 176 /* FunctionBlock */) { return undefined; } if (n.pos < n.parent.pos || n.end > n.parent.end) { @@ -28850,18 +28296,18 @@ var ts; ts.findChildOfKind = findChildOfKind; function findContainingList(node) { var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - if (c.kind === 186 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 188 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { return c; } }); if (!syntaxList) { - ts.Debug.assert(findChildOfKind(node.parent, 186 /* SyntaxList */), "Node of kind " + ts.SyntaxKind[node.parent.kind] + " has no list children"); + ts.Debug.assert(findChildOfKind(node.parent, 188 /* SyntaxList */), "Node of kind " + ts.SyntaxKind[node.parent.kind] + " has no list children"); } return syntaxList; } ts.findContainingList = findContainingList; function findListItemIndexContainingPosition(list, position) { - ts.Debug.assert(list.kind === 186 /* SyntaxList */); + ts.Debug.assert(list.kind === 188 /* SyntaxList */); var children = list.getChildren(); for (var i = 0; i < children.length; i++) { if (children[i].pos <= position && children[i].end > position) { @@ -28967,7 +28413,7 @@ var ts; } } } - ts.Debug.assert(startNode || n.kind === 184 /* SourceFile */); + ts.Debug.assert(startNode || n.kind === 186 /* SourceFile */); if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, children.length); return candidate && findRightmostToken(candidate); @@ -28983,19 +28429,19 @@ var ts; } ts.findPrecedingToken = findPrecedingToken; function nodeHasTokens(n) { - if (n.kind === 153 /* ExpressionStatement */) { + if (n.kind === 154 /* ExpressionStatement */) { return nodeHasTokens(n.expression); } - if (n.kind === 1 /* EndOfFileToken */ || n.kind === 149 /* OmittedExpression */ || n.kind === 115 /* Missing */) { + if (n.kind === 1 /* EndOfFileToken */ || n.kind === 150 /* OmittedExpression */ || n.kind === 116 /* Missing */) { return false; } - return n.kind !== 186 /* SyntaxList */ || n.getChildCount() !== 0; + return n.kind !== 188 /* SyntaxList */ || n.getChildCount() !== 0; } function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 127 /* TypeReference */ || node.kind === 139 /* CallExpression */) { + if (node.kind === 128 /* TypeReference */ || node.kind === 140 /* CallExpression */) { return node.typeArguments; } - if (ts.isAnyFunction(node) || node.kind === 176 /* ClassDeclaration */ || node.kind === 177 /* InterfaceDeclaration */) { + if (ts.isAnyFunction(node) || node.kind === 177 /* ClassDeclaration */ || node.kind === 178 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -30921,7 +30367,7 @@ var ts; return 0; } var lineAtPosition = sourceFile.getLineAndCharacterFromPosition(position).line; - if (precedingToken.kind === 18 /* CommaToken */ && precedingToken.parent.kind !== 147 /* BinaryExpression */) { + if (precedingToken.kind === 18 /* CommaToken */ && precedingToken.parent.kind !== 148 /* BinaryExpression */) { var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1) { return actualIndentation; @@ -30981,7 +30427,7 @@ var ts; return deriveActualIndentationFromList(commaItemInfo.list.getChildren(), commaItemInfo.listItemIndex - 1, sourceFile, options); } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { - var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && (parent.kind === 184 /* SourceFile */ || !parentAndChildShareLine); + var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && (parent.kind === 186 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } @@ -31008,7 +30454,7 @@ var ts; return candidate.end > position || !isCompletedNode(candidate, sourceFile); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 154 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 155 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 70 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -31018,29 +30464,29 @@ var ts; function getActualIndentationForListItem(node, sourceFile, options) { if (node.parent) { switch (node.parent.kind) { - case 127 /* TypeReference */: + case 128 /* TypeReference */: if (node.parent.typeArguments) { return getActualIndentationFromList(node.parent.typeArguments); } break; - case 135 /* ObjectLiteral */: + case 136 /* ObjectLiteral */: return getActualIndentationFromList(node.parent.properties); - case 129 /* TypeLiteral */: + case 130 /* TypeLiteral */: return getActualIndentationFromList(node.parent.members); - case 134 /* ArrayLiteral */: + case 135 /* ArrayLiteral */: return getActualIndentationFromList(node.parent.elements); - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - case 120 /* Method */: - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: + case 175 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: + case 121 /* Method */: + case 125 /* CallSignature */: + case 126 /* ConstructSignature */: if (node.parent.typeParameters && node.end < node.parent.typeParameters.end) { return getActualIndentationFromList(node.parent.typeParameters); } return getActualIndentationFromList(node.parent.parameters); - case 140 /* NewExpression */: - case 139 /* CallExpression */: + case 141 /* NewExpression */: + case 140 /* CallExpression */: if (node.parent.typeArguments && node.end < node.parent.typeArguments.end) { return getActualIndentationFromList(node.parent.typeArguments); } @@ -31088,45 +30534,45 @@ var ts; } function nodeContentIsIndented(parent, child) { switch (parent.kind) { - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 180 /* EnumDeclaration */: return true; - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: return false; - case 174 /* FunctionDeclaration */: - case 120 /* Method */: - case 143 /* FunctionExpression */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 121 /* Constructor */: + case 175 /* FunctionDeclaration */: + case 121 /* Method */: + case 144 /* FunctionExpression */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 122 /* Constructor */: return false; - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 158 /* ForInStatement */: - case 157 /* ForStatement */: - return child && child.kind !== 150 /* Block */; - case 154 /* IfStatement */: - return child && child.kind !== 150 /* Block */; - case 168 /* TryStatement */: + case 156 /* DoStatement */: + case 157 /* WhileStatement */: + case 159 /* ForInStatement */: + case 158 /* ForStatement */: + return child && child.kind !== 151 /* Block */; + case 155 /* IfStatement */: + return child && child.kind !== 151 /* Block */; + case 169 /* TryStatement */: return false; - case 134 /* ArrayLiteral */: - case 150 /* Block */: - case 175 /* FunctionBlock */: - case 169 /* TryBlock */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: - case 180 /* ModuleBlock */: - case 135 /* ObjectLiteral */: - case 129 /* TypeLiteral */: - case 163 /* SwitchStatement */: - case 165 /* DefaultClause */: - case 164 /* CaseClause */: - case 142 /* ParenExpression */: - case 139 /* CallExpression */: - case 140 /* NewExpression */: - case 151 /* VariableStatement */: - case 173 /* VariableDeclaration */: + case 135 /* ArrayLiteral */: + case 151 /* Block */: + case 176 /* FunctionBlock */: + case 170 /* TryBlock */: + case 171 /* CatchBlock */: + case 172 /* FinallyBlock */: + case 182 /* ModuleBlock */: + case 136 /* ObjectLiteral */: + case 130 /* TypeLiteral */: + case 164 /* SwitchStatement */: + case 166 /* DefaultClause */: + case 165 /* CaseClause */: + case 143 /* ParenExpression */: + case 140 /* CallExpression */: + case 141 /* NewExpression */: + case 152 /* VariableStatement */: + case 174 /* VariableDeclaration */: return true; default: return false; @@ -31147,46 +30593,46 @@ var ts; } function isCompletedNode(n, sourceFile) { switch (n.kind) { - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: - case 135 /* ObjectLiteral */: - case 150 /* Block */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: - case 163 /* SwitchStatement */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 180 /* EnumDeclaration */: + case 136 /* ObjectLiteral */: + case 151 /* Block */: + case 171 /* CatchBlock */: + case 172 /* FinallyBlock */: + case 176 /* FunctionBlock */: + case 182 /* ModuleBlock */: + case 164 /* SwitchStatement */: return nodeEndsWith(n, 10 /* CloseBraceToken */, sourceFile); - case 142 /* ParenExpression */: - case 124 /* CallSignature */: - case 139 /* CallExpression */: - case 125 /* ConstructSignature */: + case 143 /* ParenExpression */: + case 125 /* CallSignature */: + case 140 /* CallExpression */: + case 126 /* ConstructSignature */: return nodeEndsWith(n, 12 /* CloseParenToken */, sourceFile); - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 120 /* Method */: - case 144 /* ArrowFunction */: + case 175 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: + case 121 /* Method */: + case 145 /* ArrowFunction */: return !n.body || isCompletedNode(n.body, sourceFile); - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: return n.body && isCompletedNode(n.body, sourceFile); - case 154 /* IfStatement */: + case 155 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 153 /* ExpressionStatement */: + case 154 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile); - case 134 /* ArrayLiteral */: + case 135 /* ArrayLiteral */: return nodeEndsWith(n, 14 /* CloseBracketToken */, sourceFile); - case 115 /* Missing */: + case 116 /* Missing */: return false; - case 164 /* CaseClause */: - case 165 /* DefaultClause */: + case 165 /* CaseClause */: + case 166 /* DefaultClause */: return false; - case 156 /* WhileStatement */: + case 157 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 155 /* DoStatement */: + case 156 /* DoStatement */: var hasWhileKeyword = ts.findChildOfKind(n, 94 /* WhileKeyword */, sourceFile); if (hasWhileKeyword) { return nodeEndsWith(n, 12 /* CloseParenToken */, sourceFile); @@ -32595,7 +32041,7 @@ var TypeScript; })(TypeScript || (TypeScript = {})); var ts; (function (ts) { - var scanner = ts.createScanner(1 /* ES5 */, true); + var scanner = ts.createScanner(ts.ScriptTarget.Latest, true); var emptyArray = []; function createNode(kind, pos, end, flags, parent) { var node = new (ts.getNodeConstructor(kind))(); @@ -32643,7 +32089,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(186 /* SyntaxList */, nodes.pos, nodes.end, 512 /* Synthetic */, this); + var list = createNode(188 /* SyntaxList */, nodes.pos, nodes.end, 512 /* Synthetic */, this); list._children = []; var pos = nodes.pos; for (var i = 0, len = nodes.length; i < len; i++) { @@ -32661,7 +32107,7 @@ var ts; }; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; - if (this.kind > 115 /* Missing */) { + if (this.kind > 116 /* Missing */) { scanner.setText((sourceFile || this.getSourceFile()).text); var children = []; var pos = this.pos; @@ -32706,9 +32152,9 @@ var ts; var children = this.getChildren(); for (var i = 0; i < children.length; i++) { var child = children[i]; - if (child.kind < 115 /* Missing */) + if (child.kind < 116 /* Missing */) return child; - if (child.kind > 115 /* Missing */) + if (child.kind > 116 /* Missing */) return child.getFirstToken(sourceFile); } }; @@ -32716,9 +32162,9 @@ var ts; var children = this.getChildren(sourceFile); for (var i = children.length - 1; i >= 0; i--) { var child = children[i]; - if (child.kind < 115 /* Missing */) + if (child.kind < 116 /* Missing */) return child; - if (child.kind > 115 /* Missing */) + if (child.kind > 116 /* Missing */) return child.getLastToken(sourceFile); } }; @@ -32740,7 +32186,7 @@ var ts; }; SymbolObject.prototype.getDocumentationComment = function () { if (this.documentationComment === undefined) { - this.documentationComment = getJsDocCommentsFromDeclarations(this.declarations, this.name, !(this.flags & 2 /* Property */)); + this.documentationComment = getJsDocCommentsFromDeclarations(this.declarations, this.name, !(this.flags & 4 /* Property */)); } return this.documentationComment; }; @@ -32761,7 +32207,7 @@ var ts; var jsDocCommentParts = []; ts.forEach(declarations, function (declaration) { var sourceFileOfDeclaration = ts.getSourceFileOfNode(declaration); - if (canUseParsedParamTagComments && declaration.kind === 118 /* Parameter */) { + if (canUseParsedParamTagComments && declaration.kind === 119 /* Parameter */) { ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedParamJsDocComment) { @@ -32769,13 +32215,13 @@ var ts; } }); } - if (declaration.kind === 179 /* ModuleDeclaration */ && declaration.body.kind === 179 /* ModuleDeclaration */) { + if (declaration.kind === 181 /* ModuleDeclaration */ && declaration.body.kind === 181 /* ModuleDeclaration */) { return; } - while (declaration.kind === 179 /* ModuleDeclaration */ && declaration.parent.kind === 179 /* ModuleDeclaration */) { + while (declaration.kind === 181 /* ModuleDeclaration */ && declaration.parent.kind === 181 /* ModuleDeclaration */) { declaration = declaration.parent; } - ts.forEach(getJsDocCommentTextRange(declaration.kind === 173 /* VariableDeclaration */ ? declaration.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + ts.forEach(getJsDocCommentTextRange(declaration.kind === 174 /* VariableDeclaration */ ? declaration.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { jsDocCommentParts.push.apply(jsDocCommentParts, cleanedJsDocComment); @@ -33042,10 +32488,10 @@ var ts; var namedDeclarations = []; ts.forEachChild(sourceFile, function visit(node) { switch (node.kind) { - case 174 /* FunctionDeclaration */: - case 120 /* Method */: + case 175 /* FunctionDeclaration */: + case 121 /* Method */: var functionDeclaration = node; - if (functionDeclaration.name && functionDeclaration.name.kind !== 115 /* Missing */) { + if (functionDeclaration.name && functionDeclaration.name.kind !== 116 /* Missing */) { var lastDeclaration = namedDeclarations.length > 0 ? namedDeclarations[namedDeclarations.length - 1] : undefined; if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) { if (functionDeclaration.body && !lastDeclaration.body) { @@ -33058,30 +32504,31 @@ var ts; ts.forEachChild(node, visit); } break; - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: - case 179 /* ModuleDeclaration */: - case 181 /* ImportDeclaration */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 129 /* TypeLiteral */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 179 /* TypeAliasDeclaration */: + case 180 /* EnumDeclaration */: + case 181 /* ModuleDeclaration */: + case 183 /* ImportDeclaration */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 130 /* TypeLiteral */: if (node.name) { namedDeclarations.push(node); } - case 121 /* Constructor */: - case 151 /* VariableStatement */: - case 180 /* ModuleBlock */: - case 175 /* FunctionBlock */: + case 122 /* Constructor */: + case 152 /* VariableStatement */: + case 182 /* ModuleBlock */: + case 176 /* FunctionBlock */: ts.forEachChild(node, visit); break; - case 118 /* Parameter */: + case 119 /* Parameter */: if (!(node.flags & ts.NodeFlags.AccessibilityModifier)) { break; } - case 173 /* VariableDeclaration */: - case 183 /* EnumMember */: - case 119 /* Property */: + case 174 /* VariableDeclaration */: + case 185 /* EnumMember */: + case 120 /* Property */: namedDeclarations.push(node); break; } @@ -33193,6 +32640,7 @@ var ts; ScriptElementKind.moduleElement = "module"; ScriptElementKind.classElement = "class"; ScriptElementKind.interfaceElement = "interface"; + ScriptElementKind.typeElement = "type"; ScriptElementKind.enumElement = "enum"; ScriptElementKind.variableElement = "var"; ScriptElementKind.localVariableElement = "local var"; @@ -33211,6 +32659,7 @@ var ts; ScriptElementKind.primitiveType = "primitive type"; ScriptElementKind.label = "label"; ScriptElementKind.alias = "alias"; + ScriptElementKind.constantElement = "constant"; return ScriptElementKind; })(); ts.ScriptElementKind = ScriptElementKind; @@ -33342,21 +32791,21 @@ var ts; } ts.lineBreakPart = lineBreakPart; function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 118 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 119 /* Parameter */; } function isLocalVariableOrFunction(symbol) { if (symbol.parent) { return false; } return ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 143 /* FunctionExpression */) { + if (declaration.kind === 144 /* FunctionExpression */) { return true; } - if (declaration.kind !== 173 /* VariableDeclaration */ && declaration.kind !== 174 /* FunctionDeclaration */) { + if (declaration.kind !== 174 /* VariableDeclaration */ && declaration.kind !== 175 /* FunctionDeclaration */) { return false; } - for (var parent = declaration.parent; parent.kind !== 175 /* FunctionBlock */; parent = parent.parent) { - if (parent.kind === 184 /* SourceFile */ || parent.kind === 180 /* ModuleBlock */) { + for (var parent = declaration.parent; parent.kind !== 176 /* FunctionBlock */; parent = parent.parent) { + if (parent.kind === 186 /* SourceFile */ || parent.kind === 182 /* ModuleBlock */) { return false; } } @@ -33367,34 +32816,34 @@ var ts; return displayPart(text, displayPartKind(symbol), symbol); function displayPartKind(symbol) { var flags = symbol.flags; - if (flags & 1 /* Variable */) { + if (flags & ts.SymbolFlags.Variable) { return isFirstDeclarationOfSymbolParameter(symbol) ? 13 /* parameterName */ : 9 /* localName */; } - else if (flags & 2 /* Property */) { + else if (flags & 4 /* Property */) { return 14 /* propertyName */; } - else if (flags & 4 /* EnumMember */) { + else if (flags & 8 /* EnumMember */) { return 19 /* enumMemberName */; } - else if (flags & 8 /* Function */) { + else if (flags & 16 /* Function */) { return 20 /* functionName */; } - else if (flags & 16 /* Class */) { + else if (flags & 32 /* Class */) { return 1 /* className */; } - else if (flags & 32 /* Interface */) { + else if (flags & 64 /* Interface */) { return 4 /* interfaceName */; } - else if (flags & 64 /* Enum */) { + else if (flags & 128 /* Enum */) { return 2 /* enumName */; } else if (flags & ts.SymbolFlags.Module) { return 11 /* moduleName */; } - else if (flags & 2048 /* Method */) { + else if (flags & 4096 /* Method */) { return 10 /* methodName */; } - else if (flags & 262144 /* TypeParameter */) { + else if (flags & 524288 /* TypeParameter */) { return 18 /* typeParameterName */; } return 17 /* text */; @@ -33427,7 +32876,7 @@ var ts; } function getDefaultCompilerOptions() { return { - target: 1 /* ES5 */, + target: ts.ScriptTarget.Latest, module: 0 /* None */ }; } @@ -33735,7 +33184,7 @@ var ts; ts.getNodeModifiers = getNodeModifiers; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 166 /* LabeledStatement */ && referenceNode.label.text === labelName) { + if (referenceNode.kind === 167 /* LabeledStatement */ && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -33743,13 +33192,13 @@ var ts; return undefined; } function isJumpStatementTarget(node) { - return node.kind === 59 /* Identifier */ && (node.parent.kind === 160 /* BreakStatement */ || node.parent.kind === 159 /* ContinueStatement */) && node.parent.label === node; + return node.kind === 59 /* Identifier */ && (node.parent.kind === 161 /* BreakStatement */ || node.parent.kind === 160 /* ContinueStatement */) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { - return node.kind === 59 /* Identifier */ && node.parent.kind === 166 /* LabeledStatement */ && node.parent.label === node; + return node.kind === 59 /* Identifier */ && node.parent.kind === 167 /* LabeledStatement */ && node.parent.label === node; } function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 166 /* LabeledStatement */; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 167 /* LabeledStatement */; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -33759,41 +33208,52 @@ var ts; function isLabelName(node) { return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } + function isRightSideOfQualifiedName(node) { + return node.parent.kind === 117 /* QualifiedName */ && node.parent.right === node; + } + function isRightSideOfPropertyAccess(node) { + return node.parent.kind === 138 /* PropertyAccess */ && node.parent.right === node; + } function isCallExpressionTarget(node) { - if (node.parent.kind === 137 /* PropertyAccess */ && node.parent.right === node) + if (isRightSideOfPropertyAccess(node)) { node = node.parent; - return node.parent.kind === 139 /* CallExpression */ && node.parent.func === node; + } + return node.parent.kind === 140 /* CallExpression */ && node.parent.func === node; } function isNewExpressionTarget(node) { - if (node.parent.kind === 137 /* PropertyAccess */ && node.parent.right === node) + if (isRightSideOfPropertyAccess(node)) { node = node.parent; - return node.parent.kind === 140 /* NewExpression */ && node.parent.func === node; + } + return node.parent.kind === 141 /* NewExpression */ && node.parent.func === node; + } + function isNameOfModuleDeclaration(node) { + return node.parent.kind === 181 /* ModuleDeclaration */ && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { return node.kind === 59 /* Identifier */ && ts.isAnyFunction(node.parent) && node.parent.name === node; } function isNameOfPropertyAssignment(node) { - return (node.kind === 59 /* Identifier */ || node.kind === 7 /* StringLiteral */ || node.kind === 6 /* NumericLiteral */) && node.parent.kind === 136 /* PropertyAssignment */ && node.parent.name === node; + return (node.kind === 59 /* Identifier */ || node.kind === 7 /* StringLiteral */ || node.kind === 6 /* NumericLiteral */) && node.parent.kind === 137 /* PropertyAssignment */ && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 7 /* StringLiteral */ || node.kind === 6 /* NumericLiteral */) { switch (node.parent.kind) { - case 119 /* Property */: - case 136 /* PropertyAssignment */: - case 183 /* EnumMember */: - case 120 /* Method */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 179 /* ModuleDeclaration */: + case 120 /* Property */: + case 137 /* PropertyAssignment */: + case 185 /* EnumMember */: + case 121 /* Method */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 181 /* ModuleDeclaration */: return node.parent.name === node; - case 138 /* IndexedAccess */: + case 139 /* IndexedAccess */: return node.parent.index === node; } } return false; } function isNameOfExternalModuleImportOrDeclaration(node) { - return node.kind === 7 /* StringLiteral */ && ((node.parent.kind === 179 /* ModuleDeclaration */ && node.parent.name === node) || (node.parent.kind === 181 /* ImportDeclaration */ && node.parent.externalModuleName === node)); + return node.kind === 7 /* StringLiteral */ && (isNameOfModuleDeclaration(node) || (node.parent.kind === 183 /* ImportDeclaration */ && node.parent.externalModuleName === node)); } var SemanticMeaning; (function (SemanticMeaning) { @@ -34098,7 +33558,7 @@ var ts; } var existingMemberNames = {}; ts.forEach(existingMembers, function (m) { - if (m.kind !== 136 /* PropertyAssignment */) { + if (m.kind !== 137 /* PropertyAssignment */) { return; } if (m.getStart() <= position && position <= m.getEnd()) { @@ -34166,9 +33626,9 @@ var ts; if (isRightOfDot) { var symbols = []; isMemberCompletion = true; - if (mappedNode.kind === 59 /* Identifier */ || mappedNode.kind === 116 /* QualifiedName */ || mappedNode.kind === 137 /* PropertyAccess */) { + if (mappedNode.kind === 59 /* Identifier */ || mappedNode.kind === 117 /* QualifiedName */ || mappedNode.kind === 138 /* PropertyAccess */) { var symbol = typeInfoResolver.getSymbolInfo(mappedNode); - if (symbol && symbol.flags & 4194304 /* Import */) { + if (symbol && symbol.flags & 16777216 /* Import */) { symbol = typeInfoResolver.getAliasedSymbol(symbol); } if (symbol && symbol.flags & ts.SymbolFlags.HasExports) { @@ -34192,7 +33652,7 @@ var ts; else { var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(sourceFile.getSyntaxTree().sourceUnit(), position); if (containingObjectLiteral) { - var objectLiteral = (mappedNode.kind === 135 /* ObjectLiteral */ ? mappedNode : ts.getAncestor(mappedNode, 135 /* ObjectLiteral */)); + var objectLiteral = (mappedNode.kind === 136 /* ObjectLiteral */ ? mappedNode : ts.getAncestor(mappedNode, 136 /* ObjectLiteral */)); ts.Debug.assert(objectLiteral); isMemberCompletion = true; var contextualType = typeInfoResolver.getContextualType(objectLiteral); @@ -34207,7 +33667,7 @@ var ts; } else { isMemberCompletion = false; - var symbolMeanings = ts.SymbolFlags.Type | ts.SymbolFlags.Value | ts.SymbolFlags.Namespace | 4194304 /* Import */; + var symbolMeanings = ts.SymbolFlags.Type | ts.SymbolFlags.Value | ts.SymbolFlags.Namespace | 16777216 /* Import */; var symbols = typeInfoResolver.getSymbolsInScope(mappedNode, symbolMeanings); getCompletionEntriesFromSymbols(symbols, activeCompletionSession); } @@ -34257,37 +33717,39 @@ var ts; return node; } switch (node.kind) { - case 184 /* SourceFile */: - case 120 /* Method */: - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: - case 179 /* ModuleDeclaration */: + case 186 /* SourceFile */: + case 121 /* Method */: + case 175 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 177 /* ClassDeclaration */: + case 178 /* InterfaceDeclaration */: + case 180 /* EnumDeclaration */: + case 181 /* ModuleDeclaration */: return node; } } } function getSymbolKind(symbol, typeResolver) { var flags = symbol.getFlags(); - if (flags & 16 /* Class */) + if (flags & 32 /* Class */) return ScriptElementKind.classElement; - if (flags & 64 /* Enum */) + if (flags & 128 /* Enum */) return ScriptElementKind.enumElement; - if (flags & 32 /* Interface */) + if (flags & 1048576 /* TypeAlias */) + return ScriptElementKind.typeElement; + if (flags & 64 /* Interface */) return ScriptElementKind.interfaceElement; - if (flags & 262144 /* TypeParameter */) + if (flags & 524288 /* TypeParameter */) return ScriptElementKind.typeParameterElement; var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver); if (result === ScriptElementKind.unknown) { - if (flags & 262144 /* TypeParameter */) + if (flags & 524288 /* TypeParameter */) return ScriptElementKind.typeParameterElement; - if (flags & 4 /* EnumMember */) + if (flags & 8 /* EnumMember */) return ScriptElementKind.variableElement; - if (flags & 4194304 /* Import */) + if (flags & 16777216 /* Import */) return ScriptElementKind.alias; } return result; @@ -34299,34 +33761,37 @@ var ts; if (typeResolver.isArgumentsSymbol(symbol)) { return ScriptElementKind.localVariableElement; } - if (flags & 1 /* Variable */) { + if (flags & ts.SymbolFlags.Variable) { if (isFirstDeclarationOfSymbolParameter(symbol)) { return ScriptElementKind.parameterElement; } + else if (symbol.valueDeclaration && symbol.valueDeclaration.flags & 4096 /* Const */) { + return ScriptElementKind.constantElement; + } return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localVariableElement : ScriptElementKind.variableElement; } - if (flags & 8 /* Function */) + if (flags & 16 /* Function */) return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localFunctionElement : ScriptElementKind.functionElement; - if (flags & 8192 /* GetAccessor */) + if (flags & 16384 /* GetAccessor */) return ScriptElementKind.memberGetAccessorElement; - if (flags & 16384 /* SetAccessor */) + if (flags & 32768 /* SetAccessor */) return ScriptElementKind.memberSetAccessorElement; - if (flags & 2048 /* Method */) + if (flags & 4096 /* Method */) return ScriptElementKind.memberFunctionElement; - if (flags & 4096 /* Constructor */) + if (flags & 8192 /* Constructor */) return ScriptElementKind.constructorImplementationElement; - if (flags & 2 /* Property */) { - if (flags & 134217728 /* UnionProperty */) { + if (flags & 4 /* Property */) { + if (flags & 536870912 /* UnionProperty */) { return ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { var rootSymbolFlags = rootSymbol.getFlags(); - if (rootSymbolFlags & 2 /* Property */) { + if (rootSymbolFlags & 4 /* Property */) { return ScriptElementKind.memberVariableElement; } - if (rootSymbolFlags & 8192 /* GetAccessor */) + if (rootSymbolFlags & 16384 /* GetAccessor */) return ScriptElementKind.memberVariableElement; - if (rootSymbolFlags & 16384 /* SetAccessor */) + if (rootSymbolFlags & 32768 /* SetAccessor */) return ScriptElementKind.memberVariableElement; - ts.Debug.assert(rootSymbolFlags & 2048 /* Method */); + ts.Debug.assert(rootSymbolFlags & 4096 /* Method */); }) || ScriptElementKind.memberFunctionElement; } return ScriptElementKind.memberVariableElement; @@ -34351,42 +33816,44 @@ var ts; } function getNodeKind(node) { switch (node.kind) { - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: return ScriptElementKind.classElement; - case 177 /* InterfaceDeclaration */: + case 178 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; - case 178 /* EnumDeclaration */: + case 179 /* TypeAliasDeclaration */: + return ScriptElementKind.typeElement; + case 180 /* EnumDeclaration */: return ScriptElementKind.enumElement; - case 173 /* VariableDeclaration */: - return ScriptElementKind.variableElement; - case 174 /* FunctionDeclaration */: + case 174 /* VariableDeclaration */: + return node.flags & 4096 /* Const */ ? ScriptElementKind.constantElement : ScriptElementKind.variableElement; + case 175 /* FunctionDeclaration */: return ScriptElementKind.functionElement; - case 122 /* GetAccessor */: + case 123 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; - case 123 /* SetAccessor */: + case 124 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; - case 120 /* Method */: + case 121 /* Method */: return ScriptElementKind.memberFunctionElement; - case 119 /* Property */: + case 120 /* Property */: return ScriptElementKind.memberVariableElement; - case 126 /* IndexSignature */: + case 127 /* IndexSignature */: return ScriptElementKind.indexSignatureElement; - case 125 /* ConstructSignature */: + case 126 /* ConstructSignature */: return ScriptElementKind.constructSignatureElement; - case 124 /* CallSignature */: + case 125 /* CallSignature */: return ScriptElementKind.callSignatureElement; - case 121 /* Constructor */: + case 122 /* Constructor */: return ScriptElementKind.constructorImplementationElement; - case 117 /* TypeParameter */: + case 118 /* TypeParameter */: return ScriptElementKind.typeParameterElement; - case 183 /* EnumMember */: + case 185 /* EnumMember */: return ScriptElementKind.variableElement; - case 118 /* Parameter */: + case 119 /* Parameter */: return (node.flags & ts.NodeFlags.AccessibilityModifier) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - return ScriptElementKind.unknown; } + return ScriptElementKind.unknown; } function getSymbolModifiers(symbol) { return symbol && symbol.declarations && symbol.declarations.length > 0 ? getNodeModifiers(symbol.declarations[0]) : ScriptElementKindModifier.none; @@ -34398,7 +33865,7 @@ var ts; var symbolFlags = symbol.flags; var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver); var hasAddedSymbolInfo; - if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 16 /* Class */ || symbolFlags & 4194304 /* Import */) { + if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 32 /* Class */ || symbolFlags & 16777216 /* Import */) { if (symbolKind === ScriptElementKind.memberGetAccessorElement || symbolKind === ScriptElementKind.memberSetAccessorElement) { symbolKind = ScriptElementKind.memberVariableElement; } @@ -34406,7 +33873,7 @@ var ts; if (type) { if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { var callExpression; - if (location.parent.kind === 137 /* PropertyAccess */ && location.parent.right === location) { + if (location.parent.kind === 138 /* PropertyAccess */ && location.parent.right === location) { location = location.parent; } callExpression = location.parent; @@ -34415,17 +33882,17 @@ var ts; if (!signature && candidateSignatures.length) { signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 140 /* NewExpression */ || callExpression.func.kind === 85 /* SuperKeyword */; + var useConstructSignatures = callExpression.kind === 141 /* NewExpression */ || callExpression.func.kind === 85 /* SuperKeyword */; var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target || signature)) { signature = allSignatures.length ? allSignatures[0] : undefined; } if (signature) { - if (useConstructSignatures && (symbolFlags & 16 /* Class */)) { + if (useConstructSignatures && (symbolFlags & 32 /* Class */)) { symbolKind = ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } - else if (symbolFlags & 4194304 /* Import */) { + else if (symbolFlags & 16777216 /* Import */) { symbolKind = ScriptElementKind.alias; displayParts.push(punctuationPart(11 /* OpenParenToken */)); displayParts.push(textPart(symbolKind)); @@ -34443,6 +33910,7 @@ var ts; switch (symbolKind) { case ScriptElementKind.memberVariableElement: case ScriptElementKind.variableElement: + case ScriptElementKind.constantElement: case ScriptElementKind.parameterElement: case ScriptElementKind.localVariableElement: displayParts.push(punctuationPart(46 /* ColonToken */)); @@ -34462,41 +33930,51 @@ var ts; hasAddedSymbolInfo = true; } } - else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & ts.SymbolFlags.Accessor)) || (location.kind === 107 /* ConstructorKeyword */ && location.parent.kind === 121 /* Constructor */)) { + else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & ts.SymbolFlags.Accessor)) || (location.kind === 107 /* ConstructorKeyword */ && location.parent.kind === 122 /* Constructor */)) { var signature; var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 121 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); + var allSignatures = functionDeclaration.kind === 122 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 121 /* Constructor */) { + if (functionDeclaration.kind === 122 /* Constructor */) { addPrefixForAnyFunctionOrVar(type.symbol, ScriptElementKind.constructorImplementationElement); } else { - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 124 /* CallSignature */ && !(type.symbol.flags & 512 /* TypeLiteral */ || type.symbol.flags & 1024 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 125 /* CallSignature */ && !(type.symbol.flags & 1024 /* TypeLiteral */ || type.symbol.flags & 2048 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); hasAddedSymbolInfo = true; } } } - if (symbolFlags & 16 /* Class */ && !hasAddedSymbolInfo) { + if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo) { displayParts.push(keywordPart(63 /* ClassKeyword */)); displayParts.push(spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } - if ((symbolFlags & 32 /* Interface */) && (semanticMeaning & 2 /* Type */)) { + if ((symbolFlags & 64 /* Interface */) && (semanticMeaning & 2 /* Type */)) { addNewLineIfDisplayPartsExist(); displayParts.push(keywordPart(97 /* InterfaceKeyword */)); displayParts.push(spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } - if (symbolFlags & 64 /* Enum */) { + if (symbolFlags & 1048576 /* TypeAlias */) { + addNewLineIfDisplayPartsExist(); + displayParts.push(keywordPart(115 /* TypeKeyword */)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + displayParts.push(spacePart()); + displayParts.push(punctuationPart(47 /* EqualsToken */)); + displayParts.push(spacePart()); + displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); + } + if (symbolFlags & 128 /* Enum */) { addNewLineIfDisplayPartsExist(); displayParts.push(keywordPart(71 /* EnumKeyword */)); displayParts.push(spacePart()); @@ -34508,7 +33986,7 @@ var ts; displayParts.push(spacePart()); addFullSymbolName(symbol); } - if ((symbolFlags & 262144 /* TypeParameter */) && (semanticMeaning & 2 /* Type */)) { + if ((symbolFlags & 524288 /* TypeParameter */) && (semanticMeaning & 2 /* Type */)) { addNewLineIfDisplayPartsExist(); displayParts.push(punctuationPart(11 /* OpenParenToken */)); displayParts.push(textPart("type parameter")); @@ -34523,22 +34001,22 @@ var ts; writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); } else { - var signatureDeclaration = ts.getDeclarationOfKind(symbol, 117 /* TypeParameter */).parent; + var signatureDeclaration = ts.getDeclarationOfKind(symbol, 118 /* TypeParameter */).parent; var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); - if (signatureDeclaration.kind === 125 /* ConstructSignature */) { + if (signatureDeclaration.kind === 126 /* ConstructSignature */) { displayParts.push(keywordPart(82 /* NewKeyword */)); displayParts.push(spacePart()); } - else if (signatureDeclaration.kind !== 124 /* CallSignature */ && signatureDeclaration.name) { + else if (signatureDeclaration.kind !== 125 /* CallSignature */ && signatureDeclaration.name) { addFullSymbolName(signatureDeclaration.symbol); } displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } } - if (symbolFlags & 4 /* EnumMember */) { + if (symbolFlags & 8 /* EnumMember */) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 183 /* EnumMember */) { + if (declaration.kind === 185 /* EnumMember */) { var constantValue = typeResolver.getEnumMemberValue(declaration); if (constantValue !== undefined) { displayParts.push(spacePart()); @@ -34548,7 +34026,7 @@ var ts; } } } - if (symbolFlags & 4194304 /* Import */) { + if (symbolFlags & 16777216 /* Import */) { addNewLineIfDisplayPartsExist(); displayParts.push(keywordPart(79 /* ImportKeyword */)); displayParts.push(spacePart()); @@ -34557,7 +34035,7 @@ var ts; displayParts.push(punctuationPart(47 /* EqualsToken */)); displayParts.push(spacePart()); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 181 /* ImportDeclaration */) { + if (declaration.kind === 183 /* ImportDeclaration */) { var importDeclaration = declaration; if (importDeclaration.externalModuleName) { displayParts.push(keywordPart(111 /* RequireKeyword */)); @@ -34577,10 +34055,10 @@ var ts; if (symbolKind !== ScriptElementKind.unknown) { if (type) { addPrefixForAnyFunctionOrVar(symbol, symbolKind); - if (symbolKind === ScriptElementKind.memberVariableElement || symbolFlags & 1 /* Variable */ || symbolKind === ScriptElementKind.localVariableElement) { + if (symbolKind === ScriptElementKind.memberVariableElement || symbolFlags & ts.SymbolFlags.Variable || symbolKind === ScriptElementKind.localVariableElement) { displayParts.push(punctuationPart(46 /* ColonToken */)); displayParts.push(spacePart()); - if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */) { + if (type.symbol && type.symbol.flags & 524288 /* TypeParameter */) { var typeParameterParts = mapToDisplayParts(function (writer) { typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); }); @@ -34590,7 +34068,7 @@ var ts; displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, type, enclosingDeclaration)); } } - else if (symbolFlags & 8 /* Function */ || symbolFlags & 2048 /* Method */ || symbolFlags & 4096 /* Constructor */ || symbolFlags & ts.SymbolFlags.Signature || symbolFlags & ts.SymbolFlags.Accessor || symbolKind === ScriptElementKind.memberFunctionElement) { + else if (symbolFlags & 16 /* Function */ || symbolFlags & 4096 /* Method */ || symbolFlags & 8192 /* Constructor */ || symbolFlags & ts.SymbolFlags.Signature || symbolFlags & ts.SymbolFlags.Accessor || symbolKind === ScriptElementKind.memberFunctionElement) { var allSignatures = type.getCallSignatures(); addSignatureDisplayParts(allSignatures[0], allSignatures); } @@ -34655,8 +34133,8 @@ var ts; if (!symbol) { switch (node.kind) { case 59 /* Identifier */: - case 137 /* PropertyAccess */: - case 116 /* QualifiedName */: + case 138 /* PropertyAccess */: + case 117 /* QualifiedName */: case 87 /* ThisKeyword */: case 85 /* SuperKeyword */: var type = typeInfoResolver.getTypeOfNode(node); @@ -34696,7 +34174,7 @@ var ts; var declarations = []; var definition; ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 121 /* Constructor */) || (!selectConstructors && (d.kind === 174 /* FunctionDeclaration */ || d.kind === 120 /* Method */))) { + if ((selectConstructors && d.kind === 122 /* Constructor */) || (!selectConstructors && (d.kind === 175 /* FunctionDeclaration */ || d.kind === 121 /* Method */))) { declarations.push(d); if (d.body) definition = d; @@ -34714,9 +34192,9 @@ var ts; } function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { if (isNewExpressionTarget(location) || location.kind === 107 /* ConstructorKeyword */) { - if (symbol.flags & 16 /* Class */) { + if (symbol.flags & 32 /* Class */) { var classDeclaration = symbol.getDeclarations()[0]; - ts.Debug.assert(classDeclaration && classDeclaration.kind === 176 /* ClassDeclaration */); + ts.Debug.assert(classDeclaration && classDeclaration.kind === 177 /* ClassDeclaration */); return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); } } @@ -34787,70 +34265,70 @@ var ts; switch (node.kind) { case 78 /* IfKeyword */: case 70 /* ElseKeyword */: - if (hasKind(node.parent, 154 /* IfStatement */)) { + if (hasKind(node.parent, 155 /* IfStatement */)) { return getIfElseOccurrences(node.parent); } break; case 84 /* ReturnKeyword */: - if (hasKind(node.parent, 161 /* ReturnStatement */)) { + if (hasKind(node.parent, 162 /* ReturnStatement */)) { return getReturnOccurrences(node.parent); } break; case 88 /* ThrowKeyword */: - if (hasKind(node.parent, 167 /* ThrowStatement */)) { + if (hasKind(node.parent, 168 /* ThrowStatement */)) { return getThrowOccurrences(node.parent); } break; case 90 /* TryKeyword */: case 62 /* CatchKeyword */: case 75 /* FinallyKeyword */: - if (hasKind(parent(parent(node)), 168 /* TryStatement */)) { + if (hasKind(parent(parent(node)), 169 /* TryStatement */)) { return getTryCatchFinallyOccurrences(node.parent.parent); } break; case 86 /* SwitchKeyword */: - if (hasKind(node.parent, 163 /* SwitchStatement */)) { + if (hasKind(node.parent, 164 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent); } break; case 61 /* CaseKeyword */: case 67 /* DefaultKeyword */: - if (hasKind(parent(parent(node)), 163 /* SwitchStatement */)) { + if (hasKind(parent(parent(node)), 164 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent.parent); } break; case 60 /* BreakKeyword */: case 65 /* ContinueKeyword */: - if (hasKind(node.parent, 160 /* BreakStatement */) || hasKind(node.parent, 159 /* ContinueStatement */)) { + if (hasKind(node.parent, 161 /* BreakStatement */) || hasKind(node.parent, 160 /* ContinueStatement */)) { return getBreakOrContinueStatementOccurences(node.parent); } break; case 76 /* ForKeyword */: - if (hasKind(node.parent, 157 /* ForStatement */) || hasKind(node.parent, 158 /* ForInStatement */)) { + if (hasKind(node.parent, 158 /* ForStatement */) || hasKind(node.parent, 159 /* ForInStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 94 /* WhileKeyword */: case 69 /* DoKeyword */: - if (hasKind(node.parent, 156 /* WhileStatement */) || hasKind(node.parent, 155 /* DoStatement */)) { + if (hasKind(node.parent, 157 /* WhileStatement */) || hasKind(node.parent, 156 /* DoStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 107 /* ConstructorKeyword */: - if (hasKind(node.parent, 121 /* Constructor */)) { + if (hasKind(node.parent, 122 /* Constructor */)) { return getConstructorOccurrences(node.parent); } break; case 109 /* GetKeyword */: case 113 /* SetKeyword */: - if (hasKind(node.parent, 122 /* GetAccessor */) || hasKind(node.parent, 123 /* SetAccessor */)) { + if (hasKind(node.parent, 123 /* GetAccessor */) || hasKind(node.parent, 124 /* SetAccessor */)) { return getGetAndSetOccurrences(node.parent); } } return undefined; function getIfElseOccurrences(ifStatement) { var keywords = []; - while (hasKind(ifStatement.parent, 154 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { + while (hasKind(ifStatement.parent, 155 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { ifStatement = ifStatement.parent; } while (ifStatement) { @@ -34861,7 +34339,7 @@ var ts; break; } } - if (!hasKind(ifStatement.elseStatement, 154 /* IfStatement */)) { + if (!hasKind(ifStatement.elseStatement, 155 /* IfStatement */)) { break; } ifStatement = ifStatement.elseStatement; @@ -34894,7 +34372,7 @@ var ts; } function getReturnOccurrences(returnStatement) { var func = ts.getContainingFunction(returnStatement); - if (!(func && hasKind(func.body, 175 /* FunctionBlock */))) { + if (!(func && hasKind(func.body, 176 /* FunctionBlock */))) { return undefined; } var keywords = []; @@ -34915,7 +34393,7 @@ var ts; ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { pushKeywordIf(keywords, throwStatement.getFirstToken(), 88 /* ThrowKeyword */); }); - if (owner.kind === 175 /* FunctionBlock */) { + if (owner.kind === 176 /* FunctionBlock */) { ts.forEachReturnStatement(owner, function (returnStatement) { pushKeywordIf(keywords, returnStatement.getFirstToken(), 84 /* ReturnKeyword */); }); @@ -34927,10 +34405,10 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 167 /* ThrowStatement */) { + if (node.kind === 168 /* ThrowStatement */) { statementAccumulator.push(node); } - else if (node.kind === 168 /* TryStatement */) { + else if (node.kind === 169 /* TryStatement */) { var tryStatement = node; if (tryStatement.catchBlock) { aggregate(tryStatement.catchBlock); @@ -34952,10 +34430,10 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (parent.kind === 175 /* FunctionBlock */ || parent.kind === 184 /* SourceFile */) { + if (parent.kind === 176 /* FunctionBlock */ || parent.kind === 186 /* SourceFile */) { return parent; } - if (parent.kind === 168 /* TryStatement */) { + if (parent.kind === 169 /* TryStatement */) { var tryStatement = parent; if (tryStatement.tryBlock === child && tryStatement.catchBlock) { return child; @@ -34979,7 +34457,7 @@ var ts; function getLoopBreakContinueOccurrences(loopNode) { var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 76 /* ForKeyword */, 94 /* WhileKeyword */, 69 /* DoKeyword */)) { - if (loopNode.kind === 155 /* DoStatement */) { + if (loopNode.kind === 156 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 94 /* WhileKeyword */)) { @@ -35015,12 +34493,12 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 157 /* ForStatement */: - case 158 /* ForInStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: + case 158 /* ForStatement */: + case 159 /* ForInStatement */: + case 156 /* DoStatement */: + case 157 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 163 /* SwitchStatement */: + case 164 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -35031,7 +34509,7 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 160 /* BreakStatement */ || node.kind === 159 /* ContinueStatement */) { + if (node.kind === 161 /* BreakStatement */ || node.kind === 160 /* ContinueStatement */) { statementAccumulator.push(node); } else if (!ts.isAnyFunction(node)) { @@ -35047,14 +34525,14 @@ var ts; function getBreakOrContinueOwner(statement) { for (var node = statement.parent; node; node = node.parent) { switch (node.kind) { - case 163 /* SwitchStatement */: - if (statement.kind === 159 /* ContinueStatement */) { + case 164 /* SwitchStatement */: + if (statement.kind === 160 /* ContinueStatement */) { continue; } - case 157 /* ForStatement */: - case 158 /* ForInStatement */: - case 156 /* WhileStatement */: - case 155 /* DoStatement */: + case 158 /* ForStatement */: + case 159 /* ForInStatement */: + case 157 /* WhileStatement */: + case 156 /* DoStatement */: if (!statement.label || isLabeledBy(node, statement.label.text)) { return node; } @@ -35080,8 +34558,8 @@ var ts; } function getGetAndSetOccurrences(accessorDeclaration) { var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 122 /* GetAccessor */); - tryPushAccessorKeyword(accessorDeclaration.symbol, 123 /* SetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 123 /* GetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 124 /* SetAccessor */); return ts.map(keywords, getReferenceEntryFromNode); function tryPushAccessorKeyword(accessorSymbol, accessorKind) { var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); @@ -35171,7 +34649,7 @@ var ts; } return result; function getNormalizedSymbolName(symbolName, declarations) { - var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 143 /* FunctionExpression */ ? d : undefined; }); + var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 144 /* FunctionExpression */ ? d : undefined; }); if (functionExpression && functionExpression.name) { var name = functionExpression.name.text; } @@ -35186,7 +34664,7 @@ var ts; return name; } function getSymbolScope(symbol) { - if (symbol.getFlags() && (2 /* Property */ | 2048 /* Method */)) { + if (symbol.getFlags() && (4 /* Property */ | 4096 /* Method */)) { var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 32 /* Private */) ? d : undefined; }); if (privateDeclaration) { return privateDeclaration.parent; @@ -35203,7 +34681,7 @@ var ts; if (scope && scope !== container) { return undefined; } - if (container.kind === 184 /* SourceFile */ && !ts.isExternalModule(container)) { + if (container.kind === 186 /* SourceFile */ && !ts.isExternalModule(container)) { return undefined; } scope = container; @@ -35225,7 +34703,7 @@ var ts; if (position > end) break; var endPosition = position + symbolNameLength; - if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 1 /* ES5 */)) && (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 1 /* ES5 */))) { + if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), ts.ScriptTarget.Latest)) && (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), ts.ScriptTarget.Latest))) { positions.push(position); } position = text.indexOf(symbolName, position + symbolNameLength + 1); @@ -35323,11 +34801,11 @@ var ts; } var staticFlag = 128 /* Static */; switch (searchSpaceNode.kind) { - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 120 /* Property */: + case 121 /* Method */: + case 122 /* Constructor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; @@ -35354,26 +34832,26 @@ var ts; var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); var staticFlag = 128 /* Static */; switch (searchSpaceNode.kind) { - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 120 /* Property */: + case 121 /* Method */: + case 122 /* Constructor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; - case 184 /* SourceFile */: + case 186 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: + case 175 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: break; default: return undefined; } var result = []; - if (searchSpaceNode.kind === 184 /* SourceFile */) { + if (searchSpaceNode.kind === 186 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, result); @@ -35394,19 +34872,19 @@ var ts; } var container = ts.getThisContainer(node, false); switch (searchSpaceNode.kind) { - case 143 /* FunctionExpression */: - case 174 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: + case 175 /* FunctionDeclaration */: if (searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128 /* Static */) === staticFlag) { result.push(getReferenceEntryFromNode(node)); } break; - case 184 /* SourceFile */: - if (container.kind === 184 /* SourceFile */ && !ts.isExternalModule(container)) { + case 186 /* SourceFile */: + if (container.kind === 186 /* SourceFile */ && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -35425,20 +34903,20 @@ var ts; if (rootSymbol !== symbol) { result.push(rootSymbol); } - if (rootSymbol.parent && rootSymbol.parent.flags & (16 /* Class */ | 32 /* Interface */)) { + if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); } }); return result; } function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { - if (symbol && symbol.flags & (16 /* Class */ | 32 /* Interface */)) { + if (symbol && symbol.flags & (32 /* Class */ | 64 /* Interface */)) { ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 176 /* ClassDeclaration */) { + if (declaration.kind === 177 /* ClassDeclaration */) { getPropertySymbolFromTypeReference(declaration.baseType); ts.forEach(declaration.implementedTypes, getPropertySymbolFromTypeReference); } - else if (declaration.kind === 177 /* InterfaceDeclaration */) { + else if (declaration.kind === 178 /* InterfaceDeclaration */) { ts.forEach(declaration.baseTypes, getPropertySymbolFromTypeReference); } }); @@ -35470,7 +34948,7 @@ var ts; if (searchSymbols.indexOf(rootSymbol) >= 0) { return true; } - if (rootSymbol.parent && rootSymbol.parent.flags & (16 /* Class */ | 32 /* Interface */)) { + if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { var result = []; getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); return ts.forEach(result, function (s) { return searchSymbols.indexOf(s) >= 0; }); @@ -35544,10 +35022,10 @@ var ts; } var parent = node.parent; if (parent) { - if (parent.kind === 146 /* PostfixOperator */ || parent.kind === 145 /* PrefixOperator */) { + if (parent.kind === 147 /* PostfixOperator */ || parent.kind === 146 /* PrefixOperator */) { return true; } - else if (parent.kind === 147 /* BinaryExpression */ && parent.left === node) { + else if (parent.kind === 148 /* BinaryExpression */ && parent.left === node) { var operator = parent.operator; return ts.SyntaxKind.FirstAssignment <= operator && operator <= ts.SyntaxKind.LastAssignment; } @@ -35661,28 +35139,29 @@ var ts; } function getMeaningFromDeclaration(node) { switch (node.kind) { - case 118 /* Parameter */: - case 173 /* VariableDeclaration */: - case 119 /* Property */: - case 136 /* PropertyAssignment */: - case 183 /* EnumMember */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - case 170 /* CatchBlock */: + case 119 /* Parameter */: + case 174 /* VariableDeclaration */: + case 120 /* Property */: + case 137 /* PropertyAssignment */: + case 185 /* EnumMember */: + case 121 /* Method */: + case 122 /* Constructor */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 175 /* FunctionDeclaration */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: + case 171 /* CatchBlock */: return 1 /* Value */; - case 117 /* TypeParameter */: - case 177 /* InterfaceDeclaration */: - case 129 /* TypeLiteral */: + case 118 /* TypeParameter */: + case 178 /* InterfaceDeclaration */: + case 179 /* TypeAliasDeclaration */: + case 130 /* TypeLiteral */: return 2 /* Type */; - case 176 /* ClassDeclaration */: - case 178 /* EnumDeclaration */: + case 177 /* ClassDeclaration */: + case 180 /* EnumDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: if (node.name.kind === 7 /* StringLiteral */) { return 4 /* Namespace */ | 1 /* Value */; } @@ -35693,41 +35172,42 @@ var ts; return 4 /* Namespace */; } break; - case 181 /* ImportDeclaration */: + case 183 /* ImportDeclaration */: return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } ts.Debug.fail("Unknown declaration type"); } function isTypeReference(node) { - if (node.parent.kind === 116 /* QualifiedName */ && node.parent.right === node) + if (isRightSideOfQualifiedName(node)) { node = node.parent; - return node.parent.kind === 127 /* TypeReference */; + } + return node.parent.kind === 128 /* TypeReference */; } function isNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 116 /* QualifiedName */) { - while (root.parent && root.parent.kind === 116 /* QualifiedName */) + if (root.parent.kind === 117 /* QualifiedName */) { + while (root.parent && root.parent.kind === 117 /* QualifiedName */) root = root.parent; isLastClause = root.right === node; } - return root.parent.kind === 127 /* TypeReference */ && !isLastClause; + return root.parent.kind === 128 /* TypeReference */ && !isLastClause; } function isInRightSideOfImport(node) { - while (node.parent.kind === 116 /* QualifiedName */) { + while (node.parent.kind === 117 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 181 /* ImportDeclaration */ && node.parent.entityName === node; + return node.parent.kind === 183 /* ImportDeclaration */ && node.parent.entityName === node; } function getMeaningFromRightHandSideOfImport(node) { ts.Debug.assert(node.kind === 59 /* Identifier */); - if (node.parent.kind === 116 /* QualifiedName */ && node.parent.right === node && node.parent.parent.kind === 181 /* ImportDeclaration */) { + if (node.parent.kind === 117 /* QualifiedName */ && node.parent.right === node && node.parent.parent.kind === 183 /* ImportDeclaration */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } return 4 /* Namespace */; } function getMeaningFromLocation(node) { - if (node.parent.kind === 182 /* ExportAssignment */) { + if (node.parent.kind === 184 /* ExportAssignment */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } else if (isInRightSideOfImport(node)) { @@ -35810,55 +35290,47 @@ var ts; return currentSourceFile; } function getNameOrDottedNameSpan(filename, startPos, endPos) { - function getTypeInfoEligiblePath(filename, position, isConstructorValidPosition) { - var sourceUnit = syntaxTreeCache.getCurrentFileSyntaxTree(filename).sourceUnit(); - var ast = TypeScript.ASTHelpers.getAstAtPosition(sourceUnit, position, false, true); - if (ast === null) { - return null; - } - if (ast.kind() === 228 /* ParameterList */ && ast.parent.kind() === 143 /* CallSignature */ && ast.parent.parent.kind() === 138 /* ConstructorDeclaration */) { - ast = ast.parent.parent; - } - switch (ast.kind()) { - default: - return null; - case 138 /* ConstructorDeclaration */: - var constructorAST = ast; - if (!isConstructorValidPosition || !(position >= TypeScript.start(constructorAST) && position <= TypeScript.start(constructorAST) + "constructor".length)) { - return null; - } - else { - return ast; - } - case 130 /* FunctionDeclaration */: - return null; - case 213 /* MemberAccessExpression */: - case 121 /* QualifiedName */: - case 50 /* SuperKeyword */: - case 14 /* StringLiteral */: - case 35 /* ThisKeyword */: - case 11 /* IdentifierName */: - return ast; - } + filename = ts.normalizeSlashes(filename); + var node = ts.getTouchingPropertyName(getCurrentSourceFile(filename), startPos); + if (!node) { + return; } - filename = TypeScript.switchToForwardSlashes(filename); - var node = getTypeInfoEligiblePath(filename, startPos, false); - if (!node) - return null; - while (node) { - if (TypeScript.ASTHelpers.isNameOfMemberAccessExpression(node) || TypeScript.ASTHelpers.isRightSideOfQualifiedName(node)) { - node = node.parent; + switch (node.kind) { + case 138 /* PropertyAccess */: + case 117 /* QualifiedName */: + case 7 /* StringLiteral */: + case 74 /* FalseKeyword */: + case 89 /* TrueKeyword */: + case 83 /* NullKeyword */: + case 85 /* SuperKeyword */: + case 87 /* ThisKeyword */: + case 59 /* Identifier */: + break; + default: + return; + } + var nodeForStartPos = node; + while (true) { + if (isRightSideOfPropertyAccess(nodeForStartPos) || isRightSideOfQualifiedName(nodeForStartPos)) { + nodeForStartPos = nodeForStartPos.parent; + } + else if (isNameOfModuleDeclaration(nodeForStartPos)) { + if (nodeForStartPos.parent.parent.kind === 181 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { + nodeForStartPos = nodeForStartPos.parent.parent.name; + } + else { + break; + } } else { break; } } - return TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node)); + return TypeScript.TextSpan.fromBounds(nodeForStartPos.getStart(), node.getEnd()); } function getBreakpointStatementAtPosition(filename, position) { - filename = TypeScript.switchToForwardSlashes(filename); - var syntaxtree = getSyntaxTree(filename); - return TypeScript.Services.Breakpoints.getBreakpointLocation(syntaxtree, position); + filename = ts.normalizeSlashes(filename); + return ts.BreakpointResolver.spanInSourceFileAtLocation(getCurrentSourceFile(filename), position); } function getNavigationBarItems(filename) { filename = TypeScript.switchToForwardSlashes(filename); @@ -35873,17 +35345,17 @@ var ts; return result; function classifySymbol(symbol, meaningAtPosition) { var flags = symbol.getFlags(); - if (flags & 16 /* Class */) { + if (flags & 32 /* Class */) { return ClassificationTypeNames.className; } - else if (flags & 64 /* Enum */) { + else if (flags & 128 /* Enum */) { return ClassificationTypeNames.enumName; } else if (meaningAtPosition & 2 /* Type */) { - if (flags & 32 /* Interface */) { + if (flags & 64 /* Interface */) { return ClassificationTypeNames.interfaceName; } - else if (flags & 262144 /* TypeParameter */) { + else if (flags & 524288 /* TypeParameter */) { return ClassificationTypeNames.typeParameterName; } } @@ -35895,7 +35367,7 @@ var ts; return undefined; function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 179 /* ModuleDeclaration */ && ts.isInstantiated(declaration); + return declaration.kind === 181 /* ModuleDeclaration */ && ts.isInstantiated(declaration); }); } } @@ -35956,7 +35428,7 @@ var ts; } } if (ts.isPunctuation(token)) { - if (token.parent.kind === 147 /* BinaryExpression */ || token.parent.kind === 173 /* VariableDeclaration */ || token.parent.kind === 145 /* PrefixOperator */ || token.parent.kind === 146 /* PostfixOperator */ || token.parent.kind === 148 /* ConditionalExpression */) { + if (token.parent.kind === 148 /* BinaryExpression */ || token.parent.kind === 174 /* VariableDeclaration */ || token.parent.kind === 146 /* PrefixOperator */ || token.parent.kind === 147 /* PostfixOperator */ || token.parent.kind === 149 /* ConditionalExpression */) { return ClassificationTypeNames.operator; } else { @@ -35974,27 +35446,27 @@ var ts; } else if (tokenKind === 59 /* Identifier */) { switch (token.parent.kind) { - case 176 /* ClassDeclaration */: + case 177 /* ClassDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.className; } return; - case 117 /* TypeParameter */: + case 118 /* TypeParameter */: if (token.parent.name === token) { return ClassificationTypeNames.typeParameterName; } return; - case 177 /* InterfaceDeclaration */: + case 178 /* InterfaceDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.interfaceName; } return; - case 178 /* EnumDeclaration */: + case 180 /* EnumDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.enumName; } return; - case 179 /* ModuleDeclaration */: + case 181 /* ModuleDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.moduleName; } @@ -36259,7 +35731,7 @@ var ts; } ts.createLanguageService = createLanguageService; function createClassifier(host) { - var scanner = ts.createScanner(1 /* ES5 */, false); + var scanner = ts.createScanner(ts.ScriptTarget.Latest, false); var noRegexTable = []; noRegexTable[59 /* Identifier */] = true; noRegexTable[7 /* StringLiteral */] = true; @@ -36471,7 +35943,7 @@ var ts; getNodeConstructor: function (kind) { function Node() { } - var proto = kind === 184 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); + var proto = kind === 186 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); proto.kind = kind; proto.pos = 0; proto.end = 0; @@ -36487,6 +35959,345 @@ var ts; } initializeServices(); })(ts || (ts = {})); +var ts; +(function (ts) { + var BreakpointResolver; + (function (BreakpointResolver) { + function spanInSourceFileAtLocation(sourceFile, position) { + if (sourceFile.flags & 1024 /* DeclarationFile */) { + return undefined; + } + var tokenAtLocation = ts.getTokenAtPosition(sourceFile, position); + var lineOfPosition = sourceFile.getLineAndCharacterFromPosition(position).line; + if (sourceFile.getLineAndCharacterFromPosition(tokenAtLocation.getStart()).line > lineOfPosition) { + tokenAtLocation = ts.findPrecedingToken(tokenAtLocation.pos, sourceFile); + if (!tokenAtLocation || sourceFile.getLineAndCharacterFromPosition(tokenAtLocation.getEnd()).line !== lineOfPosition) { + return undefined; + } + } + if (ts.isInAmbientContext(tokenAtLocation)) { + return undefined; + } + return spanInNode(tokenAtLocation); + function textSpan(startNode, endNode) { + return TypeScript.TextSpan.fromBounds(startNode.getStart(), (endNode || startNode).getEnd()); + } + function spanInNodeIfStartsOnSameLine(node, otherwiseOnNode) { + if (node && lineOfPosition === sourceFile.getLineAndCharacterFromPosition(node.getStart()).line) { + return spanInNode(node); + } + return spanInNode(otherwiseOnNode); + } + function spanInPreviousNode(node) { + return spanInNode(ts.findPrecedingToken(node.pos, sourceFile)); + } + function spanInNextNode(node) { + return spanInNode(ts.findNextToken(node, node.parent)); + } + function spanInNode(node) { + if (node) { + if (ts.isExpression(node)) { + if (node.parent.kind === 156 /* DoStatement */) { + return spanInPreviousNode(node); + } + if (node.parent.kind === 158 /* ForStatement */) { + return textSpan(node); + } + if (node.parent.kind === 148 /* BinaryExpression */ && node.parent.operator === 18 /* CommaToken */) { + return textSpan(node); + } + if (node.parent.kind == 145 /* ArrowFunction */ && node.parent.body == node) { + return textSpan(node); + } + } + switch (node.kind) { + case 152 /* VariableStatement */: + return spanInVariableDeclaration(node.declarations[0]); + case 174 /* VariableDeclaration */: + case 120 /* Property */: + return spanInVariableDeclaration(node); + case 119 /* Parameter */: + return spanInParameterDeclaration(node); + case 175 /* FunctionDeclaration */: + case 121 /* Method */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 122 /* Constructor */: + case 144 /* FunctionExpression */: + case 145 /* ArrowFunction */: + return spanInFunctionDeclaration(node); + case 176 /* FunctionBlock */: + return spanInFunctionBlock(node); + case 151 /* Block */: + case 170 /* TryBlock */: + case 171 /* CatchBlock */: + case 172 /* FinallyBlock */: + case 182 /* ModuleBlock */: + return spanInBlock(node); + case 154 /* ExpressionStatement */: + return textSpan(node.expression); + case 162 /* ReturnStatement */: + return textSpan(node.getChildAt(0), node.expression); + case 157 /* WhileStatement */: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 156 /* DoStatement */: + return spanInNode(node.statement); + case 173 /* DebuggerStatement */: + return textSpan(node.getChildAt(0)); + case 155 /* IfStatement */: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 167 /* LabeledStatement */: + return spanInNode(node.statement); + case 161 /* BreakStatement */: + case 160 /* ContinueStatement */: + return textSpan(node.getChildAt(0), node.label); + case 158 /* ForStatement */: + return spanInForStatement(node); + case 159 /* ForInStatement */: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 164 /* SwitchStatement */: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 165 /* CaseClause */: + case 166 /* DefaultClause */: + return spanInNode(node.statements[0]); + case 169 /* TryStatement */: + return spanInBlock(node.tryBlock); + case 168 /* ThrowStatement */: + return textSpan(node, node.expression); + case 184 /* ExportAssignment */: + return textSpan(node, node.exportName); + case 183 /* ImportDeclaration */: + return textSpan(node, node.entityName || node.externalModuleName); + case 181 /* ModuleDeclaration */: + if (!ts.isInstantiated(node)) { + return undefined; + } + case 177 /* ClassDeclaration */: + case 180 /* EnumDeclaration */: + case 185 /* EnumMember */: + case 140 /* CallExpression */: + case 141 /* NewExpression */: + return textSpan(node); + case 163 /* WithStatement */: + return spanInNode(node.statement); + case 178 /* InterfaceDeclaration */: + return undefined; + case 17 /* SemicolonToken */: + case 1 /* EndOfFileToken */: + return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile)); + case 18 /* CommaToken */: + return spanInPreviousNode(node); + case 9 /* OpenBraceToken */: + return spanInOpenBraceToken(node); + case 10 /* CloseBraceToken */: + return spanInCloseBraceToken(node); + case 11 /* OpenParenToken */: + return spanInOpenParenToken(node); + case 12 /* CloseParenToken */: + return spanInCloseParenToken(node); + case 46 /* ColonToken */: + return spanInColonToken(node); + case 20 /* GreaterThanToken */: + case 19 /* LessThanToken */: + return spanInGreaterThanOrLessThanToken(node); + case 94 /* WhileKeyword */: + return spanInWhileKeyword(node); + case 70 /* ElseKeyword */: + case 62 /* CatchKeyword */: + case 75 /* FinallyKeyword */: + return spanInNextNode(node); + default: + if (node.parent.kind === 137 /* PropertyAssignment */ && node.parent.name === node) { + return spanInNode(node.parent.initializer); + } + if (node.parent.kind === 142 /* TypeAssertion */ && node.parent.type === node) { + return spanInNode(node.parent.operand); + } + if (ts.isAnyFunction(node.parent) && node.parent.type === node) { + return spanInPreviousNode(node); + } + return spanInNode(node.parent); + } + } + function spanInVariableDeclaration(variableDeclaration) { + if (variableDeclaration.parent.kind === 159 /* ForInStatement */) { + return spanInNode(variableDeclaration.parent); + } + var isParentVariableStatement = variableDeclaration.parent.kind === 152 /* VariableStatement */; + var isDeclarationOfForStatement = variableDeclaration.parent.kind === 158 /* ForStatement */ && ts.contains(variableDeclaration.parent.declarations, variableDeclaration); + var declarations = isParentVariableStatement ? variableDeclaration.parent.declarations : isDeclarationOfForStatement ? variableDeclaration.parent.declarations : undefined; + if (variableDeclaration.initializer || (variableDeclaration.flags & 1 /* Export */)) { + if (declarations && declarations[0] === variableDeclaration) { + if (isParentVariableStatement) { + return textSpan(variableDeclaration.parent, variableDeclaration); + } + else { + ts.Debug.assert(isDeclarationOfForStatement); + return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); + } + } + else { + return textSpan(variableDeclaration); + } + } + else if (declarations && declarations[0] !== variableDeclaration) { + var indexOfCurrentDeclaration = ts.indexOf(declarations, variableDeclaration); + return spanInVariableDeclaration(declarations[indexOfCurrentDeclaration - 1]); + } + } + function canHaveSpanInParameterDeclaration(parameter) { + return !!parameter.initializer || !!(parameter.flags & 8 /* Rest */) || !!(parameter.flags & 16 /* Public */) || !!(parameter.flags & 32 /* Private */); + } + function spanInParameterDeclaration(parameter) { + if (canHaveSpanInParameterDeclaration(parameter)) { + return textSpan(parameter); + } + else { + var functionDeclaration = parameter.parent; + var indexOfParameter = ts.indexOf(functionDeclaration.parameters, parameter); + if (indexOfParameter) { + return spanInParameterDeclaration(functionDeclaration.parameters[indexOfParameter - 1]); + } + else { + return spanInNode(functionDeclaration.body); + } + } + } + function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { + return !!(functionDeclaration.flags & 1 /* Export */) || (functionDeclaration.parent.kind === 177 /* ClassDeclaration */ && functionDeclaration.kind !== 122 /* Constructor */); + } + function spanInFunctionDeclaration(functionDeclaration) { + if (!functionDeclaration.body) { + return undefined; + } + if (canFunctionHaveSpanInWholeDeclaration(functionDeclaration)) { + return textSpan(functionDeclaration); + } + return spanInNode(functionDeclaration.body); + } + function spanInFunctionBlock(block) { + var nodeForSpanInBlock = block.statements.length ? block.statements[0] : block.getLastToken(); + if (canFunctionHaveSpanInWholeDeclaration(block.parent)) { + return spanInNodeIfStartsOnSameLine(block.parent, nodeForSpanInBlock); + } + return spanInNode(nodeForSpanInBlock); + } + function spanInBlock(block) { + switch (block.parent.kind) { + case 181 /* ModuleDeclaration */: + if (!ts.isInstantiated(block.parent)) { + return undefined; + } + case 157 /* WhileStatement */: + case 155 /* IfStatement */: + case 159 /* ForInStatement */: + return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); + case 158 /* ForStatement */: + return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); + } + return spanInNode(block.statements[0]); + } + function spanInForStatement(forStatement) { + if (forStatement.declarations) { + return spanInNode(forStatement.declarations[0]); + } + if (forStatement.initializer) { + return spanInNode(forStatement.initializer); + } + if (forStatement.condition) { + return textSpan(forStatement.condition); + } + if (forStatement.iterator) { + return textSpan(forStatement.iterator); + } + } + function spanInOpenBraceToken(node) { + switch (node.parent.kind) { + case 180 /* EnumDeclaration */: + var enumDeclaration = node.parent; + return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); + case 177 /* ClassDeclaration */: + var classDeclaration = node.parent; + return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); + case 164 /* SwitchStatement */: + return spanInNodeIfStartsOnSameLine(node.parent, node.parent.clauses[0]); + } + return spanInNode(node.parent); + } + function spanInCloseBraceToken(node) { + switch (node.parent.kind) { + case 182 /* ModuleBlock */: + if (!ts.isInstantiated(node.parent.parent)) { + return undefined; + } + case 176 /* FunctionBlock */: + case 180 /* EnumDeclaration */: + case 177 /* ClassDeclaration */: + return textSpan(node); + case 151 /* Block */: + case 170 /* TryBlock */: + case 171 /* CatchBlock */: + case 172 /* FinallyBlock */: + return spanInNode(node.parent.statements[node.parent.statements.length - 1]); + ; + case 164 /* SwitchStatement */: + var switchStatement = node.parent; + var lastClause = switchStatement.clauses[switchStatement.clauses.length - 1]; + if (lastClause) { + return spanInNode(lastClause.statements[lastClause.statements.length - 1]); + } + return undefined; + default: + return spanInNode(node.parent); + } + } + function spanInOpenParenToken(node) { + if (node.parent.kind === 156 /* DoStatement */) { + return spanInPreviousNode(node); + } + return spanInNode(node.parent); + } + function spanInCloseParenToken(node) { + switch (node.parent.kind) { + case 144 /* FunctionExpression */: + case 175 /* FunctionDeclaration */: + case 145 /* ArrowFunction */: + case 121 /* Method */: + case 123 /* GetAccessor */: + case 124 /* SetAccessor */: + case 122 /* Constructor */: + case 157 /* WhileStatement */: + case 156 /* DoStatement */: + case 158 /* ForStatement */: + return spanInPreviousNode(node); + default: + return spanInNode(node.parent); + } + return spanInNode(node.parent); + } + function spanInColonToken(node) { + if (ts.isAnyFunction(node.parent) || node.parent.kind === 137 /* PropertyAssignment */) { + return spanInPreviousNode(node); + } + return spanInNode(node.parent); + } + function spanInGreaterThanOrLessThanToken(node) { + if (node.parent.kind === 142 /* TypeAssertion */) { + return spanInNode(node.parent.operand); + } + return spanInNode(node.parent); + } + function spanInWhileKeyword(node) { + if (node.parent.kind === 156 /* DoStatement */) { + return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); + } + return spanInNode(node.parent); + } + } + } + BreakpointResolver.spanInSourceFileAtLocation = spanInSourceFileAtLocation; + })(BreakpointResolver = ts.BreakpointResolver || (ts.BreakpointResolver = {})); +})(ts || (ts = {})); var TypeScript; (function (TypeScript) { function isNoDefaultLibMatch(comment) { @@ -36594,7 +36405,7 @@ var TypeScript; function preProcessFile(fileName, sourceText, readImportFiles) { if (readImportFiles === void 0) { readImportFiles = true; } var text = TypeScript.SimpleText.fromScriptSnapshot(sourceText); - var scanner = TypeScript.Scanner.createScanner(1 /* ES5 */, text, reportDiagnostic); + var scanner = TypeScript.Scanner.createScanner(ts.ScriptTarget.Latest, text, reportDiagnostic); var firstToken = scanner.scan(false); var importedFiles = []; if (readImportFiles) { @@ -36615,6 +36426,7 @@ var ts; (function (LanguageVersion) { LanguageVersion[LanguageVersion["EcmaScript3"] = 0] = "EcmaScript3"; LanguageVersion[LanguageVersion["EcmaScript5"] = 1] = "EcmaScript5"; + LanguageVersion[LanguageVersion["EcmaScript6"] = 2] = "EcmaScript6"; })(ts.LanguageVersion || (ts.LanguageVersion = {})); var LanguageVersion = ts.LanguageVersion; (function (ModuleGenTarget) { @@ -36631,6 +36443,8 @@ var ts; return 0 /* ES3 */; case 1 /* EcmaScript5 */: return 1 /* ES5 */; + case 2 /* EcmaScript6 */: + return 2 /* ES6 */; default: throw Error("unsupported LanguageVersion value: " + languageVersion); } @@ -36657,6 +36471,8 @@ var ts; return 0 /* EcmaScript3 */; case 1 /* ES5 */: return 1 /* EcmaScript5 */; + case 2 /* ES6 */: + return 2 /* EcmaScript6 */; default: throw Error("unsupported ScriptTarget value: " + scriptTarget); } From f3526bd2c494c7e691594b88a01de3a1b93b0cc4 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 28 Oct 2014 12:11:52 -0700 Subject: [PATCH 23/28] Revert "Introduce .editorconfig file" This reverts commit f3b1e94d6879f6ddb810aee53eb8007f9cc187f2. --- .editorconfig | 16 ---------- package.json | 88 +++++++++++++++++++++++++-------------------------- 2 files changed, 44 insertions(+), 60 deletions(-) delete mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 0879f3c6c7d..00000000000 --- a/.editorconfig +++ /dev/null @@ -1,16 +0,0 @@ -# http://editorconfig.org - -# top-most EditorConfig file -root = true - -[*] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.json] -indent_size = 2 - -[*.yml] -indent_size = 2 diff --git a/package.json b/package.json index 535a666a4f9..00752302254 100644 --- a/package.json +++ b/package.json @@ -1,46 +1,46 @@ { - "name": "typescript", - "author": "Microsoft Corp.", - "homepage": "http://typescriptlang.org/", - "version": "1.3.0", - "licenses": [ - { - "type": "Apache License 2.0", - "url": "https://github.com/Microsoft/TypeScript/blob/master/LICENSE.txt" - } - ], - "description": "TypeScript is a language for application scale JavaScript development", - "keywords": [ - "TypeScript", - "Microsoft", - "compiler", - "language", - "javascript" - ], - "bugs": { - "url": "https://github.com/Microsoft/TypeScript/issues" - }, - "repository": { - "type": "git", - "url": "https://github.com/Microsoft/TypeScript.git" - }, - "preferGlobal": true, - "main": "./bin/tsc.js", - "bin": { - "tsc": "./bin/tsc" - }, - "engines": { - "node": ">=0.8.0" - }, - "devDependencies": { - "browserify": "latest", - "chai": "latest", - "codeclimate-test-reporter": "latest", - "istanbul": "latest", - "jake": "latest", - "mocha": "latest" - }, - "scripts": { - "test": "jake generate-code-coverage" - } + "name": "typescript", + "author": "Microsoft Corp.", + "homepage": "http://typescriptlang.org/", + "version": "1.3.0", + "licenses": [ + { + "type": "Apache License 2.0", + "url": "https://github.com/Microsoft/TypeScript/blob/master/LICENSE.txt" + } + ], + "description": "TypeScript is a language for application scale JavaScript development", + "keywords": [ + "TypeScript", + "Microsoft", + "compiler", + "language", + "javascript" + ], + "bugs": { + "url" : "https://github.com/Microsoft/TypeScript/issues" + }, + "repository" : { + "type" : "git", + "url" : "https://github.com/Microsoft/TypeScript.git" + }, + "preferGlobal" : true, + "main" : "./bin/tsc.js", + "bin" : { + "tsc" : "./bin/tsc" + }, + "engines" : { + "node" : ">=0.8.0" + }, + "devDependencies": { + "jake" : "latest", + "mocha" : "latest", + "chai" : "latest", + "browserify" : "latest", + "istanbul": "latest", + "codeclimate-test-reporter": "latest" + }, + "scripts": { + "test": "jake generate-code-coverage" + } } From e179e0565cfb90c30dc219e49599547948bb2e10 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 28 Oct 2014 12:12:18 -0700 Subject: [PATCH 24/28] Revert "Introduce .gitattributes file" This reverts commit 218064d8b4a8d1ea4fad00ff339e13318c8ee627. --- .gitattributes | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index e186d4ff06b..00000000000 --- a/.gitattributes +++ /dev/null @@ -1,14 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain From ba6855652bf60154166d2ba22b832967dd2e6ae5 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 28 Oct 2014 12:18:58 -0700 Subject: [PATCH 25/28] chainedMessage -> headMessage --- src/compiler/checker.ts | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ab5064e6776..4ad7d92d26b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3181,18 +3181,18 @@ module ts { source: Type, target: Type, errorNode: Node, - chainedMessage?: DiagnosticMessage, + headMessage?: DiagnosticMessage, containingMessageChain?: DiagnosticMessageChain): boolean { - return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, chainedMessage, containingMessageChain); + return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, headMessage, containingMessageChain); } function isTypeAssignableTo(source: Type, target: Type): boolean { return checkTypeAssignableTo(source, target, /*errorNode*/ undefined); } - function checkTypeAssignableTo(source: Type, target: Type, errorNode: Node, chainedMessage?: DiagnosticMessage): boolean { - return checkTypeRelatedTo(source, target, assignableRelation, errorNode, chainedMessage); + function checkTypeAssignableTo(source: Type, target: Type, errorNode: Node, headMessage?: DiagnosticMessage): boolean { + return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage); } function isTypeRelatedTo(source: Type, target: Type, relation: Map): boolean { @@ -3271,7 +3271,7 @@ module ts { target: Type, relation: Map, errorNode: Node, - chainedMessage?: DiagnosticMessage, + headMessage?: DiagnosticMessage, containingMessageChain?: DiagnosticMessageChain): boolean { var errorInfo: DiagnosticMessageChain; @@ -3283,7 +3283,7 @@ module ts { Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, chainedMessage); + var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, headMessage); if (overflow) { error(errorNode, Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } @@ -3300,10 +3300,10 @@ module ts { } function isRelatedTo(source: Type, target: Type, reportErrors?: boolean): boolean { - return isRelatedToWithCustomErrors(source, target, reportErrors, /*chainedMessage*/ undefined); + return isRelatedToWithCustomErrors(source, target, reportErrors, /*headMessage*/ undefined); } - function isRelatedToWithCustomErrors(source: Type, target: Type, reportErrors: boolean, chainedMessage: DiagnosticMessage): boolean { + function isRelatedToWithCustomErrors(source: Type, target: Type, reportErrors: boolean, headMessage: DiagnosticMessage): boolean { if (relation === identityRelation) { // both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases if (source === target) return true; @@ -3355,9 +3355,9 @@ module ts { } } if (reportErrors) { - chainedMessage = chainedMessage || Diagnostics.Type_0_is_not_assignable_to_type_1; - Debug.assert(chainedMessage); - reportError(chainedMessage, typeToString(source), typeToString(target)); + headMessage = headMessage || Diagnostics.Type_0_is_not_assignable_to_type_1; + Debug.assert(headMessage); + reportError(headMessage, typeToString(source), typeToString(target)); } return false; } @@ -5778,7 +5778,7 @@ module ts { else { var exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, /*chainedMessage*/ undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, /*headMessage*/ undefined); } checkFunctionExpressionBodies(node.body); } @@ -6084,7 +6084,7 @@ module ts { // Use default messages if (ok) { // to avoid cascading errors check assignability only if 'isReference' check succeeded and no errors were reported - checkTypeAssignableTo(valueType, leftType, node.left, /*chainedMessage*/ undefined); + checkTypeAssignableTo(valueType, leftType, node.left, /*headMessage*/ undefined); } } } @@ -7107,7 +7107,7 @@ module ts { if (node.initializer) { if (!(getNodeLinks(node.initializer).flags & NodeCheckFlags.TypeChecked)) { // Use default messages - checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, /*chainedMessage*/ undefined); + checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, /*headMessage*/ undefined); } checkCollisionWithConstDeclarations(node); } @@ -7220,7 +7220,7 @@ module ts { func.type || (func.kind === SyntaxKind.GetAccessor && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, SyntaxKind.SetAccessor))); if (checkAssignability) { - checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, /*chainedMessage*/ undefined); + checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, /*headMessage*/ undefined); } else if (func.kind == SyntaxKind.Constructor) { // constructor doesn't have explicit return type annotation and yet its return type is known - declaring type @@ -7248,7 +7248,7 @@ module ts { var caseType = checkExpression(clause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { // check 'expressionType isAssignableTo caseType' failed, try the reversed check and report errors if it fails - checkTypeAssignableTo(caseType, expressionType, clause.expression, /*chainedMessage*/ undefined); + checkTypeAssignableTo(caseType, expressionType, clause.expression, /*headMessage*/ undefined); } } checkBlock(clause); @@ -7604,7 +7604,7 @@ module ts { // If it is a constant value (not undefined), it is syntactically constrained to be a number. // Also, we do not need to check this for ambients because there is already // a syntax error if it is not a constant. - checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, /*chainedMessage*/ undefined); + checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, /*headMessage*/ undefined); } } else if (ambient) { From 4486c3be9d30baa97528f6fdff789f9473e98886 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Mon, 13 Oct 2014 18:25:51 -0700 Subject: [PATCH 26/28] Fix signature help crash when requested outside argument list --- src/services/formatting/smartIndenter.ts | 2 +- src/services/signatureHelp.ts | 8 ++------ src/services/utilities.ts | 16 +++++++++------- .../fourslash/noSignatureHelpOnNewKeyword.ts | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 tests/cases/fourslash/noSignatureHelpOnNewKeyword.ts diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index 79b238c893d..12d36dd4d2b 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -108,7 +108,7 @@ module ts.formatting { function getActualIndentationForListItemBeforeComma(commaToken: Node, sourceFile: SourceFile, options: TypeScript.FormattingOptions): number { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var commaItemInfo = findListItemInfo(commaToken); - Debug.assert(commaItemInfo.listItemIndex > 0); + Debug.assert(commaItemInfo && commaItemInfo.listItemIndex > 0); // The item we're interested in is right before the comma return deriveActualIndentationFromList(commaItemInfo.list.getChildren(), commaItemInfo.listItemIndex - 1, sourceFile, options); } diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts index 86e378abb45..76e17b91311 100644 --- a/src/services/signatureHelp.ts +++ b/src/services/signatureHelp.ts @@ -226,12 +226,8 @@ module ts.SignatureHelp { }; } - if (node.kind === SyntaxKind.GreaterThanToken - || node.kind === SyntaxKind.CloseParenToken - || node === parent.func) { - return undefined; - } - + // findListItemInfo can return undefined if we are not in parent's argument list + // or type argument list. return findListItemInfo(node); } diff --git a/src/services/utilities.ts b/src/services/utilities.ts index f6396bebf9b..5fd90eb894a 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -7,6 +7,15 @@ module ts { export function findListItemInfo(node: Node): ListItemInfo { var syntaxList = findContainingList(node); + + // It is possible at this point for syntaxList to be undefined, either if + // node.parent had no list child, or if none of its list children contained + // the span of node. If this happens, return undefined. The caller should + // handle this case. + if (!syntaxList) { + return undefined; + } + var children = syntaxList.getChildren(); var index = indexOf(children, node); @@ -32,13 +41,6 @@ module ts { } }); - // syntaxList should not be undefined here. If it is, there is a problem. Find out if - // there at least is a child that is a list. - if (!syntaxList) { - Debug.assert(findChildOfKind(node.parent, SyntaxKind.SyntaxList), - "Node of kind " + SyntaxKind[node.parent.kind] + " has no list children"); - } - return syntaxList; } diff --git a/tests/cases/fourslash/noSignatureHelpOnNewKeyword.ts b/tests/cases/fourslash/noSignatureHelpOnNewKeyword.ts new file mode 100644 index 00000000000..30314b1c665 --- /dev/null +++ b/tests/cases/fourslash/noSignatureHelpOnNewKeyword.ts @@ -0,0 +1,14 @@ +/// + +////class Foo { } +////new/*1*/ Foo +////new /*2*/Foo(/*3*/) + +goTo.marker('1'); +verify.not.signatureHelpPresent(); + +goTo.marker('2'); +verify.not.signatureHelpPresent(); + +goTo.marker('3'); +verify.signatureHelpPresent(); \ No newline at end of file From b187a0abddc46d6a3c84fb79e3f6d3e24a76bcf7 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Tue, 14 Oct 2014 11:23:36 -0700 Subject: [PATCH 27/28] Comment examples of when findListItemInfo can return undefined --- src/services/signatureHelp.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts index 76e17b91311..a93cf2c276e 100644 --- a/src/services/signatureHelp.ts +++ b/src/services/signatureHelp.ts @@ -227,7 +227,11 @@ module ts.SignatureHelp { } // findListItemInfo can return undefined if we are not in parent's argument list - // or type argument list. + // or type argument list. This includes cases where the cursor is: + // - To the right of the closing paren + // - Between the type arguments and the arguments (greater than token) + // - On the target of the call (parent.func) + // - On the 'new' keyword in a 'new' expression return findListItemInfo(node); } From 1d176e43b089642a7ae3384e4b7fedcdc928d449 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 28 Oct 2014 18:55:49 -0700 Subject: [PATCH 28/28] Remove syntaxTree from SourceFileObject --- src/services/services.ts | 74 +++++++++++++++------------------------- 1 file changed, 28 insertions(+), 46 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index 1ef25e2cb0e..afaf5ca4535 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -71,8 +71,6 @@ module ts { } export interface SourceFile { - getSourceUnit(): TypeScript.SourceUnitSyntax; - getSyntaxTree(): TypeScript.SyntaxTree; getScriptSnapshot(): TypeScript.IScriptSnapshot; getNamedDeclarations(): Declaration[]; update(scriptSnapshot: TypeScript.IScriptSnapshot, version: string, isOpen: boolean, textChangeRange: TypeScript.TextChangeRange): SourceFile; @@ -660,23 +658,13 @@ module ts { public languageVersion: ScriptTarget; public identifiers: Map; - private syntaxTree: TypeScript.SyntaxTree; private scriptSnapshot: TypeScript.IScriptSnapshot; private namedDeclarations: Declaration[]; - public getSourceUnit(): TypeScript.SourceUnitSyntax { - // If we don't have a script, create one from our parse tree. - return this.getSyntaxTree().sourceUnit(); - } - public getScriptSnapshot(): TypeScript.IScriptSnapshot { return this.scriptSnapshot; } - public getLineMap(): TypeScript.LineMap { - return this.getSyntaxTree().lineMap(); - } - public getNamedDeclarations() { if (!this.namedDeclarations) { var sourceFile = this; @@ -748,32 +736,11 @@ module ts { return this.namedDeclarations; } - public getSyntaxTree(): TypeScript.SyntaxTree { - if (!this.syntaxTree) { - var start = new Date().getTime(); - - this.syntaxTree = TypeScript.Parser.parse( - this.filename, TypeScript.SimpleText.fromScriptSnapshot(this.scriptSnapshot), this.languageVersion, this.isDeclareFile()); - - var time = new Date().getTime() - start; - - //TypeScript.syntaxTreeParseTime += time; - } - - return this.syntaxTree; - } - private isDeclareFile(): boolean { return TypeScript.isDTSFile(this.filename); } public update(scriptSnapshot: TypeScript.IScriptSnapshot, version: string, isOpen: boolean, textChangeRange: TypeScript.TextChangeRange): SourceFile { - // See if we are currently holding onto a syntax tree. We may not be because we're - // either a closed file, or we've just been lazy and haven't had to create the syntax - // tree yet. Access the field instead of the method so we don't accidentally realize - // the old syntax tree. - var oldSyntaxTree = this.syntaxTree; - if (textChangeRange && Debug.shouldAssert(AssertionLevel.Normal)) { var oldText = this.scriptSnapshot; var newText = scriptSnapshot; @@ -791,21 +758,12 @@ module ts { } } - var text = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - - // If we don't have a text change, or we don't have an old syntax tree, then do a full - // parse. Otherwise, do an incremental parse. - var newSyntaxTree = !textChangeRange || !oldSyntaxTree - ? TypeScript.Parser.parse(this.filename, text, this.languageVersion, TypeScript.isDTSFile(this.filename)) - : TypeScript.IncrementalParser.parse(oldSyntaxTree, textChangeRange, text); - - return SourceFileObject.createSourceFileObject(this.filename, scriptSnapshot, this.languageVersion, version, isOpen, newSyntaxTree); + return SourceFileObject.createSourceFileObject(this.filename, scriptSnapshot, this.languageVersion, version, isOpen); } - public static createSourceFileObject(filename: string, scriptSnapshot: TypeScript.IScriptSnapshot, languageVersion: ScriptTarget, version: string, isOpen: boolean, syntaxTree?: TypeScript.SyntaxTree) { + public static createSourceFileObject(filename: string, scriptSnapshot: TypeScript.IScriptSnapshot, languageVersion: ScriptTarget, version: string, isOpen: boolean) { var newSourceFile = createSourceFile(filename, scriptSnapshot.getText(0, scriptSnapshot.getLength()), languageVersion, version, isOpen); newSourceFile.scriptSnapshot = scriptSnapshot; - newSourceFile.syntaxTree = syntaxTree; return newSourceFile; } } @@ -1633,7 +1591,9 @@ module ts { private initialize(filename: string) { // ensure that both source file and syntax tree are either initialized or not initialized Debug.assert(!!this.currentFileSyntaxTree === !!this.currentSourceFile); + var start = new Date().getTime(); this.hostCache = new HostCache(this.host); + this.host.log("SyntaxTreeCache.Initialize: new HostCache: " + (new Date().getTime() - start)); var version = this.hostCache.getVersion(filename); var syntaxTree: TypeScript.SyntaxTree = null; @@ -1641,22 +1601,37 @@ module ts { if (this.currentFileSyntaxTree === null || this.currentFilename !== filename) { var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); + var start = new Date().getTime(); syntaxTree = this.createSyntaxTree(filename, scriptSnapshot); - sourceFile = createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, /*isOpen*/ true); + this.host.log("SyntaxTreeCache.Initialize: createSyntaxTree: " + (new Date().getTime() - start)); + var start = new Date().getTime(); + sourceFile = createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, /*isOpen*/ true); + this.host.log("SyntaxTreeCache.Initialize: createSourceFile: " + (new Date().getTime() - start)); + + var start = new Date().getTime(); fixupParentReferences(sourceFile); + this.host.log("SyntaxTreeCache.Initialize: fixupParentRefs : " + (new Date().getTime() - start)); } else if (this.currentFileVersion !== version) { var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); + + var start = new Date().getTime(); syntaxTree = this.updateSyntaxTree(filename, scriptSnapshot, this.currentSourceFile.getScriptSnapshot(), this.currentFileSyntaxTree, this.currentFileVersion); + this.host.log("SyntaxTreeCache.Initialize: updateSyntaxTree: " + (new Date().getTime() - start)); var editRange = this.hostCache.getChangeRange(filename, this.currentFileVersion, this.currentSourceFile.getScriptSnapshot()); + + var start = new Date().getTime(); sourceFile = !editRange ? createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, /*isOpen*/ true) : this.currentSourceFile.update(scriptSnapshot, version, /*isOpen*/ true, editRange); + this.host.log("SyntaxTreeCache.Initialize: updateSourceFile: " + (new Date().getTime() - start)); + var start = new Date().getTime(); fixupParentReferences(sourceFile); + this.host.log("SyntaxTreeCache.Initialize: fixupParentRefs : " + (new Date().getTime() - start)); } if (syntaxTree !== null) { @@ -5050,10 +5025,17 @@ module ts { function getIndentationAtPosition(filename: string, position: number, editorOptions: EditorOptions) { filename = TypeScript.switchToForwardSlashes(filename); + var start = new Date().getTime(); var sourceFile = getCurrentSourceFile(filename); + host.log("getIndentationAtPosition: getCurrentSourceFile: " + (new Date().getTime() - start)); + + var start = new Date().getTime(); var options = new TypeScript.FormattingOptions(!editorOptions.ConvertTabsToSpaces, editorOptions.TabSize, editorOptions.IndentSize, editorOptions.NewLineCharacter) - return formatting.SmartIndenter.getIndentation(position, sourceFile, options); + var result = formatting.SmartIndenter.getIndentation(position, sourceFile, options); + host.log("getIndentationAtPosition: computeIndentation : " + (new Date().getTime() - start)); + + return result; } function getFormattingManager(filename: string, options: FormatCodeOptions) {