From 1e6a5f3d0b053bd84b4d6d15abc20a13523fb276 Mon Sep 17 00:00:00 2001 From: Florian Regensburger Date: Thu, 1 Nov 2018 19:58:10 +0100 Subject: [PATCH 01/95] Add codefix for 'Cannot find name' diagnostic --- src/compiler/diagnosticMessages.json | 8 +++++++ .../codefixes/addMissingConstInForLoop.ts | 23 +++++++++++++++++++ src/services/tsconfig.json | 1 + src/services/utilities.ts | 2 +- .../codeFixAddMissingConstInForLoop1.ts | 8 +++++++ .../codeFixAddMissingConstInForLoop2.ts | 12 ++++++++++ .../codeFixAddMissingConstInForLoop3.ts | 8 +++++++ .../codeFixAddMissingConstInForLoop4.ts | 8 +++++++ 8 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 src/services/codefixes/addMissingConstInForLoop.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingConstInForLoop1.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingConstInForLoop2.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingConstInForLoop3.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingConstInForLoop4.ts diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e3f8e1a7ad5..85ad60b9850 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -4799,5 +4799,13 @@ "Add names to all parameters without names": { "category": "Message", "code": 95073 + }, + "Add const modifier to unresolved variable": { + "category": "Message", + "code": 95074 + }, + "Add const modifiers to all unresolved variables": { + "category": "Message", + "code": 95075 } } diff --git a/src/services/codefixes/addMissingConstInForLoop.ts b/src/services/codefixes/addMissingConstInForLoop.ts new file mode 100644 index 00000000000..cd4507729de --- /dev/null +++ b/src/services/codefixes/addMissingConstInForLoop.ts @@ -0,0 +1,23 @@ +/* @internal */ +namespace ts.codefix { + const fixId = "addMissingConstInForLoop"; + const errorCodes = [Diagnostics.Cannot_find_name_0.code]; + registerCodeFix({ + errorCodes, + getCodeActions: (context) => { + const changes = textChanges.ChangeTracker.with(context, t => makeChange(t, context.sourceFile, context.span.start)); + return [createCodeFixAction(fixId, changes, Diagnostics.Add_const_modifier_to_unresolved_variable, fixId, Diagnostics.Add_const_modifiers_to_all_unresolved_variables)]; + }, + fixIds: [fixId], + getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => makeChange(changes, diag.file, diag.start)), + }); + + function makeChange(changeTracker: textChanges.ChangeTracker, sourceFile: SourceFile, pos: number) { + const token = getTokenAtPosition(sourceFile, pos); + // fails on 'for ([x, y] of [[1,2]]) {}' when called for y + // since findPrecedingMatchingToken does not return the open paren here after iterating over another identifier (x) + const openParenToken = findPrecedingMatchingToken(token, SyntaxKind.OpenParenToken, sourceFile); + Debug.assert(!!openParenToken, "openParenToken must be defined"); + changeTracker.insertNodeAt(sourceFile, openParenToken.getEnd(), createToken(SyntaxKind.ConstKeyword), { suffix: " " }); + } +} diff --git a/src/services/tsconfig.json b/src/services/tsconfig.json index 15044416f84..12191f491ab 100644 --- a/src/services/tsconfig.json +++ b/src/services/tsconfig.json @@ -44,6 +44,7 @@ "codeFixProvider.ts", "refactorProvider.ts", "codefixes/addConvertToUnknownForNonOverlappingTypes.ts", + "codefixes/addMissingConstInForLoop.ts", "codefixes/addMissingInvocationForDecorator.ts", "codefixes/addNameToNamelessParameter.ts", "codefixes/annotateWithTypeFromJSDoc.ts", diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 22e6b31b55c..7b340099a74 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -936,7 +936,7 @@ namespace ts { return undefined; } token = preceding; - + if (token.kind === matchingTokenKind) { if (remainingMatchingTokens === 0) { return token; diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForLoop1.ts b/tests/cases/fourslash/codeFixAddMissingConstInForLoop1.ts new file mode 100644 index 00000000000..be35538b59b --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstInForLoop1.ts @@ -0,0 +1,8 @@ +/// + +////[|for (x of []) {}|] + +verify.codeFix({ + description: "Add const modifier to unresolved variable", + newRangeContent: "for (const x of []) {}" +}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForLoop2.ts b/tests/cases/fourslash/codeFixAddMissingConstInForLoop2.ts new file mode 100644 index 00000000000..ce79b68a769 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstInForLoop2.ts @@ -0,0 +1,12 @@ +/// + +////[|for (x of []) {}|] +////[|for (y of []) {}|] + +verify.codeFixAll({ + fixId: "addMissingConstInForLoop", + fixAllDescription: "Add const modifiers to all unresolved variables", + newFileContent: +`for (const x of []) {} +for (const y of []) {}` +}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForLoop3.ts b/tests/cases/fourslash/codeFixAddMissingConstInForLoop3.ts new file mode 100644 index 00000000000..388ab0b5503 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstInForLoop3.ts @@ -0,0 +1,8 @@ +/// + +////[|for ([x] of [[1,2]]) {}|] + +verify.codeFix({ + description: "Add const modifier to unresolved variable", + newRangeContent: "for (const [x] of [[1,2]]) {}" +}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForLoop4.ts b/tests/cases/fourslash/codeFixAddMissingConstInForLoop4.ts new file mode 100644 index 00000000000..4e57f453cfd --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstInForLoop4.ts @@ -0,0 +1,8 @@ +/// + +////[|for ([x, y] of [[1,2]]) {}|] + +verify.codeFix({ + description: "Add const modifier to unresolved variable", + newRangeContent: "for (const [x, y] of [[1,2]]) {}" +}); From 2dae10f6ba8db1c155a09d5158b92e339b86b840 Mon Sep 17 00:00:00 2001 From: Florian Regensburger Date: Thu, 1 Nov 2018 20:05:57 +0100 Subject: [PATCH 02/95] Revert whitespace change --- src/services/utilities.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 7b340099a74..22e6b31b55c 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -936,7 +936,7 @@ namespace ts { return undefined; } token = preceding; - + if (token.kind === matchingTokenKind) { if (remainingMatchingTokens === 0) { return token; From 70fee3fb367f99eff87d356bdd7005e7f71bb3ba Mon Sep 17 00:00:00 2001 From: Florian Regensburger Date: Fri, 2 Nov 2018 01:32:12 +0100 Subject: [PATCH 03/95] Review changes and adjustment of fourslash tests --- src/compiler/diagnosticMessages.json | 4 +- .../codefixes/addMissingConstInForLoop.ts | 44 ++++++++++++++++--- src/services/textChanges.ts | 3 ++ .../codeFixAddMissingConstInForInLoop1.ts | 8 ++++ .../codeFixAddMissingConstInForInLoop2.ts | 12 +++++ .../codeFixAddMissingConstInForLoop1.ts | 8 ---- .../codeFixAddMissingConstInForLoop3.ts | 8 ---- .../codeFixAddMissingConstInForLoop4.ts | 8 ---- ...ngConstInForLoopWithArrayDestructuring1.ts | 8 ++++ ...ngConstInForLoopWithArrayDestructuring2.ts | 12 +++++ ...gConstInForLoopWithObjectDestructuring1.ts | 8 ++++ ...gConstInForLoopWithObjectDestructuring2.ts | 12 +++++ .../codeFixAddMissingConstInForOfLoop1.ts | 8 ++++ ... => codeFixAddMissingConstInForOfLoop2.ts} | 6 +-- .../fourslash/codeFixAwaitInSyncFunction4.ts | 2 +- .../fourslash/codeFixAwaitInSyncFunction7.ts | 4 +- ...deFixAwaitShouldNotCrashIfNotInFunction.ts | 1 + ...sImplementInterfaceIndexSignaturesNoFix.ts | 2 +- ...xUnusedIdentifier_destructure_allUnused.ts | 2 +- ...sedIdentifier_destructure_allUnused_all.ts | 6 +-- ...sedIdentifier_destructure_allUnused_for.ts | 4 +- ...Identifier_destructure_allUnused_nested.ts | 4 +- .../incompleteFunctionCallCodefix3.ts | 4 +- 23 files changed, 129 insertions(+), 49 deletions(-) create mode 100644 tests/cases/fourslash/codeFixAddMissingConstInForInLoop1.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingConstInForInLoop2.ts delete mode 100644 tests/cases/fourslash/codeFixAddMissingConstInForLoop1.ts delete mode 100644 tests/cases/fourslash/codeFixAddMissingConstInForLoop3.ts delete mode 100644 tests/cases/fourslash/codeFixAddMissingConstInForLoop4.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingConstInForLoopWithArrayDestructuring1.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingConstInForLoopWithArrayDestructuring2.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingConstInForLoopWithObjectDestructuring1.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingConstInForLoopWithObjectDestructuring2.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingConstInForOfLoop1.ts rename tests/cases/fourslash/{codeFixAddMissingConstInForLoop2.ts => codeFixAddMissingConstInForOfLoop2.ts} (55%) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 85ad60b9850..cc6e8922c64 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -4800,11 +4800,11 @@ "category": "Message", "code": 95073 }, - "Add const modifier to unresolved variable": { + "Add 'const' to unresolved variable": { "category": "Message", "code": 95074 }, - "Add const modifiers to all unresolved variables": { + "Add 'const' to all unresolved variables": { "category": "Message", "code": 95075 } diff --git a/src/services/codefixes/addMissingConstInForLoop.ts b/src/services/codefixes/addMissingConstInForLoop.ts index cd4507729de..d1534c7020f 100644 --- a/src/services/codefixes/addMissingConstInForLoop.ts +++ b/src/services/codefixes/addMissingConstInForLoop.ts @@ -6,18 +6,48 @@ namespace ts.codefix { errorCodes, getCodeActions: (context) => { const changes = textChanges.ChangeTracker.with(context, t => makeChange(t, context.sourceFile, context.span.start)); - return [createCodeFixAction(fixId, changes, Diagnostics.Add_const_modifier_to_unresolved_variable, fixId, Diagnostics.Add_const_modifiers_to_all_unresolved_variables)]; + if (changes) { + return [createCodeFixAction(fixId, changes, Diagnostics.Add_const_to_unresolved_variable, fixId, Diagnostics.Add_const_to_all_unresolved_variables)]; + } }, fixIds: [fixId], getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => makeChange(changes, diag.file, diag.start)), }); function makeChange(changeTracker: textChanges.ChangeTracker, sourceFile: SourceFile, pos: number) { - const token = getTokenAtPosition(sourceFile, pos); - // fails on 'for ([x, y] of [[1,2]]) {}' when called for y - // since findPrecedingMatchingToken does not return the open paren here after iterating over another identifier (x) - const openParenToken = findPrecedingMatchingToken(token, SyntaxKind.OpenParenToken, sourceFile); - Debug.assert(!!openParenToken, "openParenToken must be defined"); - changeTracker.insertNodeAt(sourceFile, openParenToken.getEnd(), createToken(SyntaxKind.ConstKeyword), { suffix: " " }); + const forInitializer = findAncestor(getTokenAtPosition(sourceFile, pos), node => + isForInOrOfStatement(node.parent) ? node.parent.initializer === node + : isPossiblyPartOfDestructuring(node) ? false : "quit"); + if (!forInitializer) return; + if (alreadyContainsConstCodeFixForInitializer(changeTracker, forInitializer, sourceFile)) return; + changeTracker.insertNodeBefore(sourceFile, forInitializer, createToken(SyntaxKind.ConstKeyword)); + } + + function isPossiblyPartOfDestructuring(node: Node): boolean { + switch (node.kind) { + case SyntaxKind.Identifier: + case SyntaxKind.ArrayLiteralExpression: + case SyntaxKind.ObjectLiteralExpression: + case SyntaxKind.PropertyAssignment: + case SyntaxKind.ShorthandPropertyAssignment: + return true; + default: + return false; + } + } + + function alreadyContainsConstCodeFixForInitializer(changeTracker: textChanges.ChangeTracker, forInitializer: Node, sourceFile: SourceFile): boolean { + return changeTracker.getChanges().some(change => { + const textChanges = change.textChanges; + if (!textChanges) return false; + return textChanges.some(textChange => { + if (textChange.newText !== "const ") return false; + const changeStart = textChange.span.start; + const changeEnd = changeStart + textChange.span.length; + const initStart = forInitializer.getStart(sourceFile); + const initEnd = forInitializer.getEnd(); + return initStart <= changeEnd && changeStart <= initEnd; + }); + }); } } diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index 9c773f73f43..86076ecb877 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -403,6 +403,9 @@ namespace ts.textChanges { else if (isStringLiteral(before) && isImportDeclaration(before.parent) || isNamedImports(before)) { return { suffix: ", " }; } + else if (isForInitializer(before)) { + return { suffix: " " }; + } return Debug.failBadSyntaxKind(before); // We haven't handled this kind of node yet -- add it } diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForInLoop1.ts b/tests/cases/fourslash/codeFixAddMissingConstInForInLoop1.ts new file mode 100644 index 00000000000..76b752465a9 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstInForInLoop1.ts @@ -0,0 +1,8 @@ +/// + +////for (x in []) {} + +verify.codeFix({ + description: "Add 'const' to unresolved variable", + newFileContent: "for (const x in []) {}" +}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForInLoop2.ts b/tests/cases/fourslash/codeFixAddMissingConstInForInLoop2.ts new file mode 100644 index 00000000000..d101f384044 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstInForInLoop2.ts @@ -0,0 +1,12 @@ +/// + +////for (x in []) {} +////for (y in []) {} + +verify.codeFixAll({ + fixId: "addMissingConstInForLoop", + fixAllDescription: "Add 'const' to all unresolved variables", + newFileContent: +`for (const x in []) {} +for (const y in []) {}` +}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForLoop1.ts b/tests/cases/fourslash/codeFixAddMissingConstInForLoop1.ts deleted file mode 100644 index be35538b59b..00000000000 --- a/tests/cases/fourslash/codeFixAddMissingConstInForLoop1.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// - -////[|for (x of []) {}|] - -verify.codeFix({ - description: "Add const modifier to unresolved variable", - newRangeContent: "for (const x of []) {}" -}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForLoop3.ts b/tests/cases/fourslash/codeFixAddMissingConstInForLoop3.ts deleted file mode 100644 index 388ab0b5503..00000000000 --- a/tests/cases/fourslash/codeFixAddMissingConstInForLoop3.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// - -////[|for ([x] of [[1,2]]) {}|] - -verify.codeFix({ - description: "Add const modifier to unresolved variable", - newRangeContent: "for (const [x] of [[1,2]]) {}" -}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForLoop4.ts b/tests/cases/fourslash/codeFixAddMissingConstInForLoop4.ts deleted file mode 100644 index 4e57f453cfd..00000000000 --- a/tests/cases/fourslash/codeFixAddMissingConstInForLoop4.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// - -////[|for ([x, y] of [[1,2]]) {}|] - -verify.codeFix({ - description: "Add const modifier to unresolved variable", - newRangeContent: "for (const [x, y] of [[1,2]]) {}" -}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithArrayDestructuring1.ts b/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithArrayDestructuring1.ts new file mode 100644 index 00000000000..791615f5ea0 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithArrayDestructuring1.ts @@ -0,0 +1,8 @@ +/// + +////for ([x] of [[1,2]]) {} + +verify.codeFix({ + description: "Add 'const' to unresolved variable", + newFileContent: "for (const [x] of [[1,2]]) {}" +}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithArrayDestructuring2.ts b/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithArrayDestructuring2.ts new file mode 100644 index 00000000000..734b53ed4fb --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithArrayDestructuring2.ts @@ -0,0 +1,12 @@ +/// + +////for ([x, y] of [[1,2]]) {} +////for ([x] of [[1,2]]) {} + +verify.codeFixAll({ + fixId: "addMissingConstInForLoop", + fixAllDescription: "Add 'const' to all unresolved variables", + newFileContent: +`for (const [x, y] of [[1,2]]) {} +for (const [x] of [[1,2]]) {}` +}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithObjectDestructuring1.ts b/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithObjectDestructuring1.ts new file mode 100644 index 00000000000..f926091da80 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithObjectDestructuring1.ts @@ -0,0 +1,8 @@ +/// + +////for ({ x } of [{ x: 0 }]) { } + +verify.codeFix({ + description: "Add 'const' to unresolved variable", + newFileContent: "for (const { x } of [{ x: 0 }]) { }" +}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithObjectDestructuring2.ts b/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithObjectDestructuring2.ts new file mode 100644 index 00000000000..82cd2db6dc2 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithObjectDestructuring2.ts @@ -0,0 +1,12 @@ +/// + +////for ({ x, y } of [{ x: 0, y: 1 }]) { } +////for ({ x } of [{ x: 0 }]) { } + +verify.codeFixAll({ + fixId: "addMissingConstInForLoop", + fixAllDescription: "Add 'const' to all unresolved variables", + newFileContent: +`for (const { x, y } of [{ x: 0, y: 1 }]) { } +for (const { x } of [{ x: 0 }]) { }` +}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForOfLoop1.ts b/tests/cases/fourslash/codeFixAddMissingConstInForOfLoop1.ts new file mode 100644 index 00000000000..49efe2bc9a6 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstInForOfLoop1.ts @@ -0,0 +1,8 @@ +/// + +////for (x of []) {} + +verify.codeFix({ + description: "Add 'const' to unresolved variable", + newFileContent: "for (const x of []) {}" +}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForLoop2.ts b/tests/cases/fourslash/codeFixAddMissingConstInForOfLoop2.ts similarity index 55% rename from tests/cases/fourslash/codeFixAddMissingConstInForLoop2.ts rename to tests/cases/fourslash/codeFixAddMissingConstInForOfLoop2.ts index ce79b68a769..3dbab65de32 100644 --- a/tests/cases/fourslash/codeFixAddMissingConstInForLoop2.ts +++ b/tests/cases/fourslash/codeFixAddMissingConstInForOfLoop2.ts @@ -1,11 +1,11 @@ /// -////[|for (x of []) {}|] -////[|for (y of []) {}|] +////for (x of []) {} +////for (y of []) {} verify.codeFixAll({ fixId: "addMissingConstInForLoop", - fixAllDescription: "Add const modifiers to all unresolved variables", + fixAllDescription: "Add 'const' to all unresolved variables", newFileContent: `for (const x of []) {} for (const y of []) {}` diff --git a/tests/cases/fourslash/codeFixAwaitInSyncFunction4.ts b/tests/cases/fourslash/codeFixAwaitInSyncFunction4.ts index dd123e25d0b..24506bb39cb 100644 --- a/tests/cases/fourslash/codeFixAwaitInSyncFunction4.ts +++ b/tests/cases/fourslash/codeFixAwaitInSyncFunction4.ts @@ -1,7 +1,7 @@ /// ////class Foo { -//// constructor { +//// constructor() { //// await Promise.resolve(); //// } ////} diff --git a/tests/cases/fourslash/codeFixAwaitInSyncFunction7.ts b/tests/cases/fourslash/codeFixAwaitInSyncFunction7.ts index a467e9ee0ce..1d058fe473b 100644 --- a/tests/cases/fourslash/codeFixAwaitInSyncFunction7.ts +++ b/tests/cases/fourslash/codeFixAwaitInSyncFunction7.ts @@ -1,7 +1,7 @@ /// ////function f() { -//// for await (const x of g()) { +//// for await (const x of []) { //// console.log(x); //// } ////} @@ -10,7 +10,7 @@ verify.codeFix({ description: "Add async modifier to containing function", newFileContent: `async function f() { - for await (const x of g()) { + for await (const x of []) { console.log(x); } }`, diff --git a/tests/cases/fourslash/codeFixAwaitShouldNotCrashIfNotInFunction.ts b/tests/cases/fourslash/codeFixAwaitShouldNotCrashIfNotInFunction.ts index 1ce5c771ed4..4d916fe25b6 100644 --- a/tests/cases/fourslash/codeFixAwaitShouldNotCrashIfNotInFunction.ts +++ b/tests/cases/fourslash/codeFixAwaitShouldNotCrashIfNotInFunction.ts @@ -1,5 +1,6 @@ /// +////async function a() {} ////await a verify.not.codeFixAvailable(); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesNoFix.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesNoFix.ts index 07896b4cdb3..39470dfdd50 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesNoFix.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesNoFix.ts @@ -4,7 +4,7 @@ //// [x: string, y: number]: number; //// } //// -//// class C implements I {[| |]} +//// class C implements I4 {[| |]} verify.not.codeFixAvailable(); diff --git a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused.ts b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused.ts index 4f3f9a3e61e..97556092ade 100644 --- a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused.ts +++ b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused.ts @@ -4,7 +4,7 @@ // @noUnusedParameters: true ////export {}; -////const { x, y } = o; +////const { x, y } = [{}]; verify.codeFix({ description: "Remove destructuring", diff --git a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_all.ts b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_all.ts index c9d4f62f2db..066ba07c4f4 100644 --- a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_all.ts +++ b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_all.ts @@ -3,8 +3,8 @@ // @noUnusedLocals: true // @noUnusedParameters: true -////const { x, y } = o; -////const { a, b } = o; +////const { x, y } = [{}]; +////const { a, b } = [{}]; ////a; ////export function f({ a, b }, { x, y }) { //// a; @@ -14,7 +14,7 @@ verify.codeFixAll({ fixId: "unusedIdentifier_delete", fixAllDescription: "Delete all unused declarations", newFileContent: -`const { a } = o; +`const { a } = [{}]; a; export function f({ a }) { a; diff --git a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_for.ts b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_for.ts index 27103357d3d..ea94e5275aa 100644 --- a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_for.ts +++ b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_for.ts @@ -3,10 +3,10 @@ // @noUnusedLocals: true // @noUnusedParameters: true -////for (const { x } of o) {} +////for (const { x } of [{}]) {} verify.codeFix({ description: "Remove destructuring", newFileContent: -`for (const {} of o) {}`, +`for (const {} of [{}]) {}`, }); diff --git a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_nested.ts b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_nested.ts index 73fca113928..dc1ae26b3d0 100644 --- a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_nested.ts +++ b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_nested.ts @@ -4,11 +4,11 @@ // @noUnusedParameters: true ////export {}; -////const { x: { a, b } } = o; +////const { x: { a, b } } = [{}]; verify.codeFix({ description: "Remove destructuring", newFileContent: `export {}; -const { } = o;`, +const { } = [{}];`, }); diff --git a/tests/cases/fourslash/incompleteFunctionCallCodefix3.ts b/tests/cases/fourslash/incompleteFunctionCallCodefix3.ts index 29072c7c855..db2e82f94bf 100644 --- a/tests/cases/fourslash/incompleteFunctionCallCodefix3.ts +++ b/tests/cases/fourslash/incompleteFunctionCallCodefix3.ts @@ -3,4 +3,6 @@ // @noImplicitAny: true //// function ...q) {}} f(10); -verify.not.codeFixAvailable(); +verify.not.codeFixAvailable([ + { "description": "Infer parameter types from usage" } +]); From 94118b64c5bf082e7bdaa06a71046fbe921d61b5 Mon Sep 17 00:00:00 2001 From: Florian Regensburger Date: Fri, 2 Nov 2018 01:47:50 +0100 Subject: [PATCH 04/95] Properly check if a codefix is needed --- src/services/codefixes/addMissingConstInForLoop.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/codefixes/addMissingConstInForLoop.ts b/src/services/codefixes/addMissingConstInForLoop.ts index d1534c7020f..3caea2222fa 100644 --- a/src/services/codefixes/addMissingConstInForLoop.ts +++ b/src/services/codefixes/addMissingConstInForLoop.ts @@ -6,7 +6,7 @@ namespace ts.codefix { errorCodes, getCodeActions: (context) => { const changes = textChanges.ChangeTracker.with(context, t => makeChange(t, context.sourceFile, context.span.start)); - if (changes) { + if (changes.length > 0) { return [createCodeFixAction(fixId, changes, Diagnostics.Add_const_to_unresolved_variable, fixId, Diagnostics.Add_const_to_all_unresolved_variables)]; } }, From 1fd2371a3731811223e205f61ee1b27ff7b08a5b Mon Sep 17 00:00:00 2001 From: Florian Regensburger Date: Sat, 3 Nov 2018 00:00:12 +0100 Subject: [PATCH 05/95] Fixed codeFixAll behavior and adjusted changed fourslash tests --- .../codefixes/addMissingConstInForLoop.ts | 28 ++++++------------- ...xUnusedIdentifier_destructure_allUnused.ts | 2 +- ...sedIdentifier_destructure_allUnused_all.ts | 6 ++-- ...Identifier_destructure_allUnused_nested.ts | 4 +-- .../incompleteFunctionCallCodefix3.ts | 4 +-- 5 files changed, 16 insertions(+), 28 deletions(-) diff --git a/src/services/codefixes/addMissingConstInForLoop.ts b/src/services/codefixes/addMissingConstInForLoop.ts index 3caea2222fa..d2add652e9a 100644 --- a/src/services/codefixes/addMissingConstInForLoop.ts +++ b/src/services/codefixes/addMissingConstInForLoop.ts @@ -2,6 +2,7 @@ namespace ts.codefix { const fixId = "addMissingConstInForLoop"; const errorCodes = [Diagnostics.Cannot_find_name_0.code]; + registerCodeFix({ errorCodes, getCodeActions: (context) => { @@ -11,16 +12,20 @@ namespace ts.codefix { } }, fixIds: [fixId], - getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => makeChange(changes, diag.file, diag.start)), + getAllCodeActions: context => { + const fixedNodes = new NodeSet(); + return codeFixAll(context, errorCodes, (changes, diag) => makeChange(changes, diag.file, diag.start, fixedNodes)); + }, }); - function makeChange(changeTracker: textChanges.ChangeTracker, sourceFile: SourceFile, pos: number) { + function makeChange(changeTracker: textChanges.ChangeTracker, sourceFile: SourceFile, pos: number, fixedNodes?: NodeSet) { const forInitializer = findAncestor(getTokenAtPosition(sourceFile, pos), node => isForInOrOfStatement(node.parent) ? node.parent.initializer === node : isPossiblyPartOfDestructuring(node) ? false : "quit"); if (!forInitializer) return; - if (alreadyContainsConstCodeFixForInitializer(changeTracker, forInitializer, sourceFile)) return; - changeTracker.insertNodeBefore(sourceFile, forInitializer, createToken(SyntaxKind.ConstKeyword)); + if (!fixedNodes || fixedNodes.tryAdd(forInitializer)) { + changeTracker.insertNodeBefore(sourceFile, forInitializer, createToken(SyntaxKind.ConstKeyword)); + } } function isPossiblyPartOfDestructuring(node: Node): boolean { @@ -35,19 +40,4 @@ namespace ts.codefix { return false; } } - - function alreadyContainsConstCodeFixForInitializer(changeTracker: textChanges.ChangeTracker, forInitializer: Node, sourceFile: SourceFile): boolean { - return changeTracker.getChanges().some(change => { - const textChanges = change.textChanges; - if (!textChanges) return false; - return textChanges.some(textChange => { - if (textChange.newText !== "const ") return false; - const changeStart = textChange.span.start; - const changeEnd = changeStart + textChange.span.length; - const initStart = forInitializer.getStart(sourceFile); - const initEnd = forInitializer.getEnd(); - return initStart <= changeEnd && changeStart <= initEnd; - }); - }); - } } diff --git a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused.ts b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused.ts index 97556092ade..6f2dc76d0ae 100644 --- a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused.ts +++ b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused.ts @@ -4,7 +4,7 @@ // @noUnusedParameters: true ////export {}; -////const { x, y } = [{}]; +////const { x, y } = {}; verify.codeFix({ description: "Remove destructuring", diff --git a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_all.ts b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_all.ts index 066ba07c4f4..176f108c517 100644 --- a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_all.ts +++ b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_all.ts @@ -3,8 +3,8 @@ // @noUnusedLocals: true // @noUnusedParameters: true -////const { x, y } = [{}]; -////const { a, b } = [{}]; +////const { x, y } = {}; +////const { a, b } = {}; ////a; ////export function f({ a, b }, { x, y }) { //// a; @@ -14,7 +14,7 @@ verify.codeFixAll({ fixId: "unusedIdentifier_delete", fixAllDescription: "Delete all unused declarations", newFileContent: -`const { a } = [{}]; +`const { a } = {}; a; export function f({ a }) { a; diff --git a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_nested.ts b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_nested.ts index dc1ae26b3d0..03a8ff826c7 100644 --- a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_nested.ts +++ b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_nested.ts @@ -4,11 +4,11 @@ // @noUnusedParameters: true ////export {}; -////const { x: { a, b } } = [{}]; +////const { x: { a, b } } = {{}}; verify.codeFix({ description: "Remove destructuring", newFileContent: `export {}; -const { } = [{}];`, +const { } = {{}};`, }); diff --git a/tests/cases/fourslash/incompleteFunctionCallCodefix3.ts b/tests/cases/fourslash/incompleteFunctionCallCodefix3.ts index db2e82f94bf..29072c7c855 100644 --- a/tests/cases/fourslash/incompleteFunctionCallCodefix3.ts +++ b/tests/cases/fourslash/incompleteFunctionCallCodefix3.ts @@ -3,6 +3,4 @@ // @noImplicitAny: true //// function ...q) {}} f(10); -verify.not.codeFixAvailable([ - { "description": "Infer parameter types from usage" } -]); +verify.not.codeFixAvailable(); From ea9d519424a249933547d3765e2f8228f5c5ce90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=A0=C3=A1ndor?= Date: Sun, 3 Feb 2019 20:44:07 +0100 Subject: [PATCH 06/95] Support email in author JSDoc tag - fixes #17244 --- src/compiler/parser.ts | 66 +++++++++++++++++++ src/compiler/scanner.ts | 2 + src/compiler/types.ts | 6 ++ src/compiler/utilities.ts | 4 ++ src/testRunner/unittests/jsDocParsing.ts | 4 ++ ...DocComments.parsesCorrectly.authorTag.json | 22 +++++++ .../reference/api/tsserverlibrary.d.ts | 6 +- tests/baselines/reference/api/typescript.d.ts | 6 +- .../reference/quickInfoJsDocTags.baseline | 6 +- tests/cases/fourslash/quickInfoJsDocTags.ts | 2 +- 10 files changed, 118 insertions(+), 6 deletions(-) create mode 100644 tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.authorTag.json diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index ada42889032..f8ffddaa600 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -6611,6 +6611,9 @@ namespace ts { let tag: JSDocTag | undefined; switch (tagName.escapedText) { + case "author": + tag = parseAuthorTag(start, tagName); + break; case "augments": case "extends": tag = parseAugmentsTag(start, tagName); @@ -6874,6 +6877,69 @@ namespace ts { return finishNode(result); } + function parseAuthorTag(start: number, tagName: Identifier): JSDocAuthorTag { + const result = createNode(SyntaxKind.JSDocAuthorTag, start); + result.tagName = tagName; + + const comment = tryParse(() => tryParseAuthorNameAndEmail()); + + if (comment) { + result.comment = comment; + } + + return finishNode(result); + } + + function tryParseAuthorNameAndEmail(): string | undefined { + const comments: string[] = []; + let seenLessThan = false; + let seenGreaterThan = false; + let seenAtToken = false; + let token = scanner.getToken(); + + loop: while (true) { + switch (token) { + case SyntaxKind.Identifier: + case SyntaxKind.WhitespaceTrivia: + case SyntaxKind.DotToken: + comments.push(scanner.getTokenText()); + break; + case SyntaxKind.LessThanToken: + if (seenLessThan || seenAtToken || seenGreaterThan) { + return; + } + seenLessThan = true; + comments.push(scanner.getTokenText()); + break; + case SyntaxKind.GreaterThanToken: + if (!seenLessThan || !seenAtToken || seenGreaterThan) { + return; + } + + seenGreaterThan = true; + comments.push(scanner.getTokenText()); + break loop; + case SyntaxKind.AtToken: + if (seenAtToken || !seenLessThan || seenGreaterThan) { + return; + } + + seenAtToken = true; + comments.push(scanner.getTokenText()); + break; + case SyntaxKind.NewLineTrivia: + case SyntaxKind.EndOfFileToken: + break loop; + } + + token = nextJSDocToken(); + } + + if (seenLessThan && seenAtToken && seenGreaterThan) { + return comments.length === 0 ? undefined : comments.join(""); + } + } + function parseAugmentsTag(start: number, tagName: Identifier): JSDocAugmentsTag { const result = createNode(SyntaxKind.JSDocAugmentsTag, start); result.tagName = tagName; diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 36ac8adfa90..256e41629a1 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -2086,6 +2086,8 @@ namespace ts { return token = SyntaxKind.CloseBracketToken; case CharacterCodes.lessThan: return token = SyntaxKind.LessThanToken; + case CharacterCodes.greaterThan: + return token = SyntaxKind.GreaterThanToken; case CharacterCodes.equals: return token = SyntaxKind.EqualsToken; case CharacterCodes.comma: diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 0b952a4d009..432d1dccba7 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -17,6 +17,7 @@ namespace ts { | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken + | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken @@ -459,6 +460,7 @@ namespace ts { JSDocSignature, JSDocTag, JSDocAugmentsTag, + JSDocAuthorTag, JSDocClassTag, JSDocCallbackTag, JSDocEnumTag, @@ -2455,6 +2457,10 @@ namespace ts { class: ExpressionWithTypeArguments & { expression: Identifier | PropertyAccessEntityNameExpression }; } + export interface JSDocAuthorTag extends JSDocTag { + kind: SyntaxKind.JSDocAuthorTag; + } + export interface JSDocClassTag extends JSDocTag { kind: SyntaxKind.JSDocClassTag; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 2e6c3ae4f86..b72a30ffba4 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -6116,6 +6116,10 @@ namespace ts { return node.kind === SyntaxKind.JSDocComment; } + export function isJSDocAuthorTag(node: Node): node is JSDocAuthorTag { + return node.kind === SyntaxKind.JSDocAuthorTag; + } + export function isJSDocAugmentsTag(node: Node): node is JSDocAugmentsTag { return node.kind === SyntaxKind.JSDocAugmentsTag; } diff --git a/src/testRunner/unittests/jsDocParsing.ts b/src/testRunner/unittests/jsDocParsing.ts index 4171a330f32..59775862e99 100644 --- a/src/testRunner/unittests/jsDocParsing.ts +++ b/src/testRunner/unittests/jsDocParsing.ts @@ -313,6 +313,10 @@ namespace ts { * {@link first link} * Inside {@link link text} thing * @see {@link second link text} and {@link Foo|a foo} as well. + */`); + parsesCorrectly("authorTag", +`/** + * @author John Doe */`); }); }); diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.authorTag.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.authorTag.json new file mode 100644 index 00000000000..5239e57649c --- /dev/null +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.authorTag.json @@ -0,0 +1,22 @@ +{ + "kind": "JSDocComment", + "pos": 0, + "end": 50, + "tags": { + "0": { + "kind": "JSDocAuthorTag", + "pos": 7, + "end": 45, + "tagName": { + "kind": "Identifier", + "pos": 8, + "end": 14, + "escapedText": "author" + }, + "comment": "John Doe " + }, + "length": 1, + "pos": 7, + "end": 45 + } +} \ No newline at end of file diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 3f31d83d4f3..0d55487a4a7 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -72,7 +72,7 @@ declare namespace ts { pos: number; end: number; } - type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; + type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.OfKeyword; type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; enum SyntaxKind { @@ -1581,6 +1581,9 @@ declare namespace ts { expression: Identifier | PropertyAccessEntityNameExpression; }; } + interface JSDocAuthorTag extends JSDocTag { + kind: SyntaxKind.JSDocAuthorTag; + } interface JSDocClassTag extends JSDocTag { kind: SyntaxKind.JSDocClassTag; } @@ -3521,6 +3524,7 @@ declare namespace ts { function isJSDocFunctionType(node: Node): node is JSDocFunctionType; function isJSDocVariadicType(node: Node): node is JSDocVariadicType; function isJSDoc(node: Node): node is JSDoc; + function isJSDocAuthorTag(node: Node): node is JSDocAuthorTag; function isJSDocAugmentsTag(node: Node): node is JSDocAugmentsTag; function isJSDocClassTag(node: Node): node is JSDocClassTag; function isJSDocEnumTag(node: Node): node is JSDocEnumTag; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index ab4faf036b1..579b3276185 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -72,7 +72,7 @@ declare namespace ts { pos: number; end: number; } - type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; + type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.OfKeyword; type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; enum SyntaxKind { @@ -1581,6 +1581,9 @@ declare namespace ts { expression: Identifier | PropertyAccessEntityNameExpression; }; } + interface JSDocAuthorTag extends JSDocTag { + kind: SyntaxKind.JSDocAuthorTag; + } interface JSDocClassTag extends JSDocTag { kind: SyntaxKind.JSDocClassTag; } @@ -3521,6 +3524,7 @@ declare namespace ts { function isJSDocFunctionType(node: Node): node is JSDocFunctionType; function isJSDocVariadicType(node: Node): node is JSDocVariadicType; function isJSDoc(node: Node): node is JSDoc; + function isJSDocAuthorTag(node: Node): node is JSDocAuthorTag; function isJSDocAugmentsTag(node: Node): node is JSDocAugmentsTag; function isJSDocClassTag(node: Node): node is JSDocClassTag; function isJSDocEnumTag(node: Node): node is JSDocEnumTag; diff --git a/tests/baselines/reference/quickInfoJsDocTags.baseline b/tests/baselines/reference/quickInfoJsDocTags.baseline index d3ed4ad5ef1..a146e8e1876 100644 --- a/tests/baselines/reference/quickInfoJsDocTags.baseline +++ b/tests/baselines/reference/quickInfoJsDocTags.baseline @@ -2,13 +2,13 @@ { "marker": { "fileName": "/tests/cases/fourslash/quickInfoJsDocTags.ts", - "position": 256 + "position": 272 }, "quickInfo": { "kind": "function", "kindModifiers": "", "textSpan": { - "start": 256, + "start": 272, "length": 3 }, "displayParts": [ @@ -70,7 +70,7 @@ "tags": [ { "name": "author", - "text": "Me" + "text": "Me " }, { "name": "augments", diff --git a/tests/cases/fourslash/quickInfoJsDocTags.ts b/tests/cases/fourslash/quickInfoJsDocTags.ts index 798a850a310..2d81cb23679 100644 --- a/tests/cases/fourslash/quickInfoJsDocTags.ts +++ b/tests/cases/fourslash/quickInfoJsDocTags.ts @@ -3,7 +3,7 @@ // @Filename: quickInfoJsDocTags.ts /////** //// * Doc -//// * @author Me +//// * @author Me //// * @augments {C} Augments it //// * @template T A template //// * @type {number | string} A type From 00279e9eca77a6107f62ee40d2b05de6ea5f19ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=A0=C3=A1ndor?= Date: Sat, 9 Feb 2019 17:17:09 +0100 Subject: [PATCH 07/95] Parse unexpected comments after email in author JSDoc tag (#17244) --- src/compiler/parser.ts | 38 ++++++++++--------- src/testRunner/unittests/jsDocParsing.ts | 1 + ...DocComments.parsesCorrectly.authorTag.json | 30 +++++++++++++-- 3 files changed, 47 insertions(+), 22 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index f8ffddaa600..a3f8c950c36 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -468,6 +468,8 @@ namespace ts { visitNode(cbNode, (node).typeExpression) : visitNode(cbNode, (node).typeExpression) || visitNode(cbNode, (node).name)); + case SyntaxKind.JSDocAuthorTag: + return visitNode(cbNode, (node as JSDocTag).tagName); case SyntaxKind.JSDocAugmentsTag: return visitNode(cbNode, (node as JSDocTag).tagName) || visitNode(cbNode, (node).class); @@ -6612,7 +6614,7 @@ namespace ts { let tag: JSDocTag | undefined; switch (tagName.escapedText) { case "author": - tag = parseAuthorTag(start, tagName); + tag = parseAuthorTag(start, tagName, indent); break; case "augments": case "extends": @@ -6877,14 +6879,22 @@ namespace ts { return finishNode(result); } - function parseAuthorTag(start: number, tagName: Identifier): JSDocAuthorTag { + function parseAuthorTag(start: number, tagName: Identifier, indent: number): JSDocAuthorTag { const result = createNode(SyntaxKind.JSDocAuthorTag, start); result.tagName = tagName; - const comment = tryParse(() => tryParseAuthorNameAndEmail()); + const authorInfoWithEmail = tryParse(() => tryParseAuthorNameAndEmail()); + if (!authorInfoWithEmail) { + return finishNode(result); + } - if (comment) { - result.comment = comment; + result.comment = authorInfoWithEmail; + + if (lookAhead(() => nextToken() !== SyntaxKind.NewLineTrivia)) { + const comment = parseTagComments(indent); + if (comment) { + result.comment += comment; + } } return finishNode(result); @@ -6894,7 +6904,6 @@ namespace ts { const comments: string[] = []; let seenLessThan = false; let seenGreaterThan = false; - let seenAtToken = false; let token = scanner.getToken(); loop: while (true) { @@ -6902,31 +6911,24 @@ namespace ts { case SyntaxKind.Identifier: case SyntaxKind.WhitespaceTrivia: case SyntaxKind.DotToken: + case SyntaxKind.AtToken: comments.push(scanner.getTokenText()); break; case SyntaxKind.LessThanToken: - if (seenLessThan || seenAtToken || seenGreaterThan) { + if (seenLessThan || seenGreaterThan) { return; } seenLessThan = true; comments.push(scanner.getTokenText()); break; case SyntaxKind.GreaterThanToken: - if (!seenLessThan || !seenAtToken || seenGreaterThan) { + if (!seenLessThan || seenGreaterThan) { return; } - seenGreaterThan = true; comments.push(scanner.getTokenText()); + scanner.setTextPos(scanner.getTokenPos() + 1); break loop; - case SyntaxKind.AtToken: - if (seenAtToken || !seenLessThan || seenGreaterThan) { - return; - } - - seenAtToken = true; - comments.push(scanner.getTokenText()); - break; case SyntaxKind.NewLineTrivia: case SyntaxKind.EndOfFileToken: break loop; @@ -6935,7 +6937,7 @@ namespace ts { token = nextJSDocToken(); } - if (seenLessThan && seenAtToken && seenGreaterThan) { + if (seenLessThan && seenGreaterThan) { return comments.length === 0 ? undefined : comments.join(""); } } diff --git a/src/testRunner/unittests/jsDocParsing.ts b/src/testRunner/unittests/jsDocParsing.ts index 59775862e99..41e09f5f9fe 100644 --- a/src/testRunner/unittests/jsDocParsing.ts +++ b/src/testRunner/unittests/jsDocParsing.ts @@ -317,6 +317,7 @@ namespace ts { parsesCorrectly("authorTag", `/** * @author John Doe + * @author John Doe unexpected comment */`); }); }); diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.authorTag.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.authorTag.json index 5239e57649c..54e06da0465 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.authorTag.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.authorTag.json @@ -1,22 +1,44 @@ { "kind": "JSDocComment", "pos": 0, - "end": 50, + "end": 112, + "modifierFlagsCache": 0, + "transformFlags": 0, "tags": { "0": { "kind": "JSDocAuthorTag", "pos": 7, - "end": 45, + "end": 50, + "modifierFlagsCache": 0, + "transformFlags": 0, "tagName": { "kind": "Identifier", "pos": 8, "end": 14, + "modifierFlagsCache": 0, + "transformFlags": 0, "escapedText": "author" }, "comment": "John Doe " }, - "length": 1, + "1": { + "kind": "JSDocAuthorTag", + "pos": 50, + "end": 110, + "modifierFlagsCache": 0, + "transformFlags": 0, + "tagName": { + "kind": "Identifier", + "pos": 51, + "end": 57, + "modifierFlagsCache": 0, + "transformFlags": 0, + "escapedText": "author" + }, + "comment": "John Doe unexpected comment" + }, + "length": 2, "pos": 7, - "end": 45 + "end": 110 } } \ No newline at end of file From 08bd017db97445709cc249d3c0c9661ff962c009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=A0=C3=A1ndor?= Date: Fri, 19 Apr 2019 12:03:33 +0200 Subject: [PATCH 08/95] JSDoc author tag parsing updates (#17244) --- src/compiler/parser.ts | 4 +- .../reference/api/tsserverlibrary.d.ts | 39 ++++++++++--------- tests/baselines/reference/api/typescript.d.ts | 39 ++++++++++--------- 3 files changed, 42 insertions(+), 40 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index a3f8c950c36..ce50eeac19d 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -6614,7 +6614,7 @@ namespace ts { let tag: JSDocTag | undefined; switch (tagName.escapedText) { case "author": - tag = parseAuthorTag(start, tagName, indent); + tag = parseAuthorTag(start, tagName, margin); break; case "augments": case "extends": @@ -6934,7 +6934,7 @@ namespace ts { break loop; } - token = nextJSDocToken(); + token = nextTokenJSDoc(); } if (seenLessThan && seenGreaterThan) { diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 0d55487a4a7..b557509f8ce 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -379,23 +379,24 @@ declare namespace ts { JSDocSignature = 299, JSDocTag = 300, JSDocAugmentsTag = 301, - JSDocClassTag = 302, - JSDocCallbackTag = 303, - JSDocEnumTag = 304, - JSDocParameterTag = 305, - JSDocReturnTag = 306, - JSDocThisTag = 307, - JSDocTypeTag = 308, - JSDocTemplateTag = 309, - JSDocTypedefTag = 310, - JSDocPropertyTag = 311, - SyntaxList = 312, - NotEmittedStatement = 313, - PartiallyEmittedExpression = 314, - CommaListExpression = 315, - MergeDeclarationMarker = 316, - EndOfDeclarationMarker = 317, - Count = 318, + JSDocAuthorTag = 302, + JSDocClassTag = 303, + JSDocCallbackTag = 304, + JSDocEnumTag = 305, + JSDocParameterTag = 306, + JSDocReturnTag = 307, + JSDocThisTag = 308, + JSDocTypeTag = 309, + JSDocTemplateTag = 310, + JSDocTypedefTag = 311, + JSDocPropertyTag = 312, + SyntaxList = 313, + NotEmittedStatement = 314, + PartiallyEmittedExpression = 315, + CommaListExpression = 316, + MergeDeclarationMarker = 317, + EndOfDeclarationMarker = 318, + Count = 319, FirstAssignment = 60, LastAssignment = 72, FirstCompoundAssignment = 61, @@ -422,9 +423,9 @@ declare namespace ts { LastBinaryOperator = 72, FirstNode = 149, FirstJSDocNode = 289, - LastJSDocNode = 311, + LastJSDocNode = 312, FirstJSDocTagNode = 300, - LastJSDocTagNode = 311, + LastJSDocTagNode = 312, } enum NodeFlags { None = 0, diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 579b3276185..de6b2b187c2 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -379,23 +379,24 @@ declare namespace ts { JSDocSignature = 299, JSDocTag = 300, JSDocAugmentsTag = 301, - JSDocClassTag = 302, - JSDocCallbackTag = 303, - JSDocEnumTag = 304, - JSDocParameterTag = 305, - JSDocReturnTag = 306, - JSDocThisTag = 307, - JSDocTypeTag = 308, - JSDocTemplateTag = 309, - JSDocTypedefTag = 310, - JSDocPropertyTag = 311, - SyntaxList = 312, - NotEmittedStatement = 313, - PartiallyEmittedExpression = 314, - CommaListExpression = 315, - MergeDeclarationMarker = 316, - EndOfDeclarationMarker = 317, - Count = 318, + JSDocAuthorTag = 302, + JSDocClassTag = 303, + JSDocCallbackTag = 304, + JSDocEnumTag = 305, + JSDocParameterTag = 306, + JSDocReturnTag = 307, + JSDocThisTag = 308, + JSDocTypeTag = 309, + JSDocTemplateTag = 310, + JSDocTypedefTag = 311, + JSDocPropertyTag = 312, + SyntaxList = 313, + NotEmittedStatement = 314, + PartiallyEmittedExpression = 315, + CommaListExpression = 316, + MergeDeclarationMarker = 317, + EndOfDeclarationMarker = 318, + Count = 319, FirstAssignment = 60, LastAssignment = 72, FirstCompoundAssignment = 61, @@ -422,9 +423,9 @@ declare namespace ts { LastBinaryOperator = 72, FirstNode = 149, FirstJSDocNode = 289, - LastJSDocNode = 311, + LastJSDocNode = 312, FirstJSDocTagNode = 300, - LastJSDocTagNode = 311, + LastJSDocTagNode = 312, } enum NodeFlags { None = 0, From 8987e56e410ae8839c681cb7018f84fddb609f49 Mon Sep 17 00:00:00 2001 From: rflorian Date: Thu, 9 May 2019 00:30:55 +0200 Subject: [PATCH 09/95] Fix error from master merge --- src/compiler/diagnosticMessages.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index bf70e22ef6f..2db71a6d266 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -4974,7 +4974,6 @@ "category": "Message", "code": 95079 }, - "Add 'const' to unresolved variable": { "category": "Message", "code": 95080 @@ -4982,8 +4981,8 @@ "Add 'const' to all unresolved variables": { "category": "Message", "code": 95081 - - "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer." :{ + }, + "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer.": { "category": "Error", "code": 18004 }, From e395e49a8fcc33b894933542c4d5aeff0f6e2332 Mon Sep 17 00:00:00 2001 From: Florian Regensburger Date: Thu, 9 May 2019 01:17:31 +0200 Subject: [PATCH 10/95] Add secondary error code to relevant error code list in addMissingConstInForLoop codefix --- src/services/codefixes/addMissingConstInForLoop.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/services/codefixes/addMissingConstInForLoop.ts b/src/services/codefixes/addMissingConstInForLoop.ts index d2add652e9a..433fa45f458 100644 --- a/src/services/codefixes/addMissingConstInForLoop.ts +++ b/src/services/codefixes/addMissingConstInForLoop.ts @@ -1,7 +1,10 @@ /* @internal */ namespace ts.codefix { const fixId = "addMissingConstInForLoop"; - const errorCodes = [Diagnostics.Cannot_find_name_0.code]; + const errorCodes = [ + Diagnostics.Cannot_find_name_0.code, + Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code + ]; registerCodeFix({ errorCodes, From e0a685da4f2a60f092be60069e6c4d823b44abe7 Mon Sep 17 00:00:00 2001 From: Florian Regensburger Date: Thu, 9 May 2019 01:34:21 +0200 Subject: [PATCH 11/95] Fix whitespace issue in codefix file --- src/services/codefixes/addMissingConstInForLoop.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/codefixes/addMissingConstInForLoop.ts b/src/services/codefixes/addMissingConstInForLoop.ts index 433fa45f458..9110fb31a10 100644 --- a/src/services/codefixes/addMissingConstInForLoop.ts +++ b/src/services/codefixes/addMissingConstInForLoop.ts @@ -2,7 +2,7 @@ namespace ts.codefix { const fixId = "addMissingConstInForLoop"; const errorCodes = [ - Diagnostics.Cannot_find_name_0.code, + Diagnostics.Cannot_find_name_0.code, Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code ]; From ca44ee8f975b32d275a7f6470f2232fc68cbc8a5 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Thu, 6 Jun 2019 10:28:42 -0700 Subject: [PATCH 12/95] Update fourslash tests to have semicolons --- .../extract-method-in-anonymous-function-declaration.ts | 2 +- .../fourslash/extract-method_jsxIntrinsicTagSymbol.ts | 2 +- tests/cases/fourslash/refactorExtractType11.ts | 4 ++-- tests/cases/fourslash/refactorExtractType14.ts | 4 ++-- tests/cases/fourslash/refactorExtractType15.ts | 4 ++-- tests/cases/fourslash/refactorExtractType17.ts | 4 ++-- tests/cases/fourslash/refactorExtractType18.ts | 4 ++-- tests/cases/fourslash/refactorExtractType19.ts | 4 ++-- tests/cases/fourslash/refactorExtractType20.ts | 4 ++-- tests/cases/fourslash/refactorExtractType21.ts | 4 ++-- tests/cases/fourslash/refactorExtractType22.ts | 4 ++-- tests/cases/fourslash/refactorExtractType23.ts | 4 ++-- tests/cases/fourslash/refactorExtractType24.ts | 4 ++-- tests/cases/fourslash/refactorExtractType25.ts | 4 ++-- tests/cases/fourslash/refactorExtractType26.ts | 4 ++-- tests/cases/fourslash/refactorExtractType27.ts | 4 ++-- tests/cases/fourslash/refactorExtractType28.ts | 4 ++-- tests/cases/fourslash/refactorExtractType29.ts | 4 ++-- tests/cases/fourslash/refactorExtractType30.ts | 4 ++-- tests/cases/fourslash/refactorExtractType34.ts | 4 ++-- tests/cases/fourslash/refactorExtractType35.ts | 4 ++-- tests/cases/fourslash/refactorExtractType36.ts | 4 ++-- tests/cases/fourslash/refactorExtractType37.ts | 4 ++-- tests/cases/fourslash/refactorExtractType39.ts | 4 ++-- tests/cases/fourslash/refactorExtractType42.ts | 8 ++++---- tests/cases/fourslash/refactorExtractType44.ts | 4 ++-- tests/cases/fourslash/refactorExtractType45.ts | 4 ++-- tests/cases/fourslash/refactorExtractType46.ts | 8 ++++---- tests/cases/fourslash/refactorExtractType49.ts | 8 ++++---- tests/cases/fourslash/refactorExtractType7.ts | 4 ++-- tests/cases/fourslash/refactorExtractType8.ts | 4 ++-- tests/cases/fourslash/refactorExtractType9.ts | 4 ++-- 32 files changed, 68 insertions(+), 68 deletions(-) diff --git a/tests/cases/fourslash/extract-method-in-anonymous-function-declaration.ts b/tests/cases/fourslash/extract-method-in-anonymous-function-declaration.ts index 6566d129874..197ad698088 100644 --- a/tests/cases/fourslash/extract-method-in-anonymous-function-declaration.ts +++ b/tests/cases/fourslash/extract-method-in-anonymous-function-declaration.ts @@ -1,7 +1,7 @@ /// ////export default function() { -//// /*start*/0/*end*/ +//// /*start*/0/*end*/; ////} goTo.select('start', 'end') diff --git a/tests/cases/fourslash/extract-method_jsxIntrinsicTagSymbol.ts b/tests/cases/fourslash/extract-method_jsxIntrinsicTagSymbol.ts index 072fd670ddd..74a6b2fc212 100644 --- a/tests/cases/fourslash/extract-method_jsxIntrinsicTagSymbol.ts +++ b/tests/cases/fourslash/extract-method_jsxIntrinsicTagSymbol.ts @@ -11,5 +11,5 @@ edit.applyRefactor({ refactorName: "Extract Symbol", actionName: "constant_scope_0", actionDescription: "Extract to constant in enclosing scope", - newContent: "const /*RENAME*/newLocal =
;", + newContent: "const /*RENAME*/newLocal =
", }); diff --git a/tests/cases/fourslash/refactorExtractType11.ts b/tests/cases/fourslash/refactorExtractType11.ts index feb5e68c440..7f465bef111 100644 --- a/tests/cases/fourslash/refactorExtractType11.ts +++ b/tests/cases/fourslash/refactorExtractType11.ts @@ -1,7 +1,7 @@ /// //// function foo(a: number, b?: number, ...c: number[]): boolean { -//// return false as /*a*/boolean/*b*/ +//// return false as /*a*/boolean/*b*/; //// } goTo.select("a", "b"); @@ -12,6 +12,6 @@ edit.applyRefactor({ newContent: `function foo(a: number, b?: number, ...c: number[]): boolean { type /*RENAME*/NewType = boolean; - return false as NewType + return false as NewType; }`, }); diff --git a/tests/cases/fourslash/refactorExtractType14.ts b/tests/cases/fourslash/refactorExtractType14.ts index 4d5667bb540..29655086921 100644 --- a/tests/cases/fourslash/refactorExtractType14.ts +++ b/tests/cases/fourslash/refactorExtractType14.ts @@ -1,6 +1,6 @@ /// -//// type A = string | number | T +//// type A = string | number | T; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = boolean; -type A = string | number | T`, +type A = string | number | T;`, }); diff --git a/tests/cases/fourslash/refactorExtractType15.ts b/tests/cases/fourslash/refactorExtractType15.ts index a716f42509a..84a26de6be4 100644 --- a/tests/cases/fourslash/refactorExtractType15.ts +++ b/tests/cases/fourslash/refactorExtractType15.ts @@ -1,6 +1,6 @@ /// -//// type A = /*a*/string/*b*/ | number | T +//// type A = /*a*/string/*b*/ | number | T; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = string; -type A = NewType | number | T`, +type A = NewType | number | T;`, }); diff --git a/tests/cases/fourslash/refactorExtractType17.ts b/tests/cases/fourslash/refactorExtractType17.ts index ae62b402fe3..605fccb25d6 100644 --- a/tests/cases/fourslash/refactorExtractType17.ts +++ b/tests/cases/fourslash/refactorExtractType17.ts @@ -1,6 +1,6 @@ /// -//// type A = string | number | /*a*/T/*b*/ +//// type A = string | number | /*a*/T/*b*/; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = T; -type A = string | number | NewType`, +type A = string | number | NewType;`, }); diff --git a/tests/cases/fourslash/refactorExtractType18.ts b/tests/cases/fourslash/refactorExtractType18.ts index 1ebe8a2b354..310be9b0e28 100644 --- a/tests/cases/fourslash/refactorExtractType18.ts +++ b/tests/cases/fourslash/refactorExtractType18.ts @@ -1,6 +1,6 @@ /// -//// type A = /*a*/Partial/*b*/ & D | C +//// type A = /*a*/Partial/*b*/ & D | C; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,6 +9,6 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = Partial; -type A = NewType & D | C`, +type A = NewType & D | C;`, }); diff --git a/tests/cases/fourslash/refactorExtractType19.ts b/tests/cases/fourslash/refactorExtractType19.ts index 4a982f6899d..4ecd563c7ea 100644 --- a/tests/cases/fourslash/refactorExtractType19.ts +++ b/tests/cases/fourslash/refactorExtractType19.ts @@ -1,6 +1,6 @@ /// -//// type A = /*a*/Partial/*b*/ & D | C +//// type A = /*a*/Partial/*b*/ & D | C; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,6 +9,6 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = Partial; -type A = NewType & D | C`, +type A = NewType & D | C;`, }); diff --git a/tests/cases/fourslash/refactorExtractType20.ts b/tests/cases/fourslash/refactorExtractType20.ts index b31f208704f..2994418355b 100644 --- a/tests/cases/fourslash/refactorExtractType20.ts +++ b/tests/cases/fourslash/refactorExtractType20.ts @@ -1,6 +1,6 @@ /// -//// type A = () => (v: /*a*/T/*b*/) => (v: T) => (v: T) => U +//// type A = () => (v: /*a*/T/*b*/) => (v: T) => (v: T) => U; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = T; -type A = () => (v: NewType) => (v: T) => (v: T) => U`, +type A = () => (v: NewType) => (v: T) => (v: T) => U;`, }); diff --git a/tests/cases/fourslash/refactorExtractType21.ts b/tests/cases/fourslash/refactorExtractType21.ts index e97485c8269..157e38af75e 100644 --- a/tests/cases/fourslash/refactorExtractType21.ts +++ b/tests/cases/fourslash/refactorExtractType21.ts @@ -1,6 +1,6 @@ /// -//// type A = () => (v: T) => (v: /*a*/T/*b*/) => (v: T) => U +//// type A = () => (v: T) => (v: /*a*/T/*b*/) => (v: T) => U; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = T; -type A = () => (v: T) => (v: NewType) => (v: T) => U`, +type A = () => (v: T) => (v: NewType) => (v: T) => U;`, }); diff --git a/tests/cases/fourslash/refactorExtractType22.ts b/tests/cases/fourslash/refactorExtractType22.ts index f7282df4ef7..16344397db6 100644 --- a/tests/cases/fourslash/refactorExtractType22.ts +++ b/tests/cases/fourslash/refactorExtractType22.ts @@ -1,6 +1,6 @@ /// -//// type A = () => (v: T) => (v: T) => (v: /*a*/T/*b*/) => U +//// type A = () => (v: T) => (v: T) => (v: /*a*/T/*b*/) => U; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = T; -type A = () => (v: T) => (v: T) => (v: NewType) => U`, +type A = () => (v: T) => (v: T) => (v: NewType) => U;`, }); diff --git a/tests/cases/fourslash/refactorExtractType23.ts b/tests/cases/fourslash/refactorExtractType23.ts index 9e219dd3383..ea8082a3b2a 100644 --- a/tests/cases/fourslash/refactorExtractType23.ts +++ b/tests/cases/fourslash/refactorExtractType23.ts @@ -1,6 +1,6 @@ /// -//// type A = () => (v: T) => (v: T) => (v: T) => /*a*/U/*b*/ +//// type A = () => (v: T) => (v: T) => (v: T) => /*a*/U/*b*/; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = U; -type A = () => (v: T) => (v: T) => (v: T) => NewType`, +type A = () => (v: T) => (v: T) => (v: T) => NewType;`, }); diff --git a/tests/cases/fourslash/refactorExtractType24.ts b/tests/cases/fourslash/refactorExtractType24.ts index 54b36acb252..98f3edecc67 100644 --- a/tests/cases/fourslash/refactorExtractType24.ts +++ b/tests/cases/fourslash/refactorExtractType24.ts @@ -1,6 +1,6 @@ /// -//// type A = () => (v: T) => (v: T) => /*a*/(v: T) => U/*b*/ +//// type A = () => (v: T) => (v: T) => /*a*/(v: T) => U/*b*/; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = (v: T) => U; -type A = () => (v: T) => (v: T) => NewType`, +type A = () => (v: T) => (v: T) => NewType;`, }); diff --git a/tests/cases/fourslash/refactorExtractType25.ts b/tests/cases/fourslash/refactorExtractType25.ts index b09d04912c1..9ad43742111 100644 --- a/tests/cases/fourslash/refactorExtractType25.ts +++ b/tests/cases/fourslash/refactorExtractType25.ts @@ -1,6 +1,6 @@ /// -//// type A = () => (v: T) => /*a*/(v: T) => (v: T) => U/*b*/ +//// type A = () => (v: T) => /*a*/(v: T) => (v: T) => U/*b*/; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = (v: T) => (v: T) => U; -type A = () => (v: T) => NewType`, +type A = () => (v: T) => NewType;`, }); diff --git a/tests/cases/fourslash/refactorExtractType26.ts b/tests/cases/fourslash/refactorExtractType26.ts index 662ce7eb8dc..2dffef7e9ac 100644 --- a/tests/cases/fourslash/refactorExtractType26.ts +++ b/tests/cases/fourslash/refactorExtractType26.ts @@ -1,6 +1,6 @@ /// -//// type A = () => /*a*/(v: T) => (v: T) => (v: T) => U/*b*/ +//// type A = () => /*a*/(v: T) => (v: T) => (v: T) => U/*b*/; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = (v: T) => (v: T) => (v: T) => U; -type A = () => NewType`, +type A = () => NewType;`, }); diff --git a/tests/cases/fourslash/refactorExtractType27.ts b/tests/cases/fourslash/refactorExtractType27.ts index 5163fd2d480..e9c8d05601c 100644 --- a/tests/cases/fourslash/refactorExtractType27.ts +++ b/tests/cases/fourslash/refactorExtractType27.ts @@ -1,6 +1,6 @@ /// -//// type A = /*a*/() => (v: T) => (v: T) => (v: T) => U/*b*/ +//// type A = /*a*/() => (v: T) => (v: T) => (v: T) => U/*b*/; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = () => (v: T) => (v: T) => (v: T) => U; -type A = NewType`, +type A = NewType;`, }); diff --git a/tests/cases/fourslash/refactorExtractType28.ts b/tests/cases/fourslash/refactorExtractType28.ts index 81d1356ca21..4e53e463a90 100644 --- a/tests/cases/fourslash/refactorExtractType28.ts +++ b/tests/cases/fourslash/refactorExtractType28.ts @@ -1,6 +1,6 @@ /// -//// type Item = /*a*/T/*b*/ extends (infer P)[] ? P : never +//// type Item = /*a*/T/*b*/ extends (infer P)[] ? P : never; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = T; -type Item = NewType extends (infer P)[] ? P : never`, +type Item = NewType extends (infer P)[] ? P : never;`, }); diff --git a/tests/cases/fourslash/refactorExtractType29.ts b/tests/cases/fourslash/refactorExtractType29.ts index a1fb2ac405c..29fd2ec7e61 100644 --- a/tests/cases/fourslash/refactorExtractType29.ts +++ b/tests/cases/fourslash/refactorExtractType29.ts @@ -1,6 +1,6 @@ /// -//// type Item = T extends (infer P)[] ? /*a*/P/*b*/ : never +//// type Item = T extends (infer P)[] ? /*a*/P/*b*/ : never; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType

= P; -type Item = T extends (infer P)[] ? NewType

: never`, +type Item = T extends (infer P)[] ? NewType

: never;`, }); diff --git a/tests/cases/fourslash/refactorExtractType30.ts b/tests/cases/fourslash/refactorExtractType30.ts index a0684cabb53..a3943d32128 100644 --- a/tests/cases/fourslash/refactorExtractType30.ts +++ b/tests/cases/fourslash/refactorExtractType30.ts @@ -1,6 +1,6 @@ /// -//// type Item = T extends (infer P)[] ? P : /*a*/never/*b*/ +//// type Item = T extends (infer P)[] ? P : /*a*/never/*b*/; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = never; -type Item = T extends (infer P)[] ? P : NewType`, +type Item = T extends (infer P)[] ? P : NewType;`, }); diff --git a/tests/cases/fourslash/refactorExtractType34.ts b/tests/cases/fourslash/refactorExtractType34.ts index 114d08a09a6..45b4c116549 100644 --- a/tests/cases/fourslash/refactorExtractType34.ts +++ b/tests/cases/fourslash/refactorExtractType34.ts @@ -1,6 +1,6 @@ /// -//// type Item = /*a*/T extends (infer P)[] ? P : never/*b*/ +//// type Item = /*a*/T extends (infer P)[] ? P : never/*b*/; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = T extends (infer P)[] ? P : never; -type Item = NewType`, +type Item = NewType;`, }); diff --git a/tests/cases/fourslash/refactorExtractType35.ts b/tests/cases/fourslash/refactorExtractType35.ts index 8ace9f929b8..979918e13e8 100644 --- a/tests/cases/fourslash/refactorExtractType35.ts +++ b/tests/cases/fourslash/refactorExtractType35.ts @@ -1,6 +1,6 @@ /// -//// type Union = /*a*/U | T/*b*/ +//// type Union = /*a*/U | T/*b*/; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = U | T; -type Union = NewType`, +type Union = NewType;`, }); diff --git a/tests/cases/fourslash/refactorExtractType36.ts b/tests/cases/fourslash/refactorExtractType36.ts index 5086bf130ce..e36983e7440 100644 --- a/tests/cases/fourslash/refactorExtractType36.ts +++ b/tests/cases/fourslash/refactorExtractType36.ts @@ -1,6 +1,6 @@ /// -//// type A = (v: /*a*/string | number/*b*/) => v is string +//// type A = (v: /*a*/string | number/*b*/) => v is string; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,6 +9,6 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = string | number; -type A = (v: NewType) => v is string`, +type A = (v: NewType) => v is string;`, }); diff --git a/tests/cases/fourslash/refactorExtractType37.ts b/tests/cases/fourslash/refactorExtractType37.ts index b24e219b3e4..d3c9514e4d2 100644 --- a/tests/cases/fourslash/refactorExtractType37.ts +++ b/tests/cases/fourslash/refactorExtractType37.ts @@ -1,6 +1,6 @@ /// -//// type A = (v: string | number) => v is /*a*/string/*b*/ +//// type A = (v: string | number) => v is /*a*/string/*b*/; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = string; -type A = (v: string | number) => v is NewType`, +type A = (v: string | number) => v is NewType;`, }); diff --git a/tests/cases/fourslash/refactorExtractType39.ts b/tests/cases/fourslash/refactorExtractType39.ts index 1f55dcee39a..d5a96889304 100644 --- a/tests/cases/fourslash/refactorExtractType39.ts +++ b/tests/cases/fourslash/refactorExtractType39.ts @@ -1,6 +1,6 @@ /// -//// type A = /*a*/(v: string | number) => v is string/*b*/ +//// type A = /*a*/(v: string | number) => v is string/*b*/; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = (v: string | number) => v is string; -type A = NewType`, +type A = NewType;`, }); diff --git a/tests/cases/fourslash/refactorExtractType42.ts b/tests/cases/fourslash/refactorExtractType42.ts index 29692ab06e6..67b6dc51875 100644 --- a/tests/cases/fourslash/refactorExtractType42.ts +++ b/tests/cases/fourslash/refactorExtractType42.ts @@ -1,15 +1,15 @@ /// -//// const a = 1 -//// type A = (v: string | number) => /*a*/typeof a/*b*/ +//// const a = 1; +//// type A = (v: string | number) => /*a*/typeof a/*b*/; goTo.select("a", "b"); edit.applyRefactor({ refactorName: "Extract type", actionName: "Extract to type alias", actionDescription: "Extract to type alias", - newContent: `const a = 1 + newContent: `const a = 1; type /*RENAME*/NewType = typeof a; -type A = (v: string | number) => NewType`, +type A = (v: string | number) => NewType;`, }); diff --git a/tests/cases/fourslash/refactorExtractType44.ts b/tests/cases/fourslash/refactorExtractType44.ts index 22e1a9172dc..e570c9d60e9 100644 --- a/tests/cases/fourslash/refactorExtractType44.ts +++ b/tests/cases/fourslash/refactorExtractType44.ts @@ -1,6 +1,6 @@ /// -//// type A = /*a*/B.C.D/*b*/ +//// type A = /*a*/B.C.D/*b*/; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = B.C.D; -type A = NewType`, +type A = NewType;`, }); diff --git a/tests/cases/fourslash/refactorExtractType45.ts b/tests/cases/fourslash/refactorExtractType45.ts index 60d9d77bc29..bfc3288e587 100644 --- a/tests/cases/fourslash/refactorExtractType45.ts +++ b/tests/cases/fourslash/refactorExtractType45.ts @@ -1,6 +1,6 @@ /// -//// type A = /*a*/B.C.D/*b*/ +//// type A = /*a*/B.C.D/*b*/; goTo.select("a", "b"); edit.applyRefactor({ @@ -9,5 +9,5 @@ edit.applyRefactor({ actionDescription: "Extract to type alias", newContent: `type /*RENAME*/NewType = B.C.D; -type A = NewType`, +type A = NewType;`, }); diff --git a/tests/cases/fourslash/refactorExtractType46.ts b/tests/cases/fourslash/refactorExtractType46.ts index ddcfa4878c9..0f244f0ec02 100644 --- a/tests/cases/fourslash/refactorExtractType46.ts +++ b/tests/cases/fourslash/refactorExtractType46.ts @@ -1,15 +1,15 @@ /// -//// namespace A { export const b = 1 } -//// function a(b: string): /*a*/typeof A.b/*b*/ { return 1 } +//// namespace A { export const b = 1; } +//// function a(b: string): /*a*/typeof A.b/*b*/ { return 1; } goTo.select("a", "b"); edit.applyRefactor({ refactorName: "Extract type", actionName: "Extract to type alias", actionDescription: "Extract to type alias", - newContent: `namespace A { export const b = 1 } + newContent: `namespace A { export const b = 1; } type /*RENAME*/NewType = typeof A.b; -function a(b: string): NewType { return 1 }`, +function a(b: string): NewType { return 1; }`, }); diff --git a/tests/cases/fourslash/refactorExtractType49.ts b/tests/cases/fourslash/refactorExtractType49.ts index 7d965ee3d09..96429a91881 100644 --- a/tests/cases/fourslash/refactorExtractType49.ts +++ b/tests/cases/fourslash/refactorExtractType49.ts @@ -1,15 +1,15 @@ /// -//// type A = T -//// type B = /*a*/A/*b*/ +//// type A = T; +//// type B = /*a*/A/*b*/; goTo.select("a", "b"); edit.applyRefactor({ refactorName: "Extract type", actionName: "Extract to type alias", actionDescription: "Extract to type alias", - newContent: `type A = T + newContent: `type A = T; type /*RENAME*/NewType = A; -type B = NewType`, +type B = NewType;`, }); diff --git a/tests/cases/fourslash/refactorExtractType7.ts b/tests/cases/fourslash/refactorExtractType7.ts index a5b1f4c7dd0..d1a40f83579 100644 --- a/tests/cases/fourslash/refactorExtractType7.ts +++ b/tests/cases/fourslash/refactorExtractType7.ts @@ -1,7 +1,7 @@ /// //// function foo(a: /*a*/number/*b*/, b?: number, ...c: number[]): boolean { -//// return false as boolean +//// return false as boolean; //// } goTo.select("a", "b"); @@ -12,6 +12,6 @@ edit.applyRefactor({ newContent: `type /*RENAME*/NewType = number; function foo(a: NewType, b?: number, ...c: number[]): boolean { - return false as boolean + return false as boolean; }`, }); diff --git a/tests/cases/fourslash/refactorExtractType8.ts b/tests/cases/fourslash/refactorExtractType8.ts index 61121c67374..c13e68e10f5 100644 --- a/tests/cases/fourslash/refactorExtractType8.ts +++ b/tests/cases/fourslash/refactorExtractType8.ts @@ -1,7 +1,7 @@ /// //// function foo(a: number, b?: /*a*/number/*b*/, ...c: number[]): boolean { -//// return false as boolean +//// return false as boolean; //// } goTo.select("a", "b"); @@ -12,6 +12,6 @@ edit.applyRefactor({ newContent: `type /*RENAME*/NewType = number; function foo(a: number, b?: NewType, ...c: number[]): boolean { - return false as boolean + return false as boolean; }`, }); diff --git a/tests/cases/fourslash/refactorExtractType9.ts b/tests/cases/fourslash/refactorExtractType9.ts index 921f2a005a5..49a5f737ee9 100644 --- a/tests/cases/fourslash/refactorExtractType9.ts +++ b/tests/cases/fourslash/refactorExtractType9.ts @@ -1,7 +1,7 @@ /// //// function foo(a: number, b?: number, ...c: /*a*/number[]/*b*/): boolean { -//// return false as boolean +//// return false as boolean; //// } goTo.select("a", "b"); @@ -12,6 +12,6 @@ edit.applyRefactor({ newContent: `type /*RENAME*/NewType = number[]; function foo(a: number, b?: number, ...c: NewType): boolean { - return false as boolean + return false as boolean; }`, }); From 7815778fb053e453e17f83442fc45261937b3bb0 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Thu, 6 Jun 2019 10:48:26 -0700 Subject: [PATCH 13/95] =?UTF-8?q?Update=20fourslash=20tests=20that=20shoul?= =?UTF-8?q?dn=E2=80=99t=20insert=20semicolons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../completionsImport_default_anonymous.ts | 28 +++++++++---------- ...ompletionsImport_exportEquals_anonymous.ts | 2 +- .../extract-method_jsxIntrinsicTagSymbol.ts | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/cases/fourslash/completionsImport_default_anonymous.ts b/tests/cases/fourslash/completionsImport_default_anonymous.ts index a1eb5da6490..80ad6494dc6 100644 --- a/tests/cases/fourslash/completionsImport_default_anonymous.ts +++ b/tests/cases/fourslash/completionsImport_default_anonymous.ts @@ -14,25 +14,25 @@ goTo.marker("0"); const preferences: FourSlashInterface.UserPreferences = { includeCompletionsForModuleExports: true }; verify.completions( - { + { marker: "0", exact: [ - completion.globalThisEntry, - completion.undefinedVarEntry, - ...completion.statementKeywordsWithTypes - ], - preferences + completion.globalThisEntry, + completion.undefinedVarEntry, + ...completion.statementKeywordsWithTypes + ], + preferences }, { marker: "1", includes: { - name: "fooBar", - source: "/src/foo-bar", - sourceDisplay: "./foo-bar", - text: "(property) default: 0", - kind: "property", - hasAction: true, - sortText: completion.SortText.AutoImportSuggestions + name: "fooBar", + source: "/src/foo-bar", + sourceDisplay: "./foo-bar", + text: "(property) default: 0", + kind: "property", + hasAction: true, + sortText: completion.SortText.AutoImportSuggestions }, preferences, }, @@ -41,7 +41,7 @@ verify.applyCodeActionFromCompletion("1", { name: "fooBar", source: "/src/foo-bar", description: `Import default 'fooBar' from module "./foo-bar"`, - newFileContent: `import fooBar from "./foo-bar"; + newFileContent: `import fooBar from "./foo-bar" def fooB`, diff --git a/tests/cases/fourslash/completionsImport_exportEquals_anonymous.ts b/tests/cases/fourslash/completionsImport_exportEquals_anonymous.ts index b28de47c69d..e8d675cba8b 100644 --- a/tests/cases/fourslash/completionsImport_exportEquals_anonymous.ts +++ b/tests/cases/fourslash/completionsImport_exportEquals_anonymous.ts @@ -38,7 +38,7 @@ verify.applyCodeActionFromCompletion("0", { name: "fooBar", source: "/src/foo-bar", description: `Import 'fooBar' from module "./foo-bar"`, - newFileContent: `import fooBar = require("./foo-bar"); + newFileContent: `import fooBar = require("./foo-bar") exp fooB`, diff --git a/tests/cases/fourslash/extract-method_jsxIntrinsicTagSymbol.ts b/tests/cases/fourslash/extract-method_jsxIntrinsicTagSymbol.ts index 74a6b2fc212..072fd670ddd 100644 --- a/tests/cases/fourslash/extract-method_jsxIntrinsicTagSymbol.ts +++ b/tests/cases/fourslash/extract-method_jsxIntrinsicTagSymbol.ts @@ -11,5 +11,5 @@ edit.applyRefactor({ refactorName: "Extract Symbol", actionName: "constant_scope_0", actionDescription: "Extract to constant in enclosing scope", - newContent: "const /*RENAME*/newLocal =

", + newContent: "const /*RENAME*/newLocal =
;", }); From b37875ff7aac7c85e1a3a4859c6589ef8d50e4cf Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Thu, 6 Jun 2019 10:49:09 -0700 Subject: [PATCH 14/95] Detect semicolons in file before writing quick fixes --- src/services/textChanges.ts | 234 ++++++++++++++++++++---------------- src/services/utilities.ts | 47 ++++++++ 2 files changed, 177 insertions(+), 104 deletions(-) diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index 81441627635..c55a08808a9 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -834,9 +834,10 @@ namespace ts.textChanges { /** Note: output node may be mutated input node. */ export function getNonformattedText(node: Node, sourceFile: SourceFile | undefined, newLineCharacter: string): { text: string, node: Node } { - const writer = new Writer(newLineCharacter); + const omitTrailingSemicolon = !!sourceFile && !probablyUsesSemicolons(sourceFile); + const writer = createWriter(newLineCharacter, omitTrailingSemicolon); const newLine = newLineCharacter === "\n" ? NewLineKind.LineFeed : NewLineKind.CarriageReturnLineFeed; - createPrinter({ newLine, neverAsciiEscape: true }, writer).writeNode(EmitHint.Unspecified, node, sourceFile, writer); + createPrinter({ newLine, neverAsciiEscape: true, omitTrailingSemicolon }, writer).writeNode(EmitHint.Unspecified, node, sourceFile, writer); return { text: writer.getText(), node: assignPositionsToNode(node) }; } } @@ -874,143 +875,168 @@ namespace ts.textChanges { return nodeArray; } - class Writer implements EmitTextWriter, PrintHandlers { - private lastNonTriviaPosition = 0; - private readonly writer: EmitTextWriter; + interface TextChangesWriter extends EmitTextWriter, PrintHandlers {} - public readonly onEmitNode: PrintHandlers["onEmitNode"]; - public readonly onBeforeEmitNodeArray: PrintHandlers["onBeforeEmitNodeArray"]; - public readonly onAfterEmitNodeArray: PrintHandlers["onAfterEmitNodeArray"]; - public readonly onBeforeEmitToken: PrintHandlers["onBeforeEmitToken"]; - public readonly onAfterEmitToken: PrintHandlers["onAfterEmitToken"]; + function createWriter(newLine: string, omitTrailingSemicolon?: boolean): TextChangesWriter { + let lastNonTriviaPosition = 0; - constructor(newLine: string) { - this.writer = createTextWriter(newLine); - this.onEmitNode = (hint, node, printCallback) => { - if (node) { - setPos(node, this.lastNonTriviaPosition); - } - printCallback(hint, node); - if (node) { - setEnd(node, this.lastNonTriviaPosition); - } - }; - this.onBeforeEmitNodeArray = nodes => { - if (nodes) { - setPos(nodes, this.lastNonTriviaPosition); - } - }; - this.onAfterEmitNodeArray = nodes => { - if (nodes) { - setEnd(nodes, this.lastNonTriviaPosition); - } - }; - this.onBeforeEmitToken = node => { - if (node) { - setPos(node, this.lastNonTriviaPosition); - } - }; - this.onAfterEmitToken = node => { - if (node) { - setEnd(node, this.lastNonTriviaPosition); - } - }; - } - private setLastNonTriviaPosition(s: string, force: boolean) { + const writer = omitTrailingSemicolon ? getTrailingSemicolonOmittingWriter(createTextWriter(newLine)) : createTextWriter(newLine); + const onEmitNode: PrintHandlers["onEmitNode"] = (hint, node, printCallback) => { + if (node) { + setPos(node, lastNonTriviaPosition); + } + printCallback(hint, node); + if (node) { + setEnd(node, lastNonTriviaPosition); + } + }; + const onBeforeEmitNodeArray: PrintHandlers["onBeforeEmitNodeArray"] = nodes => { + if (nodes) { + setPos(nodes, lastNonTriviaPosition); + } + }; + const onAfterEmitNodeArray: PrintHandlers["onAfterEmitNodeArray"] = nodes => { + if (nodes) { + setEnd(nodes, lastNonTriviaPosition); + } + }; + const onBeforeEmitToken: PrintHandlers["onBeforeEmitToken"] = node => { + if (node) { + setPos(node, lastNonTriviaPosition); + } + }; + const onAfterEmitToken: PrintHandlers["onAfterEmitToken"] = node => { + if (node) { + setEnd(node, lastNonTriviaPosition); + } + }; + + function setLastNonTriviaPosition(s: string, force: boolean) { if (force || !isTrivia(s)) { - this.lastNonTriviaPosition = this.writer.getTextPos(); + lastNonTriviaPosition = writer.getTextPos(); let i = 0; while (isWhiteSpaceLike(s.charCodeAt(s.length - i - 1))) { i++; } // trim trailing whitespaces - this.lastNonTriviaPosition -= i; + lastNonTriviaPosition -= i; } } - write(s: string): void { - this.writer.write(s); - this.setLastNonTriviaPosition(s, /*force*/ false); + function write(s: string): void { + writer.write(s); + setLastNonTriviaPosition(s, /*force*/ false); } - writeComment(s: string): void { - this.writer.writeComment(s); + function writeComment(s: string): void { + writer.writeComment(s); } - writeKeyword(s: string): void { - this.writer.writeKeyword(s); - this.setLastNonTriviaPosition(s, /*force*/ false); + function writeKeyword(s: string): void { + writer.writeKeyword(s); + setLastNonTriviaPosition(s, /*force*/ false); } - writeOperator(s: string): void { - this.writer.writeOperator(s); - this.setLastNonTriviaPosition(s, /*force*/ false); + function writeOperator(s: string): void { + writer.writeOperator(s); + setLastNonTriviaPosition(s, /*force*/ false); } - writePunctuation(s: string): void { - this.writer.writePunctuation(s); - this.setLastNonTriviaPosition(s, /*force*/ false); + function writePunctuation(s: string): void { + writer.writePunctuation(s); + setLastNonTriviaPosition(s, /*force*/ false); } - writeTrailingSemicolon(s: string): void { - this.writer.writeTrailingSemicolon(s); - this.setLastNonTriviaPosition(s, /*force*/ false); + function writeTrailingSemicolon(s: string): void { + writer.writeTrailingSemicolon(s); + setLastNonTriviaPosition(s, /*force*/ false); } - writeParameter(s: string): void { - this.writer.writeParameter(s); - this.setLastNonTriviaPosition(s, /*force*/ false); + function writeParameter(s: string): void { + writer.writeParameter(s); + setLastNonTriviaPosition(s, /*force*/ false); } - writeProperty(s: string): void { - this.writer.writeProperty(s); - this.setLastNonTriviaPosition(s, /*force*/ false); + function writeProperty(s: string): void { + writer.writeProperty(s); + setLastNonTriviaPosition(s, /*force*/ false); } - writeSpace(s: string): void { - this.writer.writeSpace(s); - this.setLastNonTriviaPosition(s, /*force*/ false); + function writeSpace(s: string): void { + writer.writeSpace(s); + setLastNonTriviaPosition(s, /*force*/ false); } - writeStringLiteral(s: string): void { - this.writer.writeStringLiteral(s); - this.setLastNonTriviaPosition(s, /*force*/ false); + function writeStringLiteral(s: string): void { + writer.writeStringLiteral(s); + setLastNonTriviaPosition(s, /*force*/ false); } - writeSymbol(s: string, sym: Symbol): void { - this.writer.writeSymbol(s, sym); - this.setLastNonTriviaPosition(s, /*force*/ false); + function writeSymbol(s: string, sym: Symbol): void { + writer.writeSymbol(s, sym); + setLastNonTriviaPosition(s, /*force*/ false); } - writeLine(): void { - this.writer.writeLine(); + function writeLine(): void { + writer.writeLine(); } - increaseIndent(): void { - this.writer.increaseIndent(); + function increaseIndent(): void { + writer.increaseIndent(); } - decreaseIndent(): void { - this.writer.decreaseIndent(); + function decreaseIndent(): void { + writer.decreaseIndent(); } - getText(): string { - return this.writer.getText(); + function getText(): string { + return writer.getText(); } - rawWrite(s: string): void { - this.writer.rawWrite(s); - this.setLastNonTriviaPosition(s, /*force*/ false); + function rawWrite(s: string): void { + writer.rawWrite(s); + setLastNonTriviaPosition(s, /*force*/ false); } - writeLiteral(s: string): void { - this.writer.writeLiteral(s); - this.setLastNonTriviaPosition(s, /*force*/ true); + function writeLiteral(s: string): void { + writer.writeLiteral(s); + setLastNonTriviaPosition(s, /*force*/ true); } - getTextPos(): number { - return this.writer.getTextPos(); + function getTextPos(): number { + return writer.getTextPos(); } - getLine(): number { - return this.writer.getLine(); + function getLine(): number { + return writer.getLine(); } - getColumn(): number { - return this.writer.getColumn(); + function getColumn(): number { + return writer.getColumn(); } - getIndent(): number { - return this.writer.getIndent(); + function getIndent(): number { + return writer.getIndent(); } - isAtStartOfLine(): boolean { - return this.writer.isAtStartOfLine(); + function isAtStartOfLine(): boolean { + return writer.isAtStartOfLine(); } - clear(): void { - this.writer.clear(); - this.lastNonTriviaPosition = 0; + function clear(): void { + writer.clear(); + lastNonTriviaPosition = 0; } + + return { + onEmitNode, + onBeforeEmitNodeArray, + onAfterEmitNodeArray, + onBeforeEmitToken, + onAfterEmitToken, + write, + writeComment, + writeKeyword, + writeOperator, + writePunctuation, + writeTrailingSemicolon, + writeParameter, + writeProperty, + writeSpace, + writeStringLiteral, + writeSymbol, + writeLine, + increaseIndent, + decreaseIndent, + getText, + rawWrite, + writeLiteral, + getTextPos, + getLine, + getColumn, + getIndent, + isAtStartOfLine, + clear + }; } function getInsertionPositionAtSourceFileTop(sourceFile: SourceFile): number { diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 5506b45d380..4c6549b002c 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1991,4 +1991,51 @@ namespace ts { }); return typeIsAccessible ? res : undefined; } + + export function syntaxUsuallyHasTrailingSemicolon(kind: SyntaxKind) { + return kind === SyntaxKind.VariableStatement + || kind === SyntaxKind.ExpressionStatement + || kind === SyntaxKind.DoStatement + || kind === SyntaxKind.ContinueStatement + || kind === SyntaxKind.BreakStatement + || kind === SyntaxKind.ReturnStatement + || kind === SyntaxKind.ThrowStatement + || kind === SyntaxKind.DebuggerStatement + || kind === SyntaxKind.PropertyDeclaration + || kind === SyntaxKind.TypeAliasDeclaration + || kind === SyntaxKind.ImportDeclaration + || kind === SyntaxKind.ImportEqualsDeclaration + || kind === SyntaxKind.ExportDeclaration; + } + + export function probablyUsesSemicolons(sourceFile: SourceFile): boolean { + let withSemicolon = 0; + let withoutSemicolon = 0; + const nStatementsToObserve = 5; + forEachChild(sourceFile, function visit(node): boolean | undefined { + if (syntaxUsuallyHasTrailingSemicolon(node.kind)) { + const lastToken = node.getLastToken(sourceFile); + if (lastToken && lastToken.kind === SyntaxKind.SemicolonToken) { + withSemicolon++; + } + else { + withoutSemicolon++; + } + } + if (withSemicolon + withoutSemicolon >= nStatementsToObserve) { + return true; + } + + return forEachChild(node, visit); + }); + + // One statement missing a semicolon isn’t sufficient evidence to say the user + // doesn’t want semicolons, because they may not even be done writing that statement. + if (withSemicolon === 0 && withoutSemicolon <= 1) { + return true; + } + + // If even 2/5 places have a semicolon, the user probably wants semicolons + return withSemicolon / withoutSemicolon > 1 / nStatementsToObserve; + } } From 6282c9fb5e2097c86f44ee67da872423df1c1d5c Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Thu, 6 Jun 2019 10:55:56 -0700 Subject: [PATCH 15/95] Add test for semicolon detection in auto-import --- .../completionsImport_noSemicolons.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/cases/fourslash/completionsImport_noSemicolons.ts diff --git a/tests/cases/fourslash/completionsImport_noSemicolons.ts b/tests/cases/fourslash/completionsImport_noSemicolons.ts new file mode 100644 index 00000000000..f1e183b8b3c --- /dev/null +++ b/tests/cases/fourslash/completionsImport_noSemicolons.ts @@ -0,0 +1,20 @@ +/// + +// @Filename: /a.ts +////export function foo() {} + +// @Filename: /b.ts +////const x = 0 +////const y = 1 +////const z = fo/**/ + +verify.applyCodeActionFromCompletion("", { + name: "foo", + source: "/a", + description: `Import 'foo' from module "./a"`, + newFileContent: `import { foo } from "./a" + +const x = 0 +const y = 1 +const z = fo`, +}); From b6c415485a4ef95f118926e922c064ca394a80a8 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Fri, 14 Jun 2019 15:42:29 -0700 Subject: [PATCH 16/95] Add failing test for smartSelect string literals --- tests/cases/fourslash/smartSelection_stringLiteral.ts | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/cases/fourslash/smartSelection_stringLiteral.ts diff --git a/tests/cases/fourslash/smartSelection_stringLiteral.ts b/tests/cases/fourslash/smartSelection_stringLiteral.ts new file mode 100644 index 00000000000..3dcae459ebf --- /dev/null +++ b/tests/cases/fourslash/smartSelection_stringLiteral.ts @@ -0,0 +1,6 @@ +/// + +//// const a = 'a'; +//// const b = /**/'b'; + +verify.baselineSmartSelection(); From 54f5f2baf26cf247145026ecb8c63fe23b4aa578 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Fri, 14 Jun 2019 15:50:09 -0700 Subject: [PATCH 17/95] Fix smartSelection returning extra span inside string quotes when cursor is outside them --- src/services/smartSelection.ts | 8 ++++++-- .../reference/smartSelection_stringLiteral.baseline | 10 ++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/smartSelection_stringLiteral.baseline diff --git a/src/services/smartSelection.ts b/src/services/smartSelection.ts index ddd3c75c2c7..d0423ce031e 100644 --- a/src/services/smartSelection.ts +++ b/src/services/smartSelection.ts @@ -72,9 +72,13 @@ namespace ts.SmartSelectionRange { function pushSelectionRange(start: number, end: number): void { // Skip empty ranges if (start !== end) { - // Skip ranges that are identical to the parent const textSpan = createTextSpanFromBounds(start, end); - if (!selectionRange || !textSpansEqual(textSpan, selectionRange.textSpan)) { + if (!selectionRange || ( + // Skip ranges that are identical to the parent + !textSpansEqual(textSpan, selectionRange.textSpan) && + // Skip ranges that don’t contain the original position + textSpanIntersectsWithPosition(textSpan, pos) + )) { selectionRange = { textSpan, ...selectionRange && { parent: selectionRange } }; } } diff --git a/tests/baselines/reference/smartSelection_stringLiteral.baseline b/tests/baselines/reference/smartSelection_stringLiteral.baseline new file mode 100644 index 00000000000..4e062d162ce --- /dev/null +++ b/tests/baselines/reference/smartSelection_stringLiteral.baseline @@ -0,0 +1,10 @@ +const a = 'a'; +const b = /**/'b'; + + + 'b' + +const b = 'b'; + +const a = 'a'; +const b = 'b'; \ No newline at end of file From c65d9f261afa22588ca3f232c98978eee1f82210 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 18 Jun 2019 08:30:18 -0700 Subject: [PATCH 18/95] Initial attempt. Totally doesn't work. --- src/compiler/checker.ts | 23 ++++++++++++++--------- src/compiler/diagnosticMessages.json | 4 ++++ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a4ad3af7d9a..77025cd9843 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21439,7 +21439,7 @@ namespace ts { // function foo(): void; // foo(0); // - let candidateForArgumentError: Signature | undefined; + let candidatesForArgumentError: Signature[] | undefined; let candidateForArgumentArityError: Signature | undefined; let candidateForTypeArgumentError: Signature | undefined; let result: Signature | undefined; @@ -21474,8 +21474,13 @@ namespace ts { // If candidate is undefined, it means that no candidates had a suitable arity. In that case, // skip the checkApplicableSignature check. if (reportErrors) { - if (candidateForArgumentError) { - checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, CheckMode.Normal, /*reportErrors*/ true); + if (candidatesForArgumentError) { + createDiagnosticForNodeFromMessageChain // is what I really want to call + chainDiagnosticMessages(chain, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); + diagnostics.add(createDiagnosticForNode(node, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call)); + for (const c of candidatesForArgumentError) { + checkApplicableSignature(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true); + } } else if (candidateForArgumentArityError) { diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args)); @@ -21500,7 +21505,7 @@ namespace ts { return produceDiagnostics || !args ? resolveErrorCall(node) : getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray); function chooseOverload(candidates: Signature[], relation: Map, signatureHelpTrailingComma = false) { - candidateForArgumentError = undefined; + candidatesForArgumentError = undefined; candidateForArgumentArityError = undefined; candidateForTypeArgumentError = undefined; @@ -21510,7 +21515,7 @@ namespace ts { return undefined; } if (!checkApplicableSignature(node, args, candidate, relation, CheckMode.Normal, /*reportErrors*/ false)) { - candidateForArgumentError = candidate; + candidatesForArgumentError = [candidate]; return undefined; } return candidate; @@ -21552,8 +21557,8 @@ namespace ts { } if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false)) { // Give preference to error candidates that have no rest parameters (as they are more specific) - if (!candidateForArgumentError || getEffectiveRestType(candidateForArgumentError) || !getEffectiveRestType(checkCandidate)) { - candidateForArgumentError = checkCandidate; + if (getMinArgumentCount(checkCandidate) <= args.length && args.length <= getParameterCount(checkCandidate)) { + (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); } continue; } @@ -21574,8 +21579,8 @@ namespace ts { } if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false)) { // Give preference to error candidates that have no rest parameters (as they are more specific) - if (!candidateForArgumentError || getEffectiveRestType(candidateForArgumentError) || !getEffectiveRestType(checkCandidate)) { - candidateForArgumentError = checkCandidate; + if (getMinArgumentCount(checkCandidate) <= args.length && args.length <= getParameterCount(checkCandidate)) { + (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); } continue; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index b209a878804..6393ddd596e 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2621,6 +2621,10 @@ "category": "Error", "code": 2754 }, + "Failed to find a suitable overload for this call.": { + "category": "Error", + "code": 2755 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", From beddf9c02d1a522f5131c89a1bc39ee73a98e257 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 18 Jun 2019 10:12:32 -0700 Subject: [PATCH 19/95] Working, just not the way I would like There are still separate errors instead of one + related spans for each sub-error. --- src/compiler/checker.ts | 24 +++++++++++++++--------- src/compiler/diagnosticMessages.json | 4 ++++ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 77025cd9843..0d2f1d11813 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21108,8 +21108,11 @@ namespace ts { signature: Signature, relation: Map, checkMode: CheckMode, - reportErrors: boolean) { + reportErrors: boolean, + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined + ) { if (isJsxOpeningLikeElement(node)) { + // TODO: Maybe containingMessageChain too? return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors); } const thisType = getThisTypeOfSignature(signature); @@ -21137,7 +21140,7 @@ namespace ts { // we obtain the regular type of any object literal arguments because we may not have inferred complete // parameter types yet and therefore excess property checks may yield false positives (see #17041). const checkArgType = checkMode & CheckMode.SkipContextSensitive ? getRegularTypeOfObjectLiteral(argType) : argType; - if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage)) { + if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain)) { return false; } } @@ -21475,11 +21478,14 @@ namespace ts { // skip the checkApplicableSignature check. if (reportErrors) { if (candidatesForArgumentError) { - createDiagnosticForNodeFromMessageChain // is what I really want to call - chainDiagnosticMessages(chain, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); - diagnostics.add(createDiagnosticForNode(node, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call)); + // const related: DiagnosticRelatedInformation[] = []; for (const c of candidatesForArgumentError) { - checkApplicableSignature(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true); + const chain = chainDiagnosticMessages(chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c)), Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); + checkApplicableSignature(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + // related.push(argNode) + // This is not right; I want them to be siblings + // probably this is a new feature :( + // chain = chainDiagnosticMessages(chain, msg); } } else if (candidateForArgumentArityError) { @@ -21514,7 +21520,7 @@ namespace ts { if (typeArguments || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma)) { return undefined; } - if (!checkApplicableSignature(node, args, candidate, relation, CheckMode.Normal, /*reportErrors*/ false)) { + if (!checkApplicableSignature(node, args, candidate, relation, CheckMode.Normal, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { candidatesForArgumentError = [candidate]; return undefined; } @@ -21555,7 +21561,7 @@ namespace ts { else { checkCandidate = candidate; } - if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false)) { + if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { // Give preference to error candidates that have no rest parameters (as they are more specific) if (getMinArgumentCount(checkCandidate) <= args.length && args.length <= getParameterCount(checkCandidate)) { (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); @@ -21577,7 +21583,7 @@ namespace ts { continue; } } - if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false)) { + if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { // Give preference to error candidates that have no rest parameters (as they are more specific) if (getMinArgumentCount(checkCandidate) <= args.length && args.length <= getParameterCount(checkCandidate)) { (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 6393ddd596e..03d366a7232 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2625,6 +2625,10 @@ "category": "Error", "code": 2755 }, + "Overload '{0}' gave the following error.": { + "category": "Error", + "code": 2756 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", From caff266f5e9ced5b3290c4d5f6d54bb169da84fd Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 18 Jun 2019 10:52:03 -0700 Subject: [PATCH 20/95] Notes on how to return errors from checkTypeRelatedTo --- src/compiler/checker.ts | 58 ++++++++++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 0d2f1d11813..912306ef156 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -12341,7 +12341,26 @@ namespace ts { return getObjectFlags(source) & ObjectFlags.JsxAttributes && !isUnhyphenatedJsxName(sourceProp.escapedName); } - /** + function checkTypeRelatedTo( + source: Type, + target: Type, + relation: Map, + errorNode: Node | undefined, + headMessage?: DiagnosticMessage, + containingMessageChain?: () => DiagnosticMessageChain | undefined, + errorOutputContainer?: { error?: Diagnostic }, + ): boolean; + function checkTypeRelatedTo( + source: Type, + target: Type, + relation: Map, + errorNode: Node | undefined, + headMessage?: DiagnosticMessage, + containingMessageChain?: () => DiagnosticMessageChain | undefined, + errorOutputContainer?: { error?: Diagnostic }, + breakdown?: boolean + ): [Node, DiagnosticMessageChain]; + /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). * @param source The left-hand-side of the relation. * @param target The right-hand-side of the relation. @@ -12358,9 +12377,9 @@ namespace ts { errorNode: Node | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, - errorOutputContainer?: { error?: Diagnostic } - ): boolean { - + errorOutputContainer?: { error?: Diagnostic }, + breakdown?: boolean + ): boolean | [Node, DiagnosticMessageChain] { let errorInfo: DiagnosticMessageChain | undefined; let relatedInfo: [DiagnosticRelatedInformation, ...DiagnosticRelatedInformation[]] | undefined; let maybeKeys: string[]; @@ -12399,7 +12418,9 @@ namespace ts { } } } - + if (breakdown) { + return [errorNode!, errorInfo]; + } const diag = createDiagnosticForNodeFromMessageChain(errorNode!, errorInfo, relatedInformation); if (relatedInfo) { addRelatedInfo(diag, ...relatedInfo); @@ -12409,6 +12430,7 @@ namespace ts { } diagnostics.add(diag); // TODO: GH#18217 } + Debug.assert(!breakdown); return result !== Ternary.False; function reportError(message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): void { @@ -21102,6 +21124,9 @@ namespace ts { return checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes); } + // TODO: This function is only used in overload resolution; it should instead return a [errorNode, messageChain] pair if there is a failure and undefined if not + // The first-round callers can used undefined=pass and the second-round callers can build their own errors from the pair. + // TODO: Still need to thread BREAKDOWN through checkTypeRealtedToAndOptionallyElaborate and all other checkType calls function checkApplicableSignature( node: CallLikeExpression, args: ReadonlyArray, @@ -21109,7 +21134,7 @@ namespace ts { relation: Map, checkMode: CheckMode, reportErrors: boolean, - containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, ) { if (isJsxOpeningLikeElement(node)) { // TODO: Maybe containingMessageChain too? @@ -21478,14 +21503,21 @@ namespace ts { // skip the checkApplicableSignature check. if (reportErrors) { if (candidatesForArgumentError) { - // const related: DiagnosticRelatedInformation[] = []; - for (const c of candidatesForArgumentError) { - const chain = chainDiagnosticMessages(chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c)), Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); + if (candidatesForArgumentError.length > 3) { + const c = candidatesForArgumentError[candidatesForArgumentError.length - 1]; + const chain = chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); checkApplicableSignature(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - // related.push(argNode) - // This is not right; I want them to be siblings - // probably this is a new feature :( - // chain = chainDiagnosticMessages(chain, msg); + } + else { + // const related: DiagnosticRelatedInformation[] = []; + for (const c of candidatesForArgumentError) { + const chain = chainDiagnosticMessages(chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c)), Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); + const [errorNode, msg] = checkApplicableSignature(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + // related.push(argNode) + // This is not right; I want them to be siblings + // probably this is a new feature :( + // chain = chainDiagnosticMessages(chain, msg); + } } } else if (candidateForArgumentArityError) { From 1f6ef0504b4024e819a349a469025bbebf104e1a Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 19 Jun 2019 14:54:38 -0700 Subject: [PATCH 21/95] Re-add multiple errors In the worst possible way. Now it's sort of ready for creating a DiagnosticMessageTree. --- src/compiler/checker.ts | 45 ++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 912306ef156..861f32df0ac 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11671,12 +11671,14 @@ namespace ts { return checkTypeRelatedToAndOptionallyElaborate(source, target, assignableRelation, errorNode, expr, headMessage, containingMessageChain); } - function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined): boolean { - if (isTypeRelatedTo(source, target, relation)) return true; + function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined): boolean; + function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): [Node, DiagnosticMessageChain]; + function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): boolean | [Node, DiagnosticMessageChain] { + if (isTypeRelatedTo(source, target, relation)) return breakdown ? false : true; if (!errorNode || !elaborateError(expr, source, target, relation, headMessage)) { - return checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain); + return checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, undefined, breakdown); } - return false; + return breakdown ? [undefined!,undefined!] as [Node, DiagnosticMessageChain] : false; } function isOrHasGenericConditional(type: Type): boolean { @@ -12430,7 +12432,10 @@ namespace ts { } diagnostics.add(diag); // TODO: GH#18217 } - Debug.assert(!breakdown); + if (breakdown) { + Debug.assert(result === Ternary.False ? !errorNode : true, "missed opportunity to interact with error."); + return result === Ternary.False ? [undefined!, undefined!] as [Node, DiagnosticMessageChain] : false; + } return result !== Ternary.False; function reportError(message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): void { @@ -21121,13 +21126,13 @@ namespace ts { // can be specified by users through attributes property. const paramType = getEffectiveFirstArgumentForJsxSignature(signature, node); const attributesType = checkExpressionWithContextualType(node.attributes, paramType, /*inferenceContext*/ undefined, checkMode); - return checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes); + return checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes, undefined, undefined, /*breakdown*/ true); } // TODO: This function is only used in overload resolution; it should instead return a [errorNode, messageChain] pair if there is a failure and undefined if not // The first-round callers can used undefined=pass and the second-round callers can build their own errors from the pair. // TODO: Still need to thread BREAKDOWN through checkTypeRealtedToAndOptionallyElaborate and all other checkType calls - function checkApplicableSignature( + function getSignatureApplicabilityError( node: CallLikeExpression, args: ReadonlyArray, signature: Signature, @@ -21149,8 +21154,9 @@ namespace ts { const thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType; const errorNode = reportErrors ? (thisArgumentNode || node) : undefined; const headMessage = Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1; - if (!checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage)) { - return false; + const r = checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage, undefined, undefined, /*breakdown*/ true); + if (r) { + return r; } } const headMessage = Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1; @@ -21165,17 +21171,18 @@ namespace ts { // we obtain the regular type of any object literal arguments because we may not have inferred complete // parameter types yet and therefore excess property checks may yield false positives (see #17041). const checkArgType = checkMode & CheckMode.SkipContextSensitive ? getRegularTypeOfObjectLiteral(argType) : argType; - if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain)) { - return false; + const r = checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain, /*breakdown*/ true); + if (r) { + return r; } } } if (restType) { const spreadType = getSpreadArgumentType(args, argCount, args.length, restType, /*context*/ undefined); const errorNode = reportErrors ? argCount < args.length ? args[argCount] : node : undefined; - return checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage); + return checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, undefined, undefined, /*breakdown*/ true); } - return true; + return undefined; } /** @@ -21506,13 +21513,15 @@ namespace ts { if (candidatesForArgumentError.length > 3) { const c = candidatesForArgumentError[candidatesForArgumentError.length - 1]; const chain = chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); - checkApplicableSignature(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); } else { // const related: DiagnosticRelatedInformation[] = []; for (const c of candidatesForArgumentError) { const chain = chainDiagnosticMessages(chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c)), Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); - const [errorNode, msg] = checkApplicableSignature(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + const r = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + if (!r || !r[0]) continue; // TODO:assert! + diagnostics.add(createDiagnosticForNodeFromMessageChain(r[0], r[1], /*relatedInformation*/ undefined)); // related.push(argNode) // This is not right; I want them to be siblings // probably this is a new feature :( @@ -21552,7 +21561,7 @@ namespace ts { if (typeArguments || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma)) { return undefined; } - if (!checkApplicableSignature(node, args, candidate, relation, CheckMode.Normal, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { + if (getSignatureApplicabilityError(node, args, candidate, relation, CheckMode.Normal, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { candidatesForArgumentError = [candidate]; return undefined; } @@ -21593,7 +21602,7 @@ namespace ts { else { checkCandidate = candidate; } - if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { + if (getSignatureApplicabilityError(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { // Give preference to error candidates that have no rest parameters (as they are more specific) if (getMinArgumentCount(checkCandidate) <= args.length && args.length <= getParameterCount(checkCandidate)) { (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); @@ -21615,7 +21624,7 @@ namespace ts { continue; } } - if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { + if (getSignatureApplicabilityError(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { // Give preference to error candidates that have no rest parameters (as they are more specific) if (getMinArgumentCount(checkCandidate) <= args.length && args.length <= getParameterCount(checkCandidate)) { (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); From afecb87d3f106bc8a3f116e1a85aed0d281e4795 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 20 Jun 2019 08:54:31 -0700 Subject: [PATCH 22/95] Use related spans to form a tree of errors. Formatting is wrong, and I might want to format it as non-related spans, but the structure is exactly a tree. --- src/compiler/checker.ts | 29 ++++++++++++---------------- src/compiler/diagnosticMessages.json | 2 +- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 861f32df0ac..bad283bb1c7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11672,7 +11672,7 @@ namespace ts { } function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined): boolean; - function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): [Node, DiagnosticMessageChain]; + function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): [Node, DiagnosticMessageChain] | false; function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): boolean | [Node, DiagnosticMessageChain] { if (isTypeRelatedTo(source, target, relation)) return breakdown ? false : true; if (!errorNode || !elaborateError(expr, source, target, relation, headMessage)) { @@ -12361,7 +12361,7 @@ namespace ts { containingMessageChain?: () => DiagnosticMessageChain | undefined, errorOutputContainer?: { error?: Diagnostic }, breakdown?: boolean - ): [Node, DiagnosticMessageChain]; + ): false | [Node, DiagnosticMessageChain]; /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). * @param source The left-hand-side of the relation. @@ -21512,21 +21512,20 @@ namespace ts { if (candidatesForArgumentError) { if (candidatesForArgumentError.length > 3) { const c = candidatesForArgumentError[candidatesForArgumentError.length - 1]; - const chain = chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); + const chain = chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_the_0_closest_overloads, candidatesForArgumentError.length); + getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); } else { - // const related: DiagnosticRelatedInformation[] = []; - for (const c of candidatesForArgumentError) { - const chain = chainDiagnosticMessages(chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c)), Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); + const related: DiagnosticRelatedInformation[] = []; + const close = candidatesForArgumentError.filter(c => getMinArgumentCount(c) <= args.length && args.length <= getParameterCount(c)); + for (const c of close) { + const chain = chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c)); const r = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); if (!r || !r[0]) continue; // TODO:assert! - diagnostics.add(createDiagnosticForNodeFromMessageChain(r[0], r[1], /*relatedInformation*/ undefined)); - // related.push(argNode) - // This is not right; I want them to be siblings - // probably this is a new feature :( - // chain = chainDiagnosticMessages(chain, msg); + related.push(createDiagnosticForNodeFromMessageChain(r[0], r[1])); } + diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_the_0_closest_overloads, close.length), related)); } } else if (candidateForArgumentArityError) { @@ -21604,9 +21603,7 @@ namespace ts { } if (getSignatureApplicabilityError(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { // Give preference to error candidates that have no rest parameters (as they are more specific) - if (getMinArgumentCount(checkCandidate) <= args.length && args.length <= getParameterCount(checkCandidate)) { - (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); - } + (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); continue; } if (argCheckMode) { @@ -21626,9 +21623,7 @@ namespace ts { } if (getSignatureApplicabilityError(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { // Give preference to error candidates that have no rest parameters (as they are more specific) - if (getMinArgumentCount(checkCandidate) <= args.length && args.length <= getParameterCount(checkCandidate)) { - (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); - } + (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); continue; } } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index dd88b0029a0..baa0a5fa14e 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2621,7 +2621,7 @@ "category": "Error", "code": 2754 }, - "Failed to find a suitable overload for this call.": { + "Failed to find a suitable overload for this call from the {0} closest overloads.": { "category": "Error", "code": 2755 }, From ef0a8759bd66c10df53b0c0a76c33eadf62462fb Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 20 Jun 2019 15:40:29 -0700 Subject: [PATCH 23/95] Share code a bit better --- src/compiler/checker.ts | 28 ++++++++++++++++++---------- src/compiler/diagnosticMessages.json | 8 ++++++-- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index bad283bb1c7..a177fd3522b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21510,22 +21510,30 @@ namespace ts { // skip the checkApplicableSignature check. if (reportErrors) { if (candidatesForArgumentError) { - if (candidatesForArgumentError.length > 3) { - const c = candidatesForArgumentError[candidatesForArgumentError.length - 1]; - const chain = chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_the_0_closest_overloads, candidatesForArgumentError.length); - - getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + if (candidatesForArgumentError.length === 1 || candidatesForArgumentError.length > 3) { + const last = candidatesForArgumentError[candidatesForArgumentError.length - 1]; + let chain: DiagnosticMessageChain | undefined = undefined; + if (candidatesForArgumentError.length > 3) { + chain = chainDiagnosticMessages(chain, Diagnostics.The_last_overload_gave_the_following_error); + chain = chainDiagnosticMessages(chain, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_0_overloads, candidatesForArgumentError.length); + } + const r = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + Debug.assert(!!r && !!r[0]); + if (r) { + diagnostics.add(createDiagnosticForNodeFromMessageChain(r[0], r[1], undefined)); + } } else { const related: DiagnosticRelatedInformation[] = []; - const close = candidatesForArgumentError.filter(c => getMinArgumentCount(c) <= args.length && args.length <= getParameterCount(c)); - for (const c of close) { + for (const c of candidatesForArgumentError) { const chain = chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c)); const r = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - if (!r || !r[0]) continue; // TODO:assert! - related.push(createDiagnosticForNodeFromMessageChain(r[0], r[1])); + Debug.assert(!!r && !!r[0]); + if (r) { + related.push(createDiagnosticForNodeFromMessageChain(r[0], r[1])); + } } - diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_the_0_closest_overloads, close.length), related)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_0_overloads, candidatesForArgumentError.length), related)); } } else if (candidateForArgumentArityError) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index baa0a5fa14e..b2ba98c5868 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2621,14 +2621,18 @@ "category": "Error", "code": 2754 }, - "Failed to find a suitable overload for this call from the {0} closest overloads.": { + "Failed to find a suitable overload for this call from {0} overloads.": { "category": "Error", "code": 2755 }, - "Overload '{0}' gave the following error.": { + "The last overload gave the following error.": { "category": "Error", "code": 2756 }, + "Overload '{0}' gave the following error.": { + "category": "Error", + "code": 2757 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", From b85796cba0a78e7d5ec07603298305f55524d388 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 20 Jun 2019 16:13:08 -0700 Subject: [PATCH 24/95] Retain related info for 1-overloads --- src/compiler/checker.ts | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a177fd3522b..f8de982e02a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11672,8 +11672,8 @@ namespace ts { } function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined): boolean; - function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): [Node, DiagnosticMessageChain] | false; - function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): boolean | [Node, DiagnosticMessageChain] { + function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): [Node, DiagnosticMessageChain, DiagnosticRelatedInformation[]?] | false; + function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): boolean | [Node, DiagnosticMessageChain, DiagnosticRelatedInformation[]?] { if (isTypeRelatedTo(source, target, relation)) return breakdown ? false : true; if (!errorNode || !elaborateError(expr, source, target, relation, headMessage)) { return checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, undefined, breakdown); @@ -12361,7 +12361,7 @@ namespace ts { containingMessageChain?: () => DiagnosticMessageChain | undefined, errorOutputContainer?: { error?: Diagnostic }, breakdown?: boolean - ): false | [Node, DiagnosticMessageChain]; + ): false | [Node, DiagnosticMessageChain, DiagnosticRelatedInformation[]?]; /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). * @param source The left-hand-side of the relation. @@ -12381,7 +12381,7 @@ namespace ts { containingMessageChain?: () => DiagnosticMessageChain | undefined, errorOutputContainer?: { error?: Diagnostic }, breakdown?: boolean - ): boolean | [Node, DiagnosticMessageChain] { + ): boolean | [Node, DiagnosticMessageChain, DiagnosticRelatedInformation[]?] { let errorInfo: DiagnosticMessageChain | undefined; let relatedInfo: [DiagnosticRelatedInformation, ...DiagnosticRelatedInformation[]] | undefined; let maybeKeys: string[]; @@ -12421,7 +12421,7 @@ namespace ts { } } if (breakdown) { - return [errorNode!, errorInfo]; + return [errorNode!, errorInfo, relatedInfo ? [...(relatedInformation || []), ...relatedInfo]: relatedInformation]; } const diag = createDiagnosticForNodeFromMessageChain(errorNode!, errorInfo, relatedInformation); if (relatedInfo) { @@ -21129,9 +21129,6 @@ namespace ts { return checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes, undefined, undefined, /*breakdown*/ true); } - // TODO: This function is only used in overload resolution; it should instead return a [errorNode, messageChain] pair if there is a failure and undefined if not - // The first-round callers can used undefined=pass and the second-round callers can build their own errors from the pair. - // TODO: Still need to thread BREAKDOWN through checkTypeRealtedToAndOptionallyElaborate and all other checkType calls function getSignatureApplicabilityError( node: CallLikeExpression, args: ReadonlyArray, @@ -21518,9 +21515,9 @@ namespace ts { chain = chainDiagnosticMessages(chain, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_0_overloads, candidatesForArgumentError.length); } const r = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - Debug.assert(!!r && !!r[0]); + Debug.assert(!!r && !!r[0], "No error for last signature"); if (r) { - diagnostics.add(createDiagnosticForNodeFromMessageChain(r[0], r[1], undefined)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(...r)); } } else { @@ -21528,9 +21525,9 @@ namespace ts { for (const c of candidatesForArgumentError) { const chain = chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c)); const r = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - Debug.assert(!!r && !!r[0]); + Debug.assert(!!r && !!r[0], "No error for signature (1)"); if (r) { - related.push(createDiagnosticForNodeFromMessageChain(r[0], r[1])); + related.push(createDiagnosticForNodeFromMessageChain(...r)); } } diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_0_overloads, candidatesForArgumentError.length), related)); From 720ad5bf2244bffcdae9ae29a0cb7c489856b832 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 21 Jun 2019 13:15:32 -0700 Subject: [PATCH 25/95] Improve error message and update baselines --- src/compiler/checker.ts | 24 +- src/compiler/diagnosticMessages.json | 4 +- .../reference/bigintWithLib.errors.txt | 37 +- .../checkJsxChildrenCanBeTupleType.errors.txt | 24 +- .../constructorOverloads1.errors.txt | 20 +- ...StringLiteralsInJsxAttributes02.errors.txt | 56 ++- ...TypedStringLiteralsInJsxAttributes02.types | 8 +- .../controlFlowIterationErrors.errors.txt | 28 +- .../reference/functionOverloads2.errors.txt | 10 +- ...edMethodWithOverloadedArguments.errors.txt | 54 ++- .../reference/incompatibleTypes.errors.txt | 36 +- ...ritedConstructorWithRestParams2.errors.txt | 20 +- .../iteratorSpreadInArray6.errors.txt | 25 +- ...attersForSignatureGroupIdentity.errors.txt | 28 +- .../baselines/reference/overload1.errors.txt | 10 +- .../reference/overloadResolution.errors.txt | 30 +- ...loadResolutionClassConstructors.errors.txt | 10 +- .../overloadResolutionConstructors.errors.txt | 30 +- .../overloadingOnConstants2.errors.txt | 10 +- ...nWithConstraintCheckingDeferred.errors.txt | 25 +- .../reference/promisePermutations.errors.txt | 388 ++++++++++++------ .../reference/promisePermutations2.errors.txt | 144 ++++--- .../reference/promisePermutations3.errors.txt | 244 +++++++---- .../recursiveFunctionTypes.errors.txt | 12 +- ...edSignatureAsCallbackParameter1.errors.txt | 24 +- ...eStringsWithOverloadResolution1.errors.txt | 40 +- ...ingsWithOverloadResolution1_ES6.errors.txt | 40 +- ...eStringsWithOverloadResolution3.errors.txt | 30 +- ...ingsWithOverloadResolution3_ES6.errors.txt | 30 +- .../tsxElementResolution9.errors.txt | 30 +- .../tsxNotUsingApparentTypeOfSFC.errors.txt | 10 +- .../reference/underscoreTest1.errors.txt | 15 +- .../unionTypeCallSignatures.errors.txt | 20 +- .../unionTypeConstructSignatures.errors.txt | 20 +- 34 files changed, 1027 insertions(+), 509 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f8de982e02a..614eaeab71f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21120,13 +21120,20 @@ namespace ts { * @param signature a candidate signature we are trying whether it is a call signature * @param relation a relationship to check parameter and argument type */ - function checkApplicableSignatureForJsxOpeningLikeElement(node: JsxOpeningLikeElement, signature: Signature, relation: Map, checkMode: CheckMode, reportErrors: boolean) { + function checkApplicableSignatureForJsxOpeningLikeElement( + node: JsxOpeningLikeElement, + signature: Signature, + relation: Map, + checkMode: CheckMode, + reportErrors: boolean, + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + ) { // Stateless function components can have maximum of three arguments: "props", "context", and "updater". // However "context" and "updater" are implicit and can't be specify by users. Only the first parameter, props, // can be specified by users through attributes property. const paramType = getEffectiveFirstArgumentForJsxSignature(signature, node); const attributesType = checkExpressionWithContextualType(node.attributes, paramType, /*inferenceContext*/ undefined, checkMode); - return checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes, undefined, undefined, /*breakdown*/ true); + return checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes, undefined, containingMessageChain, /*breakdown*/ true); } function getSignatureApplicabilityError( @@ -21139,8 +21146,7 @@ namespace ts { containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, ) { if (isJsxOpeningLikeElement(node)) { - // TODO: Maybe containingMessageChain too? - return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors); + return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain); } const thisType = getThisTypeOfSignature(signature); if (thisType && thisType !== voidType && node.kind !== SyntaxKind.NewExpression) { @@ -21151,7 +21157,7 @@ namespace ts { const thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType; const errorNode = reportErrors ? (thisArgumentNode || node) : undefined; const headMessage = Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1; - const r = checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage, undefined, undefined, /*breakdown*/ true); + const r = checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage, containingMessageChain, undefined, /*breakdown*/ true); if (r) { return r; } @@ -21512,7 +21518,7 @@ namespace ts { let chain: DiagnosticMessageChain | undefined = undefined; if (candidatesForArgumentError.length > 3) { chain = chainDiagnosticMessages(chain, Diagnostics.The_last_overload_gave_the_following_error); - chain = chainDiagnosticMessages(chain, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_0_overloads, candidatesForArgumentError.length); + chain = chainDiagnosticMessages(chain, Diagnostics.No_suitable_overload_for_this_call); } const r = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); Debug.assert(!!r && !!r[0], "No error for last signature"); @@ -21522,15 +21528,17 @@ namespace ts { } else { const related: DiagnosticRelatedInformation[] = []; + let i = 0; for (const c of candidatesForArgumentError) { - const chain = chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c)); + i++; + const chain = chainDiagnosticMessages(undefined, Diagnostics.Overload_0_of_1_2_gave_the_following_error, i, candidates.length, signatureToString(c)); const r = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); Debug.assert(!!r && !!r[0], "No error for signature (1)"); if (r) { related.push(createDiagnosticForNodeFromMessageChain(...r)); } } - diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_0_overloads, candidatesForArgumentError.length), related)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.No_suitable_overload_for_this_call), related)); } } else if (candidateForArgumentArityError) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index b2ba98c5868..9ce753766a6 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2621,7 +2621,7 @@ "category": "Error", "code": 2754 }, - "Failed to find a suitable overload for this call from {0} overloads.": { + "No suitable overload for this call.": { "category": "Error", "code": 2755 }, @@ -2629,7 +2629,7 @@ "category": "Error", "code": 2756 }, - "Overload '{0}' gave the following error.": { + "Overload {0} of {1}, '{2}', gave the following error.": { "category": "Error", "code": 2757 }, diff --git a/tests/baselines/reference/bigintWithLib.errors.txt b/tests/baselines/reference/bigintWithLib.errors.txt index 993f43d5a05..c716a1dda26 100644 --- a/tests/baselines/reference/bigintWithLib.errors.txt +++ b/tests/baselines/reference/bigintWithLib.errors.txt @@ -1,9 +1,7 @@ tests/cases/compiler/bigintWithLib.ts(4,1): error TS2350: Only a void function can be called with the 'new' keyword. -tests/cases/compiler/bigintWithLib.ts(16,33): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. - Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] +tests/cases/compiler/bigintWithLib.ts(16,15): error TS2755: No suitable overload for this call. tests/cases/compiler/bigintWithLib.ts(21,13): error TS2540: Cannot assign to 'length' because it is a read-only property. -tests/cases/compiler/bigintWithLib.ts(28,35): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. - Type 'number[]' is not assignable to type 'SharedArrayBuffer'. +tests/cases/compiler/bigintWithLib.ts(28,16): error TS2755: No suitable overload for this call. tests/cases/compiler/bigintWithLib.ts(33,13): error TS2540: Cannot assign to 'length' because it is a read-only property. tests/cases/compiler/bigintWithLib.ts(40,25): error TS2345: Argument of type '-1' is not assignable to parameter of type 'bigint'. tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '123' is not assignable to parameter of type 'bigint'. @@ -28,9 +26,22 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 bigIntArray = new BigInt64Array(10); bigIntArray = new BigInt64Array([1n, 2n, 3n]); bigIntArray = new BigInt64Array([1, 2, 3]); // should error - ~~~~~~~~~ -!!! error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. -!!! error TS2345: Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'number'. +!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => IterableIterator' is not assignable to type '() => Iterator'. + Type 'IterableIterator' is not assignable to type 'Iterator'. + Types of property 'next' are incompatible. + Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. + Type 'IteratorResult' is not assignable to type 'IteratorResult'. + Type 'number' is not assignable to type 'bigint'. +!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. + Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] bigIntArray = new BigInt64Array(new ArrayBuffer(80)); bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8); bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8, 3); @@ -45,9 +56,15 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 bigUintArray = new BigUint64Array(10); bigUintArray = new BigUint64Array([1n, 2n, 3n]); bigUintArray = new BigUint64Array([1, 2, 3]); // should error - ~~~~~~~~~ -!!! error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. -!!! error TS2345: Type 'number[]' is not assignable to type 'SharedArrayBuffer'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'number'. +!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. +!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. + Type 'number[]' is not assignable to type 'SharedArrayBuffer'. bigUintArray = new BigUint64Array(new ArrayBuffer(80)); bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8); bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8, 3); diff --git a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt index 66078776c5f..8348b2cfe11 100644 --- a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt @@ -1,8 +1,4 @@ -tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,18): error TS2322: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. - Types of property 'children' are incompatible. - Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. - Types of property 'length' are incompatible. - Type '3' is not assignable to type '2'. +tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2755: No suitable overload for this call. ==== tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx (1 errors) ==== @@ -23,12 +19,18 @@ tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,18): error TS2 const testErr = - ~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. -!!! error TS2322: Types of property 'children' are incompatible. -!!! error TS2322: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. -!!! error TS2322: Types of property 'length' are incompatible. -!!! error TS2322: Type '3' is not assignable to type '2'. + ~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx:17:18: Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. + Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. + Types of property 'children' are incompatible. + Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. + Types of property 'length' are incompatible. + Type '3' is not assignable to type '2'. +!!! related TS2757 tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx:17:18: Overload 2 of 2, '(props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. + Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. + Types of property 'children' are incompatible. + Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.
diff --git a/tests/baselines/reference/constructorOverloads1.errors.txt b/tests/baselines/reference/constructorOverloads1.errors.txt index 2e8c79d159a..2a1dc25f0c2 100644 --- a/tests/baselines/reference/constructorOverloads1.errors.txt +++ b/tests/baselines/reference/constructorOverloads1.errors.txt @@ -2,8 +2,8 @@ tests/cases/compiler/constructorOverloads1.ts(2,5): error TS2392: Multiple const tests/cases/compiler/constructorOverloads1.ts(3,5): error TS2392: Multiple constructor implementations are not allowed. tests/cases/compiler/constructorOverloads1.ts(4,5): error TS2392: Multiple constructor implementations are not allowed. tests/cases/compiler/constructorOverloads1.ts(7,5): error TS2392: Multiple constructor implementations are not allowed. -tests/cases/compiler/constructorOverloads1.ts(16,18): error TS2345: Argument of type 'Foo' is not assignable to parameter of type 'number'. -tests/cases/compiler/constructorOverloads1.ts(17,18): error TS2345: Argument of type 'any[]' is not assignable to parameter of type 'number'. +tests/cases/compiler/constructorOverloads1.ts(16,10): error TS2755: No suitable overload for this call. +tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/constructorOverloads1.ts (6 errors) ==== @@ -35,11 +35,19 @@ tests/cases/compiler/constructorOverloads1.ts(17,18): error TS2345: Argument of var f1 = new Foo("hey"); var f2 = new Foo(0); var f3 = new Foo(f1); - ~~ -!!! error TS2345: Argument of type 'Foo' is not assignable to parameter of type 'number'. + ~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/constructorOverloads1.ts:16:18: Overload 1 of 2, '(s: string): Foo', gave the following error. + Argument of type 'Foo' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/compiler/constructorOverloads1.ts:16:18: Overload 2 of 2, '(n: number): Foo', gave the following error. + Argument of type 'Foo' is not assignable to parameter of type 'number'. var f4 = new Foo([f1,f2,f3]); - ~~~~~~~~~~ -!!! error TS2345: Argument of type 'any[]' is not assignable to parameter of type 'number'. + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/constructorOverloads1.ts:17:18: Overload 1 of 2, '(s: string): Foo', gave the following error. + Argument of type 'any[]' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/compiler/constructorOverloads1.ts:17:18: Overload 2 of 2, '(n: number): Foo', gave the following error. + Argument of type 'any[]' is not assignable to parameter of type 'number'. f1.bar1(); f1.bar2(); diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt index 747bbb9db8e..890eb71337f 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt @@ -1,11 +1,7 @@ -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,13): error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,13): error TS2322: Type '{ onClick: (k: any) => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,13): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,13): error TS2322: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,12): error TS2755: No suitable overload for this call. tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(33,13): error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. @@ -40,21 +36,41 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): err } const b0 = {console.log(k)}}} extra />; // k has type "left" | "right" - ~~~~~~~~~~ -!!! error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2322: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:27:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:27:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. + Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. const b2 = {console.log(k)}} extra />; // k has type "left" | "right" - ~~~~~~~~~~ -!!! error TS2322: Type '{ onClick: (k: any) => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2322: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:28:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:28:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. + Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. + Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. const b3 = ; // goTo has type"home" | "contact" - ~~~~~~~~~~ -!!! error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2322: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:29:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:29:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. + Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. const b4 = ; // goTo has type "home" | "contact" - ~~~~~~~~~~ -!!! error TS2322: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2322: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:30:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:30:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. + Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. export function NoOverload(buttonProps: ButtonProps): JSX.Element { return undefined } const c1 = {console.log(k)}}} extra />; // k has type any diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.types b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.types index 1d3508ff5c7..badb7b0d4e9 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.types +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.types @@ -81,14 +81,14 @@ const b2 = {console.log(k)}} extra />; // k has type >b2 : JSX.Element >{console.log(k)}} extra /> : JSX.Element >MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; } ->onClick : (k: any) => void ->(k)=>{console.log(k)} : (k: any) => void ->k : any +>onClick : (k: "left" | "right") => void +>(k)=>{console.log(k)} : (k: "left" | "right") => void +>k : "left" | "right" >console.log(k) : void >console.log : (message?: any, ...optionalParams: any[]) => void >console : Console >log : (message?: any, ...optionalParams: any[]) => void ->k : any +>k : "left" | "right" >extra : true const b3 = ; // goTo has type"home" | "contact" diff --git a/tests/baselines/reference/controlFlowIterationErrors.errors.txt b/tests/baselines/reference/controlFlowIterationErrors.errors.txt index 28cbf8bdc47..aaf153f3b44 100644 --- a/tests/baselines/reference/controlFlowIterationErrors.errors.txt +++ b/tests/baselines/reference/controlFlowIterationErrors.errors.txt @@ -2,10 +2,8 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(11,17): error Type 'number' is not assignable to type 'string'. tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(22,17): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(34,17): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'. - Type 'string' is not assignable to type 'number'. -tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,17): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'. - Type 'string' is not assignable to type 'number'. +tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(34,13): error TS2755: No suitable overload for this call. +tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error TS2755: No suitable overload for this call. ==== tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts (4 errors) ==== @@ -49,9 +47,14 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,17): error x = ""; while (cond) { x = foo(x); - ~ -!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'. -!!! error TS2345: Type 'string' is not assignable to type 'number'. + ~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:34:17: Overload 1 of 2, '(x: string): number', gave the following error. + Argument of type 'string | number' is not assignable to parameter of type 'string'. + Type 'number' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:34:17: Overload 2 of 2, '(x: number): string', gave the following error. + Argument of type 'string | number' is not assignable to parameter of type 'number'. + Type 'string' is not assignable to type 'number'. x; } x; @@ -63,9 +66,14 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,17): error while (cond) { x; x = foo(x); - ~ -!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'. -!!! error TS2345: Type 'string' is not assignable to type 'number'. + ~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:45:17: Overload 1 of 2, '(x: string): number', gave the following error. + Argument of type 'string | number' is not assignable to parameter of type 'string'. + Type 'number' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:45:17: Overload 2 of 2, '(x: number): string', gave the following error. + Argument of type 'string | number' is not assignable to parameter of type 'number'. + Type 'string' is not assignable to type 'number'. } x; } diff --git a/tests/baselines/reference/functionOverloads2.errors.txt b/tests/baselines/reference/functionOverloads2.errors.txt index 60fbe2843d9..71149141f45 100644 --- a/tests/baselines/reference/functionOverloads2.errors.txt +++ b/tests/baselines/reference/functionOverloads2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads2.ts(4,13): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. +tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/functionOverloads2.ts (1 errors) ==== @@ -6,5 +6,9 @@ tests/cases/compiler/functionOverloads2.ts(4,13): error TS2345: Argument of type function foo(bar: number): number; function foo(bar: any): any { return bar }; var x = foo(true); - ~~~~ -!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. \ No newline at end of file + ~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/functionOverloads2.ts:4:13: Overload 1 of 2, '(bar: string): string', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/compiler/functionOverloads2.ts:4:13: Overload 2 of 2, '(bar: number): number', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt index 9f728e554a3..064ced0b442 100644 --- a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt +++ b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt @@ -1,15 +1,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(23,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(52,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(68,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'boolean'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(52,22): error TS2755: No suitable overload for this call. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(68,22): error TS2755: No suitable overload for this call. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(84,22): error TS2755: No suitable overload for this call. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts (4 errors) ==== @@ -69,10 +63,15 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); - ~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:52:38: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:52:38: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. } ////////////////////////////////////// @@ -89,10 +88,18 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); - ~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. +!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. } ////////////////////////////////////// @@ -109,9 +116,14 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); - ~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2345: Type 'number' is not assignable to type 'boolean'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:84:38: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'boolean'. +!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:84:38: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. } \ No newline at end of file diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index 3da9adcd2b7..b6b32526162 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -9,12 +9,8 @@ tests/cases/compiler/incompatibleTypes.ts(26,12): error TS2416: Property 'p1' in Type 'number' is not assignable to type 'string'. tests/cases/compiler/incompatibleTypes.ts(34,12): error TS2416: Property 'p1' in type 'C4' is not assignable to the same property in base type 'IFoo4'. Type '{ c: { b: string; }; d: string; }' is missing the following properties from type '{ a: { a: string; }; b: string; }': a, b -tests/cases/compiler/incompatibleTypes.ts(42,5): error TS2345: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. - Types of property 'p1' are incompatible. - Type '() => string' is not assignable to type '(s: string) => number'. - Type 'string' is not assignable to type 'number'. -tests/cases/compiler/incompatibleTypes.ts(49,7): error TS2345: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. - Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. +tests/cases/compiler/incompatibleTypes.ts(42,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/incompatibleTypes.ts(49,1): error TS2755: No suitable overload for this call. tests/cases/compiler/incompatibleTypes.ts(66,47): error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2322: Type '5' is not assignable to type '() => string'. @@ -79,11 +75,18 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => var c1: C1; var c2: C2; if1(c1); - ~~ -!!! error TS2345: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. -!!! error TS2345: Types of property 'p1' are incompatible. -!!! error TS2345: Type '() => string' is not assignable to type '(s: string) => number'. -!!! error TS2345: Type 'string' is not assignable to type 'number'. + ~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/incompatibleTypes.ts:42:5: Overload 1 of 2, '(i: IFoo1): void', gave the following error. + Argument of type 'C1' is not assignable to parameter of type 'IFoo1'. + Types of property 'p1' are incompatible. + Type '() => string' is not assignable to type '() => number'. + Type 'string' is not assignable to type 'number'. +!!! related TS2757 tests/cases/compiler/incompatibleTypes.ts:42:5: Overload 2 of 2, '(i: IFoo2): void', gave the following error. + Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. + Types of property 'p1' are incompatible. + Type '() => string' is not assignable to type '(s: string) => number'. + Type 'string' is not assignable to type 'number'. function of1(n: { a: { a: string; }; b: string; }): number; @@ -91,9 +94,14 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => function of1(a: any) { return null; } of1({ e: 0, f: 0 }); - ~~~~ -!!! error TS2345: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. -!!! error TS2345: Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/incompatibleTypes.ts:49:7: Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. + Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'. + Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. +!!! related TS2757 tests/cases/compiler/incompatibleTypes.ts:49:7: Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error. + Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. + Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. interface IMap { [key:string]:string; diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt index 9249e9512bc..027e9788a45 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/inheritedConstructorWithRestParams2.ts(32,13): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. -tests/cases/compiler/inheritedConstructorWithRestParams2.ts(33,17): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. -tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,17): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. +tests/cases/compiler/inheritedConstructorWithRestParams2.ts(33,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/inheritedConstructorWithRestParams2.ts (3 errors) ==== @@ -39,8 +39,16 @@ tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,17): error TS2345 ~ !!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new Derived("", 3, "", 3); - ~ -!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:33:20: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. + Argument of type '""' is not assignable to parameter of type 'number'. +!!! related TS2757 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:33:17: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. + Argument of type '3' is not assignable to parameter of type 'string'. new Derived("", 3, "", ""); - ~ -!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. \ No newline at end of file + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:34:20: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. + Argument of type '""' is not assignable to parameter of type 'number'. +!!! related TS2757 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:34:17: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. + Argument of type '3' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt index 4f547c59ed0..0747bd48366 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt @@ -1,9 +1,4 @@ -tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,14): error TS2345: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. - Type 'symbol[]' is not assignable to type 'ConcatArray'. - Types of property 'slice' are incompatible. - Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'. - Type 'symbol[]' is not assignable to type 'number[]'. - Type 'symbol' is not assignable to type 'number'. +tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755: No suitable overload for this call. ==== tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts (1 errors) ==== @@ -22,10 +17,14 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,14): error TS234 var array: number[] = [0, 1]; array.concat([...new SymbolIterator]); - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. -!!! error TS2345: Type 'symbol[]' is not assignable to type 'ConcatArray'. -!!! error TS2345: Types of property 'slice' are incompatible. -!!! error TS2345: Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'. -!!! error TS2345: Type 'symbol[]' is not assignable to type 'number[]'. -!!! error TS2345: Type 'symbol' is not assignable to type 'number'. \ No newline at end of file + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts:15:14: Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. + Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. + Types of property 'slice' are incompatible. + Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'. + Type 'symbol[]' is not assignable to type 'number[]'. + Type 'symbol' is not assignable to type 'number'. +!!! related TS2757 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts:15:14: Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. + Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. + Type 'symbol[]' is not assignable to type 'ConcatArray'. \ No newline at end of file diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt index fc8d68f1af8..e525d7e6276 100644 --- a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt @@ -1,8 +1,6 @@ -tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,5): error TS2345: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. - Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. +tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,1): error TS2755: No suitable overload for this call. tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'w' must be of type 'A', but here has type 'C'. -tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,5): error TS2345: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. - Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. +tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts (3 errors) ==== @@ -25,9 +23,14 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,5): error TS234 var v: B; v({ s: "", n: 0 }).toLowerCase(); - ~~~~~ -!!! error TS2345: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. -!!! error TS2345: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. + ~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:19:12: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. + Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. + Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. +!!! related TS2757 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:19:5: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. + Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. + Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. var w: A; var w: C; @@ -36,6 +39,11 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,5): error TS234 !!! related TS6203 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:21:5: 'w' was also declared here. w({ s: "", n: 0 }).toLowerCase(); - ~~~~~ -!!! error TS2345: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. -!!! error TS2345: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. \ No newline at end of file + ~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:24:12: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. + Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. + Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. +!!! related TS2757 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:24:5: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. + Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. + Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt index aa58f23b95a..8c4aa818e9d 100644 --- a/tests/baselines/reference/overload1.errors.txt +++ b/tests/baselines/reference/overload1.errors.txt @@ -3,7 +3,7 @@ tests/cases/compiler/overload1.ts(29,1): error TS2322: Type 'number' is not assi tests/cases/compiler/overload1.ts(31,11): error TS2554: Expected 1-2 arguments, but got 3. tests/cases/compiler/overload1.ts(32,3): error TS2554: Expected 1-2 arguments, but got 0. tests/cases/compiler/overload1.ts(33,1): error TS2322: Type 'C' is not assignable to type 'string'. -tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type '2' is not assignable to parameter of type 'string'. +tests/cases/compiler/overload1.ts(34,3): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/overload1.ts (6 errors) ==== @@ -52,8 +52,12 @@ tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type '2' is n ~ !!! error TS2322: Type 'C' is not assignable to type 'string'. z=x.h(2,2); // no match - ~ -!!! error TS2345: Argument of type '2' is not assignable to parameter of type 'string'. + ~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/overload1.ts:34:7: Overload 1 of 2, '(s1: string, s2: number): string', gave the following error. + Argument of type '2' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/compiler/overload1.ts:34:9: Overload 2 of 2, '(s1: number, s2: string): number', gave the following error. + Argument of type '2' is not assignable to parameter of type 'string'. z=x.h("hello",0); // good var v=x.g; diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index fde241d62cc..6be2c4058c9 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,5): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,1): error TS2755: No suitable overload for this call. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2558: Expected 3 type arguments, but got 4. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,5): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,11): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,1): error TS2755: No suitable overload for this call. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -38,8 +38,12 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // No candidate overloads found fn1({}); // Error - ~~ -!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. + ~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:27:5: Overload 1 of 2, '(s: string): string', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:27:5: Overload 2 of 2, '(s: number): number', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'number'. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments function fn2(s: string, n: number): number; @@ -107,11 +111,19 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4(true, null); // Error - ~~~~ -!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. + ~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:84:5: Overload 1 of 2, '(n: string, m: any): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:84:5: Overload 2 of 2, '(n: number, m: any): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. fn4(null, true); // Error - ~~~~ -!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:85:11: Overload 1 of 2, '(n: any, m: number): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. +!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:85:11: Overload 2 of 2, '(n: any, m: string): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors function fn5(f: (n: string) => void): string; diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index cfbc2605559..8cf0b4e0fd6 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,1): error TS2755: No suitable overload for this call. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,9): error TS2558: Expected 3 type arguments, but got 1. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,9): error TS2558: Expected 3 type arguments, but got 2. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,9): error TS2558: Expected 3 type arguments, but got 4. @@ -42,8 +42,12 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru // No candidate overloads found new fn1({}); // Error - ~~ -!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. + ~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts:27:9: Overload 1 of 2, '(s: string): fn1', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts:27:9: Overload 2 of 2, '(s: number): fn1', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'number'. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments class fn2 { diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index 40b660c7eaf..769eab3a9eb 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,1): error TS2755: No suitable overload for this call. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2558: Expected 3 type arguments, but got 4. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,9): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,15): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,1): error TS2755: No suitable overload for this call. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,26): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -38,8 +38,12 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // No candidate overloads found new fn1({}); // Error - ~~ -!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. + ~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:27:9: Overload 1 of 2, '(s: string): string', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:27:9: Overload 2 of 2, '(s: number): number', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'number'. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments interface fn2 { @@ -114,11 +118,19 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints new fn4(true, null); // Error - ~~~~ -!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:91:9: Overload 1 of 2, '(n: string, m: any): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:91:9: Overload 2 of 2, '(n: number, m: any): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. new fn4(null, true); // Error - ~~~~ -!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:92:15: Overload 1 of 2, '(n: any, m: number): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. +!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:92:15: Overload 2 of 2, '(n: any, m: string): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors interface fn5 { diff --git a/tests/baselines/reference/overloadingOnConstants2.errors.txt b/tests/baselines/reference/overloadingOnConstants2.errors.txt index c12d77714a3..6d1be3d8f24 100644 --- a/tests/baselines/reference/overloadingOnConstants2.errors.txt +++ b/tests/baselines/reference/overloadingOnConstants2.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/overloadingOnConstants2.ts(9,10): error TS2394: This overload signature is not compatible with its implementation signature. -tests/cases/compiler/overloadingOnConstants2.ts(15,13): error TS2345: Argument of type '"um"' is not assignable to parameter of type '"bye"'. +tests/cases/compiler/overloadingOnConstants2.ts(15,9): error TS2755: No suitable overload for this call. tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overload signature is not compatible with its implementation signature. @@ -22,8 +22,12 @@ tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overl var a: D = foo("hi", []); // D var b: E = foo("bye", []); // E var c = foo("um", []); // error - ~~~~ -!!! error TS2345: Argument of type '"um"' is not assignable to parameter of type '"bye"'. + ~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/overloadingOnConstants2.ts:15:13: Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. + Argument of type '"um"' is not assignable to parameter of type '"hi"'. +!!! related TS2757 tests/cases/compiler/overloadingOnConstants2.ts:15:13: Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. + Argument of type '"um"' is not assignable to parameter of type '"bye"'. //function bar(x: "hi", items: string[]): D; diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt index 24476ecafd2..1804a123d84 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -3,9 +3,7 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,37): Property 'x' is missing in type 'D' but required in type 'A'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,38): error TS2344: Type 'D' does not satisfy the constraint 'A'. -tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,27): error TS2345: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. - Types of parameters 'x' and 'x' are incompatible. - Property 'q' is missing in type 'B' but required in type 'D'. +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,23): error TS2755: No suitable overload for this call. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): error TS2344: Type 'D' does not satisfy the constraint 'A'. @@ -38,14 +36,25 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): !!! error TS2344: Type 'D' does not satisfy the constraint 'A'. var result3: string = foo(x => { // x has type D - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. -!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2345: Property 'q' is missing in type 'B' but required in type 'D'. -!!! related TS2728 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~ var y: G; // error that D does not satisfy constraint, y is of type G, entire call to foo is an error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ !!! error TS2344: Type 'D' does not satisfy the constraint 'A'. return y; + ~~~~~~~~~~~~~ }); + ~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. + Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. + Type 'G' is not assignable to type 'number'. +!!! related TS2757 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. + Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. + Types of parameters 'x' and 'x' are incompatible. + Property 'q' is missing in type 'C' but required in type 'D'. +!!! related TS2757 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. + Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. + Types of parameters 'x' and 'x' are incompatible. + Property 'q' is missing in type 'B' but required in type 'D'. \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index c719d8a9b95..dfbc1f9a507 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -1,67 +1,133 @@ -tests/cases/compiler/promisePermutations.ts(74,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(79,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(82,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(83,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(84,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(88,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations.ts(93,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(97,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(100,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(101,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations.ts(102,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(106,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'cb' and 'value' are incompatible. - Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(109,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(110,19): error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. - Types of parameters 'cb' and 'value' are incompatible. - Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(111,19): error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'cb' and 'value' are incompatible. - Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(117,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(120,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -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,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. - Type 'IPromise' is not assignable to type '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,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. - Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations.ts(144,35): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -tests/cases/compiler/promisePermutations.ts(152,36): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. - Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -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'. - Type 'IPromise' is not assignable to type 'IPromise'. - Type 'number' is not assignable to type 'string'. -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'. - Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations.ts(159,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. - Type 'Promise' is not assignable to type 'IPromise'. - Types of property 'then' are incompatible. - Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. - Types of parameters 'onfulfilled' and 'success' are incompatible. - Types of parameters 'value' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/compiler/promisePermutations.ts(74,70): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. + Types of parameters 'x' and 'value' are incompatible. + Type 'IPromise' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations.ts(79,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. + Types of parameters 'x' and 'value' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations.ts(82,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. + Types of parameters 'x' and 'value' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations.ts(83,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. + Types of parameters 'x' and 'value' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations.ts(84,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. + Types of parameters 'x' and 'value' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations.ts(88,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +tests/cases/compiler/promisePermutations.ts(91,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +tests/cases/compiler/promisePermutations.ts(92,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +tests/cases/compiler/promisePermutations.ts(93,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +tests/cases/compiler/promisePermutations.ts(97,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +tests/cases/compiler/promisePermutations.ts(100,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +tests/cases/compiler/promisePermutations.ts(101,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +tests/cases/compiler/promisePermutations.ts(102,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +tests/cases/compiler/promisePermutations.ts(106,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. + Types of parameters 'cb' and 'value' are incompatible. + Type 'string' is not assignable to type '(a: T) => T'. +tests/cases/compiler/promisePermutations.ts(109,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +tests/cases/compiler/promisePermutations.ts(110,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. + Types of parameters 'cb' and 'value' are incompatible. + Type 'string' is not assignable to type '(a: T) => T'. +tests/cases/compiler/promisePermutations.ts(111,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. + Types of parameters 'cb' and 'value' are incompatible. + Type 'string' is not assignable to type '(a: T) => T'. +tests/cases/compiler/promisePermutations.ts(117,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +tests/cases/compiler/promisePermutations.ts(120,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +tests/cases/compiler/promisePermutations.ts(121,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + 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 TS2755: No suitable overload for this call. + The last overload gave the following error. + 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 TS2755: No suitable overload for this call. + The last overload gave the following error. + 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,33): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. + Type 'IPromise' is not assignable to type 'IPromise'. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations.ts(132,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + 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 TS2755: No suitable overload for this call. + The last overload gave the following error. + 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 TS2755: No suitable overload for this call. + The last overload gave the following error. + 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,33): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. + Type 'IPromise' is not assignable to type 'IPromise'. +tests/cases/compiler/promisePermutations.ts(144,35): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +tests/cases/compiler/promisePermutations.ts(152,36): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. + Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +tests/cases/compiler/promisePermutations.ts(156,21): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. + Type 'IPromise' is not assignable to type 'IPromise'. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/promisePermutations.ts(158,21): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. + Type 'IPromise' is not assignable to type 'IPromise'. +tests/cases/compiler/promisePermutations.ts(159,21): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. + Type 'Promise' is not assignable to type 'IPromise'. + Types of property 'then' are incompatible. + Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. + Types of parameters 'onfulfilled' and 'success' are incompatible. + Types of parameters 'value' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/promisePermutations.ts (33 errors) ==== @@ -140,92 +206,126 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t var s3c = s3.then(testFunction3P, testFunction3, testFunction3); var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'IPromise' is not assignable to type 'number'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. +!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2755: Type 'IPromise' is not assignable to type 'number'. var r4: IPromise; var sIPromise: (x: any) => IPromise; var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type 'number'. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type 'number'. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type 'number'. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type 'number'. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type '(a: T) => T'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type '(a: T) => T'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type '(a: T) => T'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -233,48 +333,68 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok ~~~~~~~~~ -!!! error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2755: Type 'string' is not assignable to type 'number'. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); @@ -283,7 +403,9 @@ 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 TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s10 = testFunction10P(x => x); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok @@ -293,36 +415,46 @@ 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 TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. -!!! error TS2345: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. +!!! error TS2755: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. !!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2755: Type 'number' is not assignable to type 'string'. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2755: Type 'number' is not assignable to type 'string'. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'IPromise'. -!!! error TS2345: Types of property 'then' are incompatible. -!!! error TS2345: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. -!!! error TS2345: Types of parameters 'onfulfilled' and 'success' are incompatible. -!!! error TS2345: Types of parameters 'value' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'IPromise'. +!!! error TS2755: Types of property 'then' are incompatible. +!!! error TS2755: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. +!!! error TS2755: Types of parameters 'onfulfilled' and 'success' are incompatible. +!!! error TS2755: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2755: Type 'number' is not assignable to type 'string'. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index b88ef28ca5c..5845b3ab9aa 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -1,9 +1,11 @@ tests/cases/compiler/promisePermutations2.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations2.ts(78,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'string' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations2.ts(78,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. + Types of parameters 'x' and 'value' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations2.ts(81,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. @@ -13,43 +15,65 @@ tests/cases/compiler/promisePermutations2.ts(82,19): error TS2345: Argument of t tests/cases/compiler/promisePermutations2.ts(83,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations2.ts(87,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +tests/cases/compiler/promisePermutations2.ts(87,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(90,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations2.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(96,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +tests/cases/compiler/promisePermutations2.ts(96,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(99,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(100,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations2.ts(101,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(105,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'cb' and 'value' are incompatible. - Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(108,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(109,19): error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. - Types of parameters 'cb' and 'value' are incompatible. - Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(110,19): error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'cb' and 'value' are incompatible. - Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(116,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +tests/cases/compiler/promisePermutations2.ts(105,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. + Types of parameters 'cb' and 'value' are incompatible. + Type 'string' is not assignable to type '(a: T) => T'. +tests/cases/compiler/promisePermutations2.ts(108,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +tests/cases/compiler/promisePermutations2.ts(109,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. + Types of parameters 'cb' and 'value' are incompatible. + Type 'string' is not assignable to type '(a: T) => T'. +tests/cases/compiler/promisePermutations2.ts(110,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. + Types of parameters 'cb' and 'value' are incompatible. + Type 'string' is not assignable to type '(a: T) => T'. +tests/cases/compiler/promisePermutations2.ts(116,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(119,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. 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,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. - Type 'IPromise' is not assignable to type 'IPromise'. - Type 'string' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations2.ts(125,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + 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,33): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. + Type 'IPromise' is not assignable to type '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,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations2.ts(143,35): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +tests/cases/compiler/promisePermutations2.ts(143,35): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. tests/cases/compiler/promisePermutations2.ts(151,36): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -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'. - Type 'IPromise' is not assignable to type 'IPromise'. - Type 'number' is not assignable to type 'string'. +tests/cases/compiler/promisePermutations2.ts(155,21): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. + Type 'IPromise' is not assignable to type 'IPromise'. + Type 'number' is not assignable to type 'string'. 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'. Type 'IPromise' is not assignable to type 'IPromise'. tests/cases/compiler/promisePermutations2.ts(158,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. @@ -148,9 +172,11 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type 'number'. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error @@ -173,7 +199,9 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error @@ -190,7 +218,9 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error @@ -207,24 +237,32 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type '(a: T) => T'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type '(a: T) => T'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type '(a: T) => T'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -232,7 +270,9 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error @@ -249,14 +289,18 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2755: Type 'string' is not assignable to type 'number'. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error @@ -282,7 +326,9 @@ 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 TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s10 = testFunction10P(x => x); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok @@ -300,9 +346,11 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2755: Type 'number' is not assignable to type 'string'. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 83a161af960..1e59f21ae1b 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -1,29 +1,49 @@ tests/cases/compiler/promisePermutations3.ts(68,69): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'IPromise' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations3.ts(73,70): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. + Types of parameters 'x' and 'value' are incompatible. + Type 'IPromise' is not assignable to type 'number'. tests/cases/compiler/promisePermutations3.ts(78,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(81,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(82,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(83,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'string' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations3.ts(81,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. + Types of parameters 'x' and 'value' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations3.ts(82,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. + Types of parameters 'x' and 'value' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations3.ts(83,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. + Types of parameters 'x' and 'value' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations3.ts(87,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(90,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations3.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +tests/cases/compiler/promisePermutations3.ts(90,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +tests/cases/compiler/promisePermutations3.ts(91,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +tests/cases/compiler/promisePermutations3.ts(92,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations3.ts(96,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(99,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(100,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations3.ts(101,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +tests/cases/compiler/promisePermutations3.ts(99,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +tests/cases/compiler/promisePermutations3.ts(100,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +tests/cases/compiler/promisePermutations3.ts(101,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations3.ts(105,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. @@ -35,36 +55,58 @@ tests/cases/compiler/promisePermutations3.ts(110,19): error TS2345: Argument of Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. tests/cases/compiler/promisePermutations3.ts(116,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(119,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -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(119,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +tests/cases/compiler/promisePermutations3.ts(120,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + 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 TS2755: No suitable overload for this call. + The last overload gave the following error. + 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,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type '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,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. - Type 'IPromise' is not assignable to type 'IPromise'. +tests/cases/compiler/promisePermutations3.ts(131,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + 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 TS2755: No suitable overload for this call. + The last overload gave the following error. + 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 TS2755: No suitable overload for this call. + The last overload gave the following error. + 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,33): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. + Type 'IPromise' is not assignable to type 'IPromise'. tests/cases/compiler/promisePermutations3.ts(143,35): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(151,36): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. - Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +tests/cases/compiler/promisePermutations3.ts(151,36): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. + Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. 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'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'number' is not assignable to type 'string'. -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'. - Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations3.ts(158,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations3.ts(159,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. - Type 'Promise' is not assignable to type 'IPromise'. - Types of property 'then' are incompatible. - Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. - Types of parameters 'onfulfilled' and 'success' are incompatible. - Types of parameters 'value' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/compiler/promisePermutations3.ts(157,21): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. + Type 'IPromise' is not assignable to type 'IPromise'. +tests/cases/compiler/promisePermutations3.ts(158,21): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/promisePermutations3.ts(159,21): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. + Type 'Promise' is not assignable to type 'IPromise'. + Types of property 'then' are incompatible. + Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. + Types of parameters 'onfulfilled' and 'success' are incompatible. + Types of parameters 'value' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of type '{ (x: T): IPromise; (x: T, y: T): Promise; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. @@ -148,9 +190,11 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s3c = s3.then(testFunction3P, testFunction3, testFunction3); var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'IPromise' is not assignable to type 'number'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. +!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2755: Type 'IPromise' is not assignable to type 'number'. var r4: IPromise; var sIPromise: (x: any) => IPromise; @@ -164,19 +208,25 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type 'number'. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type 'number'. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type 'number'. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; @@ -187,13 +237,19 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; @@ -204,13 +260,19 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; @@ -246,13 +308,19 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; @@ -270,19 +338,27 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); @@ -301,8 +377,10 @@ 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 TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. -!!! error TS2345: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. +!!! error TS2755: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. !!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok @@ -315,22 +393,28 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2755: Type 'number' is not assignable to type 'string'. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'IPromise'. -!!! error TS2345: Types of property 'then' are incompatible. -!!! error TS2345: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. -!!! error TS2345: Types of parameters 'onfulfilled' and 'success' are incompatible. -!!! error TS2345: Types of parameters 'value' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'IPromise'. +!!! error TS2755: Types of property 'then' are incompatible. +!!! error TS2755: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. +!!! error TS2755: Types of parameters 'onfulfilled' and 'success' are incompatible. +!!! error TS2755: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2755: Type 'number' is not assignable to type 'string'. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index c58b98b3949..72821c437af 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -11,7 +11,7 @@ tests/cases/compiler/recursiveFunctionTypes.ts(30,10): error TS2394: This overlo tests/cases/compiler/recursiveFunctionTypes.ts(33,8): error TS2554: Expected 0-1 arguments, but got 2. tests/cases/compiler/recursiveFunctionTypes.ts(34,4): error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. tests/cases/compiler/recursiveFunctionTypes.ts(42,8): error TS2554: Expected 0-1 arguments, but got 2. -tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. +tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/recursiveFunctionTypes.ts (13 errors) ==== @@ -84,6 +84,12 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of ~ !!! error TS2554: Expected 0-1 arguments, but got 2. f7(""); // ok (function takes an any param) - ~~ -!!! error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. + ~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. + Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. +!!! related TS2757 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 2 of 4, '(a: number): number', gave the following error. + Argument of type '""' is not assignable to parameter of type 'number'. +!!! related TS2757 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 3 of 4, '(a?: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }', gave the following error. + Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. f7(); // ok \ No newline at end of file diff --git a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt index cf294de7780..8757e85713a 100644 --- a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt +++ b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(7,4): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. -tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,4): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. +tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(7,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts (2 errors) ==== @@ -10,8 +10,20 @@ tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,4): error TS2 } // both are errors x3(1, (x: string) => 1); - ~ -!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:7:7: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. + Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number' is not assignable to type 'string'. +!!! related TS2757 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:7:4: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. + Argument of type '1' is not assignable to parameter of type 'string'. x3(1, (x: 'hm') => 1); - ~ -!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. \ No newline at end of file + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:8:7: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. + Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number' is not assignable to type '"hm"'. +!!! related TS2757 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:8:4: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. + Argument of type '1' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt index 40a3321fe61..187d7dab5cc 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(9,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(11,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(11,9): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,9): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,9): error TS2755: No suitable overload for this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,20): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,9): error TS2755: No suitable overload for this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4. @@ -27,14 +27,26 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio ~~ !!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var c = foo([], 1, 2); // boolean - ~~ -!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. + ~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:11:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:11:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var d = foo([], 1, true); // boolean (with error) - ~~ -!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. + ~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:12:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:12:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var e = foo([], 1, "2"); // {} - ~~ -!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. + ~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:13:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:13:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var f = foo([], 1, 2, 3); // any (with error) ~ !!! error TS2554: Expected 1-3 arguments, but got 4. @@ -43,8 +55,12 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var v = foo `${1}`; // string var w = foo `${1}${2}`; // boolean var x = foo `${1}${true}`; // boolean (with error) - ~~~~ -!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:19:20: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:19:20: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. var y = foo `${1}${"2"}`; // {} var z = foo `${1}${2}${3}`; // any (with error) ~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt index eb7d2f510a8..150c66be410 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(9,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,9): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,9): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,9): error TS2755: No suitable overload for this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,20): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,9): error TS2755: No suitable overload for this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4. @@ -27,14 +27,26 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio ~~ !!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var c = foo([], 1, 2); // boolean - ~~ -!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. + ~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:11:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:11:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var d = foo([], 1, true); // boolean (with error) - ~~ -!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. + ~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:12:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:12:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var e = foo([], 1, "2"); // {} - ~~ -!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. + ~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:13:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:13:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var f = foo([], 1, 2, 3); // any (with error) ~ !!! error TS2554: Expected 1-3 arguments, but got 4. @@ -43,8 +55,12 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var v = foo `${1}`; // string var w = foo `${1}${2}`; // boolean var x = foo `${1}${true}`; // boolean (with error) - ~~~~ -!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:19:20: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:19:20: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. var y = foo `${1}${"2"}`; // {} var z = foo `${1}${2}${3}`; // any (with error) ~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt index a3be7fbc7f7..4d5ec42700c 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(9,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(9,1): error TS2755: No suitable overload for this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(62,9): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,18): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(62,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,1): error TS2755: No suitable overload for this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(69,18): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -16,8 +16,12 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // No candidate overloads found fn1 `${ {} }`; // Error - ~~ -!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. + ~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:9:9: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:9:9: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'number'. function fn2(strs: TemplateStringsArray, s: string, n: number): number; function fn2(strs: TemplateStringsArray, n: number, t: T): T; @@ -76,11 +80,19 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4 `${ true }${ null }`; - ~~~~ -!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:62:9: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:62:9: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; - ~~~~ -!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:63:18: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:63:18: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt index c5063689b51..2e1e1f2ffc1 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,1): error TS2755: No suitable overload for this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,9): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,18): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,1): error TS2755: No suitable overload for this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(69,18): error TS2551: Property 'toFixed' does not exist on type 'string'. Did you mean 'fixed'? @@ -16,8 +16,12 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // No candidate overloads found fn1 `${ {} }`; // Error - ~~ -!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. + ~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:9:9: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:9:9: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'number'. function fn2(strs: TemplateStringsArray, s: string, n: number): number; function fn2(strs: TemplateStringsArray, n: number, t: T): T; @@ -76,11 +80,19 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4 `${ true }${ null }`; - ~~~~ -!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:62:9: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:62:9: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; - ~~~~ -!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:63:18: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. +!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:63:18: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; diff --git a/tests/baselines/reference/tsxElementResolution9.errors.txt b/tests/baselines/reference/tsxElementResolution9.errors.txt index acfe7ce9cca..b350fe0fdbc 100644 --- a/tests/baselines/reference/tsxElementResolution9.errors.txt +++ b/tests/baselines/reference/tsxElementResolution9.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/jsx/file.tsx(11,2): error TS2322: Type '{}' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(18,2): error TS2322: Type '{}' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(25,2): error TS2322: Type '{ x: number; }' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(11,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(18,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No suitable overload for this call. ==== tests/cases/conformance/jsx/file.tsx (3 errors) ==== @@ -15,8 +15,12 @@ tests/cases/conformance/jsx/file.tsx(25,2): error TS2322: Type '{ x: number; }' } var Obj1: Obj1; ; // Error, return type is not an object type - ~~~~ -!!! error TS2322: Type '{}' is not assignable to type 'number'. + ~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:11:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. + Type '{}' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:11:2: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. + Type '{}' is not assignable to type 'number'. interface Obj2 { (n: string): { x: number }; @@ -24,8 +28,12 @@ tests/cases/conformance/jsx/file.tsx(25,2): error TS2322: Type '{ x: number; }' } var Obj2: Obj2; ; // Error, return type is not an object type - ~~~~ -!!! error TS2322: Type '{}' is not assignable to type 'number'. + ~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:18:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. + Type '{}' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:18:2: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. + Type '{}' is not assignable to type 'number'. interface Obj3 { (n: string): { x: number }; @@ -33,6 +41,10 @@ tests/cases/conformance/jsx/file.tsx(25,2): error TS2322: Type '{ x: number; }' } var Obj3: Obj3; ; // OK - ~~~~ -!!! error TS2322: Type '{ x: number; }' is not assignable to type 'number'. + ~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:25:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. + Type '{ x: number; }' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:25:2: Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. + Type '{ x: number; }' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt index 7fe6609cc96..e06fffebe85 100644 --- a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt +++ b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(14,14): error TS2322: Type '{}' is not assignable to type 'P'. '{}' is assignable to the constraint of type 'P', but 'P' could be instantiated with a different subtype of constraint '{}'. -tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,14): error TS2322: Type '{}' is not assignable to type 'Readonly

'. +tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx (2 errors) ==== @@ -22,8 +22,12 @@ tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,14): error TS2322: Type !!! error TS2322: Type '{}' is not assignable to type 'P'. !!! error TS2322: '{}' is assignable to the constraint of type 'P', but 'P' could be instantiated with a different subtype of constraint '{}'. let y = ; // should error - ~~~~~~~~~~~ -!!! error TS2322: Type '{}' is not assignable to type 'Readonly

'. + ~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx:15:14: Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. + Type '{}' is not assignable to type 'Readonly

'. +!!! related TS2757 tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx:15:14: Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. + Type '{}' is not assignable to type 'Readonly

'. let z = // should work let q = // should work diff --git a/tests/baselines/reference/underscoreTest1.errors.txt b/tests/baselines/reference/underscoreTest1.errors.txt index 66fc8961eef..971650a4f14 100644 --- a/tests/baselines/reference/underscoreTest1.errors.txt +++ b/tests/baselines/reference/underscoreTest1.errors.txt @@ -1,5 +1,4 @@ -tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,7): error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. - Index signature is missing in type '(string | number | boolean)[]'. +tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/underscoreTest1_underscoreTests.ts (1 errors) ==== @@ -29,9 +28,15 @@ tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,7): error TS2345: Arg var odds = _.reject([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); _.all([true, 1, null, 'yes'], _.identity); - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. -!!! error TS2345: Index signature is missing in type '(string | number | boolean)[]'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/underscoreTest1_underscoreTests.ts:26:31: Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. + Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. + Type 'string | number | boolean' is not assignable to type 'boolean'. + Type 'string' is not assignable to type 'boolean'. +!!! related TS2757 tests/cases/compiler/underscoreTest1_underscoreTests.ts:26:7: Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. + Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. + Index signature is missing in type '(string | number | boolean)[]'. _.any([null, 0, 'yes', false]); diff --git a/tests/baselines/reference/unionTypeCallSignatures.errors.txt b/tests/baselines/reference/unionTypeCallSignatures.errors.txt index 2c80ac58cc8..9ae0bfaaa9d 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeCallSignatures.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(9,43): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(10,29): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,29): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(10,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,1): error TS2755: No suitable overload for this call. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(16,1): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(19,32): error TS2345: Argument of type '10' is not assignable to parameter of type 'never'. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(20,32): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'never'. @@ -40,15 +40,23 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 ~~~~~~~ !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. unionOfDifferentReturnType1(true); // error in type of parameter - ~~~~ -!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:10:29: Overload 1 of 2, '(a: number): number | Date', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. +!!! related TS2757 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:10:29: Overload 2 of 2, '(a: string): string | boolean', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. var unionOfDifferentReturnType1: { (a: number): number; (a: string): string; } | { (a: number): Date; (a: string): boolean; }; numOrDate = unionOfDifferentReturnType1(10); strOrBoolean = unionOfDifferentReturnType1("hello"); unionOfDifferentReturnType1(true); // error in type of parameter - ~~~~ -!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:15:29: Overload 1 of 2, '(a: number): number | Date', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. +!!! related TS2757 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:15:29: Overload 2 of 2, '(a: string): string | boolean', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. unionOfDifferentReturnType1(); // error missing parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. diff --git a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt index d46f616e53e..d0eadc3cedc 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(9,47): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(10,33): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,33): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(10,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,1): error TS2755: No suitable overload for this call. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(16,1): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(19,36): error TS2345: Argument of type '10' is not assignable to parameter of type 'never'. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(20,36): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'never'. @@ -39,15 +39,23 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro ~~~~~~~ !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. new unionOfDifferentReturnType1(true); // error in type of parameter - ~~~~ -!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:10:33: Overload 1 of 2, '(a: number): number | Date', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. +!!! related TS2757 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:10:33: Overload 2 of 2, '(a: string): string | boolean', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. var unionOfDifferentReturnType1: { new (a: number): number; new (a: string): string; } | { new (a: number): Date; new (a: string): boolean; }; numOrDate = new unionOfDifferentReturnType1(10); strOrBoolean = new unionOfDifferentReturnType1("hello"); new unionOfDifferentReturnType1(true); // error in type of parameter - ~~~~ -!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:15:33: Overload 1 of 2, '(a: number): number | Date', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. +!!! related TS2757 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:15:33: Overload 2 of 2, '(a: string): string | boolean', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. new unionOfDifferentReturnType1(); // error missing parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. From 7bbd2992268589d47b4061abf88508a21c9b5aa7 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 24 Jun 2019 15:19:43 -0700 Subject: [PATCH 26/95] Look at properties of constraint-instantiated optional mapped types when deciding assignability --- src/compiler/checker.ts | 8 +- ...nalNoInfiniteInstantiationDepth.errors.txt | 170 ++++++++++++------ .../mappedTypeRelationships.errors.txt | 6 + .../reference/mappedTypeRelationships.js | 15 ++ .../reference/mappedTypeRelationships.symbols | 19 ++ .../reference/mappedTypeRelationships.types | 15 ++ ...ferredInferenceAllowsAssignment.errors.txt | 170 ++++++++++++------ .../types/mapped/mappedTypeRelationships.ts | 6 + 8 files changed, 293 insertions(+), 116 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a3abe1dc5b5..8feb1d4a412 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13200,14 +13200,14 @@ namespace ts { if (!isGenericMappedType(source)) { const targetConstraint = getConstraintTypeFromMappedType(target); const sourceKeys = getIndexType(source, /*stringsOnly*/ undefined, /*noIndexSignatures*/ true); - const hasOptionalUnionKeys = modifiers & MappedTypeModifiers.IncludeOptional && targetConstraint.flags & TypeFlags.Union; - const filteredByApplicability = hasOptionalUnionKeys ? filterType(targetConstraint, t => !!isRelatedTo(t, sourceKeys)) : undefined; + const includeOptional = modifiers & MappedTypeModifiers.IncludeOptional; + const filteredByApplicability = includeOptional ? filterType(getLiteralTypeFromProperties(target, TypeFlags.StringOrNumberLiteralOrUnique), t => !!isRelatedTo(t, sourceKeys)) : undefined; // A source type T is related to a target type { [P in Q]: X } if Q is related to keyof T and T[Q] is related to X. // A source type T is related to a target type { [P in Q]?: X } if some constituent Q' of Q is related to keyof T and T[Q'] is related to X. - if (hasOptionalUnionKeys + if (includeOptional ? !(filteredByApplicability!.flags & TypeFlags.Never) : isRelatedTo(targetConstraint, sourceKeys)) { - const indexingType = hasOptionalUnionKeys ? filteredByApplicability! : getTypeParameterFromMappedType(target); + const indexingType = filteredByApplicability || getTypeParameterFromMappedType(target); const indexedAccessType = getIndexedAccessType(source, indexingType); const templateType = getTemplateTypeFromMappedType(target); if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { diff --git a/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt b/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt index 74835c4a55b..2c5fc84b37c 100644 --- a/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt +++ b/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt @@ -4,35 +4,64 @@ tests/cases/compiler/circularlyConstrainedMappedTypeContainingConditionalNoInfin Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. Type 'GetProps[P] | (TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. Type 'GetProps[P]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[Extract>] | (TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[keyof GetProps & string] | (TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>] | (TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>] | GetProps[Extract>] | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>] | GetProps[Extract>] | GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[string] | (TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]) | GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] | GetProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & string] | GetProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. ==== tests/cases/compiler/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.ts (1 errors) ==== @@ -106,33 +135,62 @@ tests/cases/compiler/circularlyConstrainedMappedTypeContainingConditionalNoInfin !!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. !!! error TS2344: Type 'GetProps[P] | (TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. !!! error TS2344: Type 'GetProps[P]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[Extract>] | (TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[keyof GetProps & string] | (TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>] | (TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>] | GetProps[Extract>] | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>] | GetProps[Extract>] | GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. !!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[string] | (TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]) | GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] | GetProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] | GetProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. \ No newline at end of file diff --git a/tests/baselines/reference/mappedTypeRelationships.errors.txt b/tests/baselines/reference/mappedTypeRelationships.errors.txt index 6e76eb4721c..8f33c7414b1 100644 --- a/tests/baselines/reference/mappedTypeRelationships.errors.txt +++ b/tests/baselines/reference/mappedTypeRelationships.errors.txt @@ -386,4 +386,10 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS function f82(t: T, k1: K1, k2: K2): Partial { return t[k1][k2]; } + + // #31070 + type Numeric = { [K in keyof T]?: number }; + function f90() { + const n: Numeric = { x: 1 }; + } \ No newline at end of file diff --git a/tests/baselines/reference/mappedTypeRelationships.js b/tests/baselines/reference/mappedTypeRelationships.js index 8bd44da5658..ea448f5fb92 100644 --- a/tests/baselines/reference/mappedTypeRelationships.js +++ b/tests/baselines/reference/mappedTypeRelationships.js @@ -180,6 +180,12 @@ function f81(t: T, k: K): Partial { function f82(t: T, k1: K1, k2: K2): Partial { return t[k1][k2]; } + +// #31070 +type Numeric = { [K in keyof T]?: number }; +function f90() { + const n: Numeric = { x: 1 }; +} //// [mappedTypeRelationships.js] @@ -310,6 +316,9 @@ function f81(t, k) { function f82(t, k1, k2) { return t[k1][k2]; } +function f90() { + var n = { x: 1 }; +} //// [mappedTypeRelationships.d.ts] @@ -393,3 +402,9 @@ declare function f76(x: { declare function f80(t: T): Partial; declare function f81(t: T, k: K): Partial; declare function f82(t: T, k1: K1, k2: K2): Partial; +declare type Numeric = { + [K in keyof T]?: number; +}; +declare function f90(): void; diff --git a/tests/baselines/reference/mappedTypeRelationships.symbols b/tests/baselines/reference/mappedTypeRelationships.symbols index 39d82b5b857..c70cf1c07a0 100644 --- a/tests/baselines/reference/mappedTypeRelationships.symbols +++ b/tests/baselines/reference/mappedTypeRelationships.symbols @@ -805,3 +805,22 @@ function f82(t: T, k1: K1, k2: K2 >k2 : Symbol(k2, Decl(mappedTypeRelationships.ts, 178, 73)) } +// #31070 +type Numeric = { [K in keyof T]?: number }; +>Numeric : Symbol(Numeric, Decl(mappedTypeRelationships.ts, 180, 1)) +>T : Symbol(T, Decl(mappedTypeRelationships.ts, 183, 13)) +>K : Symbol(K, Decl(mappedTypeRelationships.ts, 183, 21)) +>T : Symbol(T, Decl(mappedTypeRelationships.ts, 183, 13)) + +function f90() { +>f90 : Symbol(f90, Decl(mappedTypeRelationships.ts, 183, 46)) +>T : Symbol(T, Decl(mappedTypeRelationships.ts, 184, 13)) +>x : Symbol(x, Decl(mappedTypeRelationships.ts, 184, 24)) + + const n: Numeric = { x: 1 }; +>n : Symbol(n, Decl(mappedTypeRelationships.ts, 185, 9)) +>Numeric : Symbol(Numeric, Decl(mappedTypeRelationships.ts, 180, 1)) +>T : Symbol(T, Decl(mappedTypeRelationships.ts, 184, 13)) +>x : Symbol(x, Decl(mappedTypeRelationships.ts, 185, 27)) +} + diff --git a/tests/baselines/reference/mappedTypeRelationships.types b/tests/baselines/reference/mappedTypeRelationships.types index 0922ee18340..b130e05bfa5 100644 --- a/tests/baselines/reference/mappedTypeRelationships.types +++ b/tests/baselines/reference/mappedTypeRelationships.types @@ -653,3 +653,18 @@ function f82(t: T, k1: K1, k2: K2 >k2 : K2 } +// #31070 +type Numeric = { [K in keyof T]?: number }; +>Numeric : Numeric + +function f90() { +>f90 : () => void +>x : number + + const n: Numeric = { x: 1 }; +>n : Numeric +>{ x: 1 } : { x: number; } +>x : number +>1 : 1 +} + diff --git a/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.errors.txt b/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.errors.txt index 8c7e2f57eda..6267b5299ad 100644 --- a/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.errors.txt +++ b/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.errors.txt @@ -4,35 +4,64 @@ tests/cases/compiler/reactReduxLikeDeferredInferenceAllowsAssignment.ts(76,50): Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. Type 'GetProps[P] | (TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. Type 'GetProps[P]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[Extract>] | (TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[keyof GetProps & string] | (TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>] | (TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>] | GetProps[Extract>] | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>] | GetProps[Extract>] | GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[string] | (TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]) | GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] | GetProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & string] | GetProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. ==== tests/cases/compiler/reactReduxLikeDeferredInferenceAllowsAssignment.ts (1 errors) ==== @@ -119,35 +148,64 @@ tests/cases/compiler/reactReduxLikeDeferredInferenceAllowsAssignment.ts(76,50): !!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. !!! error TS2344: Type 'GetProps[P] | (TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. !!! error TS2344: Type 'GetProps[P]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[Extract>] | (TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[keyof GetProps & string] | (TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>] | (TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>] | GetProps[Extract>] | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>] | GetProps[Extract>] | GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. !!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[string] | (TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]) | GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] | GetProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] | GetProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. >; declare const connect: { diff --git a/tests/cases/conformance/types/mapped/mappedTypeRelationships.ts b/tests/cases/conformance/types/mapped/mappedTypeRelationships.ts index 9e8639bbb9e..f140d84687a 100644 --- a/tests/cases/conformance/types/mapped/mappedTypeRelationships.ts +++ b/tests/cases/conformance/types/mapped/mappedTypeRelationships.ts @@ -182,3 +182,9 @@ function f81(t: T, k: K): Partial { function f82(t: T, k1: K1, k2: K2): Partial { return t[k1][k2]; } + +// #31070 +type Numeric = { [K in keyof T]?: number }; +function f90() { + const n: Numeric = { x: 1 }; +} From ecfa902ba1aa502943dda2d5d673c3e08e915af7 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 24 Jun 2019 15:32:58 -0700 Subject: [PATCH 27/95] Use existing reporting mechanism --- src/compiler/checker.ts | 245 ++++++++++++------ ...elessFunctionComponentOverload5.errors.txt | 49 ++-- ...xStatelessFunctionComponentOverload5.types | 6 +- 3 files changed, 198 insertions(+), 102 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 614eaeab71f..06066e3120e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11668,52 +11668,76 @@ namespace ts { * attempt to issue more specific errors on, for example, specific object literal properties or tuple members. */ function checkTypeAssignableToAndOptionallyElaborate(source: Type, target: Type, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined): boolean { - return checkTypeRelatedToAndOptionallyElaborate(source, target, assignableRelation, errorNode, expr, headMessage, containingMessageChain); + return checkTypeRelatedToAndOptionallyElaborate(source, target, assignableRelation, errorNode, expr, headMessage, containingMessageChain, /*errorOutputContainer*/ undefined); } - function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined): boolean; - function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): [Node, DiagnosticMessageChain, DiagnosticRelatedInformation[]?] | false; - function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): boolean | [Node, DiagnosticMessageChain, DiagnosticRelatedInformation[]?] { - if (isTypeRelatedTo(source, target, relation)) return breakdown ? false : true; - if (!errorNode || !elaborateError(expr, source, target, relation, headMessage)) { - return checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, undefined, breakdown); + function checkTypeRelatedToAndOptionallyElaborate( + source: Type, + target: Type, + relation: Map, + errorNode: Node | undefined, + expr: Expression | undefined, + headMessage: DiagnosticMessage | undefined, + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + ): boolean { + if (isTypeRelatedTo(source, target, relation)) return true; + if (!errorNode || !elaborateError(expr, source, target, relation, headMessage, errorOutputContainer)) { + return checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer); } - return breakdown ? [undefined!,undefined!] as [Node, DiagnosticMessageChain] : false; + return false; } function isOrHasGenericConditional(type: Type): boolean { return !!(type.flags & TypeFlags.Conditional || (type.flags & TypeFlags.Intersection && some((type as IntersectionType).types, isOrHasGenericConditional))); } - function elaborateError(node: Expression | undefined, source: Type, target: Type, relation: Map, headMessage: DiagnosticMessage | undefined): boolean { + function elaborateError( + node: Expression | undefined, + source: Type, + target: Type, + relation: Map, + headMessage: DiagnosticMessage | undefined, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + ): boolean { + // TODO: The first case probably still needs to set errorOutputContainer.error to something + // TODO: Make sure all error logging in dynamic scope sets errorOutputContainer.error instead if (!node || isOrHasGenericConditional(target)) return false; - if (!checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined) && elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage)) { + if (!checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined) + && elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage, errorOutputContainer)) { return true; } switch (node.kind) { case SyntaxKind.JsxExpression: case SyntaxKind.ParenthesizedExpression: - return elaborateError((node as ParenthesizedExpression | JsxExpression).expression, source, target, relation, headMessage); + return elaborateError((node as ParenthesizedExpression | JsxExpression).expression, source, target, relation, headMessage, errorOutputContainer); case SyntaxKind.BinaryExpression: switch ((node as BinaryExpression).operatorToken.kind) { case SyntaxKind.EqualsToken: case SyntaxKind.CommaToken: - return elaborateError((node as BinaryExpression).right, source, target, relation, headMessage); + return elaborateError((node as BinaryExpression).right, source, target, relation, headMessage, errorOutputContainer); } break; case SyntaxKind.ObjectLiteralExpression: - return elaborateObjectLiteral(node as ObjectLiteralExpression, source, target, relation); + return elaborateObjectLiteral(node as ObjectLiteralExpression, source, target, relation, errorOutputContainer); case SyntaxKind.ArrayLiteralExpression: - return elaborateArrayLiteral(node as ArrayLiteralExpression, source, target, relation); + return elaborateArrayLiteral(node as ArrayLiteralExpression, source, target, relation, errorOutputContainer); case SyntaxKind.JsxAttributes: - return elaborateJsxComponents(node as JsxAttributes, source, target, relation); + return elaborateJsxComponents(node as JsxAttributes, source, target, relation, errorOutputContainer); case SyntaxKind.ArrowFunction: - return elaborateArrowFunction(node as ArrowFunction, source, target, relation); + return elaborateArrowFunction(node as ArrowFunction, source, target, relation, errorOutputContainer); } return false; } - function elaborateDidYouMeanToCallOrConstruct(node: Expression, source: Type, target: Type, relation: Map, headMessage: DiagnosticMessage | undefined): boolean { + function elaborateDidYouMeanToCallOrConstruct( + node: Expression, + source: Type, + target: Type, + relation: Map, + headMessage: DiagnosticMessage | undefined, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + ): boolean { const callSignatures = getSignaturesOfType(source, SignatureKind.Call); const constructSignatures = getSignaturesOfType(source, SignatureKind.Construct); for (const signatures of [constructSignatures, callSignatures]) { @@ -11721,7 +11745,7 @@ namespace ts { const returnType = getReturnTypeOfSignature(s); return !(returnType.flags & (TypeFlags.Any | TypeFlags.Never)) && checkTypeRelatedTo(returnType, target, relation, /*errorNode*/ undefined); })) { - const resultObj: { error?: Diagnostic } = {}; + const resultObj: { error?: Diagnostic } = errorOutputContainer || {}; checkTypeAssignableTo(source, target, node, headMessage, /*containingChain*/ undefined, resultObj); const diagnostic = resultObj.error!; addRelatedInfo(diagnostic, createDiagnosticForNode( @@ -11734,7 +11758,13 @@ namespace ts { return false; } - function elaborateArrowFunction(node: ArrowFunction, source: Type, target: Type, relation: Map): boolean { + function elaborateArrowFunction( + node: ArrowFunction, + source: Type, + target: Type, + relation: Map, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + ): boolean { // Don't elaborate blocks if (isBlock(node.body)) { return false; @@ -11755,11 +11785,11 @@ namespace ts { const sourceReturn = getReturnTypeOfSignature(sourceSig); const targetReturn = getUnionType(map(targetSignatures, getReturnTypeOfSignature)); if (!checkTypeRelatedTo(sourceReturn, targetReturn, relation, /*errorNode*/ undefined)) { - const elaborated = returnExpression && elaborateError(returnExpression, sourceReturn, targetReturn, relation, /*headMessage*/ undefined); + const elaborated = returnExpression && elaborateError(returnExpression, sourceReturn, targetReturn, relation, /*headMessage*/ undefined, errorOutputContainer); if (elaborated) { return elaborated; } - const resultObj: { error?: Diagnostic } = {}; + const resultObj: { error?: Diagnostic } = errorOutputContainer || {}; checkTypeRelatedTo(sourceReturn, targetReturn, relation, returnExpression, /*message*/ undefined, /*chain*/ undefined, resultObj); if (resultObj.error) { if (target.symbol && length(target.symbol.declarations)) { @@ -11780,7 +11810,13 @@ namespace ts { * If that element would issue an error, we first attempt to dive into that element's inner expression and issue a more specific error by recuring into `elaborateError` * Otherwise, we issue an error on _every_ element which fail the assignability check */ - function elaborateElementwise(iterator: ElaborationIterator, source: Type, target: Type, relation: Map) { + function elaborateElementwise( + iterator: ElaborationIterator, + source: Type, + target: Type, + relation: Map, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + ) { // Assignability failure - check each prop individually, and if that fails, fall back on the bad error span let reportedError = false; for (let status = iterator.next(); !status.done; status = iterator.next()) { @@ -11789,13 +11825,13 @@ namespace ts { if (!targetPropType || targetPropType.flags & TypeFlags.IndexedAccess) continue; // Don't elaborate on indexes on generic variables const sourcePropType = getIndexedAccessTypeOrUndefined(source, nameType); if (sourcePropType && !checkTypeRelatedTo(sourcePropType, targetPropType, relation, /*errorNode*/ undefined)) { - const elaborated = next && elaborateError(next, sourcePropType, targetPropType, relation, /*headMessage*/ undefined); + const elaborated = next && elaborateError(next, sourcePropType, targetPropType, relation, /*headMessage*/ undefined, errorOutputContainer); if (elaborated) { reportedError = true; } else { // Issue error on the prop itself, since the prop couldn't elaborate the error - const resultObj: { error?: Diagnostic } = {}; + const resultObj: { error?: Diagnostic } = errorOutputContainer || {}; // Use the expression type, if available const specificSource = next ? checkExpressionForMutableLocation(next, CheckMode.Normal, sourcePropType) : sourcePropType; const result = checkTypeRelatedTo(specificSource, targetPropType, relation, prop, errorMessage, /*containingChain*/ undefined, resultObj); @@ -11887,8 +11923,14 @@ namespace ts { return filter(children, i => !isJsxText(i) || !i.containsOnlyTriviaWhiteSpaces); } - function elaborateJsxComponents(node: JsxAttributes, source: Type, target: Type, relation: Map) { - let result = elaborateElementwise(generateJsxAttributes(node), source, target, relation); + function elaborateJsxComponents( + node: JsxAttributes, + source: Type, + target: Type, + relation: Map, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + ) { + let result = elaborateElementwise(generateJsxAttributes(node), source, target, relation, errorOutputContainer); let invalidTextDiagnostic: DiagnosticMessage | undefined; if (isJsxOpeningElement(node.parent) && isJsxElement(node.parent.parent)) { const containingElement = node.parent.parent; @@ -11906,17 +11948,21 @@ namespace ts { if (moreThanOneRealChildren) { if (arrayLikeTargetParts !== neverType) { const realSource = createTupleType(checkJsxChildren(containingElement, CheckMode.Normal)); - result = elaborateElementwise(generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic), realSource, arrayLikeTargetParts, relation) || result; + const children = generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic) + result = elaborateElementwise(children, realSource, arrayLikeTargetParts, relation, errorOutputContainer) || result; } else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { // arity mismatch result = true; - error( + const diag = error( containingElement.openingElement.tagName, Diagnostics.This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided, childrenPropName, typeToString(childrenTargetType) ); + if (errorOutputContainer && errorOutputContainer.skipLogging) { + errorOutputContainer.error = diag; + } } } else { @@ -11928,19 +11974,23 @@ namespace ts { (function*() { yield elem; })(), source, target, - relation + relation, + errorOutputContainer ) || result; } } else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { // arity mismatch result = true; - error( + const diag = error( containingElement.openingElement.tagName, Diagnostics.This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided, childrenPropName, typeToString(childrenTargetType) ); + if (errorOutputContainer && errorOutputContainer.skipLogging) { + errorOutputContainer.error = diag; + } } } } @@ -11972,15 +12022,21 @@ namespace ts { } } - function elaborateArrayLiteral(node: ArrayLiteralExpression, source: Type, target: Type, relation: Map) { + function elaborateArrayLiteral( + node: ArrayLiteralExpression, + source: Type, + target: Type, + relation: Map, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + ) { if (target.flags & TypeFlags.Primitive) return false; if (isTupleLikeType(source)) { - return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation); + return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, errorOutputContainer); } // recreate a tuple from the elements, if possible const tupleizedType = checkArrayLiteral(node, CheckMode.Contextual, /*forceTuple*/ true); if (isTupleLikeType(tupleizedType)) { - return elaborateElementwise(generateLimitedTupleElements(node, target), tupleizedType, target, relation); + return elaborateElementwise(generateLimitedTupleElements(node, target), tupleizedType, target, relation, errorOutputContainer); } return false; } @@ -12009,9 +12065,15 @@ namespace ts { } } - function elaborateObjectLiteral(node: ObjectLiteralExpression, source: Type, target: Type, relation: Map) { + function elaborateObjectLiteral( + node: ObjectLiteralExpression, + source: Type, + target: Type, + relation: Map, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + ) { if (target.flags & TypeFlags.Primitive) return false; - return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation); + return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, errorOutputContainer); } /** @@ -12343,25 +12405,6 @@ namespace ts { return getObjectFlags(source) & ObjectFlags.JsxAttributes && !isUnhyphenatedJsxName(sourceProp.escapedName); } - function checkTypeRelatedTo( - source: Type, - target: Type, - relation: Map, - errorNode: Node | undefined, - headMessage?: DiagnosticMessage, - containingMessageChain?: () => DiagnosticMessageChain | undefined, - errorOutputContainer?: { error?: Diagnostic }, - ): boolean; - function checkTypeRelatedTo( - source: Type, - target: Type, - relation: Map, - errorNode: Node | undefined, - headMessage?: DiagnosticMessage, - containingMessageChain?: () => DiagnosticMessageChain | undefined, - errorOutputContainer?: { error?: Diagnostic }, - breakdown?: boolean - ): false | [Node, DiagnosticMessageChain, DiagnosticRelatedInformation[]?]; /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). * @param source The left-hand-side of the relation. @@ -12371,6 +12414,7 @@ namespace ts { * @param errorNode The suggested node upon which all errors will be reported, if defined. This may or may not be the actual node used. * @param headMessage If the error chain should be prepended by a head message, then headMessage will be used. * @param containingMessageChain A chain of errors to prepend any new errors found. + * @param errorOutputContainer Return the diagnostic. Do not log if 'skipLogging' is truthy. */ function checkTypeRelatedTo( source: Type, @@ -12379,9 +12423,8 @@ namespace ts { errorNode: Node | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, - errorOutputContainer?: { error?: Diagnostic }, - breakdown?: boolean - ): boolean | [Node, DiagnosticMessageChain, DiagnosticRelatedInformation[]?] { + errorOutputContainer?: { error?: Diagnostic, skipLogging?: boolean }, + ): boolean { let errorInfo: DiagnosticMessageChain | undefined; let relatedInfo: [DiagnosticRelatedInformation, ...DiagnosticRelatedInformation[]] | undefined; let maybeKeys: string[]; @@ -12397,7 +12440,10 @@ namespace ts { const result = isRelatedTo(source, target, /*reportErrors*/ !!errorNode, headMessage); if (overflow) { - error(errorNode, Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); + const diag = error(errorNode, Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); + if (errorOutputContainer) { + errorOutputContainer.error = diag; + } } else if (errorInfo) { if (containingMessageChain) { @@ -12420,9 +12466,6 @@ namespace ts { } } } - if (breakdown) { - return [errorNode!, errorInfo, relatedInfo ? [...(relatedInformation || []), ...relatedInfo]: relatedInformation]; - } const diag = createDiagnosticForNodeFromMessageChain(errorNode!, errorInfo, relatedInformation); if (relatedInfo) { addRelatedInfo(diag, ...relatedInfo); @@ -12430,11 +12473,12 @@ namespace ts { if (errorOutputContainer) { errorOutputContainer.error = diag; } - diagnostics.add(diag); // TODO: GH#18217 + if (!errorOutputContainer || !errorOutputContainer.skipLogging) { + diagnostics.add(diag); + } } - if (breakdown) { - Debug.assert(result === Ternary.False ? !errorNode : true, "missed opportunity to interact with error."); - return result === Ternary.False ? [undefined!, undefined!] as [Node, DiagnosticMessageChain] : false; + if (errorNode && errorOutputContainer && errorOutputContainer.skipLogging && result === Ternary.False) { + Debug.assert(!!errorOutputContainer.error, "missed opportunity to interact with error."); } return result !== Ternary.False; @@ -21127,13 +21171,14 @@ namespace ts { checkMode: CheckMode, reportErrors: boolean, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } ) { // Stateless function components can have maximum of three arguments: "props", "context", and "updater". // However "context" and "updater" are implicit and can't be specify by users. Only the first parameter, props, // can be specified by users through attributes property. const paramType = getEffectiveFirstArgumentForJsxSignature(signature, node); const attributesType = checkExpressionWithContextualType(node.attributes, paramType, /*inferenceContext*/ undefined, checkMode); - return checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes, undefined, containingMessageChain, /*breakdown*/ true); + return checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes, undefined, containingMessageChain, errorOutputContainer); } function getSignatureApplicabilityError( @@ -21145,8 +21190,19 @@ namespace ts { reportErrors: boolean, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, ) { + + const errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } = { error: undefined, skipLogging: true }; if (isJsxOpeningLikeElement(node)) { - return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain); + const r = checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain, errorOutputContainer); + if (!r) { + if (reportErrors) { + Debug.assert(!!errorOutputContainer.error, "has error 0"); + return errorOutputContainer.error; + } + else { + return true; + } + } } const thisType = getThisTypeOfSignature(signature); if (thisType && thisType !== voidType && node.kind !== SyntaxKind.NewExpression) { @@ -21157,9 +21213,15 @@ namespace ts { const thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType; const errorNode = reportErrors ? (thisArgumentNode || node) : undefined; const headMessage = Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1; - const r = checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage, containingMessageChain, undefined, /*breakdown*/ true); - if (r) { - return r; + const r = checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer); + if (!r) { + if (reportErrors) { + Debug.assert(!!errorOutputContainer.error, "has error 1"); // CLEAR + return errorOutputContainer.error; + } + else { + return true; + } } } const headMessage = Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1; @@ -21174,16 +21236,31 @@ namespace ts { // we obtain the regular type of any object literal arguments because we may not have inferred complete // parameter types yet and therefore excess property checks may yield false positives (see #17041). const checkArgType = checkMode & CheckMode.SkipContextSensitive ? getRegularTypeOfObjectLiteral(argType) : argType; - const r = checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain, /*breakdown*/ true); - if (r) { - return r; + const r = checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain, errorOutputContainer); + if (!r) { + if (reportErrors) { + Debug.assert(!!errorOutputContainer.error, "has error 2"); // CLEAR + return errorOutputContainer.error; + } + else { + return true; + } } } } if (restType) { const spreadType = getSpreadArgumentType(args, argCount, args.length, restType, /*context*/ undefined); const errorNode = reportErrors ? argCount < args.length ? args[argCount] : node : undefined; - return checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, undefined, undefined, /*breakdown*/ true); + const r = checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, undefined, errorOutputContainer); + if (!r) { + if (reportErrors) { + Debug.assert(!!errorOutputContainer.error, "has error 3"); // CLEAR + return errorOutputContainer.error; + } + else { + return true; + } + } } return undefined; } @@ -21520,10 +21597,13 @@ namespace ts { chain = chainDiagnosticMessages(chain, Diagnostics.The_last_overload_gave_the_following_error); chain = chainDiagnosticMessages(chain, Diagnostics.No_suitable_overload_for_this_call); } - const r = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - Debug.assert(!!r && !!r[0], "No error for last signature"); - if (r) { - diagnostics.add(createDiagnosticForNodeFromMessageChain(...r)); + const d = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + Debug.assert(!!d, "No error for last signature"); + if (d) { + Debug.assert(d !== true); + // if elaboration already displayed the error, don't do anything extra + // note that we could do this always here, but getSignatureApplicabilityError is currently not configured to do that + diagnostics.add(d as Diagnostic); } } else { @@ -21532,10 +21612,11 @@ namespace ts { for (const c of candidatesForArgumentError) { i++; const chain = chainDiagnosticMessages(undefined, Diagnostics.Overload_0_of_1_2_gave_the_following_error, i, candidates.length, signatureToString(c)); - const r = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - Debug.assert(!!r && !!r[0], "No error for signature (1)"); - if (r) { - related.push(createDiagnosticForNodeFromMessageChain(...r)); + const d = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + Debug.assert(!!d, "No error for signature (1)"); + if (d) { + Debug.assert(d !== true); + related.push(d as Diagnostic); } } diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.No_suitable_overload_for_this_call), related)); diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt index 9101537a6e9..9a5486fa8bf 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt @@ -1,8 +1,7 @@ -tests/cases/conformance/jsx/file.tsx(48,13): error TS2322: Type '{ children: string; to: string; onClick: (e: any) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. - Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. -tests/cases/conformance/jsx/file.tsx(54,51): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(55,68): error TS2322: Type 'true' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(56,24): error TS2322: Type 'true' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(48,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(54,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(55,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No suitable overload for this call. ==== tests/cases/conformance/jsx/file.tsx (4 errors) ==== @@ -54,23 +53,39 @@ tests/cases/conformance/jsx/file.tsx(56,24): error TS2322: Type 'true' is not as // Error const b0 = {}}>GO; // extra property; - ~~~~~~~~~~ -!!! error TS2322: Type '{ children: string; to: string; onClick: (e: any) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. -!!! error TS2322: Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:48:13: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:48:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. + Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:48:13: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. + Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. + Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. const b1 = {}} {...obj0}>Hello world; // extra property; const b2 = ; // extra property const b3 = {}}} />; // extra property const b4 = ; // Should error because Incorrect type; but attributes are any so everything is allowed const b5 = ; // Spread retain method declaration (see GitHub #13365), so now there is an extra attributes const b6 = ; // incorrect type for optional attribute - ~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & HyphenProps' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2322 tests/cases/conformance/jsx/file.tsx:54:51: Type 'number' is not assignable to type 'string'. +!!! related TS2322 tests/cases/conformance/jsx/file.tsx:54:51: Type 'number' is not assignable to type 'string'. +!!! related TS2322 tests/cases/conformance/jsx/file.tsx:54:51: Type 'number' is not assignable to type 'string'. const b7 = ; // incorrect type for optional attribute - ~~~~~~~~~ -!!! error TS2322: Type 'true' is not assignable to type 'string'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:5:5: The expected type comes from property 'className' which is declared here on type 'IntrinsicAttributes & HyphenProps' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2322 tests/cases/conformance/jsx/file.tsx:55:68: Type 'true' is not assignable to type 'string'. +!!! related TS2322 tests/cases/conformance/jsx/file.tsx:55:68: Type 'true' is not assignable to type 'string'. +!!! related TS2322 tests/cases/conformance/jsx/file.tsx:55:68: Type 'true' is not assignable to type 'string'. const b8 = ; // incorrect type for specified hyphanated name - ~~~~~~~~~~~ -!!! error TS2322: Type 'true' is not assignable to type 'string'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:17:5: The expected type comes from property 'data-format' which is declared here on type 'IntrinsicAttributes & HyphenProps' \ No newline at end of file + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:56:13: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:56:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. +!!! related TS2322 tests/cases/conformance/jsx/file.tsx:56:24: Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.types b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.types index d9b40dad94f..6a9b770ef48 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.types +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.types @@ -113,9 +113,9 @@ const b0 = {}}>GO; // ex >{}}>GO : JSX.Element >MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; } >to : string ->onClick : (e: any) => void ->(e)=>{} : (e: any) => void ->e : any +>onClick : (e: React.MouseEvent) => void +>(e)=>{} : (e: React.MouseEvent) => void +>e : React.MouseEvent >MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; } const b1 = {}} {...obj0}>Hello world; // extra property; From 252840ad40f33518b5efd47a9d2a9c7c8d1514ab Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 24 Jun 2019 17:37:14 -0700 Subject: [PATCH 28/95] Fix incorrect noImplicitAny error on contextual union function signature --- src/compiler/checker.ts | 4 +++- .../functionExpressionContextualTyping3.js | 8 ++++++++ .../functionExpressionContextualTyping3.symbols | 12 ++++++++++++ .../functionExpressionContextualTyping3.types | 13 +++++++++++++ .../functionExpressionContextualTyping3.ts | 5 +++++ 5 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/functionExpressionContextualTyping3.js create mode 100644 tests/baselines/reference/functionExpressionContextualTyping3.symbols create mode 100644 tests/baselines/reference/functionExpressionContextualTyping3.types create mode 100644 tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping3.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a3abe1dc5b5..534e5e2f067 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19095,7 +19095,9 @@ namespace ts { } } // Result is union of signatures collected (return type is union of return types of this signature set) - return signatureList && createUnionSignature(signatureList[0], signatureList); + if (signatureList) { + return signatureList.length === 1 ? signatureList[0] : createUnionSignature(signatureList[0], signatureList); + } } function checkSpreadExpression(node: SpreadElement, checkMode?: CheckMode): Type { diff --git a/tests/baselines/reference/functionExpressionContextualTyping3.js b/tests/baselines/reference/functionExpressionContextualTyping3.js new file mode 100644 index 00000000000..b25754b568f --- /dev/null +++ b/tests/baselines/reference/functionExpressionContextualTyping3.js @@ -0,0 +1,8 @@ +//// [functionExpressionContextualTyping3.ts] +// #31114 +declare function f(value: T | number): void; +f((a: any) => "") + + +//// [functionExpressionContextualTyping3.js] +f(function (a) { return ""; }); diff --git a/tests/baselines/reference/functionExpressionContextualTyping3.symbols b/tests/baselines/reference/functionExpressionContextualTyping3.symbols new file mode 100644 index 00000000000..8b773f08428 --- /dev/null +++ b/tests/baselines/reference/functionExpressionContextualTyping3.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping3.ts === +// #31114 +declare function f(value: T | number): void; +>f : Symbol(f, Decl(functionExpressionContextualTyping3.ts, 0, 0)) +>T : Symbol(T, Decl(functionExpressionContextualTyping3.ts, 1, 19)) +>value : Symbol(value, Decl(functionExpressionContextualTyping3.ts, 1, 22)) +>T : Symbol(T, Decl(functionExpressionContextualTyping3.ts, 1, 19)) + +f((a: any) => "") +>f : Symbol(f, Decl(functionExpressionContextualTyping3.ts, 0, 0)) +>a : Symbol(a, Decl(functionExpressionContextualTyping3.ts, 2, 3)) + diff --git a/tests/baselines/reference/functionExpressionContextualTyping3.types b/tests/baselines/reference/functionExpressionContextualTyping3.types new file mode 100644 index 00000000000..662aa72ea90 --- /dev/null +++ b/tests/baselines/reference/functionExpressionContextualTyping3.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping3.ts === +// #31114 +declare function f(value: T | number): void; +>f : (value: number | T) => void +>value : number | T + +f((a: any) => "") +>f((a: any) => "") : void +>f : (value: number | T) => void +>(a: any) => "" : (a: any) => "" +>a : any +>"" : "" + diff --git a/tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping3.ts b/tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping3.ts new file mode 100644 index 00000000000..a1dc4e5d7d7 --- /dev/null +++ b/tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping3.ts @@ -0,0 +1,5 @@ +// @noImplicitAny: true + +// #31114 +declare function f(value: T | number): void; +f((a: any) => "") From 49e3f1788641fe3709644f5644048a00a3fea43b Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 24 Jun 2019 17:11:16 -1000 Subject: [PATCH 29/95] Add instantiation count limiter --- src/compiler/checker.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 9cb08b3e440..f4eb3940e1e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -65,6 +65,7 @@ namespace ts { let typeCount = 0; let symbolCount = 0; let enumCount = 0; + let instantiationCount = 0; let instantiationDepth = 0; let constraintDepth = 0; let currentNode: Node | undefined; @@ -11408,13 +11409,14 @@ namespace ts { if (!type || !mapper || mapper === identityMapper) { return type; } - if (instantiationDepth === 50) { + if (instantiationDepth === 50 || instantiationCount >= 5000000) { // We have reached 50 recursive type instantiations and there is a very high likelyhood we're dealing // with a combination of infinite generic types that perpetually generate new type identities. We stop // the recursion here by yielding the error type. error(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); return errorType; } + instantiationCount++; instantiationDepth++; const result = instantiateTypeWorker(type, mapper); instantiationDepth--; @@ -24494,6 +24496,7 @@ namespace ts { function checkExpression(node: Expression | QualifiedName, checkMode?: CheckMode, forceTuple?: boolean): Type { const saveCurrentNode = currentNode; currentNode = node; + instantiationCount = 0; const uninstantiatedType = checkExpressionWorker(node, checkMode, forceTuple); const type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); if (isConstEnumObjectType(type)) { @@ -29204,6 +29207,7 @@ namespace ts { if (node) { const saveCurrentNode = currentNode; currentNode = node; + instantiationCount = 0; checkSourceElementWorker(node); currentNode = saveCurrentNode; } @@ -29475,6 +29479,7 @@ namespace ts { function checkDeferredNode(node: Node) { const saveCurrentNode = currentNode; currentNode = node; + instantiationCount = 0; switch (node.kind) { case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: From f20f700025e40129d3bdec97adb0bf2ae8b80925 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 25 Jun 2019 13:16:34 -0700 Subject: [PATCH 30/95] Update baselines, except JSX JSX is still broken --- src/compiler/checker.ts | 161 ++++++++---------- tests/baselines/reference/for-of39.errors.txt | 20 ++- .../reference/functionOverloads40.errors.txt | 11 +- .../reference/functionOverloads41.errors.txt | 11 +- .../heterogeneousArrayAndOverloads.errors.txt | 22 +-- .../iterableArrayPattern28.errors.txt | 20 ++- .../overloadResolutionTest1.errors.txt | 33 ++-- .../overloadsWithProvisionalErrors.errors.txt | 23 ++- .../reference/promiseTypeInference.errors.txt | 29 ++-- ...actDefaultPropsInferenceSuccess.errors.txt | 50 +++--- .../reference/strictBindCallApply1.errors.txt | 52 ++++-- 11 files changed, 250 insertions(+), 182 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 06066e3120e..f1aa67ab00f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11659,7 +11659,7 @@ namespace ts { return isTypeComparableTo(type1, type2) || isTypeComparableTo(type2, type1); } - function checkTypeAssignableTo(source: Type, target: Type, errorNode: Node | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, errorOutputObject?: { error?: Diagnostic }): boolean { + function checkTypeAssignableTo(source: Type, target: Type, errorNode: Node | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, errorOutputObject?: { errors?: Diagnostic[] }): boolean { return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain, errorOutputObject); } @@ -11679,10 +11679,10 @@ namespace ts { expr: Expression | undefined, headMessage: DiagnosticMessage | undefined, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ): boolean { if (isTypeRelatedTo(source, target, relation)) return true; - if (!errorNode || !elaborateError(expr, source, target, relation, headMessage, errorOutputContainer)) { + if (!errorNode || !elaborateError(expr, source, target, relation, headMessage, containingMessageChain, errorOutputContainer)) { return checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer); } return false; @@ -11698,34 +11698,35 @@ namespace ts { target: Type, relation: Map, headMessage: DiagnosticMessage | undefined, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ): boolean { // TODO: The first case probably still needs to set errorOutputContainer.error to something // TODO: Make sure all error logging in dynamic scope sets errorOutputContainer.error instead if (!node || isOrHasGenericConditional(target)) return false; if (!checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined) - && elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage, errorOutputContainer)) { + && elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage, containingMessageChain, errorOutputContainer)) { return true; } switch (node.kind) { case SyntaxKind.JsxExpression: case SyntaxKind.ParenthesizedExpression: - return elaborateError((node as ParenthesizedExpression | JsxExpression).expression, source, target, relation, headMessage, errorOutputContainer); + return elaborateError((node as ParenthesizedExpression | JsxExpression).expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); case SyntaxKind.BinaryExpression: switch ((node as BinaryExpression).operatorToken.kind) { case SyntaxKind.EqualsToken: case SyntaxKind.CommaToken: - return elaborateError((node as BinaryExpression).right, source, target, relation, headMessage, errorOutputContainer); + return elaborateError((node as BinaryExpression).right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; case SyntaxKind.ObjectLiteralExpression: - return elaborateObjectLiteral(node as ObjectLiteralExpression, source, target, relation, errorOutputContainer); + return elaborateObjectLiteral(node as ObjectLiteralExpression, source, target, relation, containingMessageChain, errorOutputContainer); case SyntaxKind.ArrayLiteralExpression: - return elaborateArrayLiteral(node as ArrayLiteralExpression, source, target, relation, errorOutputContainer); + return elaborateArrayLiteral(node as ArrayLiteralExpression, source, target, relation, containingMessageChain, errorOutputContainer); case SyntaxKind.JsxAttributes: - return elaborateJsxComponents(node as JsxAttributes, source, target, relation, errorOutputContainer); + return elaborateJsxComponents(node as JsxAttributes, source, target, relation, containingMessageChain, errorOutputContainer); case SyntaxKind.ArrowFunction: - return elaborateArrowFunction(node as ArrowFunction, source, target, relation, errorOutputContainer); + return elaborateArrowFunction(node as ArrowFunction, source, target, relation, containingMessageChain, errorOutputContainer); } return false; } @@ -11736,7 +11737,8 @@ namespace ts { target: Type, relation: Map, headMessage: DiagnosticMessage | undefined, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ): boolean { const callSignatures = getSignaturesOfType(source, SignatureKind.Call); const constructSignatures = getSignaturesOfType(source, SignatureKind.Construct); @@ -11745,9 +11747,9 @@ namespace ts { const returnType = getReturnTypeOfSignature(s); return !(returnType.flags & (TypeFlags.Any | TypeFlags.Never)) && checkTypeRelatedTo(returnType, target, relation, /*errorNode*/ undefined); })) { - const resultObj: { error?: Diagnostic } = errorOutputContainer || {}; - checkTypeAssignableTo(source, target, node, headMessage, /*containingChain*/ undefined, resultObj); - const diagnostic = resultObj.error!; + const resultObj: { errors?: Diagnostic[] } = errorOutputContainer || {}; + checkTypeAssignableTo(source, target, node, headMessage, containingMessageChain, resultObj); + const diagnostic = resultObj.errors![resultObj.errors!.length - 1]; addRelatedInfo(diagnostic, createDiagnosticForNode( node, signatures === constructSignatures ? Diagnostics.Did_you_mean_to_use_new_with_this_expression : Diagnostics.Did_you_mean_to_call_this_expression @@ -11763,7 +11765,8 @@ namespace ts { source: Type, target: Type, relation: Map, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ): boolean { // Don't elaborate blocks if (isBlock(node.body)) { @@ -11785,15 +11788,15 @@ namespace ts { const sourceReturn = getReturnTypeOfSignature(sourceSig); const targetReturn = getUnionType(map(targetSignatures, getReturnTypeOfSignature)); if (!checkTypeRelatedTo(sourceReturn, targetReturn, relation, /*errorNode*/ undefined)) { - const elaborated = returnExpression && elaborateError(returnExpression, sourceReturn, targetReturn, relation, /*headMessage*/ undefined, errorOutputContainer); + const elaborated = returnExpression && elaborateError(returnExpression, sourceReturn, targetReturn, relation, /*headMessage*/ undefined, containingMessageChain, errorOutputContainer); if (elaborated) { return elaborated; } - const resultObj: { error?: Diagnostic } = errorOutputContainer || {}; - checkTypeRelatedTo(sourceReturn, targetReturn, relation, returnExpression, /*message*/ undefined, /*chain*/ undefined, resultObj); - if (resultObj.error) { + const resultObj: { errors?: Diagnostic[] } = errorOutputContainer || {}; + checkTypeRelatedTo(sourceReturn, targetReturn, relation, returnExpression, /*message*/ undefined, containingMessageChain, resultObj); + if (resultObj.errors) { if (target.symbol && length(target.symbol.declarations)) { - addRelatedInfo(resultObj.error, createDiagnosticForNode( + addRelatedInfo(resultObj.errors[resultObj.errors.length - 1], createDiagnosticForNode( target.symbol.declarations[0], Diagnostics.The_expected_type_comes_from_the_return_type_of_this_signature, )); @@ -11815,7 +11818,8 @@ namespace ts { source: Type, target: Type, relation: Map, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ) { // Assignability failure - check each prop individually, and if that fails, fall back on the bad error span let reportedError = false; @@ -11825,22 +11829,22 @@ namespace ts { if (!targetPropType || targetPropType.flags & TypeFlags.IndexedAccess) continue; // Don't elaborate on indexes on generic variables const sourcePropType = getIndexedAccessTypeOrUndefined(source, nameType); if (sourcePropType && !checkTypeRelatedTo(sourcePropType, targetPropType, relation, /*errorNode*/ undefined)) { - const elaborated = next && elaborateError(next, sourcePropType, targetPropType, relation, /*headMessage*/ undefined, errorOutputContainer); + const elaborated = next && elaborateError(next, sourcePropType, targetPropType, relation, /*headMessage*/ undefined, containingMessageChain, errorOutputContainer); if (elaborated) { reportedError = true; } else { // Issue error on the prop itself, since the prop couldn't elaborate the error - const resultObj: { error?: Diagnostic } = errorOutputContainer || {}; + const resultObj: { errors?: Diagnostic[] } = errorOutputContainer || {}; // Use the expression type, if available const specificSource = next ? checkExpressionForMutableLocation(next, CheckMode.Normal, sourcePropType) : sourcePropType; - const result = checkTypeRelatedTo(specificSource, targetPropType, relation, prop, errorMessage, /*containingChain*/ undefined, resultObj); + const result = checkTypeRelatedTo(specificSource, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj); if (result && specificSource !== sourcePropType) { // If for whatever reason the expression type doesn't yield an error, make sure we still issue an error on the sourcePropType - checkTypeRelatedTo(sourcePropType, targetPropType, relation, prop, errorMessage, /*containingChain*/ undefined, resultObj); + checkTypeRelatedTo(sourcePropType, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj); } - if (resultObj.error) { - const reportedDiag = resultObj.error; + if (resultObj.errors) { + const reportedDiag = resultObj.errors[resultObj.errors.length - 1]; const propertyName = isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : undefined; const targetProp = propertyName !== undefined ? getPropertyOfType(target, propertyName) : undefined; @@ -11928,9 +11932,10 @@ namespace ts { source: Type, target: Type, relation: Map, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ) { - let result = elaborateElementwise(generateJsxAttributes(node), source, target, relation, errorOutputContainer); + let result = elaborateElementwise(generateJsxAttributes(node), source, target, relation, containingMessageChain, errorOutputContainer); let invalidTextDiagnostic: DiagnosticMessage | undefined; if (isJsxOpeningElement(node.parent) && isJsxElement(node.parent.parent)) { const containingElement = node.parent.parent; @@ -11949,7 +11954,7 @@ namespace ts { if (arrayLikeTargetParts !== neverType) { const realSource = createTupleType(checkJsxChildren(containingElement, CheckMode.Normal)); const children = generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic) - result = elaborateElementwise(children, realSource, arrayLikeTargetParts, relation, errorOutputContainer) || result; + result = elaborateElementwise(children, realSource, arrayLikeTargetParts, relation, containingMessageChain, errorOutputContainer) || result; } else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { // arity mismatch @@ -11961,7 +11966,7 @@ namespace ts { typeToString(childrenTargetType) ); if (errorOutputContainer && errorOutputContainer.skipLogging) { - errorOutputContainer.error = diag; + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); } } } @@ -11975,6 +11980,7 @@ namespace ts { source, target, relation, + containingMessageChain, errorOutputContainer ) || result; } @@ -11989,7 +11995,7 @@ namespace ts { typeToString(childrenTargetType) ); if (errorOutputContainer && errorOutputContainer.skipLogging) { - errorOutputContainer.error = diag; + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); } } } @@ -12027,16 +12033,17 @@ namespace ts { source: Type, target: Type, relation: Map, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ) { if (target.flags & TypeFlags.Primitive) return false; if (isTupleLikeType(source)) { - return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, errorOutputContainer); + return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, containingMessageChain, errorOutputContainer); } // recreate a tuple from the elements, if possible const tupleizedType = checkArrayLiteral(node, CheckMode.Contextual, /*forceTuple*/ true); if (isTupleLikeType(tupleizedType)) { - return elaborateElementwise(generateLimitedTupleElements(node, target), tupleizedType, target, relation, errorOutputContainer); + return elaborateElementwise(generateLimitedTupleElements(node, target), tupleizedType, target, relation, containingMessageChain, errorOutputContainer); } return false; } @@ -12070,10 +12077,11 @@ namespace ts { source: Type, target: Type, relation: Map, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ) { if (target.flags & TypeFlags.Primitive) return false; - return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, errorOutputContainer); + return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, containingMessageChain, errorOutputContainer); } /** @@ -12423,7 +12431,7 @@ namespace ts { errorNode: Node | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, - errorOutputContainer?: { error?: Diagnostic, skipLogging?: boolean }, + errorOutputContainer?: { errors?: Diagnostic[], skipLogging?: boolean }, ): boolean { let errorInfo: DiagnosticMessageChain | undefined; let relatedInfo: [DiagnosticRelatedInformation, ...DiagnosticRelatedInformation[]] | undefined; @@ -12442,7 +12450,7 @@ namespace ts { if (overflow) { const diag = error(errorNode, Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); if (errorOutputContainer) { - errorOutputContainer.error = diag; + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); } } else if (errorInfo) { @@ -12471,14 +12479,14 @@ namespace ts { addRelatedInfo(diag, ...relatedInfo); } if (errorOutputContainer) { - errorOutputContainer.error = diag; + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); } if (!errorOutputContainer || !errorOutputContainer.skipLogging) { diagnostics.add(diag); } } if (errorNode && errorOutputContainer && errorOutputContainer.skipLogging && result === Ternary.False) { - Debug.assert(!!errorOutputContainer.error, "missed opportunity to interact with error."); + Debug.assert(!!errorOutputContainer.errors, "missed opportunity to interact with error."); } return result !== Ternary.False; @@ -21171,7 +21179,7 @@ namespace ts { checkMode: CheckMode, reportErrors: boolean, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } ) { // Stateless function components can have maximum of three arguments: "props", "context", and "updater". // However "context" and "updater" are implicit and can't be specify by users. Only the first parameter, props, @@ -21191,17 +21199,14 @@ namespace ts { containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, ) { - const errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } = { error: undefined, skipLogging: true }; + const errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } = { errors: undefined, skipLogging: true }; if (isJsxOpeningLikeElement(node)) { const r = checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain, errorOutputContainer); if (!r) { if (reportErrors) { - Debug.assert(!!errorOutputContainer.error, "has error 0"); - return errorOutputContainer.error; - } - else { - return true; + Debug.assert(!!errorOutputContainer.errors, "has error 0"); } + return errorOutputContainer.errors || []; } } const thisType = getThisTypeOfSignature(signature); @@ -21213,15 +21218,9 @@ namespace ts { const thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType; const errorNode = reportErrors ? (thisArgumentNode || node) : undefined; const headMessage = Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1; - const r = checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer); - if (!r) { - if (reportErrors) { - Debug.assert(!!errorOutputContainer.error, "has error 1"); // CLEAR - return errorOutputContainer.error; - } - else { - return true; - } + if (!checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer)) { + Debug.assert(!reportErrors || !!errorOutputContainer.errors, "has error 1"); // CLEAR + return errorOutputContainer.errors || []; } } const headMessage = Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1; @@ -21236,30 +21235,18 @@ namespace ts { // we obtain the regular type of any object literal arguments because we may not have inferred complete // parameter types yet and therefore excess property checks may yield false positives (see #17041). const checkArgType = checkMode & CheckMode.SkipContextSensitive ? getRegularTypeOfObjectLiteral(argType) : argType; - const r = checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain, errorOutputContainer); - if (!r) { - if (reportErrors) { - Debug.assert(!!errorOutputContainer.error, "has error 2"); // CLEAR - return errorOutputContainer.error; - } - else { - return true; - } + if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain, errorOutputContainer)) { + Debug.assert(!reportErrors || !!errorOutputContainer.errors, "has error 2"); // CLEAR + return errorOutputContainer.errors || []; } } } if (restType) { const spreadType = getSpreadArgumentType(args, argCount, args.length, restType, /*context*/ undefined); const errorNode = reportErrors ? argCount < args.length ? args[argCount] : node : undefined; - const r = checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, undefined, errorOutputContainer); - if (!r) { - if (reportErrors) { - Debug.assert(!!errorOutputContainer.error, "has error 3"); // CLEAR - return errorOutputContainer.error; - } - else { - return true; - } + if (!checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, undefined, errorOutputContainer)) { + Debug.assert(!reportErrors || !!errorOutputContainer.errors, "has error 3"); // CLEAR + return errorOutputContainer.errors || []; } } return undefined; @@ -21597,13 +21584,14 @@ namespace ts { chain = chainDiagnosticMessages(chain, Diagnostics.The_last_overload_gave_the_following_error); chain = chainDiagnosticMessages(chain, Diagnostics.No_suitable_overload_for_this_call); } - const d = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - Debug.assert(!!d, "No error for last signature"); - if (d) { - Debug.assert(d !== true); + const ds = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + Debug.assert(!!ds, "No error for last signature"); + if (ds) { // if elaboration already displayed the error, don't do anything extra // note that we could do this always here, but getSignatureApplicabilityError is currently not configured to do that - diagnostics.add(d as Diagnostic); + for (const d of ds as Diagnostic[]) { + diagnostics.add(d); + } } } else { @@ -21611,12 +21599,11 @@ namespace ts { let i = 0; for (const c of candidatesForArgumentError) { i++; - const chain = chainDiagnosticMessages(undefined, Diagnostics.Overload_0_of_1_2_gave_the_following_error, i, candidates.length, signatureToString(c)); - const d = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - Debug.assert(!!d, "No error for signature (1)"); - if (d) { - Debug.assert(d !== true); - related.push(d as Diagnostic); + const chain = () => chainDiagnosticMessages(undefined, Diagnostics.Overload_0_of_1_2_gave_the_following_error, i, candidates.length, signatureToString(c)); + const ds = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, chain); + Debug.assert(!!ds, "No error for signature (1)"); + if (ds) { + related.push(...ds as Diagnostic[]) } } diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.No_suitable_overload_for_this_call), related)); diff --git a/tests/baselines/reference/for-of39.errors.txt b/tests/baselines/reference/for-of39.errors.txt index fedf9f3e343..d5e48579c28 100644 --- a/tests/baselines/reference/for-of39.errors.txt +++ b/tests/baselines/reference/for-of39.errors.txt @@ -1,10 +1,24 @@ -tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,37): error TS2322: Type 'number' is not assignable to type 'boolean'. +tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2755: No suitable overload for this call. ==== tests/cases/conformance/es6/for-ofStatements/for-of39.ts (1 errors) ==== var map = new Map([["", true], ["", 0]]); - ~ -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:19: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. + Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => IterableIterator<[string, number] | [string, true]>' is not assignable to type '() => Iterator'. + Type 'IterableIterator<[string, number] | [string, true]>' is not assignable to type 'Iterator'. + Types of property 'next' are incompatible. + Type '(value?: any) => IteratorResult<[string, number] | [string, true]>' is not assignable to type '(value?: any) => IteratorResult'. + Type 'IteratorResult<[string, number] | [string, true]>' is not assignable to type 'IteratorResult'. + Type '[string, number] | [string, true]' is not assignable to type 'readonly [string, boolean]'. + Type '[string, number]' is not assignable to type 'readonly [string, boolean]'. + Types of property '1' are incompatible. + Type 'number' is not assignable to type 'boolean'. +!!! related TS2757 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:37: Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map', gave the following error. + Type 'number' is not assignable to type 'boolean'. for (var [k, v] of map) { k; v; diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index f053c7c6208..b0706ed9650 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads40.ts(4,15): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/functionOverloads40.ts (1 errors) ==== @@ -6,7 +6,10 @@ tests/cases/compiler/functionOverloads40.ts(4,15): error TS2322: Type 'string' i function foo(bar:{a:boolean;}[]):number; function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{a:'bar'}]); - ~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/compiler/functionOverloads40.ts:2:19: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' + ~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. + Type 'string' is not assignable to type 'number'. +!!! related TS2757 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. + 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 a09e6e14769..430a6e295c6 100644 --- a/tests/baselines/reference/functionOverloads41.errors.txt +++ b/tests/baselines/reference/functionOverloads41.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads41.ts(4,14): error TS2741: Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. +tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/functionOverloads41.ts (1 errors) ==== @@ -6,7 +6,10 @@ tests/cases/compiler/functionOverloads41.ts(4,14): error TS2741: Property 'a' is function foo(bar:{a:boolean;}[]):number; function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{}]); - ~~ -!!! error TS2741: Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. -!!! related TS2728 tests/cases/compiler/functionOverloads41.ts:2:19: 'a' is declared here. + ~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. + Property 'a' is missing in type '{}' but required in type '{ a: number; }'. +!!! related TS2757 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. + Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. \ No newline at end of file diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt index 60228b956f9..8c2d8ed2617 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt @@ -1,9 +1,7 @@ -tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,20): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,23): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,32): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No suitable overload for this call. -==== tests/cases/compiler/heterogeneousArrayAndOverloads.ts (3 errors) ==== +==== tests/cases/compiler/heterogeneousArrayAndOverloads.ts (1 errors) ==== class arrTest { test(arg1: number[]); test(arg1: string[]); @@ -13,11 +11,15 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,32): error TS2322: Type this.test(["hi"]); this.test([]); this.test([1, 2, "hi", 5]); // Error - ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. - ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. - ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:26: Overload 1 of 2, '(arg1: number[]): any', gave the following error. + Type 'string' is not assignable to type 'number'. +!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:20: Overload 2 of 2, '(arg1: string[]): any', gave the following error. + Type 'number' is not assignable to type 'string'. +!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:23: Overload 2 of 2, '(arg1: string[]): any', gave the following error. + Type 'number' is not assignable to type 'string'. +!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:32: Overload 2 of 2, '(arg1: string[]): any', gave the following error. + Type 'number' is not assignable to type 'string'. } } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern28.errors.txt b/tests/baselines/reference/iterableArrayPattern28.errors.txt index f90bba07c1a..53e41cb1de3 100644 --- a/tests/baselines/reference/iterableArrayPattern28.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern28.errors.txt @@ -1,8 +1,22 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,52): error TS2322: Type 'true' is not assignable to type 'number'. +tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error TS2755: No suitable overload for this call. ==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (1 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); - ~~~~ -!!! error TS2322: Type 'true' is not assignable to type 'number'. \ No newline at end of file + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:32: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. + Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator'. + Type 'IterableIterator<[string, number] | [string, boolean]>' is not assignable to type 'Iterator'. + Types of property 'next' are incompatible. + Type '(value?: any) => IteratorResult<[string, number] | [string, boolean]>' is not assignable to type '(value?: any) => IteratorResult'. + Type 'IteratorResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. + Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. + Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. + Types of property '1' are incompatible. + Type 'boolean' is not assignable to type 'number'. +!!! related TS2757 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:52: Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. + Type 'true' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index 008ee13127c..f765e3d27d7 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/overloadResolutionTest1.ts(7,18): error TS2322: Type 'string' is not assignable to type 'boolean'. -tests/cases/compiler/overloadResolutionTest1.ts(18,16): error TS2322: Type 'string' is not assignable to type 'boolean'. -tests/cases/compiler/overloadResolutionTest1.ts(24,15): error TS2322: Type 'true' is not assignable to type 'string'. +tests/cases/compiler/overloadResolutionTest1.ts(7,12): error TS2755: No suitable overload for this call. +tests/cases/compiler/overloadResolutionTest1.ts(18,10): error TS2755: No suitable overload for this call. +tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/overloadResolutionTest1.ts (3 errors) ==== @@ -11,9 +11,12 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,15): error TS2322: Type 'true var x1 = foo([{a:true}]); // works var x11 = foo([{a:0}]); // works var x111 = foo([{a:"s"}]); // error - does not match any signature - ~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:2:19: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' + ~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. + Type 'string' is not assignable to type 'number'. +!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. + 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 @@ -25,15 +28,21 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,15): error TS2322: Type 'true var x2 = foo2({a:0}); // works var x3 = foo2({a:true}); // works var x4 = foo2({a:"s"}); // error - ~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:13:20: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' + ~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. + Type 'string' is not assignable to type 'number'. +!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. + Type 'string' is not assignable to type 'boolean'. function foo4(bar:{a:number;}):number; function foo4(bar:{a:string;}):string; function foo4(bar:{a:any;}):any{ return bar }; var x = foo4({a:true}); // error - ~ -!!! error TS2322: Type 'true' is not assignable to type 'string'. -!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:22:20: The expected type comes from property 'a' which is declared here on type '{ a: string; }' \ No newline at end of file + ~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. + Type 'true' is not assignable to type 'number'. +!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. + Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt index 3db9a29053f..2f2d4a5f5cd 100644 --- a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,11): error TS2739: Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b +tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,1): error TS2755: No suitable overload for this call. tests/cases/compiler/overloadsWithProvisionalErrors.ts(7,17): error TS2304: Cannot find name 'blah'. -tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,11): error TS2741: Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. +tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,1): error TS2755: No suitable overload for this call. tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cannot find name 'blah'. @@ -11,16 +11,21 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cann }; func(s => ({})); // Error for no applicable overload (object type is missing a and b) - ~~~~ -!!! error TS2739: Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b -!!! related TS6502 tests/cases/compiler/overloadsWithProvisionalErrors.ts:3:14: The expected type comes from the return type of this signature. + ~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:6: Overload 1 of 2, '(s: string): number', gave the following error. + Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. + Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) ~~~~ !!! error TS2304: Cannot find name 'blah'. func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway - ~~~~~~~~~~~~~ -!!! error TS2741: Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. -!!! related TS2728 tests/cases/compiler/overloadsWithProvisionalErrors.ts:3:42: 'b' is declared here. -!!! related TS6502 tests/cases/compiler/overloadsWithProvisionalErrors.ts:3:14: The expected type comes from the return type of this signature. + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:6: Overload 1 of 2, '(s: string): number', gave the following error. + Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. + Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. ~~~~ !!! error TS2304: Cannot find name 'blah'. \ No newline at end of file diff --git a/tests/baselines/reference/promiseTypeInference.errors.txt b/tests/baselines/reference/promiseTypeInference.errors.txt index 1996f37e540..ebd8bcf947b 100644 --- a/tests/baselines/reference/promiseTypeInference.errors.txt +++ b/tests/baselines/reference/promiseTypeInference.errors.txt @@ -1,10 +1,4 @@ -tests/cases/compiler/promiseTypeInference.ts(10,39): error TS2322: Type 'IPromise' is not assignable to type 'number | PromiseLike'. - Type 'IPromise' is not assignable to type 'PromiseLike'. - Types of property 'then' are incompatible. - Type '(success?: (value: number) => IPromise) => IPromise' is not assignable to type '(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. - Types of parameters 'success' and 'onfulfilled' are incompatible. - Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. - Type 'TResult1' is not assignable to type 'IPromise'. +tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/promiseTypeInference.ts (1 errors) ==== @@ -18,13 +12,16 @@ tests/cases/compiler/promiseTypeInference.ts(10,39): error TS2322: Type 'IPromis declare function convert(s: string): IPromise; var $$x = load("something").then(s => convert(s)); - ~~~~~~~~~~ -!!! error TS2322: Type 'IPromise' is not assignable to type 'number | PromiseLike'. -!!! error TS2322: Type 'IPromise' is not assignable to type 'PromiseLike'. -!!! error TS2322: Types of property 'then' are incompatible. -!!! error TS2322: Type '(success?: (value: number) => IPromise) => IPromise' is not assignable to type '(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. -!!! error TS2322: Types of parameters 'success' and 'onfulfilled' are incompatible. -!!! error TS2322: Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. -!!! error TS2322: Type 'TResult1' is not assignable to type 'IPromise'. -!!! related TS6502 /.ts/lib.es5.d.ts:1406:57: The expected type comes from the return type of this signature. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. + Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! related TS2757 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. + Type 'IPromise' is not assignable to type 'number | PromiseLike'. + Type 'IPromise' is not assignable to type 'PromiseLike'. + Types of property 'then' are incompatible. + Type '(success?: (value: number) => IPromise) => IPromise' is not assignable to type '(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. + Types of parameters 'success' and 'onfulfilled' are incompatible. + Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. + Type 'TResult1' is not assignable to type 'IPromise'. \ No newline at end of file diff --git a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt index dbc1e42c572..d49b31bc38d 100644 --- a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt +++ b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt @@ -1,11 +1,6 @@ -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,36): error TS2322: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. - Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. - Type 'void' is not assignable to type 'boolean'. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,41): error TS2322: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. - Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. - Type 'void' is not assignable to type 'boolean'. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. - Type 'void' is not assignable to type 'boolean'. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2755: No suitable overload for this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx (3 errors) ==== @@ -36,11 +31,15 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2322: // Error: Void not assignable to boolean const Test2 = () => console.log(value)} />; - ~~~~ -!!! error TS2322: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. -!!! error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -!!! error TS2322: Type 'void' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:27:36: Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. +!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:27:36: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. class FieldFeedbackBeta

extends React.Component

{ static defaultProps: BaseProps = { @@ -57,11 +56,15 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2322: // Error: Void not assignable to boolean const Test2a = () => console.log(value)} error>Hah; - ~~~~ -!!! error TS2322: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. -!!! error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -!!! error TS2322: Type 'void' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, "when" | "error">> & Partial>' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:43:41: Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. +!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:43:41: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. interface MyPropsProps extends Props { when: (value: string) => boolean; @@ -83,10 +86,13 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2322: // Error: Void not assignable to boolean const Test4 = () => console.log(value)} />; - ~~~~ -!!! error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -!!! error TS2322: Type 'void' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:64:37: Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. +!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:64:37: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. // OK const Test5 = () => ; diff --git a/tests/baselines/reference/strictBindCallApply1.errors.txt b/tests/baselines/reference/strictBindCallApply1.errors.txt index 7b13d5e3181..c673a2b26ea 100644 --- a/tests/baselines/reference/strictBindCallApply1.errors.txt +++ b/tests/baselines/reference/strictBindCallApply1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/functions/strictBindCallApply1.ts(11,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2755: No suitable overload for this call. tests/cases/conformance/functions/strictBindCallApply1.ts(17,11): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(18,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(19,44): error TS2554: Expected 3 arguments, but got 4. @@ -8,8 +8,8 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(23,37): error TS2322: tests/cases/conformance/functions/strictBindCallApply1.ts(24,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. -tests/cases/conformance/functions/strictBindCallApply1.ts(41,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(42,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. +tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2755: No suitable overload for this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(42,11): error TS2755: No suitable overload for this call. tests/cases/conformance/functions/strictBindCallApply1.ts(48,11): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(49,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(50,38): error TS2554: Expected 3 arguments, but got 4. @@ -18,7 +18,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(54,26): error TS2345: tests/cases/conformance/functions/strictBindCallApply1.ts(55,31): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(56,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. tests/cases/conformance/functions/strictBindCallApply1.ts(57,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. -tests/cases/conformance/functions/strictBindCallApply1.ts(62,33): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(62,11): error TS2755: No suitable overload for this call. tests/cases/conformance/functions/strictBindCallApply1.ts(65,1): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(66,15): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(67,24): error TS2554: Expected 3 arguments, but got 4. @@ -39,8 +39,15 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f01 = foo.bind(undefined, 10); let f02 = foo.bind(undefined, 10, "hello"); let f03 = foo.bind(undefined, 10, 20); // Error - ~~ -!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:11:35: Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. + Argument of type '20' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:11:11: Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. + The 'this' context of type '(a: number, b: string) => string' is not assignable to method's 'this' of type '(this: undefined, ...args: (10 | 20)[]) => string'. + Types of parameters 'b' and 'args' are incompatible. + Type '10 | 20' is not assignable to type 'string'. + Type '10' is not assignable to type 'string'. let f04 = overloaded.bind(undefined); // typeof overloaded let f05 = generic.bind(undefined); // typeof generic @@ -86,11 +93,25 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f11 = c.foo.bind(c, 10); let f12 = c.foo.bind(c, 10, "hello"); let f13 = c.foo.bind(c, 10, 20); // Error - ~~ -!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:41:29: Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. + Argument of type '20' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:41:11: Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. + The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (10 | 20)[]) => string'. + Types of parameters 'b' and 'args' are incompatible. + Type '10 | 20' is not assignable to type 'string'. + Type '10' is not assignable to type 'string'. let f14 = c.foo.bind(undefined); // Error - ~~~~~~~~~ -!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:42:22: Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type 'C'. +!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:42:11: Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. + The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (string | number)[]) => string'. + Types of parameters 'a' and 'args' are incompatible. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded let f16 = c.generic.bind(c); // typeof C.prototype.generic @@ -127,8 +148,15 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f21 = C.bind(undefined, 10); let f22 = C.bind(undefined, 10, "hello"); let f23 = C.bind(undefined, 10, 20); // Error - ~~ -!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:62:33: Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. + Argument of type '20' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:62:11: Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. + The 'this' context of type 'typeof C' is not assignable to method's 'this' of type 'new (...args: (10 | 20)[]) => C'. + Types of parameters 'b' and 'args' are incompatible. + Type '10 | 20' is not assignable to type 'string'. + Type '10' is not assignable to type 'string'. C.call(c, 10, "hello"); C.call(c, 10); // Error From 66244f793763e0b83f6df237389d8a612584a707 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 25 Jun 2019 13:57:30 -0700 Subject: [PATCH 31/95] Don't double-check JSX calls The JSX code path stands on its own --- src/compiler/checker.ts | 14 +- ...elessFunctionComponentOverload4.errors.txt | 147 ++++++++++++------ ...elessFunctionComponentOverload5.errors.txt | 21 ++- ...ionComponentsWithTypeArguments4.errors.txt | 31 ++-- 4 files changed, 139 insertions(+), 74 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f1aa67ab00f..257c660716b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21201,13 +21201,11 @@ namespace ts { const errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } = { errors: undefined, skipLogging: true }; if (isJsxOpeningLikeElement(node)) { - const r = checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain, errorOutputContainer); - if (!r) { - if (reportErrors) { - Debug.assert(!!errorOutputContainer.errors, "has error 0"); - } + if (!checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain, errorOutputContainer)) { + Debug.assert(!reportErrors || !!errorOutputContainer.errors, "jsx should have errors when reporting errors"); return errorOutputContainer.errors || []; } + return undefined; } const thisType = getThisTypeOfSignature(signature); if (thisType && thisType !== voidType && node.kind !== SyntaxKind.NewExpression) { @@ -21219,7 +21217,7 @@ namespace ts { const errorNode = reportErrors ? (thisArgumentNode || node) : undefined; const headMessage = Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1; if (!checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer)) { - Debug.assert(!reportErrors || !!errorOutputContainer.errors, "has error 1"); // CLEAR + Debug.assert(!reportErrors || !!errorOutputContainer.errors, "this parameter should have errors when reporting errors"); return errorOutputContainer.errors || []; } } @@ -21236,7 +21234,7 @@ namespace ts { // parameter types yet and therefore excess property checks may yield false positives (see #17041). const checkArgType = checkMode & CheckMode.SkipContextSensitive ? getRegularTypeOfObjectLiteral(argType) : argType; if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain, errorOutputContainer)) { - Debug.assert(!reportErrors || !!errorOutputContainer.errors, "has error 2"); // CLEAR + Debug.assert(!reportErrors || !!errorOutputContainer.errors, "parameter should have errors when reporting errors"); return errorOutputContainer.errors || []; } } @@ -21245,7 +21243,7 @@ namespace ts { const spreadType = getSpreadArgumentType(args, argCount, args.length, restType, /*context*/ undefined); const errorNode = reportErrors ? argCount < args.length ? args[argCount] : node : undefined; if (!checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, undefined, errorOutputContainer)) { - Debug.assert(!reportErrors || !!errorOutputContainer.errors, "has error 3"); // CLEAR + Debug.assert(!reportErrors || !!errorOutputContainer.errors, "rest parameter should have errors when reporting errors"); return errorOutputContainer.errors || []; } } diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt index 733bb200e99..e1969542774 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt @@ -1,18 +1,14 @@ -tests/cases/conformance/jsx/file.tsx(12,13): error TS2322: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. - Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -tests/cases/conformance/jsx/file.tsx(13,13): error TS2741: Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. -tests/cases/conformance/jsx/file.tsx(14,31): error TS2322: Type 'true' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(16,13): error TS2322: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. - Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -tests/cases/conformance/jsx/file.tsx(17,13): error TS2322: Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. - Types of property 'yy' are incompatible. - Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(25,13): error TS2741: Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. -tests/cases/conformance/jsx/file.tsx(26,40): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(33,32): error TS2322: Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(34,29): error TS2322: Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(35,29): error TS2322: Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(36,29): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(12,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(13,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(14,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(16,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(17,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(25,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(26,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(33,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(34,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(35,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No suitable overload for this call. ==== tests/cases/conformance/jsx/file.tsx (11 errors) ==== @@ -28,27 +24,49 @@ tests/cases/conformance/jsx/file.tsx(36,29): error TS2322: Type 'string' is not // Error const c0 = ; // extra property; - ~~~~~~~~ -!!! error TS2322: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -!!! error TS2322: Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:12:13: Overload 1 of 2, '(): Element', gave the following error. + Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. + Property 'extraProp' does not exist on type 'IntrinsicAttributes'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:12:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. + Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c1 = ; // missing property; - ~~~~~~~~ -!!! error TS2741: Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. -!!! related TS2728 tests/cases/conformance/jsx/file.tsx:3:43: 'yy1' is declared here. + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:13:13: Overload 1 of 2, '(): Element', gave the following error. + Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. + Property 'yy' does not exist on type 'IntrinsicAttributes'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:13:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. const c2 = ; // type incompatible; - ~~~ -!!! error TS2322: Type 'true' is not assignable to type 'string'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:43: The expected type comes from property 'yy1' which is declared here on type 'IntrinsicAttributes & { yy: number; yy1: string; }' + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:14:13: Overload 1 of 2, '(): Element', gave the following error. + Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'. + Property 'yy1' does not exist on type 'IntrinsicAttributes'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:14:31: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Type 'true' is not assignable to type 'string'. const c3 = ; // This is OK becuase all attribute are spread const c4 = ; // extra property; - ~~~~~~~~ -!!! error TS2322: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -!!! error TS2322: Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:16:13: Overload 1 of 2, '(): Element', gave the following error. + Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. + Property 'y1' does not exist on type 'IntrinsicAttributes'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:16:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. + Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c5 = ; // type incompatible; - ~~~~~~~~ -!!! error TS2322: Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. -!!! error TS2322: Types of property 'yy' are incompatible. -!!! error TS2322: Type 'boolean' is not assignable to type 'number'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:17:13: Overload 1 of 2, '(): Element', gave the following error. + Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:17:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. + Types of property 'yy' are incompatible. + Type 'boolean' is not assignable to type 'number'. const c6 = ; // Should error as there is extra attribute that doesn't match any. Current it is not const c7 = ; // Should error as there is extra attribute that doesn't match any. Current it is not @@ -57,13 +75,20 @@ tests/cases/conformance/jsx/file.tsx(36,29): error TS2322: Type 'string' is not // Error const d1 = - ~~~~~~~~~~~~~~~ -!!! error TS2741: Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. -!!! related TS2728 tests/cases/conformance/jsx/file.tsx:22:38: 'yy' is declared here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:25:29: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. + Type 'true' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:25:13: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. + Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. const d2 = - ~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:22:50: The expected type comes from property 'direction' which is declared here on type 'IntrinsicAttributes & { yy: string; direction?: number; }' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:26:13: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. + Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. + Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:26:40: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. + Type 'string' is not assignable to type 'number'. declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element; declare function TestingOptional(a: {y1?: string, y2?: number, children: JSX.Element}): JSX.Element; @@ -71,19 +96,43 @@ tests/cases/conformance/jsx/file.tsx(36,29): error TS2322: Type 'string' is not // Error const e1 = - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:64: The expected type comes from property 'y3' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:33:29: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type 'true' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:33:29: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + Type 'true' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:33:32: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. const e2 = - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:34:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:34:13: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. + Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:34:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. const e3 = - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:35:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:35:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + Type 'string' is not assignable to type 'Element'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:35:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. const e4 = Hi - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:36:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:36:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:36:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt index 9a5486fa8bf..1b3b140d458 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt @@ -72,15 +72,21 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No suitable overload const b6 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No suitable overload for this call. -!!! related TS2322 tests/cases/conformance/jsx/file.tsx:54:51: Type 'number' is not assignable to type 'string'. -!!! related TS2322 tests/cases/conformance/jsx/file.tsx:54:51: Type 'number' is not assignable to type 'string'. -!!! related TS2322 tests/cases/conformance/jsx/file.tsx:54:51: Type 'number' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:54:51: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Type 'number' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:54:51: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Type 'number' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:54:51: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. + Type 'number' is not assignable to type 'string'. const b7 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No suitable overload for this call. -!!! related TS2322 tests/cases/conformance/jsx/file.tsx:55:68: Type 'true' is not assignable to type 'string'. -!!! related TS2322 tests/cases/conformance/jsx/file.tsx:55:68: Type 'true' is not assignable to type 'string'. -!!! related TS2322 tests/cases/conformance/jsx/file.tsx:55:68: Type 'true' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:55:68: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Type 'true' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:55:68: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Type 'true' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:55:68: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. + Type 'true' is not assignable to type 'string'. const b8 = ; // incorrect type for specified hyphanated name ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No suitable overload for this call. @@ -88,4 +94,5 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No suitable overload Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. !!! related TS2757 tests/cases/conformance/jsx/file.tsx:56:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. -!!! related TS2322 tests/cases/conformance/jsx/file.tsx:56:24: Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:56:24: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. + Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt index 38d4435a46d..d956253311b 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt @@ -1,6 +1,5 @@ -tests/cases/conformance/jsx/file.tsx(9,15): error TS2741: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. -tests/cases/conformance/jsx/file.tsx(10,15): error TS2322: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. - Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. +tests/cases/conformance/jsx/file.tsx(9,14): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No suitable overload for this call. ==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== @@ -13,12 +12,24 @@ tests/cases/conformance/jsx/file.tsx(10,15): error TS2322: Type 'T & { ignore-pr // Error function Baz(arg1: T, arg2: U) { let a0 = - ~~~~~~~~~~~~~~~~~ -!!! error TS2741: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. -!!! related TS2728 tests/cases/conformance/jsx/file.tsx:5:49: 'b' is declared here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:9:15: Overload 1 of 3, '(): Element', gave the following error. + Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. + Property 'a' does not exist on type 'IntrinsicAttributes'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:9:33: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. + Type 'number' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:9:15: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. + Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. let a2 = // missing a - ~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. -!!! error TS2322: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. -!!! related TS2728 tests/cases/conformance/jsx/file.tsx:5:55: 'a' is declared here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:10:15: Overload 1 of 3, '(): Element', gave the following error. + Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:10:15: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. + Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }'. + Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: string; "ignore-prop": boolean; }'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:10:15: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. + Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. + Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. } \ No newline at end of file From b58932e638ee8ffe96facbfbaedc14c4a15ccacb Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 25 Jun 2019 14:54:43 -0700 Subject: [PATCH 32/95] Fix lint and remove done TODOs --- src/compiler/checker.ts | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 42364fb1a80..ea2b0ecd199 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11706,8 +11706,6 @@ namespace ts { containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ): boolean { - // TODO: The first case probably still needs to set errorOutputContainer.error to something - // TODO: Make sure all error logging in dynamic scope sets errorOutputContainer.error instead if (!node || isOrHasGenericConditional(target)) return false; if (!checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined) && elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage, containingMessageChain, errorOutputContainer)) { @@ -11958,7 +11956,7 @@ namespace ts { if (moreThanOneRealChildren) { if (arrayLikeTargetParts !== neverType) { const realSource = createTupleType(checkJsxChildren(containingElement, CheckMode.Normal)); - const children = generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic) + const children = generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic); result = elaborateElementwise(children, realSource, arrayLikeTargetParts, relation, containingMessageChain, errorOutputContainer) || result; } else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { @@ -12418,7 +12416,7 @@ namespace ts { return getObjectFlags(source) & ObjectFlags.JsxAttributes && !isUnhyphenatedJsxName(sourceProp.escapedName); } - /** + /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). * @param source The left-hand-side of the relation. * @param target The right-hand-side of the relation. @@ -21207,7 +21205,15 @@ namespace ts { // can be specified by users through attributes property. const paramType = getEffectiveFirstArgumentForJsxSignature(signature, node); const attributesType = checkExpressionWithContextualType(node.attributes, paramType, /*inferenceContext*/ undefined, checkMode); - return checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes, undefined, containingMessageChain, errorOutputContainer); + return checkTypeRelatedToAndOptionallyElaborate( + attributesType, + paramType, + relation, + reportErrors ? node.tagName : undefined, + node.attributes, + /*headMessage*/ undefined, + containingMessageChain, + errorOutputContainer); } function getSignatureApplicabilityError( @@ -21263,7 +21269,7 @@ namespace ts { if (restType) { const spreadType = getSpreadArgumentType(args, argCount, args.length, restType, /*context*/ undefined); const errorNode = reportErrors ? argCount < args.length ? args[argCount] : node : undefined; - if (!checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, undefined, errorOutputContainer)) { + if (!checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, /*containingMessageChain*/ undefined, errorOutputContainer)) { Debug.assert(!reportErrors || !!errorOutputContainer.errors, "rest parameter should have errors when reporting errors"); return errorOutputContainer.errors || []; } @@ -21600,34 +21606,38 @@ namespace ts { if (candidatesForArgumentError) { if (candidatesForArgumentError.length === 1 || candidatesForArgumentError.length > 3) { const last = candidatesForArgumentError[candidatesForArgumentError.length - 1]; - let chain: DiagnosticMessageChain | undefined = undefined; + let chain: DiagnosticMessageChain | undefined; if (candidatesForArgumentError.length > 3) { chain = chainDiagnosticMessages(chain, Diagnostics.The_last_overload_gave_the_following_error); chain = chainDiagnosticMessages(chain, Diagnostics.No_suitable_overload_for_this_call); } const ds = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - Debug.assert(!!ds, "No error for last signature"); if (ds) { // if elaboration already displayed the error, don't do anything extra // note that we could do this always here, but getSignatureApplicabilityError is currently not configured to do that - for (const d of ds as Diagnostic[]) { + for (const d of ds) { diagnostics.add(d); } } + else { + Debug.assert(false, "No error for last overload signature"); + } } else { const related: DiagnosticRelatedInformation[] = []; let i = 0; for (const c of candidatesForArgumentError) { i++; - const chain = () => chainDiagnosticMessages(undefined, Diagnostics.Overload_0_of_1_2_gave_the_following_error, i, candidates.length, signatureToString(c)); + const chain = () => chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Overload_0_of_1_2_gave_the_following_error, i, candidates.length, signatureToString(c)); const ds = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, chain); - Debug.assert(!!ds, "No error for signature (1)"); if (ds) { - related.push(...ds as Diagnostic[]) + related.push(...ds); + } + else { + Debug.assert(false, "No error for 3 or fewer overload signatures"); } } - diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.No_suitable_overload_for_this_call), related)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(/*details*/ undefined, Diagnostics.No_suitable_overload_for_this_call), related)); } } else if (candidateForArgumentArityError) { From 68968fd396326a4a5ba1418ab24e576f11eb8c46 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 26 Jun 2019 10:05:44 -0700 Subject: [PATCH 33/95] Improve error messages and related spans --- src/compiler/checker.ts | 25 +-- src/compiler/diagnosticMessages.json | 18 +- .../reference/bigintWithLib.errors.txt | 20 +-- .../checkJsxChildrenCanBeTupleType.errors.txt | 8 +- .../constructorOverloads1.errors.txt | 16 +- ...StringLiteralsInJsxAttributes02.errors.txt | 32 ++-- .../controlFlowIterationErrors.errors.txt | 16 +- tests/baselines/reference/for-of39.errors.txt | 8 +- .../reference/functionOverloads2.errors.txt | 8 +- .../reference/functionOverloads40.errors.txt | 8 +- .../reference/functionOverloads41.errors.txt | 8 +- ...edMethodWithOverloadedArguments.errors.txt | 26 +-- .../heterogeneousArrayAndOverloads.errors.txt | 12 +- .../reference/incompatibleTypes.errors.txt | 16 +- ...ritedConstructorWithRestParams2.errors.txt | 16 +- .../iterableArrayPattern28.errors.txt | 8 +- .../iteratorSpreadInArray6.errors.txt | 8 +- ...attersForSignatureGroupIdentity.errors.txt | 16 +- .../baselines/reference/overload1.errors.txt | 8 +- .../reference/overloadResolution.errors.txt | 24 +-- ...loadResolutionClassConstructors.errors.txt | 8 +- .../overloadResolutionConstructors.errors.txt | 24 +-- .../overloadResolutionTest1.errors.txt | 24 +-- .../overloadingOnConstants2.errors.txt | 8 +- ...nWithConstraintCheckingDeferred.errors.txt | 10 +- .../overloadsWithProvisionalErrors.errors.txt | 16 +- .../reference/promisePermutations.errors.txt | 165 +++++++++++------- .../reference/promisePermutations2.errors.txt | 60 ++++--- .../reference/promisePermutations3.errors.txt | 105 ++++++----- .../reference/promiseTypeInference.errors.txt | 8 +- ...actDefaultPropsInferenceSuccess.errors.txt | 24 +-- .../recursiveFunctionTypes.errors.txt | 10 +- ...edSignatureAsCallbackParameter1.errors.txt | 16 +- .../reference/strictBindCallApply1.errors.txt | 32 ++-- ...eStringsWithOverloadResolution1.errors.txt | 32 ++-- ...ingsWithOverloadResolution1_ES6.errors.txt | 32 ++-- ...eStringsWithOverloadResolution3.errors.txt | 24 +-- ...ingsWithOverloadResolution3_ES6.errors.txt | 24 +-- .../tsxElementResolution9.errors.txt | 24 +-- .../tsxNotUsingApparentTypeOfSFC.errors.txt | 8 +- ...elessFunctionComponentOverload4.errors.txt | 96 +++++----- ...elessFunctionComponentOverload5.errors.txt | 40 ++--- ...ionComponentsWithTypeArguments4.errors.txt | 20 +-- .../reference/underscoreTest1.errors.txt | 8 +- .../unionTypeCallSignatures.errors.txt | 16 +- .../unionTypeConstructSignatures.errors.txt | 16 +- 46 files changed, 615 insertions(+), 536 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ea2b0ecd199..e26a8a46436 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21609,18 +21609,19 @@ namespace ts { let chain: DiagnosticMessageChain | undefined; if (candidatesForArgumentError.length > 3) { chain = chainDiagnosticMessages(chain, Diagnostics.The_last_overload_gave_the_following_error); - chain = chainDiagnosticMessages(chain, Diagnostics.No_suitable_overload_for_this_call); + chain = chainDiagnosticMessages(chain, Diagnostics.No_overload_matches_this_call); } - const ds = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - if (ds) { - // if elaboration already displayed the error, don't do anything extra - // note that we could do this always here, but getSignatureApplicabilityError is currently not configured to do that - for (const d of ds) { + const diags = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + if (diags) { + for (const d of diags) { + if (last.declaration && candidatesForArgumentError.length > 3) { + addRelatedInfo(d, createDiagnosticForNode(last.declaration, Diagnostics.The_last_overload_is_declared_here)); + } diagnostics.add(d); } } else { - Debug.assert(false, "No error for last overload signature"); + Debug.fail("No error for last overload signature"); } } else { @@ -21629,15 +21630,15 @@ namespace ts { for (const c of candidatesForArgumentError) { i++; const chain = () => chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Overload_0_of_1_2_gave_the_following_error, i, candidates.length, signatureToString(c)); - const ds = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, chain); - if (ds) { - related.push(...ds); + const diags = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, chain); + if (diags) { + related.push(...diags); } else { - Debug.assert(false, "No error for 3 or fewer overload signatures"); + Debug.fail("No error for 3 or fewer overload signatures"); } } - diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(/*details*/ undefined, Diagnostics.No_suitable_overload_for_this_call), related)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(/*details*/ undefined, Diagnostics.No_overload_matches_this_call), related)); } } else if (candidateForArgumentArityError) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 7d2a344c777..8dbc74c6b12 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2621,18 +2621,30 @@ "category": "Error", "code": 2754 }, - "No suitable overload for this call.": { + "No overload matches this call.": { "category": "Error", "code": 2755 }, - "The last overload gave the following error.": { + "The closest overload gave the following error.": { "category": "Error", "code": 2756 }, - "Overload {0} of {1}, '{2}', gave the following error.": { + "The closest overload is declared here.": { "category": "Error", "code": 2757 }, + "The last overload gave the following error.": { + "category": "Error", + "code": 2758 + }, + "The last overload is declared here.": { + "category": "Error", + "code": 2759 + }, + "Overload {0} of {1}, '{2}', gave the following error.": { + "category": "Error", + "code": 2760 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/tests/baselines/reference/bigintWithLib.errors.txt b/tests/baselines/reference/bigintWithLib.errors.txt index c716a1dda26..836e2397ae3 100644 --- a/tests/baselines/reference/bigintWithLib.errors.txt +++ b/tests/baselines/reference/bigintWithLib.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/bigintWithLib.ts(4,1): error TS2350: Only a void function can be called with the 'new' keyword. -tests/cases/compiler/bigintWithLib.ts(16,15): error TS2755: No suitable overload for this call. +tests/cases/compiler/bigintWithLib.ts(16,15): error TS2755: No overload matches this call. tests/cases/compiler/bigintWithLib.ts(21,13): error TS2540: Cannot assign to 'length' because it is a read-only property. -tests/cases/compiler/bigintWithLib.ts(28,16): error TS2755: No suitable overload for this call. +tests/cases/compiler/bigintWithLib.ts(28,16): error TS2755: No overload matches this call. tests/cases/compiler/bigintWithLib.ts(33,13): error TS2540: Cannot assign to 'length' because it is a read-only property. tests/cases/compiler/bigintWithLib.ts(40,25): error TS2345: Argument of type '-1' is not assignable to parameter of type 'bigint'. tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '123' is not assignable to parameter of type 'bigint'. @@ -27,10 +27,10 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 bigIntArray = new BigInt64Array([1n, 2n, 3n]); bigIntArray = new BigInt64Array([1, 2, 3]); // should error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. Argument of type 'number[]' is not assignable to parameter of type 'number'. -!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. +!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. Types of property '[Symbol.iterator]' are incompatible. Type '() => IterableIterator' is not assignable to type '() => Iterator'. @@ -39,7 +39,7 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. Type 'IteratorResult' is not assignable to type 'IteratorResult'. Type 'number' is not assignable to type 'bigint'. -!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error. +!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error. Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] bigIntArray = new BigInt64Array(new ArrayBuffer(80)); @@ -57,12 +57,12 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 bigUintArray = new BigUint64Array([1n, 2n, 3n]); bigUintArray = new BigUint64Array([1, 2, 3]); // should error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. Argument of type 'number[]' is not assignable to parameter of type 'number'. -!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. +!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. -!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error. +!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error. Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. Type 'number[]' is not assignable to type 'SharedArrayBuffer'. bigUintArray = new BigUint64Array(new ArrayBuffer(80)); diff --git a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt index 8348b2cfe11..5e38aa9c574 100644 --- a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2755: No overload matches this call. ==== tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx (1 errors) ==== @@ -20,14 +20,14 @@ tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2 const testErr = ~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx:17:18: Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx:17:18: Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. Types of property 'children' are incompatible. Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. -!!! related TS2757 tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx:17:18: Overload 2 of 2, '(props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx:17:18: Overload 2 of 2, '(props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. Types of property 'children' are incompatible. Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. diff --git a/tests/baselines/reference/constructorOverloads1.errors.txt b/tests/baselines/reference/constructorOverloads1.errors.txt index 2a1dc25f0c2..5f560ff38d8 100644 --- a/tests/baselines/reference/constructorOverloads1.errors.txt +++ b/tests/baselines/reference/constructorOverloads1.errors.txt @@ -2,8 +2,8 @@ tests/cases/compiler/constructorOverloads1.ts(2,5): error TS2392: Multiple const tests/cases/compiler/constructorOverloads1.ts(3,5): error TS2392: Multiple constructor implementations are not allowed. tests/cases/compiler/constructorOverloads1.ts(4,5): error TS2392: Multiple constructor implementations are not allowed. tests/cases/compiler/constructorOverloads1.ts(7,5): error TS2392: Multiple constructor implementations are not allowed. -tests/cases/compiler/constructorOverloads1.ts(16,10): error TS2755: No suitable overload for this call. -tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2755: No suitable overload for this call. +tests/cases/compiler/constructorOverloads1.ts(16,10): error TS2755: No overload matches this call. +tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2755: No overload matches this call. ==== tests/cases/compiler/constructorOverloads1.ts (6 errors) ==== @@ -36,17 +36,17 @@ tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2755: No suitable var f2 = new Foo(0); var f3 = new Foo(f1); ~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/constructorOverloads1.ts:16:18: Overload 1 of 2, '(s: string): Foo', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/constructorOverloads1.ts:16:18: Overload 1 of 2, '(s: string): Foo', gave the following error. Argument of type 'Foo' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/compiler/constructorOverloads1.ts:16:18: Overload 2 of 2, '(n: number): Foo', gave the following error. +!!! related TS2760 tests/cases/compiler/constructorOverloads1.ts:16:18: Overload 2 of 2, '(n: number): Foo', gave the following error. Argument of type 'Foo' is not assignable to parameter of type 'number'. var f4 = new Foo([f1,f2,f3]); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/constructorOverloads1.ts:17:18: Overload 1 of 2, '(s: string): Foo', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/constructorOverloads1.ts:17:18: Overload 1 of 2, '(s: string): Foo', gave the following error. Argument of type 'any[]' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/compiler/constructorOverloads1.ts:17:18: Overload 2 of 2, '(n: number): Foo', gave the following error. +!!! related TS2760 tests/cases/compiler/constructorOverloads1.ts:17:18: Overload 2 of 2, '(n: number): Foo', gave the following error. Argument of type 'any[]' is not assignable to parameter of type 'number'. f1.bar1(); diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt index 890eb71337f..73fc41eeaf8 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,12): error TS2755: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,12): error TS2755: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,12): error TS2755: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,12): error TS2755: No overload matches this call. tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(33,13): error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. @@ -37,38 +37,38 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): err const b0 = {console.log(k)}}} extra />; // k has type "left" | "right" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:27:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:27:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:27:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:27:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. const b2 = {console.log(k)}} extra />; // k has type "left" | "right" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:28:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:28:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:28:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:28:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. const b3 = ; // goTo has type"home" | "contact" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:29:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:29:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:29:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:29:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. const b4 = ; // goTo has type "home" | "contact" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:30:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:30:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:30:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:30:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. diff --git a/tests/baselines/reference/controlFlowIterationErrors.errors.txt b/tests/baselines/reference/controlFlowIterationErrors.errors.txt index aaf153f3b44..4ce7e28a5d1 100644 --- a/tests/baselines/reference/controlFlowIterationErrors.errors.txt +++ b/tests/baselines/reference/controlFlowIterationErrors.errors.txt @@ -2,8 +2,8 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(11,17): error Type 'number' is not assignable to type 'string'. tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(22,17): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(34,13): error TS2755: No suitable overload for this call. -tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error TS2755: No suitable overload for this call. +tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(34,13): error TS2755: No overload matches this call. +tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error TS2755: No overload matches this call. ==== tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts (4 errors) ==== @@ -48,11 +48,11 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error while (cond) { x = foo(x); ~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:34:17: Overload 1 of 2, '(x: string): number', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:34:17: Overload 1 of 2, '(x: string): number', gave the following error. Argument of type 'string | number' is not assignable to parameter of type 'string'. Type 'number' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:34:17: Overload 2 of 2, '(x: number): string', gave the following error. +!!! related TS2760 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:34:17: Overload 2 of 2, '(x: number): string', gave the following error. Argument of type 'string | number' is not assignable to parameter of type 'number'. Type 'string' is not assignable to type 'number'. x; @@ -67,11 +67,11 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error x; x = foo(x); ~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:45:17: Overload 1 of 2, '(x: string): number', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:45:17: Overload 1 of 2, '(x: string): number', gave the following error. Argument of type 'string | number' is not assignable to parameter of type 'string'. Type 'number' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:45:17: Overload 2 of 2, '(x: number): string', gave the following error. +!!! related TS2760 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:45:17: Overload 2 of 2, '(x: number): string', gave the following error. Argument of type 'string | number' is not assignable to parameter of type 'number'. Type 'string' is not assignable to type 'number'. } diff --git a/tests/baselines/reference/for-of39.errors.txt b/tests/baselines/reference/for-of39.errors.txt index d5e48579c28..36bdbdf9447 100644 --- a/tests/baselines/reference/for-of39.errors.txt +++ b/tests/baselines/reference/for-of39.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2755: No overload matches this call. ==== tests/cases/conformance/es6/for-ofStatements/for-of39.ts (1 errors) ==== var map = new Map([["", true], ["", 0]]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:19: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:19: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable'. Types of property '[Symbol.iterator]' are incompatible. Type '() => IterableIterator<[string, number] | [string, true]>' is not assignable to type '() => Iterator'. @@ -17,7 +17,7 @@ tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2755: No Type '[string, number]' is not assignable to type 'readonly [string, boolean]'. Types of property '1' are incompatible. Type 'number' is not assignable to type 'boolean'. -!!! related TS2757 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:37: Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:37: Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map', gave the following error. Type 'number' is not assignable to type 'boolean'. for (var [k, v] of map) { k; diff --git a/tests/baselines/reference/functionOverloads2.errors.txt b/tests/baselines/reference/functionOverloads2.errors.txt index 71149141f45..913c3cb49e3 100644 --- a/tests/baselines/reference/functionOverloads2.errors.txt +++ b/tests/baselines/reference/functionOverloads2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No suitable overload for this call. +tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No overload matches this call. ==== tests/cases/compiler/functionOverloads2.ts (1 errors) ==== @@ -7,8 +7,8 @@ tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No suitable overl function foo(bar: any): any { return bar }; var x = foo(true); ~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/functionOverloads2.ts:4:13: Overload 1 of 2, '(bar: string): string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/functionOverloads2.ts:4:13: Overload 1 of 2, '(bar: string): string', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/compiler/functionOverloads2.ts:4:13: Overload 2 of 2, '(bar: number): number', gave the following error. +!!! related TS2760 tests/cases/compiler/functionOverloads2.ts:4:13: Overload 2 of 2, '(bar: number): number', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index b0706ed9650..9e99d383746 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No suitable overload for this call. +tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No overload matches this call. ==== tests/cases/compiler/functionOverloads40.ts (1 errors) ==== @@ -7,9 +7,9 @@ tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No suitable over function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{a:'bar'}]); ~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. Type 'string' is not assignable to type 'number'. -!!! related TS2757 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! related TS2760 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. 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 430a6e295c6..95b3296e5c9 100644 --- a/tests/baselines/reference/functionOverloads41.errors.txt +++ b/tests/baselines/reference/functionOverloads41.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No suitable overload for this call. +tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No overload matches this call. ==== tests/cases/compiler/functionOverloads41.ts (1 errors) ==== @@ -7,9 +7,9 @@ tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No suitable over function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{}]); ~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. Property 'a' is missing in type '{}' but required in type '{ a: number; }'. -!!! related TS2757 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! related TS2760 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt index 064ced0b442..9c1f49a581b 100644 --- a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt +++ b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(23,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(52,22): error TS2755: No suitable overload for this call. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(68,22): error TS2755: No suitable overload for this call. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(84,22): error TS2755: No suitable overload for this call. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(52,22): error TS2755: No overload matches this call. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(68,22): error TS2755: No overload matches this call. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(84,22): error TS2755: No overload matches this call. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts (4 errors) ==== @@ -64,12 +64,12 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:52:38: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:52:38: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:52:38: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. +!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:52:38: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. } @@ -89,15 +89,15 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. +!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. -!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. +!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. } @@ -117,12 +117,12 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:84:38: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:84:38: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'boolean'. -!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:84:38: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. +!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:84:38: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. } diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt index 8c2d8ed2617..d6ced6a25a1 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No suitable overload for this call. +tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No overload matches this call. ==== tests/cases/compiler/heterogeneousArrayAndOverloads.ts (1 errors) ==== @@ -12,14 +12,14 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No su this.test([]); this.test([1, 2, "hi", 5]); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:26: Overload 1 of 2, '(arg1: number[]): any', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:26: Overload 1 of 2, '(arg1: number[]): any', gave the following error. Type 'string' is not assignable to type 'number'. -!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:20: Overload 2 of 2, '(arg1: string[]): any', gave the following error. +!!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:20: Overload 2 of 2, '(arg1: string[]): any', gave the following error. Type 'number' is not assignable to type 'string'. -!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:23: Overload 2 of 2, '(arg1: string[]): any', gave the following error. +!!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:23: Overload 2 of 2, '(arg1: string[]): any', gave the following error. Type 'number' is not assignable to type 'string'. -!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:32: Overload 2 of 2, '(arg1: string[]): any', gave the following error. +!!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:32: Overload 2 of 2, '(arg1: string[]): any', gave the following error. Type 'number' is not assignable to type 'string'. } } \ No newline at end of file diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index b6b32526162..a9290e9988a 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -9,8 +9,8 @@ tests/cases/compiler/incompatibleTypes.ts(26,12): error TS2416: Property 'p1' in Type 'number' is not assignable to type 'string'. tests/cases/compiler/incompatibleTypes.ts(34,12): error TS2416: Property 'p1' in type 'C4' is not assignable to the same property in base type 'IFoo4'. Type '{ c: { b: string; }; d: string; }' is missing the following properties from type '{ a: { a: string; }; b: string; }': a, b -tests/cases/compiler/incompatibleTypes.ts(42,1): error TS2755: No suitable overload for this call. -tests/cases/compiler/incompatibleTypes.ts(49,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/incompatibleTypes.ts(42,1): error TS2755: No overload matches this call. +tests/cases/compiler/incompatibleTypes.ts(49,1): error TS2755: No overload matches this call. tests/cases/compiler/incompatibleTypes.ts(66,47): error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2322: Type '5' is not assignable to type '() => string'. @@ -76,13 +76,13 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => var c2: C2; if1(c1); ~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/incompatibleTypes.ts:42:5: Overload 1 of 2, '(i: IFoo1): void', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/incompatibleTypes.ts:42:5: Overload 1 of 2, '(i: IFoo1): void', gave the following error. Argument of type 'C1' is not assignable to parameter of type 'IFoo1'. Types of property 'p1' are incompatible. Type '() => string' is not assignable to type '() => number'. Type 'string' is not assignable to type 'number'. -!!! related TS2757 tests/cases/compiler/incompatibleTypes.ts:42:5: Overload 2 of 2, '(i: IFoo2): void', gave the following error. +!!! related TS2760 tests/cases/compiler/incompatibleTypes.ts:42:5: Overload 2 of 2, '(i: IFoo2): void', gave the following error. Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. Types of property 'p1' are incompatible. Type '() => string' is not assignable to type '(s: string) => number'. @@ -95,11 +95,11 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => of1({ e: 0, f: 0 }); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/incompatibleTypes.ts:49:7: Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/incompatibleTypes.ts:49:7: Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'. Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. -!!! related TS2757 tests/cases/compiler/incompatibleTypes.ts:49:7: Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error. +!!! related TS2760 tests/cases/compiler/incompatibleTypes.ts:49:7: Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error. Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt index 027e9788a45..da0ca0f92f9 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/inheritedConstructorWithRestParams2.ts(32,13): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. -tests/cases/compiler/inheritedConstructorWithRestParams2.ts(33,1): error TS2755: No suitable overload for this call. -tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/inheritedConstructorWithRestParams2.ts(33,1): error TS2755: No overload matches this call. +tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2755: No overload matches this call. ==== tests/cases/compiler/inheritedConstructorWithRestParams2.ts (3 errors) ==== @@ -40,15 +40,15 @@ tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2755: !!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new Derived("", 3, "", 3); ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:33:20: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:33:20: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. Argument of type '""' is not assignable to parameter of type 'number'. -!!! related TS2757 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:33:17: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. +!!! related TS2760 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:33:17: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. Argument of type '3' is not assignable to parameter of type 'string'. new Derived("", 3, "", ""); ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:34:20: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:34:20: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. Argument of type '""' is not assignable to parameter of type 'number'. -!!! related TS2757 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:34:17: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. +!!! related TS2760 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:34:17: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. Argument of type '3' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern28.errors.txt b/tests/baselines/reference/iterableArrayPattern28.errors.txt index 53e41cb1de3..a64d2b9a413 100644 --- a/tests/baselines/reference/iterableArrayPattern28.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern28.errors.txt @@ -1,12 +1,12 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error TS2755: No overload matches this call. ==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (1 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:32: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:32: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. Types of property '[Symbol.iterator]' are incompatible. Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator'. @@ -18,5 +18,5 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. Types of property '1' are incompatible. Type 'boolean' is not assignable to type 'number'. -!!! related TS2757 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:52: Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:52: Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. Type 'true' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt index 0747bd48366..6a11cc31fff 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755: No overload matches this call. ==== tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts (1 errors) ==== @@ -18,13 +18,13 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755 var array: number[] = [0, 1]; array.concat([...new SymbolIterator]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts:15:14: Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts:15:14: Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. Types of property 'slice' are incompatible. Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'. Type 'symbol[]' is not assignable to type 'number[]'. Type 'symbol' is not assignable to type 'number'. -!!! related TS2757 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts:15:14: Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts:15:14: Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. Type 'symbol[]' is not assignable to type 'ConcatArray'. \ No newline at end of file diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt index e525d7e6276..bcab0991b08 100644 --- a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,1): error TS2755: No overload matches this call. tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'w' must be of type 'A', but here has type 'C'. -tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS2755: No overload matches this call. ==== tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts (3 errors) ==== @@ -24,11 +24,11 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS275 v({ s: "", n: 0 }).toLowerCase(); ~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:19:12: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:19:12: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. -!!! related TS2757 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:19:5: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. +!!! related TS2760 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:19:5: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. @@ -40,10 +40,10 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS275 w({ s: "", n: 0 }).toLowerCase(); ~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:24:12: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:24:12: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. -!!! related TS2757 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:24:5: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. +!!! related TS2760 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:24:5: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt index 775e77602f3..6625de2f9a6 100644 --- a/tests/baselines/reference/overload1.errors.txt +++ b/tests/baselines/reference/overload1.errors.txt @@ -3,7 +3,7 @@ tests/cases/compiler/overload1.ts(29,1): error TS2322: Type 'number' is not assi tests/cases/compiler/overload1.ts(31,11): error TS2554: Expected 1-2 arguments, but got 3. tests/cases/compiler/overload1.ts(32,5): error TS2554: Expected 1-2 arguments, but got 0. tests/cases/compiler/overload1.ts(33,1): error TS2322: Type 'C' is not assignable to type 'string'. -tests/cases/compiler/overload1.ts(34,3): error TS2755: No suitable overload for this call. +tests/cases/compiler/overload1.ts(34,3): error TS2755: No overload matches this call. ==== tests/cases/compiler/overload1.ts (6 errors) ==== @@ -53,10 +53,10 @@ tests/cases/compiler/overload1.ts(34,3): error TS2755: No suitable overload for !!! error TS2322: Type 'C' is not assignable to type 'string'. z=x.h(2,2); // no match ~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/overload1.ts:34:7: Overload 1 of 2, '(s1: string, s2: number): string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/overload1.ts:34:7: Overload 1 of 2, '(s1: string, s2: number): string', gave the following error. Argument of type '2' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/compiler/overload1.ts:34:9: Overload 2 of 2, '(s1: number, s2: string): number', gave the following error. +!!! related TS2760 tests/cases/compiler/overload1.ts:34:9: Overload 2 of 2, '(s1: number, s2: string): number', gave the following error. Argument of type '2' is not assignable to parameter of type 'string'. z=x.h("hello",0); // good diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index 6be2c4058c9..a64c341f2cb 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,1): error TS2755: No overload matches this call. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2558: Expected 3 type arguments, but got 4. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,1): error TS2755: No suitable overload for this call. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,1): error TS2755: No overload matches this call. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -39,10 +39,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // No candidate overloads found fn1({}); // Error ~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:27:5: Overload 1 of 2, '(s: string): string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:27:5: Overload 1 of 2, '(s: string): string', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:27:5: Overload 2 of 2, '(s: number): number', gave the following error. +!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:27:5: Overload 2 of 2, '(s: number): number', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments @@ -112,17 +112,17 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4(true, null); // Error ~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:84:5: Overload 1 of 2, '(n: string, m: any): any', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:84:5: Overload 1 of 2, '(n: string, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:84:5: Overload 2 of 2, '(n: number, m: any): any', gave the following error. +!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:84:5: Overload 2 of 2, '(n: number, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. fn4(null, true); // Error ~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:85:11: Overload 1 of 2, '(n: any, m: number): any', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:85:11: Overload 1 of 2, '(n: any, m: number): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:85:11: Overload 2 of 2, '(n: any, m: string): any', gave the following error. +!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:85:11: Overload 2 of 2, '(n: any, m: string): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index 8cf0b4e0fd6..569fe146ac8 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,1): error TS2755: No overload matches this call. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,9): error TS2558: Expected 3 type arguments, but got 1. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,9): error TS2558: Expected 3 type arguments, but got 2. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,9): error TS2558: Expected 3 type arguments, but got 4. @@ -43,10 +43,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru // No candidate overloads found new fn1({}); // Error ~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts:27:9: Overload 1 of 2, '(s: string): fn1', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts:27:9: Overload 1 of 2, '(s: string): fn1', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts:27:9: Overload 2 of 2, '(s: number): fn1', gave the following error. +!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts:27:9: Overload 2 of 2, '(s: number): fn1', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index 769eab3a9eb..eef196f17cb 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,1): error TS2755: No overload matches this call. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2558: Expected 3 type arguments, but got 4. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,1): error TS2755: No suitable overload for this call. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,1): error TS2755: No overload matches this call. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,26): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -39,10 +39,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // No candidate overloads found new fn1({}); // Error ~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:27:9: Overload 1 of 2, '(s: string): string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:27:9: Overload 1 of 2, '(s: string): string', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:27:9: Overload 2 of 2, '(s: number): number', gave the following error. +!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:27:9: Overload 2 of 2, '(s: number): number', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments @@ -119,17 +119,17 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints new fn4(true, null); // Error ~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:91:9: Overload 1 of 2, '(n: string, m: any): any', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:91:9: Overload 1 of 2, '(n: string, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:91:9: Overload 2 of 2, '(n: number, m: any): any', gave the following error. +!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:91:9: Overload 2 of 2, '(n: number, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. new fn4(null, true); // Error ~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:92:15: Overload 1 of 2, '(n: any, m: number): any', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:92:15: Overload 1 of 2, '(n: any, m: number): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:92:15: Overload 2 of 2, '(n: any, m: string): any', gave the following error. +!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:92:15: Overload 2 of 2, '(n: any, m: string): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index f765e3d27d7..46f0bb623ff 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/overloadResolutionTest1.ts(7,12): error TS2755: No suitable overload for this call. -tests/cases/compiler/overloadResolutionTest1.ts(18,10): error TS2755: No suitable overload for this call. -tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No suitable overload for this call. +tests/cases/compiler/overloadResolutionTest1.ts(7,12): error TS2755: No overload matches this call. +tests/cases/compiler/overloadResolutionTest1.ts(18,10): error TS2755: No overload matches this call. +tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload matches this call. ==== tests/cases/compiler/overloadResolutionTest1.ts (3 errors) ==== @@ -12,10 +12,10 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No suitable var x11 = foo([{a:0}]); // works var x111 = foo([{a:"s"}]); // error - does not match any signature ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. Type 'string' is not assignable to type 'number'. -!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. 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 @@ -29,10 +29,10 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No suitable var x3 = foo2({a:true}); // works var x4 = foo2({a:"s"}); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. Type 'string' is not assignable to type 'number'. -!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. +!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. Type 'string' is not assignable to type 'boolean'. @@ -41,8 +41,8 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No suitable function foo4(bar:{a:any;}):any{ return bar }; var x = foo4({a:true}); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. Type 'true' is not assignable to type 'number'. -!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. +!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadingOnConstants2.errors.txt b/tests/baselines/reference/overloadingOnConstants2.errors.txt index 6d1be3d8f24..d9844b26e28 100644 --- a/tests/baselines/reference/overloadingOnConstants2.errors.txt +++ b/tests/baselines/reference/overloadingOnConstants2.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/overloadingOnConstants2.ts(9,10): error TS2394: This overload signature is not compatible with its implementation signature. -tests/cases/compiler/overloadingOnConstants2.ts(15,9): error TS2755: No suitable overload for this call. +tests/cases/compiler/overloadingOnConstants2.ts(15,9): error TS2755: No overload matches this call. tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overload signature is not compatible with its implementation signature. @@ -23,10 +23,10 @@ tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overl var b: E = foo("bye", []); // E var c = foo("um", []); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/overloadingOnConstants2.ts:15:13: Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/overloadingOnConstants2.ts:15:13: Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. Argument of type '"um"' is not assignable to parameter of type '"hi"'. -!!! related TS2757 tests/cases/compiler/overloadingOnConstants2.ts:15:13: Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. +!!! related TS2760 tests/cases/compiler/overloadingOnConstants2.ts:15:13: Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. Argument of type '"um"' is not assignable to parameter of type '"bye"'. diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt index 1804a123d84..b1254d24a8a 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -3,7 +3,7 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,37): Property 'x' is missing in type 'D' but required in type 'A'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,38): error TS2344: Type 'D' does not satisfy the constraint 'A'. -tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,23): error TS2755: No suitable overload for this call. +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,23): error TS2755: No overload matches this call. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): error TS2344: Type 'D' does not satisfy the constraint 'A'. @@ -45,15 +45,15 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): ~~~~~~~~~~~~~ }); ~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. Type 'G' is not assignable to type 'number'. -!!! related TS2757 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. +!!! related TS2760 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. Types of parameters 'x' and 'x' are incompatible. Property 'q' is missing in type 'C' but required in type 'D'. -!!! related TS2757 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. +!!! related TS2760 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. Types of parameters 'x' and 'x' are incompatible. Property 'q' is missing in type 'B' but required in type 'D'. diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt index 2f2d4a5f5cd..cc65c84b4a5 100644 --- a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,1): error TS2755: No overload matches this call. tests/cases/compiler/overloadsWithProvisionalErrors.ts(7,17): error TS2304: Cannot find name 'blah'. -tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,1): error TS2755: No overload matches this call. tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cannot find name 'blah'. @@ -12,20 +12,20 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cann func(s => ({})); // Error for no applicable overload (object type is missing a and b) ~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:6: Overload 1 of 2, '(s: string): number', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:6: Overload 1 of 2, '(s: string): number', gave the following error. Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. +!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) ~~~~ !!! error TS2304: Cannot find name 'blah'. func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:6: Overload 1 of 2, '(s: string): number', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:6: Overload 1 of 2, '(s: string): number', gave the following error. Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. +!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. ~~~~ !!! error TS2304: Cannot find name 'blah'. \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index dfbc1f9a507..2a27563fa24 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -1,125 +1,125 @@ -tests/cases/compiler/promisePermutations.ts(74,70): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(74,70): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(79,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(79,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(82,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(82,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(83,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(83,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(84,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(84,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(88,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(88,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(91,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(91,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(92,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(92,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations.ts(93,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(93,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(97,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(97,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(100,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(100,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(101,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(101,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations.ts(102,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(102,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(106,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(106,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(109,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(109,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(110,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(110,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(111,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(111,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(117,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(117,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(120,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(120,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(121,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(121,19): error TS2755: No overload matches this call. The last overload gave the following error. 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 TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(122,19): error TS2755: No overload matches this call. The last overload gave the following error. 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 TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(126,19): error TS2755: No overload matches this call. The last overload gave the following error. 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,33): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(129,33): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(132,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(132,19): error TS2755: No overload matches this call. The last overload gave the following error. 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 TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(133,19): error TS2755: No overload matches this call. The last overload gave the following error. 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 TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(134,19): error TS2755: No overload matches this call. The last overload gave the following error. 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,33): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(137,33): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations.ts(144,35): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(144,35): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -tests/cases/compiler/promisePermutations.ts(152,36): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(152,36): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -tests/cases/compiler/promisePermutations.ts(156,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(156,21): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations.ts(158,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(158,21): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations.ts(159,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(159,21): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'Promise' is not assignable to type 'IPromise'. @@ -206,126 +206,143 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No suitable o var s3c = s3.then(testFunction3P, testFunction3, testFunction3); var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'IPromise' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var r4: IPromise; var sIPromise: (x: any) => IPromise; var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. !!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -333,68 +350,78 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No suitable o var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok ~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. !!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. !!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); @@ -403,9 +430,10 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No suitable o var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok ~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s10 = testFunction10P(x => x); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok @@ -415,38 +443,42 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No suitable o var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. !!! error TS2755: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. !!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. !!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. !!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. !!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2755: Type 'Promise' is not assignable to type 'IPromise'. @@ -455,6 +487,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No suitable o !!! error TS2755: Types of parameters 'onfulfilled' and 'success' are incompatible. !!! error TS2755: Types of parameters 'value' and 'value' are incompatible. !!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index 5845b3ab9aa..7c852d4e370 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/promisePermutations2.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations2.ts(78,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(78,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. @@ -15,46 +15,46 @@ tests/cases/compiler/promisePermutations2.ts(82,19): error TS2345: Argument of t tests/cases/compiler/promisePermutations2.ts(83,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations2.ts(87,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(87,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(90,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations2.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(96,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(96,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(99,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(100,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations2.ts(101,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(105,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(105,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(108,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(108,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(109,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(109,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(110,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(110,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(116,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(116,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(119,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. 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 TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(125,19): error TS2755: No overload matches this call. The last overload gave the following error. 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,33): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(128,33): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. @@ -64,12 +64,12 @@ tests/cases/compiler/promisePermutations2.ts(132,19): error TS2345: Argument of 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,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations2.ts(143,35): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(143,35): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. tests/cases/compiler/promisePermutations2.ts(151,36): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -tests/cases/compiler/promisePermutations2.ts(155,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(155,21): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. @@ -172,11 +172,12 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error @@ -199,9 +200,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error @@ -218,9 +220,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error @@ -237,32 +240,36 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. !!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -270,9 +277,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error @@ -289,18 +297,20 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. !!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error @@ -326,9 +336,10 @@ 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 TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s10 = testFunction10P(x => x); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok @@ -346,11 +357,12 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. !!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 1e59f21ae1b..4e00aba27b4 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/promisePermutations3.ts(68,69): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(73,70): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(73,70): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. @@ -9,39 +9,39 @@ tests/cases/compiler/promisePermutations3.ts(73,70): error TS2755: No suitable o tests/cases/compiler/promisePermutations3.ts(78,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(81,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(81,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(82,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(82,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(83,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(83,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations3.ts(87,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(90,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(90,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(91,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(91,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations3.ts(92,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(92,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations3.ts(96,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(99,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(99,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(100,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(100,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations3.ts(101,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(101,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations3.ts(105,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. @@ -55,50 +55,50 @@ tests/cases/compiler/promisePermutations3.ts(110,19): error TS2345: Argument of Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. tests/cases/compiler/promisePermutations3.ts(116,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(119,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(119,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(120,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(120,19): error TS2755: No overload matches this call. The last overload gave the following error. 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 TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(121,19): error TS2755: No overload matches this call. The last overload gave the following error. 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,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(131,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(131,19): error TS2755: No overload matches this call. The last overload gave the following error. 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 TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(132,19): error TS2755: No overload matches this call. The last overload gave the following error. 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 TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(133,19): error TS2755: No overload matches this call. The last overload gave the following error. 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,33): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(136,33): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. tests/cases/compiler/promisePermutations3.ts(143,35): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(151,36): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(151,36): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. 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'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations3.ts(157,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(157,21): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations3.ts(158,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(158,21): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations3.ts(159,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(159,21): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'Promise' is not assignable to type 'IPromise'. @@ -190,11 +190,12 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s3c = s3.then(testFunction3P, testFunction3, testFunction3); var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'IPromise' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var r4: IPromise; var sIPromise: (x: any) => IPromise; @@ -208,25 +209,28 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; @@ -237,19 +241,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; @@ -260,19 +267,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; @@ -308,19 +318,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; @@ -338,27 +351,31 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. !!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); @@ -377,11 +394,12 @@ 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 TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. !!! error TS2755: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. !!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; @@ -393,20 +411,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. !!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. !!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2755: Type 'Promise' is not assignable to type 'IPromise'. @@ -415,6 +435,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! error TS2755: Types of parameters 'onfulfilled' and 'success' are incompatible. !!! error TS2755: Types of parameters 'value' and 'value' are incompatible. !!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/promiseTypeInference.errors.txt b/tests/baselines/reference/promiseTypeInference.errors.txt index ebd8bcf947b..237f3067063 100644 --- a/tests/baselines/reference/promiseTypeInference.errors.txt +++ b/tests/baselines/reference/promiseTypeInference.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No suitable overload for this call. +tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No overload matches this call. ==== tests/cases/compiler/promiseTypeInference.ts (1 errors) ==== @@ -13,10 +13,10 @@ tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No suitable o var $$x = load("something").then(s => convert(s)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! related TS2757 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. +!!! related TS2760 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. Type 'IPromise' is not assignable to type 'number | PromiseLike'. Type 'IPromise' is not assignable to type 'PromiseLike'. Types of property 'then' are incompatible. diff --git a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt index d49b31bc38d..9d8f05d7b35 100644 --- a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt +++ b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2755: No suitable overload for this call. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2755: No suitable overload for this call. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2755: No overload matches this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2755: No overload matches this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: No overload matches this call. ==== tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx (3 errors) ==== @@ -32,12 +32,12 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: // Error: Void not assignable to boolean const Test2 = () => console.log(value)} />; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:27:36: Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:27:36: Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. Type 'void' is not assignable to type 'boolean'. -!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:27:36: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. +!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:27:36: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. @@ -57,12 +57,12 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: // Error: Void not assignable to boolean const Test2a = () => console.log(value)} error>Hah; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:43:41: Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:43:41: Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. Type 'void' is not assignable to type 'boolean'. -!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:43:41: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. +!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:43:41: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. @@ -87,11 +87,11 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: // Error: Void not assignable to boolean const Test4 = () => console.log(value)} />; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:64:37: Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:64:37: Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. Type 'void' is not assignable to type 'boolean'. -!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:64:37: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. +!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:64:37: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. // OK diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index 72821c437af..b0091454264 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -11,7 +11,7 @@ tests/cases/compiler/recursiveFunctionTypes.ts(30,10): error TS2394: This overlo tests/cases/compiler/recursiveFunctionTypes.ts(33,8): error TS2554: Expected 0-1 arguments, but got 2. tests/cases/compiler/recursiveFunctionTypes.ts(34,4): error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. tests/cases/compiler/recursiveFunctionTypes.ts(42,8): error TS2554: Expected 0-1 arguments, but got 2. -tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2755: No overload matches this call. ==== tests/cases/compiler/recursiveFunctionTypes.ts (13 errors) ==== @@ -85,11 +85,11 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2755: No suitable !!! error TS2554: Expected 0-1 arguments, but got 2. f7(""); // ok (function takes an any param) ~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. -!!! related TS2757 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 2 of 4, '(a: number): number', gave the following error. +!!! related TS2760 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 2 of 4, '(a: number): number', gave the following error. Argument of type '""' is not assignable to parameter of type 'number'. -!!! related TS2757 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 3 of 4, '(a?: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }', gave the following error. +!!! related TS2760 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 3 of 4, '(a?: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }', gave the following error. Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. f7(); // ok \ No newline at end of file diff --git a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt index 8757e85713a..86f3e1c8904 100644 --- a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt +++ b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(7,1): error TS2755: No suitable overload for this call. -tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(7,1): error TS2755: No overload matches this call. +tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2755: No overload matches this call. ==== tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts (2 errors) ==== @@ -11,19 +11,19 @@ tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2 // both are errors x3(1, (x: string) => 1); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:7:7: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:7:7: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. -!!! related TS2757 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:7:4: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. +!!! related TS2760 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:7:4: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. Argument of type '1' is not assignable to parameter of type 'string'. x3(1, (x: 'hm') => 1); ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:8:7: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:8:7: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type '"hm"'. -!!! related TS2757 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:8:4: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. +!!! related TS2760 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:8:4: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. Argument of type '1' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/strictBindCallApply1.errors.txt b/tests/baselines/reference/strictBindCallApply1.errors.txt index e5e6fe1e850..496bee9108f 100644 --- a/tests/baselines/reference/strictBindCallApply1.errors.txt +++ b/tests/baselines/reference/strictBindCallApply1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2755: No suitable overload for this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2755: No overload matches this call. tests/cases/conformance/functions/strictBindCallApply1.ts(17,15): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(18,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(19,44): error TS2554: Expected 3 arguments, but got 4. @@ -8,8 +8,8 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(23,37): error TS2322: tests/cases/conformance/functions/strictBindCallApply1.ts(24,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. -tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2755: No suitable overload for this call. -tests/cases/conformance/functions/strictBindCallApply1.ts(42,11): error TS2755: No suitable overload for this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2755: No overload matches this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(42,11): error TS2755: No overload matches this call. tests/cases/conformance/functions/strictBindCallApply1.ts(48,17): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(49,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(50,38): error TS2554: Expected 3 arguments, but got 4. @@ -18,7 +18,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(54,26): error TS2345: tests/cases/conformance/functions/strictBindCallApply1.ts(55,31): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(56,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. tests/cases/conformance/functions/strictBindCallApply1.ts(57,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. -tests/cases/conformance/functions/strictBindCallApply1.ts(62,11): error TS2755: No suitable overload for this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(62,11): error TS2755: No overload matches this call. tests/cases/conformance/functions/strictBindCallApply1.ts(65,3): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(66,15): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(67,24): error TS2554: Expected 3 arguments, but got 4. @@ -40,10 +40,10 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f02 = foo.bind(undefined, 10, "hello"); let f03 = foo.bind(undefined, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:11:35: Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:11:35: Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. Argument of type '20' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:11:11: Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. +!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:11:11: Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. The 'this' context of type '(a: number, b: string) => string' is not assignable to method's 'this' of type '(this: undefined, ...args: (10 | 20)[]) => string'. Types of parameters 'b' and 'args' are incompatible. Type '10 | 20' is not assignable to type 'string'. @@ -94,20 +94,20 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f12 = c.foo.bind(c, 10, "hello"); let f13 = c.foo.bind(c, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:41:29: Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:41:29: Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. Argument of type '20' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:41:11: Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. +!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:41:11: Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (10 | 20)[]) => string'. Types of parameters 'b' and 'args' are incompatible. Type '10 | 20' is not assignable to type 'string'. Type '10' is not assignable to type 'string'. let f14 = c.foo.bind(undefined); // Error ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:42:22: Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:42:22: Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. Argument of type 'undefined' is not assignable to parameter of type 'C'. -!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:42:11: Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. +!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:42:11: Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (string | number)[]) => string'. Types of parameters 'a' and 'args' are incompatible. Type 'string | number' is not assignable to type 'number'. @@ -149,10 +149,10 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f22 = C.bind(undefined, 10, "hello"); let f23 = C.bind(undefined, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:62:33: Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:62:33: Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. Argument of type '20' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:62:11: Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. +!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:62:11: Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. The 'this' context of type 'typeof C' is not assignable to method's 'this' of type 'new (...args: (10 | 20)[]) => C'. Types of parameters 'b' and 'args' are incompatible. Type '10 | 20' is not assignable to type 'string'. diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt index 187d7dab5cc..c8528ceaf93 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(9,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(11,9): error TS2755: No suitable overload for this call. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,9): error TS2755: No suitable overload for this call. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,9): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(11,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,9): error TS2755: No overload matches this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,9): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,9): error TS2755: No overload matches this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4. @@ -28,24 +28,24 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio !!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var c = foo([], 1, 2); // boolean ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:11:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:11:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:11:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:11:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var d = foo([], 1, true); // boolean (with error) ~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:12:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:12:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:12:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:12:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var e = foo([], 1, "2"); // {} ~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:13:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:13:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:13:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:13:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var f = foo([], 1, 2, 3); // any (with error) ~ @@ -56,10 +56,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var w = foo `${1}${2}`; // boolean var x = foo `${1}${true}`; // boolean (with error) ~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:19:20: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:19:20: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:19:20: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:19:20: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. var y = foo `${1}${"2"}`; // {} var z = foo `${1}${2}${3}`; // any (with error) diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt index 150c66be410..b103d9eef9e 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(9,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,9): error TS2755: No suitable overload for this call. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,9): error TS2755: No suitable overload for this call. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,9): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,9): error TS2755: No overload matches this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,9): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,9): error TS2755: No overload matches this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4. @@ -28,24 +28,24 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio !!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var c = foo([], 1, 2); // boolean ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:11:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:11:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:11:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:11:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var d = foo([], 1, true); // boolean (with error) ~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:12:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:12:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:12:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:12:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var e = foo([], 1, "2"); // {} ~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:13:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:13:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:13:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:13:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var f = foo([], 1, 2, 3); // any (with error) ~ @@ -56,10 +56,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var w = foo `${1}${2}`; // boolean var x = foo `${1}${true}`; // boolean (with error) ~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:19:20: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:19:20: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:19:20: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:19:20: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. var y = foo `${1}${"2"}`; // {} var z = foo `${1}${2}${3}`; // any (with error) diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt index 4d5ec42700c..06986bf66f7 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(9,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(9,1): error TS2755: No overload matches this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(62,1): error TS2755: No suitable overload for this call. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(62,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,1): error TS2755: No overload matches this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(69,18): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -17,10 +17,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // No candidate overloads found fn1 `${ {} }`; // Error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:9:9: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:9:9: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:9:9: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:9:9: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. function fn2(strs: TemplateStringsArray, s: string, n: number): number; @@ -81,17 +81,17 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4 `${ true }${ null }`; ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:62:9: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:62:9: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:62:9: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:62:9: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:63:18: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:63:18: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:63:18: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:63:18: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt index 2e1e1f2ffc1..1d641d2611e 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,1): error TS2755: No overload matches this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,1): error TS2755: No suitable overload for this call. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,1): error TS2755: No overload matches this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(69,18): error TS2551: Property 'toFixed' does not exist on type 'string'. Did you mean 'fixed'? @@ -17,10 +17,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // No candidate overloads found fn1 `${ {} }`; // Error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:9:9: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:9:9: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:9:9: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:9:9: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. function fn2(strs: TemplateStringsArray, s: string, n: number): number; @@ -81,17 +81,17 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4 `${ true }${ null }`; ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:62:9: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:62:9: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:62:9: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:62:9: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:63:18: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:63:18: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:63:18: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:63:18: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors diff --git a/tests/baselines/reference/tsxElementResolution9.errors.txt b/tests/baselines/reference/tsxElementResolution9.errors.txt index b350fe0fdbc..6686890b839 100644 --- a/tests/baselines/reference/tsxElementResolution9.errors.txt +++ b/tests/baselines/reference/tsxElementResolution9.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/jsx/file.tsx(11,1): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(18,1): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(11,1): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(18,1): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches this call. ==== tests/cases/conformance/jsx/file.tsx (3 errors) ==== @@ -16,10 +16,10 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No suitable overload f var Obj1: Obj1; ; // Error, return type is not an object type ~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:11:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:11:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. Type '{}' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:11:2: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:11:2: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. Type '{}' is not assignable to type 'number'. interface Obj2 { @@ -29,10 +29,10 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No suitable overload f var Obj2: Obj2; ; // Error, return type is not an object type ~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:18:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:18:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. Type '{}' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:18:2: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:18:2: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. Type '{}' is not assignable to type 'number'. interface Obj3 { @@ -42,9 +42,9 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No suitable overload f var Obj3: Obj3; ; // OK ~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:25:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:25:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. Type '{ x: number; }' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:25:2: Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:25:2: Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. Type '{ x: number; }' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt index e06fffebe85..e85f25c0fdb 100644 --- a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt +++ b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(14,14): error TS2322: Type '{}' is not assignable to type 'P'. '{}' is assignable to the constraint of type 'P', but 'P' could be instantiated with a different subtype of constraint '{}'. -tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2755: No suitable overload for this call. +tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2755: No overload matches this call. ==== tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx (2 errors) ==== @@ -23,10 +23,10 @@ tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2755: No s !!! error TS2322: '{}' is assignable to the constraint of type 'P', but 'P' could be instantiated with a different subtype of constraint '{}'. let y = ; // should error ~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx:15:14: Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx:15:14: Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. Type '{}' is not assignable to type 'Readonly

'. -!!! related TS2757 tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx:15:14: Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. +!!! related TS2760 tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx:15:14: Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. Type '{}' is not assignable to type 'Readonly

'. let z = // should work diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt index e1969542774..c95de6de1f3 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/jsx/file.tsx(12,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(13,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(14,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(16,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(17,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(25,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(26,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(33,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(34,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(35,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(12,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(13,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(14,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(16,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(17,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(25,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(26,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(33,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(34,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(35,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches this call. ==== tests/cases/conformance/jsx/file.tsx (11 errors) ==== @@ -25,45 +25,45 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No suitable overload // Error const c0 = ; // extra property; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:12:13: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:12:13: Overload 1 of 2, '(): Element', gave the following error. Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. Property 'extraProp' does not exist on type 'IntrinsicAttributes'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:12:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:12:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c1 = ; // missing property; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:13:13: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:13:13: Overload 1 of 2, '(): Element', gave the following error. Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. Property 'yy' does not exist on type 'IntrinsicAttributes'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:13:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:13:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. const c2 = ; // type incompatible; ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:14:13: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:14:13: Overload 1 of 2, '(): Element', gave the following error. Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'. Property 'yy1' does not exist on type 'IntrinsicAttributes'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:14:31: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:14:31: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type 'true' is not assignable to type 'string'. const c3 = ; // This is OK becuase all attribute are spread const c4 = ; // extra property; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:16:13: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:16:13: Overload 1 of 2, '(): Element', gave the following error. Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. Property 'y1' does not exist on type 'IntrinsicAttributes'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:16:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:16:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c5 = ; // type incompatible; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:17:13: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:17:13: Overload 1 of 2, '(): Element', gave the following error. Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:17:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:17:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. Types of property 'yy' are incompatible. Type 'boolean' is not assignable to type 'number'. @@ -76,18 +76,18 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No suitable overload // Error const d1 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:25:29: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:25:29: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. Type 'true' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:25:13: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:25:13: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. const d2 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:26:13: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:26:13: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:26:40: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:26:40: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. Type 'string' is not assignable to type 'number'. declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element; @@ -97,42 +97,42 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No suitable overload // Error const e1 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:33:29: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:33:29: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. Type 'true' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:33:29: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:33:29: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. Type 'true' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:33:32: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:33:32: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. const e2 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:34:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:34:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:34:13: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:34:13: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:34:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:34:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. const e3 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:35:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:35:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:35:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:35:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. Type 'string' is not assignable to type 'Element'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:35:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:35:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. const e4 = Hi ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:36:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:36:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:36:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:36:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:36:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:36:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt index 1b3b140d458..f364876a945 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/jsx/file.tsx(48,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(54,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(55,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(48,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(54,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(55,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No overload matches this call. ==== tests/cases/conformance/jsx/file.tsx (4 errors) ==== @@ -54,14 +54,14 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No suitable overload // Error const b0 = {}}>GO; // extra property; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:48:13: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:48:13: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:48:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:48:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:48:13: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:48:13: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. const b1 = {}} {...obj0}>Hello world; // extra property; @@ -71,28 +71,28 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No suitable overload const b5 = ; // Spread retain method declaration (see GitHub #13365), so now there is an extra attributes const b6 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:54:51: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:54:51: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Type 'number' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:54:51: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:54:51: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. Type 'number' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:54:51: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:54:51: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type 'number' is not assignable to type 'string'. const b7 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:55:68: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:55:68: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Type 'true' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:55:68: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:55:68: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. Type 'true' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:55:68: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:55:68: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type 'true' is not assignable to type 'string'. const b8 = ; // incorrect type for specified hyphanated name ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:56:13: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:56:13: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:56:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:56:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:56:24: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:56:24: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt index d956253311b..a8d2a1c004e 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/jsx/file.tsx(9,14): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(9,14): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No overload matches this call. ==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== @@ -13,23 +13,23 @@ tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No suitable overload function Baz(arg1: T, arg2: U) { let a0 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:9:15: Overload 1 of 3, '(): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:9:15: Overload 1 of 3, '(): Element', gave the following error. Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. Property 'a' does not exist on type 'IntrinsicAttributes'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:9:33: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:9:33: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. Type 'number' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:9:15: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:9:15: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. let a2 = // missing a ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:10:15: Overload 1 of 3, '(): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:10:15: Overload 1 of 3, '(): Element', gave the following error. Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:10:15: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:10:15: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }'. Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: string; "ignore-prop": boolean; }'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:10:15: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:10:15: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. } \ No newline at end of file diff --git a/tests/baselines/reference/underscoreTest1.errors.txt b/tests/baselines/reference/underscoreTest1.errors.txt index 971650a4f14..256b6e873aa 100644 --- a/tests/baselines/reference/underscoreTest1.errors.txt +++ b/tests/baselines/reference/underscoreTest1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2755: No overload matches this call. ==== tests/cases/compiler/underscoreTest1_underscoreTests.ts (1 errors) ==== @@ -29,12 +29,12 @@ tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2755: No _.all([true, 1, null, 'yes'], _.identity); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/underscoreTest1_underscoreTests.ts:26:31: Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/underscoreTest1_underscoreTests.ts:26:31: Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. Type 'string | number | boolean' is not assignable to type 'boolean'. Type 'string' is not assignable to type 'boolean'. -!!! related TS2757 tests/cases/compiler/underscoreTest1_underscoreTests.ts:26:7: Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. +!!! related TS2760 tests/cases/compiler/underscoreTest1_underscoreTests.ts:26:7: Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. Index signature is missing in type '(string | number | boolean)[]'. diff --git a/tests/baselines/reference/unionTypeCallSignatures.errors.txt b/tests/baselines/reference/unionTypeCallSignatures.errors.txt index b0ce088ca1b..fd1a5cdb379 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeCallSignatures.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(9,43): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(10,1): error TS2755: No suitable overload for this call. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(10,1): error TS2755: No overload matches this call. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,1): error TS2755: No overload matches this call. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(16,1): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(19,32): error TS2345: Argument of type '10' is not assignable to parameter of type 'never'. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(20,32): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'never'. @@ -41,10 +41,10 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:10:29: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:10:29: Overload 1 of 2, '(a: number): number | Date', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2757 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:10:29: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! related TS2760 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:10:29: Overload 2 of 2, '(a: string): string | boolean', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. var unionOfDifferentReturnType1: { (a: number): number; (a: string): string; } | { (a: number): Date; (a: string): boolean; }; @@ -52,10 +52,10 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 strOrBoolean = unionOfDifferentReturnType1("hello"); unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:15:29: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:15:29: Overload 1 of 2, '(a: number): number | Date', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2757 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:15:29: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! related TS2760 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:15:29: Overload 2 of 2, '(a: string): string | boolean', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. unionOfDifferentReturnType1(); // error missing parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt index d0eadc3cedc..c277a2f6b24 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(9,47): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(10,1): error TS2755: No suitable overload for this call. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(10,1): error TS2755: No overload matches this call. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,1): error TS2755: No overload matches this call. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(16,1): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(19,36): error TS2345: Argument of type '10' is not assignable to parameter of type 'never'. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(20,36): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'never'. @@ -40,10 +40,10 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. new unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:10:33: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:10:33: Overload 1 of 2, '(a: number): number | Date', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2757 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:10:33: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! related TS2760 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:10:33: Overload 2 of 2, '(a: string): string | boolean', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. var unionOfDifferentReturnType1: { new (a: number): number; new (a: string): string; } | { new (a: number): Date; new (a: string): boolean; }; @@ -51,10 +51,10 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro strOrBoolean = new unionOfDifferentReturnType1("hello"); new unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:15:33: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:15:33: Overload 1 of 2, '(a: number): number | Date', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2757 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:15:33: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! related TS2760 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:15:33: Overload 2 of 2, '(a: string): string | boolean', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. new unionOfDifferentReturnType1(); // error missing parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 0436cfca16f504feac2b13b3120d2c802a0231a4 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 26 Jun 2019 12:56:14 -0700 Subject: [PATCH 34/95] Do not report multiple diagnostics per signature. If there are multiple diagnostics per signature, choose the signature with the fewer diagnostics to report. If there are more than one with the minimum, choose the latest in the overload set. --- src/compiler/checker.ts | 18 ++++++++++++++---- src/compiler/core.ts | 1 + src/compiler/diagnosticMessages.json | 8 -------- src/compiler/utilities.ts | 2 +- .../heterogeneousArrayAndOverloads.errors.txt | 6 ------ 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a8f1c0de383..f38bcb88e1d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21632,19 +21632,29 @@ namespace ts { } } else { - const related: DiagnosticRelatedInformation[] = []; + const allDiagnostics: DiagnosticRelatedInformation[][] = []; + let max = 0; + let min = Number.MAX_VALUE; + let minIndex = 0; let i = 0; for (const c of candidatesForArgumentError) { - i++; - const chain = () => chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Overload_0_of_1_2_gave_the_following_error, i, candidates.length, signatureToString(c)); + const chain = () => chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Overload_0_of_1_2_gave_the_following_error, i + 1, candidates.length, signatureToString(c)); const diags = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, chain); if (diags) { - related.push(...diags); + if (diags.length <= min) { + min = diags.length; + minIndex = i; + } + max = Math.max(max, diags.length); + allDiagnostics.push(diags); } else { Debug.fail("No error for 3 or fewer overload signatures"); } + i++; } + + const related = max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics); diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(/*details*/ undefined, Diagnostics.No_overload_matches_this_call), related)); } } diff --git a/src/compiler/core.ts b/src/compiler/core.ts index f1511b79c12..896bf7d849c 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -600,6 +600,7 @@ namespace ts { * * @param array The array to flatten. */ + export function flatten(array: T[][]): T[]; export function flatten(array: ReadonlyArray | undefined>): T[]; export function flatten(array: ReadonlyArray | undefined> | undefined): T[] | undefined; export function flatten(array: ReadonlyArray | undefined> | undefined): T[] | undefined { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 8dbc74c6b12..8d96a91bd82 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2625,14 +2625,6 @@ "category": "Error", "code": 2755 }, - "The closest overload gave the following error.": { - "category": "Error", - "code": 2756 - }, - "The closest overload is declared here.": { - "category": "Error", - "code": 2757 - }, "The last overload gave the following error.": { "category": "Error", "code": 2758 diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index ae5b60cd864..ae230d75154 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -8092,7 +8092,7 @@ namespace ts { visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth); } - return flatten(results); + return flatten(results); function visitDirectory(path: string, absolutePath: string, depth: number | undefined) { const canonicalPath = toCanonical(realpath(absolutePath)); diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt index d6ced6a25a1..9750b678e7f 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt @@ -15,11 +15,5 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No ov !!! error TS2755: No overload matches this call. !!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:26: Overload 1 of 2, '(arg1: number[]): any', gave the following error. Type 'string' is not assignable to type 'number'. -!!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:20: Overload 2 of 2, '(arg1: string[]): any', gave the following error. - Type 'number' is not assignable to type 'string'. -!!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:23: Overload 2 of 2, '(arg1: string[]): any', gave the following error. - Type 'number' is not assignable to type 'string'. -!!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:32: Overload 2 of 2, '(arg1: string[]): any', gave the following error. - Type 'number' is not assignable to type 'string'. } } \ No newline at end of file From 79c604836ad955f2e0d2ad99aa1e1225a92d764b Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Wed, 26 Jun 2019 16:56:54 -0700 Subject: [PATCH 35/95] Use intersectTypes instead of filterType --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 8feb1d4a412..0e18dba6635 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13201,7 +13201,7 @@ namespace ts { const targetConstraint = getConstraintTypeFromMappedType(target); const sourceKeys = getIndexType(source, /*stringsOnly*/ undefined, /*noIndexSignatures*/ true); const includeOptional = modifiers & MappedTypeModifiers.IncludeOptional; - const filteredByApplicability = includeOptional ? filterType(getLiteralTypeFromProperties(target, TypeFlags.StringOrNumberLiteralOrUnique), t => !!isRelatedTo(t, sourceKeys)) : undefined; + const filteredByApplicability = includeOptional ? intersectTypes(targetConstraint, sourceKeys) : undefined; // A source type T is related to a target type { [P in Q]: X } if Q is related to keyof T and T[Q] is related to X. // A source type T is related to a target type { [P in Q]?: X } if some constituent Q' of Q is related to keyof T and T[Q'] is related to X. if (includeOptional From 35dda10865bafcd01547bc0e89dae60db6057d22 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 27 Jun 2019 09:09:59 -0700 Subject: [PATCH 36/95] Fix lint, remove overloads --- src/compiler/core.ts | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 896bf7d849c..c93f6ccb3ab 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -600,25 +600,18 @@ namespace ts { * * @param array The array to flatten. */ - export function flatten(array: T[][]): T[]; - export function flatten(array: ReadonlyArray | undefined>): T[]; - export function flatten(array: ReadonlyArray | undefined> | undefined): T[] | undefined; - export function flatten(array: ReadonlyArray | undefined> | undefined): T[] | undefined { - let result: T[] | undefined; - if (array) { - result = []; - for (const v of array) { - if (v) { - if (isArray(v)) { - addRange(result, v); - } - else { - result.push(v); - } + export function flatten(array: T[][] | ReadonlyArray | undefined>): T[] { + const result = []; + for (const v of array) { + if (v) { + if (isArray(v)) { + addRange(result, v); + } + else { + result.push(v); } } } - return result; } From ba9d8e2e81736854734f07f4441100f29f603bcd Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 27 Jun 2019 16:30:35 -0700 Subject: [PATCH 37/95] Switch DiagnosticMessageChain to be a tree --- src/compiler/builder.ts | 26 ++--------- src/compiler/checker.ts | 5 ++- src/compiler/program.ts | 40 ++++++++--------- src/compiler/types.ts | 2 +- src/compiler/utilities.ts | 91 ++++++++++++++++++++++++++++----------- src/harness/fourslash.ts | 19 +++++--- 6 files changed, 104 insertions(+), 79 deletions(-) diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index d4c2132d36b..e8224e22866 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -20,7 +20,7 @@ namespace ts { messageText: string; category: DiagnosticCategory; code: number; - next?: ReusableDiagnosticMessageChain; + next?: ReusableDiagnosticMessageChain[]; } export interface ReusableBuilderProgramState extends ReusableBuilderState { @@ -263,20 +263,10 @@ namespace ts { } function convertToDiagnosticRelatedInformation(diagnostic: ReusableDiagnosticRelatedInformation, newProgram: Program): DiagnosticRelatedInformation { - const { file, messageText } = diagnostic; + const { file } = diagnostic; return { ...diagnostic, file: file && newProgram.getSourceFileByPath(file), - messageText: messageText === undefined || isString(messageText) ? - messageText : - convertToDiagnosticMessageChain(messageText, newProgram) - }; - } - - function convertToDiagnosticMessageChain(diagnostic: ReusableDiagnosticMessageChain, newProgram: Program): DiagnosticMessageChain { - return { - ...diagnostic, - next: diagnostic.next && convertToDiagnosticMessageChain(diagnostic.next, newProgram) }; } @@ -685,20 +675,10 @@ namespace ts { } function convertToReusableDiagnosticRelatedInformation(diagnostic: DiagnosticRelatedInformation): ReusableDiagnosticRelatedInformation { - const { file, messageText } = diagnostic; + const { file } = diagnostic; return { ...diagnostic, file: file && file.path, - messageText: messageText === undefined || isString(messageText) ? - messageText : - convertToReusableDiagnosticMessageChain(messageText) - }; - } - - function convertToReusableDiagnosticMessageChain(diagnostic: DiagnosticMessageChain): ReusableDiagnosticMessageChain { - return { - ...diagnostic, - next: diagnostic.next && convertToReusableDiagnosticMessageChain(diagnostic.next) }; } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f38bcb88e1d..75e477f55da 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -12460,7 +12460,8 @@ namespace ts { if (containingMessageChain) { const chain = containingMessageChain(); if (chain) { - errorInfo = concatenateDiagnosticMessageChains(chain, errorInfo); + concatenateDiagnosticMessageChains(chain, errorInfo); + errorInfo = chain; } } @@ -21655,7 +21656,7 @@ namespace ts { } const related = max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics); - diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(/*details*/ undefined, Diagnostics.No_overload_matches_this_call), related)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.No_overload_matches_this_call), related)); } } else if (candidateForArgumentArityError) { diff --git a/src/compiler/program.ts b/src/compiler/program.ts index f5ede694f8c..b409370d018 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -502,30 +502,30 @@ namespace ts { return output; } - export function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain | undefined, newLine: string): string { - if (isString(messageText)) { - return messageText; + export function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent = 0): string { + if (isString(diag)) { + return diag; } - else { - let diagnosticChain = messageText; - let result = ""; + else if (diag === undefined) { + return ""; + } + let result = ""; + if (indent) { + result += newLine; - let indent = 0; - while (diagnosticChain) { - if (indent) { - result += newLine; - - for (let i = 0; i < indent; i++) { - result += " "; - } - } - result += diagnosticChain.messageText; - indent++; - diagnosticChain = diagnosticChain.next; + for (let i = 0; i < indent; i++) { + result += " "; } - - return result; } + result += diag.messageText; + indent++; + if (diag.next) { + // TODO: Should be possible to optimise the common, non-tree case + for (const kid of diag.next) { + result += flattenDiagnosticMessageText(kid, newLine, indent); + } + } + return result; } /* @internal */ diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 4442f339d83..86b5174278b 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4561,7 +4561,7 @@ namespace ts { messageText: string; category: DiagnosticCategory; code: number; - next?: DiagnosticMessageChain; + next?: DiagnosticMessageChain[]; } export interface Diagnostic extends DiagnosticRelatedInformation { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index ae230d75154..4d7eaf65a24 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -7112,8 +7112,8 @@ namespace ts { }; } - export function chainDiagnosticMessages(details: DiagnosticMessageChain | undefined, message: DiagnosticMessage, ...args: (string | number | undefined)[]): DiagnosticMessageChain; - export function chainDiagnosticMessages(details: DiagnosticMessageChain | undefined, message: DiagnosticMessage): DiagnosticMessageChain { + export function chainDiagnosticMessages(details: DiagnosticMessageChain | DiagnosticMessageChain[] | undefined, message: DiagnosticMessage, ...args: (string | number | undefined)[]): DiagnosticMessageChain; + export function chainDiagnosticMessages(details: DiagnosticMessageChain | DiagnosticMessageChain[] | undefined, message: DiagnosticMessage): DiagnosticMessageChain { let text = getLocaleSpecificMessage(message); if (arguments.length > 2) { @@ -7125,18 +7125,17 @@ namespace ts { category: message.category, code: message.code, - next: details + next: details === undefined || Array.isArray(details) ? details : [details] }; } - export function concatenateDiagnosticMessageChains(headChain: DiagnosticMessageChain, tailChain: DiagnosticMessageChain): DiagnosticMessageChain { + export function concatenateDiagnosticMessageChains(headChain: DiagnosticMessageChain, tailChain: DiagnosticMessageChain): void { let lastChain = headChain; while (lastChain.next) { - lastChain = lastChain.next; + lastChain = lastChain.next[0]; } - lastChain.next = tailChain; - return headChain; + lastChain.next = [tailChain]; } function getDiagnosticFilePath(diagnostic: Diagnostic): string | undefined { @@ -7171,30 +7170,70 @@ namespace ts { return d1.relatedInformation ? Comparison.LessThan : Comparison.GreaterThan; } - function compareMessageText(t1: string | DiagnosticMessageChain, t2: string | DiagnosticMessageChain): Comparison { - let text1: string | DiagnosticMessageChain | undefined = t1; - let text2: string | DiagnosticMessageChain | undefined = t2; - while (text1 && text2) { - // We still have both chains. - const string1 = isString(text1) ? text1 : text1.messageText; - const string2 = isString(text2) ? text2 : text2.messageText; + // function compareMessageText(t1: string | DiagnosticMessageChain[], t2: string | DiagnosticMessageChain[]): Comparison { + // if (typeof t1 === 'string' && typeof t2 === 'string') { + // return compareStringsCaseSensitive(t1, t2) + // } + // else if (Array.isArray(t1) && Array.isArray(t2)) { + // if (t1.length < t2.length) { + // return Comparison.LessThan; + // } + // else if (t1.length > t2.length) { + // return Comparison.GreaterThan; + // } + // else { + // for (let i = 0; i < t1.length; i++) { + // t1[i].messageText + // const res = cmps(t1[i], t2[i]); + // if (res) { + // return res; + // } + // } + // return Comparison.EqualTo; + // } + // } + // else if (typeof t1 === 'string') { + // return Comparison.LessThan; + // } + // else { + // return Comparison.GreaterThan; + // } + // } - const res = compareStringsCaseSensitive(string1, string2); + function compareMessageText(t1: string | DiagnosticMessageChain, t2: string | DiagnosticMessageChain): Comparison { + if (typeof t1 === 'string' && typeof t2 === 'string') { + return compareStringsCaseSensitive(t1, t2); + } + else if (typeof t1 === 'string') { + return Comparison.LessThan; + } + else if (typeof t2 === 'string') { + return Comparison.GreaterThan; + } + let res = compareStringsCaseSensitive(t1.messageText, t2.messageText); + if (res) { + return res; + } + if (!t1.next && !t2.next) { + return Comparison.EqualTo; + } + if (!t1.next) { + return Comparison.LessThan; + } + if (!t2.next) { + return Comparison.GreaterThan; + } + res = compareValues(t1.next.length, t2.next.length); + if (res) { + return res; + } + for (let i = 0; i < t1.next.length; i++) { + res = compareMessageText(t1.next[i], t2.next[i]) if (res) { return res; } - - text1 = isString(text1) ? undefined : text1.next; - text2 = isString(text2) ? undefined : text2.next; } - - if (!text1 && !text2) { - // if the chains are done, then these messages are the same. - return Comparison.EqualTo; - } - - // We still have one chain remaining. The shorter chain should come first. - return text1 ? Comparison.GreaterThan : Comparison.LessThan; + return Comparison.EqualTo; } export function getEmitScriptTarget(compilerOptions: CompilerOptions) { diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index cbe4c3336d7..84fb7f390ba 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1482,13 +1482,7 @@ Actual: ${stringify(fullActual)}`); const diagnostics = ts.getPreEmitDiagnostics(this.languageService.getProgram()!); // TODO: GH#18217 for (const diagnostic of diagnostics) { if (!ts.isString(diagnostic.messageText)) { - let chainedMessage: ts.DiagnosticMessageChain | undefined = diagnostic.messageText; - let indentation = " "; - while (chainedMessage) { - resultString += indentation + chainedMessage.messageText + Harness.IO.newLine(); - chainedMessage = chainedMessage.next; - indentation = indentation + " "; - } + resultString += this.flattenChainedMessage(diagnostic.messageText); } else { resultString += " " + diagnostic.messageText + Harness.IO.newLine(); @@ -1506,6 +1500,17 @@ Actual: ${stringify(fullActual)}`); Harness.Baseline.runBaseline(ts.Debug.assertDefined(this.testData.globalOptions[MetadataOptionNames.baselineFile]), resultString); } + private flattenChainedMessage(diag: ts.DiagnosticMessageChain, indent = " ") { + let result = ""; + result += indent + diag.messageText + Harness.IO.newLine(); + if (diag.next) { + for (const kid of diag.next) { + result += this.flattenChainedMessage(kid, indent + " "); + } + } + return result; + } + public baselineQuickInfo() { const baselineFile = this.getBaselineFileName(); Harness.Baseline.runBaseline( From 5c6c1a3efe640d565e1d0bf0e0399b02b3866cc6 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 27 Jun 2019 16:48:00 -1000 Subject: [PATCH 38/95] Add regression test --- tests/cases/compiler/infiniteConstraints.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/cases/compiler/infiniteConstraints.ts b/tests/cases/compiler/infiniteConstraints.ts index e914b738efc..a1dcc754260 100644 --- a/tests/cases/compiler/infiniteConstraints.ts +++ b/tests/cases/compiler/infiniteConstraints.ts @@ -36,3 +36,15 @@ const shouldBeError = ensureNoDuplicates({main: value("dup"), alternate: value(" type Cond = T extends number ? number : never; declare function function1}>(): T[keyof T]["foo"]; + +// Repro from #31823 + +export type Prepend = + T extends unknown ? + ((arg: Elm, ...rest: T) => void) extends ((...args: infer T2) => void) ? T2 : + never : + never; +export type ExactExtract = T extends U ? U extends T ? T : never : never; + +type Conv = + { 0: [T]; 1: Prepend>>;}[U extends T ? 0 : 1]; From a1c6d9e671a01be3ebb7cb9a7e85f27f9fb1909b Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 27 Jun 2019 16:48:06 -1000 Subject: [PATCH 39/95] Accept new baselines --- .../reference/infiniteConstraints.errors.txt | 17 ++++++- .../reference/infiniteConstraints.js | 13 +++++ .../reference/infiniteConstraints.symbols | 50 +++++++++++++++++++ .../reference/infiniteConstraints.types | 23 +++++++++ 4 files changed, 102 insertions(+), 1 deletion(-) diff --git a/tests/baselines/reference/infiniteConstraints.errors.txt b/tests/baselines/reference/infiniteConstraints.errors.txt index 685b18932c1..2548b00f044 100644 --- a/tests/baselines/reference/infiniteConstraints.errors.txt +++ b/tests/baselines/reference/infiniteConstraints.errors.txt @@ -2,9 +2,10 @@ tests/cases/compiler/infiniteConstraints.ts(4,37): error TS2536: Type '"val"' ca tests/cases/compiler/infiniteConstraints.ts(31,43): error TS2322: Type 'Record<"val", "dup">' is not assignable to type 'never'. tests/cases/compiler/infiniteConstraints.ts(31,63): error TS2322: Type 'Record<"val", "dup">' is not assignable to type 'never'. tests/cases/compiler/infiniteConstraints.ts(36,71): error TS2536: Type '"foo"' cannot be used to index type 'T[keyof T]'. +tests/cases/compiler/infiniteConstraints.ts(48,16): error TS2589: Type instantiation is excessively deep and possibly infinite. -==== tests/cases/compiler/infiniteConstraints.ts (4 errors) ==== +==== tests/cases/compiler/infiniteConstraints.ts (5 errors) ==== // Both of the following types trigger the recursion limiter in getImmediateBaseConstraint type T1], { val: string }>["val"] }> = B; @@ -51,4 +52,18 @@ tests/cases/compiler/infiniteConstraints.ts(36,71): error TS2536: Type '"foo"' c declare function function1}>(): T[keyof T]["foo"]; ~~~~~~~~~~~~~~~~~ !!! error TS2536: Type '"foo"' cannot be used to index type 'T[keyof T]'. + + // Repro from #31823 + + export type Prepend = + T extends unknown ? + ((arg: Elm, ...rest: T) => void) extends ((...args: infer T2) => void) ? T2 : + never : + never; + export type ExactExtract = T extends U ? U extends T ? T : never : never; + + type Conv = + { 0: [T]; 1: Prepend>>;}[U extends T ? 0 : 1]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2589: Type instantiation is excessively deep and possibly infinite. \ No newline at end of file diff --git a/tests/baselines/reference/infiniteConstraints.js b/tests/baselines/reference/infiniteConstraints.js index 03a4d70e00c..547091f5cf2 100644 --- a/tests/baselines/reference/infiniteConstraints.js +++ b/tests/baselines/reference/infiniteConstraints.js @@ -35,11 +35,24 @@ const shouldBeError = ensureNoDuplicates({main: value("dup"), alternate: value(" type Cond = T extends number ? number : never; declare function function1}>(): T[keyof T]["foo"]; + +// Repro from #31823 + +export type Prepend = + T extends unknown ? + ((arg: Elm, ...rest: T) => void) extends ((...args: infer T2) => void) ? T2 : + never : + never; +export type ExactExtract = T extends U ? U extends T ? T : never : never; + +type Conv = + { 0: [T]; 1: Prepend>>;}[U extends T ? 0 : 1]; //// [infiniteConstraints.js] "use strict"; // Both of the following types trigger the recursion limiter in getImmediateBaseConstraint +exports.__esModule = true; var out = myBug({ obj1: { a: "test" } }); var noError = ensureNoDuplicates({ main: value("test"), alternate: value("test2") }); var shouldBeNoError = ensureNoDuplicates({ main: value("test") }); diff --git a/tests/baselines/reference/infiniteConstraints.symbols b/tests/baselines/reference/infiniteConstraints.symbols index 6306203a7e0..2fa45c84f10 100644 --- a/tests/baselines/reference/infiniteConstraints.symbols +++ b/tests/baselines/reference/infiniteConstraints.symbols @@ -138,3 +138,53 @@ declare function function1}>(): T[keyof T] >T : Symbol(T, Decl(infiniteConstraints.ts, 35, 27)) >T : Symbol(T, Decl(infiniteConstraints.ts, 35, 27)) +// Repro from #31823 + +export type Prepend = +>Prepend : Symbol(Prepend, Decl(infiniteConstraints.ts, 35, 88)) +>Elm : Symbol(Elm, Decl(infiniteConstraints.ts, 39, 20)) +>T : Symbol(T, Decl(infiniteConstraints.ts, 39, 24)) + + T extends unknown ? +>T : Symbol(T, Decl(infiniteConstraints.ts, 39, 24)) + + ((arg: Elm, ...rest: T) => void) extends ((...args: infer T2) => void) ? T2 : +>arg : Symbol(arg, Decl(infiniteConstraints.ts, 41, 4)) +>Elm : Symbol(Elm, Decl(infiniteConstraints.ts, 39, 20)) +>rest : Symbol(rest, Decl(infiniteConstraints.ts, 41, 13)) +>T : Symbol(T, Decl(infiniteConstraints.ts, 39, 24)) +>args : Symbol(args, Decl(infiniteConstraints.ts, 41, 45)) +>T2 : Symbol(T2, Decl(infiniteConstraints.ts, 41, 59)) +>T2 : Symbol(T2, Decl(infiniteConstraints.ts, 41, 59)) + + never : + never; +export type ExactExtract = T extends U ? U extends T ? T : never : never; +>ExactExtract : Symbol(ExactExtract, Decl(infiniteConstraints.ts, 43, 8)) +>T : Symbol(T, Decl(infiniteConstraints.ts, 44, 25)) +>U : Symbol(U, Decl(infiniteConstraints.ts, 44, 27)) +>T : Symbol(T, Decl(infiniteConstraints.ts, 44, 25)) +>U : Symbol(U, Decl(infiniteConstraints.ts, 44, 27)) +>U : Symbol(U, Decl(infiniteConstraints.ts, 44, 27)) +>T : Symbol(T, Decl(infiniteConstraints.ts, 44, 25)) +>T : Symbol(T, Decl(infiniteConstraints.ts, 44, 25)) + +type Conv = +>Conv : Symbol(Conv, Decl(infiniteConstraints.ts, 44, 79)) +>T : Symbol(T, Decl(infiniteConstraints.ts, 46, 10)) +>U : Symbol(U, Decl(infiniteConstraints.ts, 46, 12)) +>T : Symbol(T, Decl(infiniteConstraints.ts, 46, 10)) + + { 0: [T]; 1: Prepend>>;}[U extends T ? 0 : 1]; +>0 : Symbol(0, Decl(infiniteConstraints.ts, 47, 3)) +>T : Symbol(T, Decl(infiniteConstraints.ts, 46, 10)) +>1 : Symbol(1, Decl(infiniteConstraints.ts, 47, 11)) +>Prepend : Symbol(Prepend, Decl(infiniteConstraints.ts, 35, 88)) +>T : Symbol(T, Decl(infiniteConstraints.ts, 46, 10)) +>Conv : Symbol(Conv, Decl(infiniteConstraints.ts, 44, 79)) +>ExactExtract : Symbol(ExactExtract, Decl(infiniteConstraints.ts, 43, 8)) +>U : Symbol(U, Decl(infiniteConstraints.ts, 46, 12)) +>T : Symbol(T, Decl(infiniteConstraints.ts, 46, 10)) +>U : Symbol(U, Decl(infiniteConstraints.ts, 46, 12)) +>T : Symbol(T, Decl(infiniteConstraints.ts, 46, 10)) + diff --git a/tests/baselines/reference/infiniteConstraints.types b/tests/baselines/reference/infiniteConstraints.types index c7d4c07ff4b..4b929ac667e 100644 --- a/tests/baselines/reference/infiniteConstraints.types +++ b/tests/baselines/reference/infiniteConstraints.types @@ -95,3 +95,26 @@ type Cond = T extends number ? number : never; declare function function1}>(): T[keyof T]["foo"]; >function1 : ; }>() => T[keyof T]["foo"] +// Repro from #31823 + +export type Prepend = +>Prepend : Prepend + + T extends unknown ? + ((arg: Elm, ...rest: T) => void) extends ((...args: infer T2) => void) ? T2 : +>arg : Elm +>rest : T +>args : T2 + + never : + never; +export type ExactExtract = T extends U ? U extends T ? T : never : never; +>ExactExtract : ExactExtract + +type Conv = +>Conv : { 0: [T]; 1: Prepend]; 1: Prepend, { 0: [ExactExtract, ExactExtract>]; 1: Prepend, ExactExtract>, { 0: [ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>]; 1: Prepend, ExactExtract>, ExactExtract, ExactExtract>>, { 0: [ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>]; 1: Prepend, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, { 0: [ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>]; 1: Prepend, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, { 0: [ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>]; 1: Prepend, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, { 0: [ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>]; 1: Prepend, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, { 0: [ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>]; 1: Prepend, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, { 0: [ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>]; 1: Prepend, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, { 0: [ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>]; 1: Prepend, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>, any[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>> ? 0 : 1]>; }[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>> ? 0 : 1]>; }[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>> ? 0 : 1]>; }[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>> ? 0 : 1]>; }[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>> ? 0 : 1]>; }[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>> ? 0 : 1]>; }[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>> ? 0 : 1]>; }[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>> ? 0 : 1]>; }[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>> ? 0 : 1]>; }[ExactExtract, ExactExtract> extends ExactExtract, ExactExtract> ? 0 : 1]>; }[ExactExtract extends ExactExtract ? 0 : 1]>; }[U extends T ? 0 : 1] + + { 0: [T]; 1: Prepend>>;}[U extends T ? 0 : 1]; +>0 : [T] +>1 : Prepend]; 1: Prepend, { 0: [ExactExtract, ExactExtract>]; 1: Prepend, ExactExtract>, { 0: [ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>]; 1: Prepend, ExactExtract>, ExactExtract, ExactExtract>>, { 0: [ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>]; 1: Prepend, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, { 0: [ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>]; 1: Prepend, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, { 0: [ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>]; 1: Prepend, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, { 0: [ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>]; 1: Prepend, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, { 0: [ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>]; 1: Prepend, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, { 0: [ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>]; 1: Prepend, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, { 0: [ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>]; 1: Prepend, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>, { 0: [ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>>]; 1: Prepend, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>>, any[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>>> ? 0 : 1]>; }[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>>> ? 0 : 1]>; }[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>>> ? 0 : 1]>; }[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>>> ? 0 : 1]>; }[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>>> ? 0 : 1]>; }[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>>> ? 0 : 1]>; }[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>>> ? 0 : 1]>; }[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>>> ? 0 : 1]>; }[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>, ExactExtract, ExactExtract>, ExactExtract, ExactExtract>>> ? 0 : 1]>; }[ExactExtract, ExactExtract>, ExactExtract, ExactExtract>> extends ExactExtract, ExactExtract>, ExactExtract, ExactExtract>> ? 0 : 1]>; }[ExactExtract, ExactExtract> extends ExactExtract, ExactExtract> ? 0 : 1]>; }[ExactExtract extends ExactExtract ? 0 : 1]> + From 47bbc9546e032bfdaf2436f486178c27bee9c089 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 28 Jun 2019 15:42:27 -0700 Subject: [PATCH 40/95] Convert related spans to message chains --- src/compiler/checker.ts | 6 +- .../reference/bigintWithLib.errors.txt | 63 ++++-- .../constructorOverloads1.errors.txt | 24 ++- ...StringLiteralsInJsxAttributes02.errors.txt | 72 ++++--- .../controlFlowIterationErrors.errors.txt | 36 ++-- tests/baselines/reference/for-of39.errors.txt | 42 ++-- .../reference/functionOverloads2.errors.txt | 12 +- .../reference/functionOverloads40.errors.txt | 12 +- .../reference/functionOverloads41.errors.txt | 12 +- ...edMethodWithOverloadedArguments.errors.txt | 72 ++++--- .../heterogeneousArrayAndOverloads.errors.txt | 6 +- .../reference/incompatibleTypes.errors.txt | 48 +++-- ...ritedConstructorWithRestParams2.errors.txt | 24 ++- .../iterableArrayPattern28.errors.txt | 42 ++-- .../iteratorSpreadInArray6.errors.txt | 27 ++- ...attersForSignatureGroupIdentity.errors.txt | 36 ++-- .../baselines/reference/overload1.errors.txt | 12 +- .../reference/overloadResolution.errors.txt | 36 ++-- ...loadResolutionClassConstructors.errors.txt | 12 +- .../overloadResolutionConstructors.errors.txt | 36 ++-- .../overloadResolutionTest1.errors.txt | 36 ++-- .../overloadingOnConstants2.errors.txt | 12 +- ...nWithConstraintCheckingDeferred.errors.txt | 33 ++- .../overloadsWithProvisionalErrors.errors.txt | 24 ++- .../reference/promiseTypeInference.errors.txt | 30 ++- .../recursiveFunctionTypes.errors.txt | 18 +- ...edSignatureAsCallbackParameter1.errors.txt | 36 ++-- ...eStringsWithOverloadResolution1.errors.txt | 48 +++-- ...ingsWithOverloadResolution1_ES6.errors.txt | 48 +++-- ...eStringsWithOverloadResolution3.errors.txt | 36 ++-- ...ingsWithOverloadResolution3_ES6.errors.txt | 36 ++-- .../tsxElementResolution9.errors.txt | 36 ++-- ...elessFunctionComponentOverload4.errors.txt | 195 ++++++++++++------ ...elessFunctionComponentOverload5.errors.txt | 81 +++++--- ...ionComponentsWithTypeArguments4.errors.txt | 45 ++-- .../unionTypeCallSignatures.errors.txt | 24 ++- .../unionTypeConstructSignatures.errors.txt | 24 ++- 37 files changed, 928 insertions(+), 464 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 75e477f55da..3e35732ce49 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21655,8 +21655,10 @@ namespace ts { i++; } - const related = max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics); - diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.No_overload_matches_this_call), related)); + const related = map( + max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics), + d => typeof d.messageText === 'string' ? (d as DiagnosticMessageChain) : d.messageText); + diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(related, Diagnostics.No_overload_matches_this_call))); } } else if (candidateForArgumentArityError) { diff --git a/tests/baselines/reference/bigintWithLib.errors.txt b/tests/baselines/reference/bigintWithLib.errors.txt index 836e2397ae3..19dc04b17fe 100644 --- a/tests/baselines/reference/bigintWithLib.errors.txt +++ b/tests/baselines/reference/bigintWithLib.errors.txt @@ -1,7 +1,28 @@ tests/cases/compiler/bigintWithLib.ts(4,1): error TS2350: Only a void function can be called with the 'new' keyword. tests/cases/compiler/bigintWithLib.ts(16,15): error TS2755: No overload matches this call. + Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'number'. + Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => IterableIterator' is not assignable to type '() => Iterator'. + Type 'IterableIterator' is not assignable to type 'Iterator'. + Types of property 'next' are incompatible. + Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. + Type 'IteratorResult' is not assignable to type 'IteratorResult'. + Type 'number' is not assignable to type 'bigint'. + Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. + Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] tests/cases/compiler/bigintWithLib.ts(21,13): error TS2540: Cannot assign to 'length' because it is a read-only property. tests/cases/compiler/bigintWithLib.ts(28,16): error TS2755: No overload matches this call. + Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'number'. + Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. + Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. + Type 'number[]' is not assignable to type 'SharedArrayBuffer'. tests/cases/compiler/bigintWithLib.ts(33,13): error TS2540: Cannot assign to 'length' because it is a read-only property. tests/cases/compiler/bigintWithLib.ts(40,25): error TS2345: Argument of type '-1' is not assignable to parameter of type 'bigint'. tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '123' is not assignable to parameter of type 'bigint'. @@ -28,20 +49,20 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 bigIntArray = new BigInt64Array([1, 2, 3]); // should error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'number'. -!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. - Types of property '[Symbol.iterator]' are incompatible. - Type '() => IterableIterator' is not assignable to type '() => Iterator'. - Type 'IterableIterator' is not assignable to type 'Iterator'. - Types of property 'next' are incompatible. - Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. - Type 'IteratorResult' is not assignable to type 'IteratorResult'. - Type 'number' is not assignable to type 'bigint'. -!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. - Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] +!!! error TS2755: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. +!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. +!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2755: Types of property '[Symbol.iterator]' are incompatible. +!!! error TS2755: Type '() => IterableIterator' is not assignable to type '() => Iterator'. +!!! error TS2755: Type 'IterableIterator' is not assignable to type 'Iterator'. +!!! error TS2755: Types of property 'next' are incompatible. +!!! error TS2755: Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. +!!! error TS2755: Type 'IteratorResult' is not assignable to type 'IteratorResult'. +!!! error TS2755: Type 'number' is not assignable to type 'bigint'. +!!! error TS2755: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error. +!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. +!!! error TS2755: Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] bigIntArray = new BigInt64Array(new ArrayBuffer(80)); bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8); bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8, 3); @@ -58,13 +79,13 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 bigUintArray = new BigUint64Array([1, 2, 3]); // should error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'number'. -!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. -!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. - Type 'number[]' is not assignable to type 'SharedArrayBuffer'. +!!! error TS2755: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. +!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. +!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2755: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error. +!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. +!!! error TS2755: Type 'number[]' is not assignable to type 'SharedArrayBuffer'. bigUintArray = new BigUint64Array(new ArrayBuffer(80)); bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8); bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8, 3); diff --git a/tests/baselines/reference/constructorOverloads1.errors.txt b/tests/baselines/reference/constructorOverloads1.errors.txt index 5f560ff38d8..9c2db5b39e6 100644 --- a/tests/baselines/reference/constructorOverloads1.errors.txt +++ b/tests/baselines/reference/constructorOverloads1.errors.txt @@ -3,7 +3,15 @@ tests/cases/compiler/constructorOverloads1.ts(3,5): error TS2392: Multiple const tests/cases/compiler/constructorOverloads1.ts(4,5): error TS2392: Multiple constructor implementations are not allowed. tests/cases/compiler/constructorOverloads1.ts(7,5): error TS2392: Multiple constructor implementations are not allowed. tests/cases/compiler/constructorOverloads1.ts(16,10): error TS2755: No overload matches this call. + Overload 1 of 2, '(s: string): Foo', gave the following error. + Argument of type 'Foo' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(n: number): Foo', gave the following error. + Argument of type 'Foo' is not assignable to parameter of type 'number'. tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2755: No overload matches this call. + Overload 1 of 2, '(s: string): Foo', gave the following error. + Argument of type 'any[]' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(n: number): Foo', gave the following error. + Argument of type 'any[]' is not assignable to parameter of type 'number'. ==== tests/cases/compiler/constructorOverloads1.ts (6 errors) ==== @@ -37,17 +45,17 @@ tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2755: No overload var f3 = new Foo(f1); ~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/constructorOverloads1.ts:16:18: Overload 1 of 2, '(s: string): Foo', gave the following error. - Argument of type 'Foo' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/compiler/constructorOverloads1.ts:16:18: Overload 2 of 2, '(n: number): Foo', gave the following error. - Argument of type 'Foo' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 1 of 2, '(s: string): Foo', gave the following error. +!!! error TS2755: Argument of type 'Foo' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(n: number): Foo', gave the following error. +!!! error TS2755: Argument of type 'Foo' is not assignable to parameter of type 'number'. var f4 = new Foo([f1,f2,f3]); ~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/constructorOverloads1.ts:17:18: Overload 1 of 2, '(s: string): Foo', gave the following error. - Argument of type 'any[]' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/compiler/constructorOverloads1.ts:17:18: Overload 2 of 2, '(n: number): Foo', gave the following error. - Argument of type 'any[]' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 1 of 2, '(s: string): Foo', gave the following error. +!!! error TS2755: Argument of type 'any[]' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(n: number): Foo', gave the following error. +!!! error TS2755: Argument of type 'any[]' is not assignable to parameter of type 'number'. f1.bar1(); f1.bar2(); diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt index 73fc41eeaf8..28aa026b11f 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt @@ -1,7 +1,31 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. + Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. + Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. + Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. + Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. + Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. + Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. + Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. + Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. + Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(33,13): error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. @@ -38,39 +62,39 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): err const b0 = {console.log(k)}}} extra />; // k has type "left" | "right" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:27:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. - Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:27:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. - Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2755: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. const b2 = {console.log(k)}} extra />; // k has type "left" | "right" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:28:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. - Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:28:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. - Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2755: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2755: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. const b3 = ; // goTo has type"home" | "contact" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:29:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. - Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:29:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. - Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2755: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. const b4 = ; // goTo has type "home" | "contact" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:30:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. - Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. - Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:30:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. - Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2755: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. export function NoOverload(buttonProps: ButtonProps): JSX.Element { return undefined } const c1 = {console.log(k)}}} extra />; // k has type any diff --git a/tests/baselines/reference/controlFlowIterationErrors.errors.txt b/tests/baselines/reference/controlFlowIterationErrors.errors.txt index 4ce7e28a5d1..b8c4c21906c 100644 --- a/tests/baselines/reference/controlFlowIterationErrors.errors.txt +++ b/tests/baselines/reference/controlFlowIterationErrors.errors.txt @@ -3,7 +3,19 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(11,17): error tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(22,17): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'. Type 'number' is not assignable to type 'string'. tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(34,13): error TS2755: No overload matches this call. + Overload 1 of 2, '(x: string): number', gave the following error. + Argument of type 'string | number' is not assignable to parameter of type 'string'. + Type 'number' is not assignable to type 'string'. + Overload 2 of 2, '(x: number): string', gave the following error. + Argument of type 'string | number' is not assignable to parameter of type 'number'. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error TS2755: No overload matches this call. + Overload 1 of 2, '(x: string): number', gave the following error. + Argument of type 'string | number' is not assignable to parameter of type 'string'. + Type 'number' is not assignable to type 'string'. + Overload 2 of 2, '(x: number): string', gave the following error. + Argument of type 'string | number' is not assignable to parameter of type 'number'. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts (4 errors) ==== @@ -49,12 +61,12 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error x = foo(x); ~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:34:17: Overload 1 of 2, '(x: string): number', gave the following error. - Argument of type 'string | number' is not assignable to parameter of type 'string'. - Type 'number' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:34:17: Overload 2 of 2, '(x: number): string', gave the following error. - Argument of type 'string | number' is not assignable to parameter of type 'number'. - Type 'string' is not assignable to type 'number'. +!!! error TS2755: Overload 1 of 2, '(x: string): number', gave the following error. +!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'string'. +!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 2, '(x: number): string', gave the following error. +!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'number'. +!!! error TS2755: Type 'string' is not assignable to type 'number'. x; } x; @@ -68,12 +80,12 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error x = foo(x); ~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:45:17: Overload 1 of 2, '(x: string): number', gave the following error. - Argument of type 'string | number' is not assignable to parameter of type 'string'. - Type 'number' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:45:17: Overload 2 of 2, '(x: number): string', gave the following error. - Argument of type 'string | number' is not assignable to parameter of type 'number'. - Type 'string' is not assignable to type 'number'. +!!! error TS2755: Overload 1 of 2, '(x: string): number', gave the following error. +!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'string'. +!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 2, '(x: number): string', gave the following error. +!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'number'. +!!! error TS2755: Type 'string' is not assignable to type 'number'. } x; } diff --git a/tests/baselines/reference/for-of39.errors.txt b/tests/baselines/reference/for-of39.errors.txt index 36bdbdf9447..77f8bff4412 100644 --- a/tests/baselines/reference/for-of39.errors.txt +++ b/tests/baselines/reference/for-of39.errors.txt @@ -1,24 +1,38 @@ tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2755: No overload matches this call. + Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. + Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => IterableIterator<[string, number] | [string, true]>' is not assignable to type '() => Iterator'. + Type 'IterableIterator<[string, number] | [string, true]>' is not assignable to type 'Iterator'. + Types of property 'next' are incompatible. + Type '(value?: any) => IteratorResult<[string, number] | [string, true]>' is not assignable to type '(value?: any) => IteratorResult'. + Type 'IteratorResult<[string, number] | [string, true]>' is not assignable to type 'IteratorResult'. + Type '[string, number] | [string, true]' is not assignable to type 'readonly [string, boolean]'. + Type '[string, number]' is not assignable to type 'readonly [string, boolean]'. + Types of property '1' are incompatible. + Type 'number' is not assignable to type 'boolean'. + Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map', gave the following error. + Type 'number' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/for-ofStatements/for-of39.ts (1 errors) ==== var map = new Map([["", true], ["", 0]]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:19: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. - Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable'. - Types of property '[Symbol.iterator]' are incompatible. - Type '() => IterableIterator<[string, number] | [string, true]>' is not assignable to type '() => Iterator'. - Type 'IterableIterator<[string, number] | [string, true]>' is not assignable to type 'Iterator'. - Types of property 'next' are incompatible. - Type '(value?: any) => IteratorResult<[string, number] | [string, true]>' is not assignable to type '(value?: any) => IteratorResult'. - Type 'IteratorResult<[string, number] | [string, true]>' is not assignable to type 'IteratorResult'. - Type '[string, number] | [string, true]' is not assignable to type 'readonly [string, boolean]'. - Type '[string, number]' is not assignable to type 'readonly [string, boolean]'. - Types of property '1' are incompatible. - Type 'number' is not assignable to type 'boolean'. -!!! related TS2760 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:37: Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map', gave the following error. - Type 'number' is not assignable to type 'boolean'. +!!! error TS2755: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. +!!! error TS2755: Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2755: Types of property '[Symbol.iterator]' are incompatible. +!!! error TS2755: Type '() => IterableIterator<[string, number] | [string, true]>' is not assignable to type '() => Iterator'. +!!! error TS2755: Type 'IterableIterator<[string, number] | [string, true]>' is not assignable to type 'Iterator'. +!!! error TS2755: Types of property 'next' are incompatible. +!!! error TS2755: Type '(value?: any) => IteratorResult<[string, number] | [string, true]>' is not assignable to type '(value?: any) => IteratorResult'. +!!! error TS2755: Type 'IteratorResult<[string, number] | [string, true]>' is not assignable to type 'IteratorResult'. +!!! error TS2755: Type '[string, number] | [string, true]' is not assignable to type 'readonly [string, boolean]'. +!!! error TS2755: Type '[string, number]' is not assignable to type 'readonly [string, boolean]'. +!!! error TS2755: Types of property '1' are incompatible. +!!! error TS2755: Type 'number' is not assignable to type 'boolean'. +!!! error TS2755: Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map', gave the following error. +!!! error TS2755: Type 'number' is not assignable to type 'boolean'. for (var [k, v] of map) { k; v; diff --git a/tests/baselines/reference/functionOverloads2.errors.txt b/tests/baselines/reference/functionOverloads2.errors.txt index 913c3cb49e3..785844037fa 100644 --- a/tests/baselines/reference/functionOverloads2.errors.txt +++ b/tests/baselines/reference/functionOverloads2.errors.txt @@ -1,4 +1,8 @@ tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No overload matches this call. + Overload 1 of 2, '(bar: string): string', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(bar: number): number', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. ==== tests/cases/compiler/functionOverloads2.ts (1 errors) ==== @@ -8,7 +12,7 @@ tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No overload match var x = foo(true); ~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/functionOverloads2.ts:4:13: Overload 1 of 2, '(bar: string): string', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/compiler/functionOverloads2.ts:4:13: Overload 2 of 2, '(bar: number): number', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'number'. \ No newline at end of file +!!! error TS2755: Overload 1 of 2, '(bar: string): string', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(bar: number): number', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index 9e99d383746..ce7472e1936 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -1,4 +1,8 @@ tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No overload matches this call. + Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. + Type 'string' is not assignable to type 'number'. + Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. + Type 'string' is not assignable to type 'boolean'. ==== tests/cases/compiler/functionOverloads40.ts (1 errors) ==== @@ -8,8 +12,8 @@ tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No overload matc var x = foo([{a:'bar'}]); ~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. - Type 'string' is not assignable to type 'number'. -!!! related TS2760 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. - Type 'string' is not assignable to type 'boolean'. +!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! error TS2755: 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 95b3296e5c9..a26840f22f0 100644 --- a/tests/baselines/reference/functionOverloads41.errors.txt +++ b/tests/baselines/reference/functionOverloads41.errors.txt @@ -1,4 +1,8 @@ tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No overload matches this call. + Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. + Property 'a' is missing in type '{}' but required in type '{ a: number; }'. + Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. + Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. ==== tests/cases/compiler/functionOverloads41.ts (1 errors) ==== @@ -8,8 +12,8 @@ tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No overload matc var x = foo([{}]); ~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. - Property 'a' is missing in type '{}' but required in type '{ a: number; }'. -!!! related TS2760 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. - Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. +!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2755: Property 'a' is missing in type '{}' but required in type '{ a: number; }'. +!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! error TS2755: Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt index 9c1f49a581b..10673021477 100644 --- a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt +++ b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt @@ -2,8 +2,32 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(52,22): error TS2755: No overload matches this call. + Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. + Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(68,22): error TS2755: No overload matches this call. + Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. + Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(84,22): error TS2755: No overload matches this call. + Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'boolean'. + Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts (4 errors) ==== @@ -65,13 +89,13 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:52:38: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. - Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:52:38: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. - Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2755: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. +!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. } ////////////////////////////////////// @@ -90,16 +114,16 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. - Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. - Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. -!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. - Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2755: Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. +!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2755: Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. +!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. } ////////////////////////////////////// @@ -118,12 +142,12 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:84:38: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. - Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'boolean'. -!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:84:38: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. - Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2755: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2755: Type 'number' is not assignable to type 'boolean'. +!!! error TS2755: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. +!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. } \ No newline at end of file diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt index 9750b678e7f..2f3a813bf85 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt @@ -1,4 +1,6 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No overload matches this call. + Overload 1 of 2, '(arg1: number[]): any', gave the following error. + Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/heterogeneousArrayAndOverloads.ts (1 errors) ==== @@ -13,7 +15,7 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No ov this.test([1, 2, "hi", 5]); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:26: Overload 1 of 2, '(arg1: number[]): any', gave the following error. - Type 'string' is not assignable to type 'number'. +!!! error TS2755: Overload 1 of 2, '(arg1: number[]): any', gave the following error. +!!! error TS2755: Type 'string' 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 a9290e9988a..296b749cce8 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -10,7 +10,23 @@ tests/cases/compiler/incompatibleTypes.ts(26,12): error TS2416: Property 'p1' in tests/cases/compiler/incompatibleTypes.ts(34,12): error TS2416: Property 'p1' in type 'C4' is not assignable to the same property in base type 'IFoo4'. Type '{ c: { b: string; }; d: string; }' is missing the following properties from type '{ a: { a: string; }; b: string; }': a, b tests/cases/compiler/incompatibleTypes.ts(42,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(i: IFoo1): void', gave the following error. + Argument of type 'C1' is not assignable to parameter of type 'IFoo1'. + Types of property 'p1' are incompatible. + Type '() => string' is not assignable to type '() => number'. + Type 'string' is not assignable to type 'number'. + Overload 2 of 2, '(i: IFoo2): void', gave the following error. + Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. + Types of property 'p1' are incompatible. + Type '() => string' is not assignable to type '(s: string) => number'. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/incompatibleTypes.ts(49,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. + Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'. + Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. + Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error. + Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. + Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. tests/cases/compiler/incompatibleTypes.ts(66,47): error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2322: Type '5' is not assignable to type '() => string'. @@ -77,16 +93,16 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => if1(c1); ~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/incompatibleTypes.ts:42:5: Overload 1 of 2, '(i: IFoo1): void', gave the following error. - Argument of type 'C1' is not assignable to parameter of type 'IFoo1'. - Types of property 'p1' are incompatible. - Type '() => string' is not assignable to type '() => number'. - Type 'string' is not assignable to type 'number'. -!!! related TS2760 tests/cases/compiler/incompatibleTypes.ts:42:5: Overload 2 of 2, '(i: IFoo2): void', gave the following error. - Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. - Types of property 'p1' are incompatible. - Type '() => string' is not assignable to type '(s: string) => number'. - Type 'string' is not assignable to type 'number'. +!!! error TS2755: Overload 1 of 2, '(i: IFoo1): void', gave the following error. +!!! error TS2755: Argument of type 'C1' is not assignable to parameter of type 'IFoo1'. +!!! error TS2755: Types of property 'p1' are incompatible. +!!! error TS2755: Type '() => string' is not assignable to type '() => number'. +!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2755: Overload 2 of 2, '(i: IFoo2): void', gave the following error. +!!! error TS2755: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. +!!! error TS2755: Types of property 'p1' are incompatible. +!!! error TS2755: Type '() => string' is not assignable to type '(s: string) => number'. +!!! error TS2755: Type 'string' is not assignable to type 'number'. function of1(n: { a: { a: string; }; b: string; }): number; @@ -96,12 +112,12 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => of1({ e: 0, f: 0 }); ~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/incompatibleTypes.ts:49:7: Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. - Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'. - Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. -!!! related TS2760 tests/cases/compiler/incompatibleTypes.ts:49:7: Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error. - Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. - Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. +!!! error TS2755: Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. +!!! error TS2755: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'. +!!! error TS2755: Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. +!!! error TS2755: Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error. +!!! error TS2755: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. +!!! error TS2755: Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. interface IMap { [key:string]:string; diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt index da0ca0f92f9..c11826196c4 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt @@ -1,6 +1,14 @@ tests/cases/compiler/inheritedConstructorWithRestParams2.ts(32,13): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/compiler/inheritedConstructorWithRestParams2.ts(33,1): error TS2755: No overload matches this call. + Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. + Argument of type '""' is not assignable to parameter of type 'number'. + Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. + Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2755: No overload matches this call. + Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. + Argument of type '""' is not assignable to parameter of type 'number'. + Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. + Argument of type '3' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/inheritedConstructorWithRestParams2.ts (3 errors) ==== @@ -41,14 +49,14 @@ tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2755: new Derived("", 3, "", 3); ~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:33:20: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. - Argument of type '""' is not assignable to parameter of type 'number'. -!!! related TS2760 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:33:17: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. - Argument of type '3' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. +!!! error TS2755: Argument of type '""' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. +!!! error TS2755: Argument of type '3' is not assignable to parameter of type 'string'. new Derived("", 3, "", ""); ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:34:20: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. - Argument of type '""' is not assignable to parameter of type 'number'. -!!! related TS2760 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:34:17: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. - Argument of type '3' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2755: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. +!!! error TS2755: Argument of type '""' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. +!!! error TS2755: Argument of type '3' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern28.errors.txt b/tests/baselines/reference/iterableArrayPattern28.errors.txt index a64d2b9a413..2591d3f9ef7 100644 --- a/tests/baselines/reference/iterableArrayPattern28.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern28.errors.txt @@ -1,4 +1,18 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error TS2755: No overload matches this call. + Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. + Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator'. + Type 'IterableIterator<[string, number] | [string, boolean]>' is not assignable to type 'Iterator'. + Types of property 'next' are incompatible. + Type '(value?: any) => IteratorResult<[string, number] | [string, boolean]>' is not assignable to type '(value?: any) => IteratorResult'. + Type 'IteratorResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. + Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. + Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. + Types of property '1' are incompatible. + Type 'boolean' is not assignable to type 'number'. + Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. + Type 'true' is not assignable to type 'number'. ==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (1 errors) ==== @@ -6,17 +20,17 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:32: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. - Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. - Types of property '[Symbol.iterator]' are incompatible. - Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator'. - Type 'IterableIterator<[string, number] | [string, boolean]>' is not assignable to type 'Iterator'. - Types of property 'next' are incompatible. - Type '(value?: any) => IteratorResult<[string, number] | [string, boolean]>' is not assignable to type '(value?: any) => IteratorResult'. - Type 'IteratorResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. - Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. - Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. - Types of property '1' are incompatible. - Type 'boolean' is not assignable to type 'number'. -!!! related TS2760 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:52: Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. - Type 'true' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2755: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. +!!! error TS2755: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2755: Types of property '[Symbol.iterator]' are incompatible. +!!! error TS2755: Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator'. +!!! error TS2755: Type 'IterableIterator<[string, number] | [string, boolean]>' is not assignable to type 'Iterator'. +!!! error TS2755: Types of property 'next' are incompatible. +!!! error TS2755: Type '(value?: any) => IteratorResult<[string, number] | [string, boolean]>' is not assignable to type '(value?: any) => IteratorResult'. +!!! error TS2755: Type 'IteratorResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. +!!! error TS2755: Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. +!!! error TS2755: Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. +!!! error TS2755: Types of property '1' are incompatible. +!!! error TS2755: Type 'boolean' is not assignable to type 'number'. +!!! error TS2755: Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt index 6a11cc31fff..b3ce072c8e4 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt @@ -1,4 +1,13 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. + Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. + Types of property 'slice' are incompatible. + Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'. + Type 'symbol[]' is not assignable to type 'number[]'. + Type 'symbol' is not assignable to type 'number'. + Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. + Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. + Type 'symbol[]' is not assignable to type 'ConcatArray'. ==== tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts (1 errors) ==== @@ -19,12 +28,12 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755 array.concat([...new SymbolIterator]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts:15:14: Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. - Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. - Types of property 'slice' are incompatible. - Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'. - Type 'symbol[]' is not assignable to type 'number[]'. - Type 'symbol' is not assignable to type 'number'. -!!! related TS2760 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts:15:14: Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. - Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. - Type 'symbol[]' is not assignable to type 'ConcatArray'. \ No newline at end of file +!!! error TS2755: Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. +!!! error TS2755: Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. +!!! error TS2755: Types of property 'slice' are incompatible. +!!! error TS2755: Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'. +!!! error TS2755: Type 'symbol[]' is not assignable to type 'number[]'. +!!! error TS2755: Type 'symbol' is not assignable to type 'number'. +!!! error TS2755: Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. +!!! error TS2755: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. +!!! error TS2755: Type 'symbol[]' is not assignable to type 'ConcatArray'. \ No newline at end of file diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt index bcab0991b08..3365a92b749 100644 --- a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt @@ -1,6 +1,18 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(x: { s: string; }): string', gave the following error. + Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. + Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. + Overload 2 of 2, '(x: { n: number; }): number', gave the following error. + Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. + Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'w' must be of type 'A', but here has type 'C'. tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(x: { s: string; }): string', gave the following error. + Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. + Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. + Overload 2 of 2, '(x: { n: number; }): number', gave the following error. + Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. + Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. ==== tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts (3 errors) ==== @@ -25,12 +37,12 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS275 v({ s: "", n: 0 }).toLowerCase(); ~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:19:12: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. - Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. - Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. -!!! related TS2760 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:19:5: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. - Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. - Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. +!!! error TS2755: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. +!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. +!!! error TS2755: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. +!!! error TS2755: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. +!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. +!!! error TS2755: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. var w: A; var w: C; @@ -41,9 +53,9 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS275 w({ s: "", n: 0 }).toLowerCase(); ~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:24:12: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. - Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. - Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. -!!! related TS2760 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:24:5: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. - Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. - Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. \ No newline at end of file +!!! error TS2755: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. +!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. +!!! error TS2755: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. +!!! error TS2755: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. +!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. +!!! error TS2755: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt index 6625de2f9a6..c8ac63bf4ee 100644 --- a/tests/baselines/reference/overload1.errors.txt +++ b/tests/baselines/reference/overload1.errors.txt @@ -4,6 +4,10 @@ tests/cases/compiler/overload1.ts(31,11): error TS2554: Expected 1-2 arguments, tests/cases/compiler/overload1.ts(32,5): error TS2554: Expected 1-2 arguments, but got 0. tests/cases/compiler/overload1.ts(33,1): error TS2322: Type 'C' is not assignable to type 'string'. tests/cases/compiler/overload1.ts(34,3): error TS2755: No overload matches this call. + Overload 1 of 2, '(s1: string, s2: number): string', gave the following error. + Argument of type '2' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(s1: number, s2: string): number', gave the following error. + Argument of type '2' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/overload1.ts (6 errors) ==== @@ -54,10 +58,10 @@ tests/cases/compiler/overload1.ts(34,3): error TS2755: No overload matches this z=x.h(2,2); // no match ~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/overload1.ts:34:7: Overload 1 of 2, '(s1: string, s2: number): string', gave the following error. - Argument of type '2' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/compiler/overload1.ts:34:9: Overload 2 of 2, '(s1: number, s2: string): number', gave the following error. - Argument of type '2' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 1 of 2, '(s1: string, s2: number): string', gave the following error. +!!! error TS2755: Argument of type '2' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(s1: number, s2: string): number', gave the following error. +!!! error TS2755: Argument of type '2' is not assignable to parameter of type 'string'. z=x.h("hello",0); // good var v=x.g; diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index a64c341f2cb..d2c21b4ea7b 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,11 +1,23 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(s: string): string', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(s: number): number', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2558: Expected 3 type arguments, but got 4. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(n: string, m: any): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(n: number, m: any): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(n: any, m: number): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. + Overload 2 of 2, '(n: any, m: string): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -40,10 +52,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): fn1({}); // Error ~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:27:5: Overload 1 of 2, '(s: string): string', gave the following error. - Argument of type '{}' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:27:5: Overload 2 of 2, '(s: number): number', gave the following error. - Argument of type '{}' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 1 of 2, '(s: string): string', gave the following error. +!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(s: number): number', gave the following error. +!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments function fn2(s: string, n: number): number; @@ -113,17 +125,17 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): fn4(true, null); // Error ~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:84:5: Overload 1 of 2, '(n: string, m: any): any', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:84:5: Overload 2 of 2, '(n: number, m: any): any', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 1 of 2, '(n: string, m: any): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(n: number, m: any): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. fn4(null, true); // Error ~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:85:11: Overload 1 of 2, '(n: any, m: number): any', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:85:11: Overload 2 of 2, '(n: any, m: string): any', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 1 of 2, '(n: any, m: number): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 2, '(n: any, m: string): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors function fn5(f: (n: string) => void): string; diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index 569fe146ac8..2eaf7490759 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -1,4 +1,8 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(s: string): fn1', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(s: number): fn1', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,9): error TS2558: Expected 3 type arguments, but got 1. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,9): error TS2558: Expected 3 type arguments, but got 2. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,9): error TS2558: Expected 3 type arguments, but got 4. @@ -44,10 +48,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru new fn1({}); // Error ~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts:27:9: Overload 1 of 2, '(s: string): fn1', gave the following error. - Argument of type '{}' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts:27:9: Overload 2 of 2, '(s: number): fn1', gave the following error. - Argument of type '{}' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 1 of 2, '(s: string): fn1', gave the following error. +!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(s: number): fn1', gave the following error. +!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments class fn2 { diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index eef196f17cb..c4972bb89eb 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,11 +1,23 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(s: string): string', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(s: number): number', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2558: Expected 3 type arguments, but got 4. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(n: string, m: any): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(n: number, m: any): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(n: any, m: number): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. + Overload 2 of 2, '(n: any, m: string): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,26): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -40,10 +52,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors new fn1({}); // Error ~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:27:9: Overload 1 of 2, '(s: string): string', gave the following error. - Argument of type '{}' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:27:9: Overload 2 of 2, '(s: number): number', gave the following error. - Argument of type '{}' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 1 of 2, '(s: string): string', gave the following error. +!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(s: number): number', gave the following error. +!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments interface fn2 { @@ -120,17 +132,17 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors new fn4(true, null); // Error ~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:91:9: Overload 1 of 2, '(n: string, m: any): any', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:91:9: Overload 2 of 2, '(n: number, m: any): any', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 1 of 2, '(n: string, m: any): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(n: number, m: any): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. new fn4(null, true); // Error ~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:92:15: Overload 1 of 2, '(n: any, m: number): any', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:92:15: Overload 2 of 2, '(n: any, m: string): any', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 1 of 2, '(n: any, m: number): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 2, '(n: any, m: string): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors interface fn5 { diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index 46f0bb623ff..06050fb2192 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -1,6 +1,18 @@ tests/cases/compiler/overloadResolutionTest1.ts(7,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. + Type 'string' is not assignable to type 'number'. + Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. + Type 'string' is not assignable to type 'boolean'. tests/cases/compiler/overloadResolutionTest1.ts(18,10): error TS2755: No overload matches this call. + Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. + Type 'string' is not assignable to type 'number'. + Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. + Type 'string' is not assignable to type 'boolean'. tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload matches this call. + Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. + Type 'true' is not assignable to type 'number'. + Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. + Type 'true' is not assignable to type 'string'. ==== tests/cases/compiler/overloadResolutionTest1.ts (3 errors) ==== @@ -13,10 +25,10 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload var x111 = foo([{a:"s"}]); // error - does not match any signature ~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. - Type 'string' is not assignable to type 'number'. -!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. - Type 'string' is not assignable to type 'boolean'. +!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! error TS2755: 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 @@ -30,10 +42,10 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload var x4 = foo2({a:"s"}); // error ~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. - Type 'string' is not assignable to type 'number'. -!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. - Type 'string' is not assignable to type 'boolean'. +!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'boolean'. function foo4(bar:{a:number;}):number; @@ -42,7 +54,7 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload var x = foo4({a:true}); // error ~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. - Type 'true' is not assignable to type 'number'. -!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. - Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'number'. +!!! error TS2755: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadingOnConstants2.errors.txt b/tests/baselines/reference/overloadingOnConstants2.errors.txt index d9844b26e28..aafe28250ad 100644 --- a/tests/baselines/reference/overloadingOnConstants2.errors.txt +++ b/tests/baselines/reference/overloadingOnConstants2.errors.txt @@ -1,5 +1,9 @@ tests/cases/compiler/overloadingOnConstants2.ts(9,10): error TS2394: This overload signature is not compatible with its implementation signature. tests/cases/compiler/overloadingOnConstants2.ts(15,9): error TS2755: No overload matches this call. + Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. + Argument of type '"um"' is not assignable to parameter of type '"hi"'. + Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. + Argument of type '"um"' is not assignable to parameter of type '"bye"'. tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overload signature is not compatible with its implementation signature. @@ -24,10 +28,10 @@ tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overl var c = foo("um", []); // error ~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/overloadingOnConstants2.ts:15:13: Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. - Argument of type '"um"' is not assignable to parameter of type '"hi"'. -!!! related TS2760 tests/cases/compiler/overloadingOnConstants2.ts:15:13: Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. - Argument of type '"um"' is not assignable to parameter of type '"bye"'. +!!! error TS2755: Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. +!!! error TS2755: Argument of type '"um"' is not assignable to parameter of type '"hi"'. +!!! error TS2755: Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. +!!! error TS2755: Argument of type '"um"' is not assignable to parameter of type '"bye"'. //function bar(x: "hi", items: string[]): D; diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt index b1254d24a8a..75688b0d459 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -4,6 +4,17 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,37): tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,38): error TS2344: Type 'D' does not satisfy the constraint 'A'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,23): error TS2755: No overload matches this call. + Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. + Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. + Type 'G' is not assignable to type 'number'. + Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. + Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. + Types of parameters 'x' and 'x' are incompatible. + Property 'q' is missing in type 'C' but required in type 'D'. + Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. + Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. + Types of parameters 'x' and 'x' are incompatible. + Property 'q' is missing in type 'B' but required in type 'D'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): error TS2344: Type 'D' does not satisfy the constraint 'A'. @@ -46,15 +57,15 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): }); ~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. - Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. - Type 'G' is not assignable to type 'number'. -!!! related TS2760 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. - Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. - Types of parameters 'x' and 'x' are incompatible. - Property 'q' is missing in type 'C' but required in type 'D'. -!!! related TS2760 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. - Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. - Types of parameters 'x' and 'x' are incompatible. - Property 'q' is missing in type 'B' but required in type 'D'. +!!! error TS2755: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. +!!! error TS2755: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. +!!! error TS2755: Type 'G' is not assignable to type 'number'. +!!! error TS2755: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. +!!! error TS2755: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. +!!! error TS2755: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2755: Property 'q' is missing in type 'C' but required in type 'D'. +!!! error TS2755: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. +!!! error TS2755: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. +!!! error TS2755: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2755: Property 'q' is missing in type 'B' but required in type 'D'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt index cc65c84b4a5..3bdc2092e9f 100644 --- a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt @@ -1,6 +1,14 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(s: string): number', gave the following error. + Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. + Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b tests/cases/compiler/overloadsWithProvisionalErrors.ts(7,17): error TS2304: Cannot find name 'blah'. tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(s: string): number', gave the following error. + Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. + Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cannot find name 'blah'. @@ -13,19 +21,19 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cann func(s => ({})); // Error for no applicable overload (object type is missing a and b) ~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:6: Overload 1 of 2, '(s: string): number', gave the following error. - Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. - Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b +!!! error TS2755: Overload 1 of 2, '(s: string): number', gave the following error. +!!! error TS2755: Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. +!!! error TS2755: Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) ~~~~ !!! error TS2304: Cannot find name 'blah'. func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:6: Overload 1 of 2, '(s: string): number', gave the following error. - Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. - Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. +!!! error TS2755: Overload 1 of 2, '(s: string): number', gave the following error. +!!! error TS2755: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. +!!! error TS2755: Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. ~~~~ !!! error TS2304: Cannot find name 'blah'. \ No newline at end of file diff --git a/tests/baselines/reference/promiseTypeInference.errors.txt b/tests/baselines/reference/promiseTypeInference.errors.txt index 237f3067063..c2f3c51f0ec 100644 --- a/tests/baselines/reference/promiseTypeInference.errors.txt +++ b/tests/baselines/reference/promiseTypeInference.errors.txt @@ -1,4 +1,14 @@ tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No overload matches this call. + Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. + Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. + Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. + Type 'IPromise' is not assignable to type 'number | PromiseLike'. + Type 'IPromise' is not assignable to type 'PromiseLike'. + Types of property 'then' are incompatible. + Type '(success?: (value: number) => IPromise) => IPromise' is not assignable to type '(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. + Types of parameters 'success' and 'onfulfilled' are incompatible. + Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. + Type 'TResult1' is not assignable to type 'IPromise'. ==== tests/cases/compiler/promiseTypeInference.ts (1 errors) ==== @@ -14,14 +24,14 @@ tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No overload m var $$x = load("something").then(s => convert(s)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. - Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! related TS2760 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. - Type 'IPromise' is not assignable to type 'number | PromiseLike'. - Type 'IPromise' is not assignable to type 'PromiseLike'. - Types of property 'then' are incompatible. - Type '(success?: (value: number) => IPromise) => IPromise' is not assignable to type '(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. - Types of parameters 'success' and 'onfulfilled' are incompatible. - Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. - Type 'TResult1' is not assignable to type 'IPromise'. +!!! error TS2755: Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. +!!! error TS2755: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! error TS2755: Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. +!!! error TS2755: Type 'IPromise' is not assignable to type 'number | PromiseLike'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'PromiseLike'. +!!! error TS2755: Types of property 'then' are incompatible. +!!! error TS2755: Type '(success?: (value: number) => IPromise) => IPromise' is not assignable to type '(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. +!!! error TS2755: Types of parameters 'success' and 'onfulfilled' are incompatible. +!!! error TS2755: Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. +!!! error TS2755: Type 'TResult1' is not assignable to type 'IPromise'. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index b0091454264..2a473c2d22f 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -12,6 +12,12 @@ tests/cases/compiler/recursiveFunctionTypes.ts(33,8): error TS2554: Expected 0-1 tests/cases/compiler/recursiveFunctionTypes.ts(34,4): error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. tests/cases/compiler/recursiveFunctionTypes.ts(42,8): error TS2554: Expected 0-1 arguments, but got 2. tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2755: No overload matches this call. + Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. + Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. + Overload 2 of 4, '(a: number): number', gave the following error. + Argument of type '""' is not assignable to parameter of type 'number'. + Overload 3 of 4, '(a?: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }', gave the following error. + Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. ==== tests/cases/compiler/recursiveFunctionTypes.ts (13 errors) ==== @@ -86,10 +92,10 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2755: No overload f7(""); // ok (function takes an any param) ~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. - Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. -!!! related TS2760 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 2 of 4, '(a: number): number', gave the following error. - Argument of type '""' is not assignable to parameter of type 'number'. -!!! related TS2760 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 3 of 4, '(a?: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }', gave the following error. - Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. +!!! error TS2755: Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. +!!! error TS2755: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. +!!! error TS2755: Overload 2 of 4, '(a: number): number', gave the following error. +!!! error TS2755: Argument of type '""' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 3 of 4, '(a?: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }', gave the following error. +!!! error TS2755: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. f7(); // ok \ No newline at end of file diff --git a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt index 86f3e1c8904..e1a2004542c 100644 --- a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt +++ b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt @@ -1,5 +1,17 @@ tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(7,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. + Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number' is not assignable to type 'string'. + Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. + Argument of type '1' is not assignable to parameter of type 'string'. tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. + Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number' is not assignable to type '"hm"'. + Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. + Argument of type '1' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts (2 errors) ==== @@ -12,18 +24,18 @@ tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2 x3(1, (x: string) => 1); ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:7:7: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. - Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'. - Types of parameters 'x' and 'x' are incompatible. - Type 'number' is not assignable to type 'string'. -!!! related TS2760 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:7:4: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. - Argument of type '1' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. +!!! error TS2755: Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'. +!!! error TS2755: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. +!!! error TS2755: Argument of type '1' is not assignable to parameter of type 'string'. x3(1, (x: 'hm') => 1); ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:8:7: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. - Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'. - Types of parameters 'x' and 'x' are incompatible. - Type 'number' is not assignable to type '"hm"'. -!!! related TS2760 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:8:4: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. - Argument of type '1' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2755: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. +!!! error TS2755: Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'. +!!! error TS2755: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2755: Type 'number' is not assignable to type '"hm"'. +!!! error TS2755: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. +!!! error TS2755: Argument of type '1' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt index c8528ceaf93..541a327b311 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -2,10 +2,26 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(11,9): error TS2755: No overload matches this call. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,9): error TS2755: No overload matches this call. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,9): error TS2755: No overload matches this call. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,9): error TS2755: No overload matches this call. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4. @@ -29,24 +45,24 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var c = foo([], 1, 2); // boolean ~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:11:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:11:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var d = foo([], 1, true); // boolean (with error) ~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:12:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:12:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var e = foo([], 1, "2"); // {} ~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:13:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:13:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var f = foo([], 1, 2, 3); // any (with error) ~ !!! error TS2554: Expected 1-3 arguments, but got 4. @@ -57,10 +73,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var x = foo `${1}${true}`; // boolean (with error) ~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:19:20: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:19:20: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. var y = foo `${1}${"2"}`; // {} var z = foo `${1}${2}${3}`; // any (with error) ~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt index b103d9eef9e..409cf9fb676 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt @@ -2,10 +2,26 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,9): error TS2755: No overload matches this call. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,9): error TS2755: No overload matches this call. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,9): error TS2755: No overload matches this call. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. + Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,9): error TS2755: No overload matches this call. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4. @@ -29,24 +45,24 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var c = foo([], 1, 2); // boolean ~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:11:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:11:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var d = foo([], 1, true); // boolean (with error) ~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:12:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:12:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var e = foo([], 1, "2"); // {} ~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:13:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:13:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var f = foo([], 1, 2, 3); // any (with error) ~ !!! error TS2554: Expected 1-3 arguments, but got 4. @@ -57,10 +73,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var x = foo `${1}${true}`; // boolean (with error) ~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:19:20: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:19:20: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. var y = foo `${1}${"2"}`; // {} var z = foo `${1}${2}${3}`; // any (with error) ~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt index 06986bf66f7..1432360eba8 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt @@ -1,8 +1,20 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(9,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(62,1): error TS2755: No overload matches this call. + Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. + Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,1): error TS2755: No overload matches this call. + Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. + Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(69,18): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -18,10 +30,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio fn1 `${ {} }`; // Error ~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:9:9: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. - Argument of type '{}' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:9:9: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. - Argument of type '{}' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. +!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. +!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'. function fn2(strs: TemplateStringsArray, s: string, n: number): number; function fn2(strs: TemplateStringsArray, n: number, t: T): T; @@ -82,17 +94,17 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio fn4 `${ true }${ null }`; ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:62:9: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:62:9: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:63:18: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:63:18: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt index 1d641d2611e..c3b049af05f 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt @@ -1,8 +1,20 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,1): error TS2755: No overload matches this call. + Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. + Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,1): error TS2755: No overload matches this call. + Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. + Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(69,18): error TS2551: Property 'toFixed' does not exist on type 'string'. Did you mean 'fixed'? @@ -18,10 +30,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio fn1 `${ {} }`; // Error ~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:9:9: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. - Argument of type '{}' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:9:9: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. - Argument of type '{}' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. +!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. +!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'. function fn2(strs: TemplateStringsArray, s: string, n: number): number; function fn2(strs: TemplateStringsArray, n: number, t: T): T; @@ -82,17 +94,17 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio fn4 `${ true }${ null }`; ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:62:9: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:62:9: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:63:18: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:63:18: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; diff --git a/tests/baselines/reference/tsxElementResolution9.errors.txt b/tests/baselines/reference/tsxElementResolution9.errors.txt index 6686890b839..37a847d0126 100644 --- a/tests/baselines/reference/tsxElementResolution9.errors.txt +++ b/tests/baselines/reference/tsxElementResolution9.errors.txt @@ -1,6 +1,18 @@ tests/cases/conformance/jsx/file.tsx(11,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(n: string): { x: number; }', gave the following error. + Type '{}' is not assignable to type 'string'. + Overload 2 of 2, '(n: number): { y: string; }', gave the following error. + Type '{}' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(18,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(n: string): { x: number; }', gave the following error. + Type '{}' is not assignable to type 'string'. + Overload 2 of 2, '(n: number): { y: string; }', gave the following error. + Type '{}' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(n: string): { x: number; }', gave the following error. + Type '{ x: number; }' is not assignable to type 'string'. + Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. + Type '{ x: number; }' is not assignable to type 'number'. ==== tests/cases/conformance/jsx/file.tsx (3 errors) ==== @@ -17,10 +29,10 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches th ; // Error, return type is not an object type ~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:11:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. - Type '{}' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:11:2: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. - Type '{}' is not assignable to type 'number'. +!!! error TS2755: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +!!! error TS2755: Type '{}' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. +!!! error TS2755: Type '{}' is not assignable to type 'number'. interface Obj2 { (n: string): { x: number }; @@ -30,10 +42,10 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches th ; // Error, return type is not an object type ~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:18:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. - Type '{}' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:18:2: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. - Type '{}' is not assignable to type 'number'. +!!! error TS2755: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +!!! error TS2755: Type '{}' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. +!!! error TS2755: Type '{}' is not assignable to type 'number'. interface Obj3 { (n: string): { x: number }; @@ -43,8 +55,8 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches th ; // OK ~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:25:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. - Type '{ x: number; }' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:25:2: Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. - Type '{ x: number; }' is not assignable to type 'number'. +!!! error TS2755: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +!!! error TS2755: Type '{ x: number; }' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. +!!! error TS2755: Type '{ x: number; }' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt index c95de6de1f3..bd90b09a12a 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt @@ -1,14 +1,79 @@ tests/cases/conformance/jsx/file.tsx(12,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(): Element', gave the following error. + Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. + Property 'extraProp' does not exist on type 'IntrinsicAttributes'. + Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. + Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. tests/cases/conformance/jsx/file.tsx(13,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(): Element', gave the following error. + Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. + Property 'yy' does not exist on type 'IntrinsicAttributes'. + Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. tests/cases/conformance/jsx/file.tsx(14,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(): Element', gave the following error. + Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'. + Property 'yy1' does not exist on type 'IntrinsicAttributes'. + Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Type 'true' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(16,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(): Element', gave the following error. + Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. + Property 'y1' does not exist on type 'IntrinsicAttributes'. + Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. + Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. tests/cases/conformance/jsx/file.tsx(17,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(): Element', gave the following error. + Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. + Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. + Types of property 'yy' are incompatible. + Type 'boolean' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(25,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. + Type 'true' is not assignable to type 'string'. + Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. + Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. tests/cases/conformance/jsx/file.tsx(26,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. + Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. + Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. + Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(33,12): error TS2755: No overload matches this call. + Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type 'true' is not assignable to type 'string'. + Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + Type 'true' is not assignable to type 'string'. + Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. tests/cases/conformance/jsx/file.tsx(34,12): error TS2755: No overload matches this call. + Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. + Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. + Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. tests/cases/conformance/jsx/file.tsx(35,12): error TS2755: No overload matches this call. + Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + Type 'string' is not assignable to type 'Element'. + Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches this call. + Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. + Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. ==== tests/cases/conformance/jsx/file.tsx (11 errors) ==== @@ -26,47 +91,47 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches t const c0 = ; // extra property; ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:12:13: Overload 1 of 2, '(): Element', gave the following error. - Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. - Property 'extraProp' does not exist on type 'IntrinsicAttributes'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:12:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. - Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. - Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. +!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2755: Property 'extraProp' does not exist on type 'IntrinsicAttributes'. +!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2755: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. +!!! error TS2755: Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c1 = ; // missing property; ~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:13:13: Overload 1 of 2, '(): Element', gave the following error. - Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. - Property 'yy' does not exist on type 'IntrinsicAttributes'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:13:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. - Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. +!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2755: Property 'yy' does not exist on type 'IntrinsicAttributes'. +!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2755: Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. const c2 = ; // type incompatible; ~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:14:13: Overload 1 of 2, '(): Element', gave the following error. - Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'. - Property 'yy1' does not exist on type 'IntrinsicAttributes'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:14:31: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. - Type 'true' is not assignable to type 'string'. +!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2755: Property 'yy1' does not exist on type 'IntrinsicAttributes'. +!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. const c3 = ; // This is OK becuase all attribute are spread const c4 = ; // extra property; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:16:13: Overload 1 of 2, '(): Element', gave the following error. - Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. - Property 'y1' does not exist on type 'IntrinsicAttributes'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:16:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. - Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. - Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. +!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2755: Property 'y1' does not exist on type 'IntrinsicAttributes'. +!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2755: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. +!!! error TS2755: Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c5 = ; // type incompatible; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:17:13: Overload 1 of 2, '(): Element', gave the following error. - Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:17:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. - Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. - Types of property 'yy' are incompatible. - Type 'boolean' is not assignable to type 'number'. +!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. +!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2755: Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. +!!! error TS2755: Types of property 'yy' are incompatible. +!!! error TS2755: Type 'boolean' is not assignable to type 'number'. const c6 = ; // Should error as there is extra attribute that doesn't match any. Current it is not const c7 = ; // Should error as there is extra attribute that doesn't match any. Current it is not @@ -77,18 +142,18 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches t const d1 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:25:29: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. - Type 'true' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:25:13: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. - Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. +!!! error TS2755: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. +!!! error TS2755: Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. const d2 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:26:13: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. - Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. - Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:26:40: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. - Type 'string' is not assignable to type 'number'. +!!! error TS2755: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. +!!! error TS2755: Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. +!!! error TS2755: Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. +!!! error TS2755: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'number'. declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element; declare function TestingOptional(a: {y1?: string, y2?: number, children: JSX.Element}): JSX.Element; @@ -98,41 +163,41 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches t const e1 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:33:29: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. - Type 'true' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:33:29: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. - Type 'true' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:33:32: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. - Type 'string' is not assignable to type 'boolean'. +!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. +!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'boolean'. const e2 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:34:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. - Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. - Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:34:13: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. - Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. - Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:34:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. - Type 'string' is not assignable to type 'boolean'. +!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2755: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2755: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2755: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. +!!! error TS2755: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. +!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'boolean'. const e3 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:35:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. - Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. - Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:35:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. - Type 'string' is not assignable to type 'Element'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:35:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. - Type 'string' is not assignable to type 'boolean'. +!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2755: Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2755: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'Element'. +!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'boolean'. const e4 = Hi ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:36:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. - Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. - Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:36:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. - 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:36:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. - Type 'string' is not assignable to type 'boolean'. +!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2755: Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2755: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2755: 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. +!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt index f364876a945..680f2903b77 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt @@ -1,7 +1,34 @@ tests/cases/conformance/jsx/file.tsx(48,12): error TS2755: No overload matches this call. + Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. + Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. + Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. + Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. + Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. + Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. tests/cases/conformance/jsx/file.tsx(54,12): error TS2755: No overload matches this call. + Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Type 'number' is not assignable to type 'string'. + Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Type 'number' is not assignable to type 'string'. + Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(55,12): error TS2755: No overload matches this call. + Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Type 'true' is not assignable to type 'string'. + Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Type 'true' is not assignable to type 'string'. + Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. + Type 'true' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No overload matches this call. + Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. + Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. + Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. + Type 'true' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (4 errors) ==== @@ -55,15 +82,15 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No overload matches t const b0 = {}}>GO; // extra property; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:48:13: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. - Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. - Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:48:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. - Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:48:13: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. - Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. - Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. +!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2755: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2755: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! error TS2755: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. +!!! error TS2755: Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. const b1 = {}} {...obj0}>Hello world; // extra property; const b2 = ; // extra property const b3 = {}}} />; // extra property @@ -72,27 +99,27 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No overload matches t const b6 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:54:51: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. - Type 'number' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:54:51: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. - Type 'number' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:54:51: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. - Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! error TS2755: Type 'number' is not assignable to type 'string'. const b7 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:55:68: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. - Type 'true' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:55:68: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. - Type 'true' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:55:68: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. - Type 'true' is not assignable to type 'string'. +!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. +!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. const b8 = ; // incorrect type for specified hyphanated name ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:56:13: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. - Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:56:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. - Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:56:24: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. - Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. +!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2755: Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. +!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt index a8d2a1c004e..ea279fdedfb 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt @@ -1,5 +1,20 @@ tests/cases/conformance/jsx/file.tsx(9,14): error TS2755: No overload matches this call. + Overload 1 of 3, '(): Element', gave the following error. + Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. + Property 'a' does not exist on type 'IntrinsicAttributes'. + Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. + Type 'number' is not assignable to type 'string'. + Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. + Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No overload matches this call. + Overload 1 of 3, '(): Element', gave the following error. + Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. + Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. + Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }'. + Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: string; "ignore-prop": boolean; }'. + Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. + Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. + Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. ==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== @@ -14,22 +29,22 @@ tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No overload matches t let a0 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:9:15: Overload 1 of 3, '(): Element', gave the following error. - Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. - Property 'a' does not exist on type 'IntrinsicAttributes'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:9:33: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. - Type 'number' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:9:15: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. - Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. +!!! error TS2755: Overload 1 of 3, '(): Element', gave the following error. +!!! error TS2755: Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2755: Property 'a' does not exist on type 'IntrinsicAttributes'. +!!! error TS2755: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. +!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. +!!! error TS2755: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. let a2 = // missing a ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:10:15: Overload 1 of 3, '(): Element', gave the following error. - Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:10:15: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. - Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }'. - Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: string; "ignore-prop": boolean; }'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:10:15: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. - Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. - Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. +!!! error TS2755: Overload 1 of 3, '(): Element', gave the following error. +!!! error TS2755: Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. +!!! error TS2755: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. +!!! error TS2755: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }'. +!!! error TS2755: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: string; "ignore-prop": boolean; }'. +!!! error TS2755: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. +!!! error TS2755: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. +!!! error TS2755: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. } \ No newline at end of file diff --git a/tests/baselines/reference/unionTypeCallSignatures.errors.txt b/tests/baselines/reference/unionTypeCallSignatures.errors.txt index fd1a5cdb379..01bb58176aa 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeCallSignatures.errors.txt @@ -1,6 +1,14 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(9,43): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(10,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(a: number): number | Date', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. + Overload 2 of 2, '(a: string): string | boolean', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(a: number): number | Date', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. + Overload 2 of 2, '(a: string): string | boolean', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(16,1): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(19,32): error TS2345: Argument of type '10' is not assignable to parameter of type 'never'. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(20,32): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'never'. @@ -42,10 +50,10 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:10:29: Overload 1 of 2, '(a: number): number | Date', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2760 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:10:29: Overload 2 of 2, '(a: string): string | boolean', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. var unionOfDifferentReturnType1: { (a: number): number; (a: string): string; } | { (a: number): Date; (a: string): boolean; }; numOrDate = unionOfDifferentReturnType1(10); @@ -53,10 +61,10 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:15:29: Overload 1 of 2, '(a: number): number | Date', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2760 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:15:29: Overload 2 of 2, '(a: string): string | boolean', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. unionOfDifferentReturnType1(); // error missing parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. diff --git a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt index c277a2f6b24..5913799605b 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt @@ -1,6 +1,14 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(9,47): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(10,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(a: number): number | Date', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. + Overload 2 of 2, '(a: string): string | boolean', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(a: number): number | Date', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. + Overload 2 of 2, '(a: string): string | boolean', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(16,1): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(19,36): error TS2345: Argument of type '10' is not assignable to parameter of type 'never'. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(20,36): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'never'. @@ -41,10 +49,10 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro new unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:10:33: Overload 1 of 2, '(a: number): number | Date', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2760 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:10:33: Overload 2 of 2, '(a: string): string | boolean', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. var unionOfDifferentReturnType1: { new (a: number): number; new (a: string): string; } | { new (a: number): Date; new (a: string): boolean; }; numOrDate = new unionOfDifferentReturnType1(10); @@ -52,10 +60,10 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro new unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:15:33: Overload 1 of 2, '(a: number): number | Date', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'number'. -!!! related TS2760 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:15:33: Overload 2 of 2, '(a: string): string | boolean', gave the following error. - Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. new unionOfDifferentReturnType1(); // error missing parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. From 97784749b5e218843cd5b2574e802900a71cfe2d Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 28 Jun 2019 16:09:54 -0700 Subject: [PATCH 41/95] Fix lint --- src/compiler/checker.ts | 2 +- src/compiler/utilities.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 0f0ba5c786a..5bb5210248d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21658,7 +21658,7 @@ namespace ts { const related = map( max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics), - d => typeof d.messageText === 'string' ? (d as DiagnosticMessageChain) : d.messageText); + d => typeof d.messageText === "string" ? (d as DiagnosticMessageChain) : d.messageText); diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(related, Diagnostics.No_overload_matches_this_call))); } } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 4d7eaf65a24..b575deab62f 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -7201,13 +7201,13 @@ namespace ts { // } function compareMessageText(t1: string | DiagnosticMessageChain, t2: string | DiagnosticMessageChain): Comparison { - if (typeof t1 === 'string' && typeof t2 === 'string') { + if (typeof t1 === "string" && typeof t2 === "string") { return compareStringsCaseSensitive(t1, t2); } - else if (typeof t1 === 'string') { + else if (typeof t1 === "string") { return Comparison.LessThan; } - else if (typeof t2 === 'string') { + else if (typeof t2 === "string") { return Comparison.GreaterThan; } let res = compareStringsCaseSensitive(t1.messageText, t2.messageText); @@ -7228,7 +7228,7 @@ namespace ts { return res; } for (let i = 0; i < t1.next.length; i++) { - res = compareMessageText(t1.next[i], t2.next[i]) + res = compareMessageText(t1.next[i], t2.next[i]); if (res) { return res; } From 34c4047371ea606787238955a5ebe064d0aaaddc Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 28 Jun 2019 16:26:52 -0700 Subject: [PATCH 42/95] Update baselines with new error numbers --- .../reference/bigintWithLib.errors.txt | 50 ++--- .../constructorOverloads1.errors.txt | 24 +-- ...StringLiteralsInJsxAttributes02.errors.txt | 64 +++---- .../controlFlowIterationErrors.errors.txt | 32 ++-- tests/baselines/reference/for-of39.errors.txt | 32 ++-- .../reference/functionOverloads2.errors.txt | 12 +- .../reference/functionOverloads40.errors.txt | 12 +- .../reference/functionOverloads41.errors.txt | 12 +- ...edMethodWithOverloadedArguments.errors.txt | 60 +++--- .../heterogeneousArrayAndOverloads.errors.txt | 8 +- .../reference/incompatibleTypes.errors.txt | 40 ++-- ...ritedConstructorWithRestParams2.errors.txt | 24 +-- .../iterableArrayPattern28.errors.txt | 32 ++-- .../iteratorSpreadInArray6.errors.txt | 22 +-- ...attersForSignatureGroupIdentity.errors.txt | 32 ++-- .../baselines/reference/overload1.errors.txt | 12 +- .../reference/overloadResolution.errors.txt | 36 ++-- ...loadResolutionClassConstructors.errors.txt | 12 +- .../overloadResolutionConstructors.errors.txt | 36 ++-- .../overloadResolutionTest1.errors.txt | 36 ++-- .../overloadingOnConstants2.errors.txt | 12 +- ...nWithConstraintCheckingDeferred.errors.txt | 26 +-- .../overloadsWithProvisionalErrors.errors.txt | 24 +-- .../reference/promiseTypeInference.errors.txt | 24 +-- .../recursiveFunctionTypes.errors.txt | 16 +- ...edSignatureAsCallbackParameter1.errors.txt | 32 ++-- ...eStringsWithOverloadResolution1.errors.txt | 48 ++--- ...ingsWithOverloadResolution1_ES6.errors.txt | 48 ++--- ...eStringsWithOverloadResolution3.errors.txt | 36 ++-- ...ingsWithOverloadResolution3_ES6.errors.txt | 36 ++-- .../tsxElementResolution9.errors.txt | 36 ++-- ...elessFunctionComponentOverload4.errors.txt | 174 +++++++++--------- ...elessFunctionComponentOverload5.errors.txt | 70 +++---- ...ionComponentsWithTypeArguments4.errors.txt | 38 ++-- .../unionTypeCallSignatures.errors.txt | 24 +-- .../unionTypeConstructSignatures.errors.txt | 24 +-- 36 files changed, 628 insertions(+), 628 deletions(-) diff --git a/tests/baselines/reference/bigintWithLib.errors.txt b/tests/baselines/reference/bigintWithLib.errors.txt index 19dc04b17fe..3cb6306a1e0 100644 --- a/tests/baselines/reference/bigintWithLib.errors.txt +++ b/tests/baselines/reference/bigintWithLib.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/bigintWithLib.ts(4,1): error TS2350: Only a void function can be called with the 'new' keyword. -tests/cases/compiler/bigintWithLib.ts(16,15): error TS2755: No overload matches this call. +tests/cases/compiler/bigintWithLib.ts(16,15): error TS2763: No overload matches this call. Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. Argument of type 'number[]' is not assignable to parameter of type 'number'. Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. @@ -15,7 +15,7 @@ tests/cases/compiler/bigintWithLib.ts(16,15): error TS2755: No overload matches Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] tests/cases/compiler/bigintWithLib.ts(21,13): error TS2540: Cannot assign to 'length' because it is a read-only property. -tests/cases/compiler/bigintWithLib.ts(28,16): error TS2755: No overload matches this call. +tests/cases/compiler/bigintWithLib.ts(28,16): error TS2763: No overload matches this call. Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. Argument of type 'number[]' is not assignable to parameter of type 'number'. Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. @@ -48,21 +48,21 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 bigIntArray = new BigInt64Array([1n, 2n, 3n]); bigIntArray = new BigInt64Array([1, 2, 3]); // should error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. -!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. -!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. -!!! error TS2755: Types of property '[Symbol.iterator]' are incompatible. -!!! error TS2755: Type '() => IterableIterator' is not assignable to type '() => Iterator'. -!!! error TS2755: Type 'IterableIterator' is not assignable to type 'Iterator'. -!!! error TS2755: Types of property 'next' are incompatible. -!!! error TS2755: Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. -!!! error TS2755: Type 'IteratorResult' is not assignable to type 'IteratorResult'. -!!! error TS2755: Type 'number' is not assignable to type 'bigint'. -!!! error TS2755: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error. -!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. -!!! error TS2755: Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. +!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. +!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2763: Types of property '[Symbol.iterator]' are incompatible. +!!! error TS2763: Type '() => IterableIterator' is not assignable to type '() => Iterator'. +!!! error TS2763: Type 'IterableIterator' is not assignable to type 'Iterator'. +!!! error TS2763: Types of property 'next' are incompatible. +!!! error TS2763: Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. +!!! error TS2763: Type 'IteratorResult' is not assignable to type 'IteratorResult'. +!!! error TS2763: Type 'number' is not assignable to type 'bigint'. +!!! error TS2763: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error. +!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. +!!! error TS2763: Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] bigIntArray = new BigInt64Array(new ArrayBuffer(80)); bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8); bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8, 3); @@ -78,14 +78,14 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 bigUintArray = new BigUint64Array([1n, 2n, 3n]); bigUintArray = new BigUint64Array([1, 2, 3]); // should error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. -!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. -!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. -!!! error TS2755: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error. -!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. -!!! error TS2755: Type 'number[]' is not assignable to type 'SharedArrayBuffer'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. +!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. +!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2763: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error. +!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. +!!! error TS2763: Type 'number[]' is not assignable to type 'SharedArrayBuffer'. bigUintArray = new BigUint64Array(new ArrayBuffer(80)); bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8); bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8, 3); diff --git a/tests/baselines/reference/constructorOverloads1.errors.txt b/tests/baselines/reference/constructorOverloads1.errors.txt index 9c2db5b39e6..dd0353bbc0e 100644 --- a/tests/baselines/reference/constructorOverloads1.errors.txt +++ b/tests/baselines/reference/constructorOverloads1.errors.txt @@ -2,12 +2,12 @@ tests/cases/compiler/constructorOverloads1.ts(2,5): error TS2392: Multiple const tests/cases/compiler/constructorOverloads1.ts(3,5): error TS2392: Multiple constructor implementations are not allowed. tests/cases/compiler/constructorOverloads1.ts(4,5): error TS2392: Multiple constructor implementations are not allowed. tests/cases/compiler/constructorOverloads1.ts(7,5): error TS2392: Multiple constructor implementations are not allowed. -tests/cases/compiler/constructorOverloads1.ts(16,10): error TS2755: No overload matches this call. +tests/cases/compiler/constructorOverloads1.ts(16,10): error TS2763: No overload matches this call. Overload 1 of 2, '(s: string): Foo', gave the following error. Argument of type 'Foo' is not assignable to parameter of type 'string'. Overload 2 of 2, '(n: number): Foo', gave the following error. Argument of type 'Foo' is not assignable to parameter of type 'number'. -tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2755: No overload matches this call. +tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2763: No overload matches this call. Overload 1 of 2, '(s: string): Foo', gave the following error. Argument of type 'any[]' is not assignable to parameter of type 'string'. Overload 2 of 2, '(n: number): Foo', gave the following error. @@ -44,18 +44,18 @@ tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2755: No overload var f2 = new Foo(0); var f3 = new Foo(f1); ~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(s: string): Foo', gave the following error. -!!! error TS2755: Argument of type 'Foo' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(n: number): Foo', gave the following error. -!!! error TS2755: Argument of type 'Foo' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(s: string): Foo', gave the following error. +!!! error TS2763: Argument of type 'Foo' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(n: number): Foo', gave the following error. +!!! error TS2763: Argument of type 'Foo' is not assignable to parameter of type 'number'. var f4 = new Foo([f1,f2,f3]); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(s: string): Foo', gave the following error. -!!! error TS2755: Argument of type 'any[]' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(n: number): Foo', gave the following error. -!!! error TS2755: Argument of type 'any[]' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(s: string): Foo', gave the following error. +!!! error TS2763: Argument of type 'any[]' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(n: number): Foo', gave the following error. +!!! error TS2763: Argument of type 'any[]' is not assignable to parameter of type 'number'. f1.bar1(); f1.bar2(); diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt index 28aa026b11f..e09d3c59572 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt @@ -1,25 +1,25 @@ -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,12): error TS2755: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,12): error TS2763: No overload matches this call. Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,12): error TS2755: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,12): error TS2763: No overload matches this call. Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,12): error TS2755: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,12): error TS2763: No overload matches this call. Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,12): error TS2755: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,12): error TS2763: No overload matches this call. Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. @@ -61,40 +61,40 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): err const b0 = {console.log(k)}}} extra />; // k has type "left" | "right" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2755: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2755: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2763: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2763: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. const b2 = {console.log(k)}} extra />; // k has type "left" | "right" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2755: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2755: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2755: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2763: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2763: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. const b3 = ; // goTo has type"home" | "contact" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2755: Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2755: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2763: Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2763: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. const b4 = ; // goTo has type "home" | "contact" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2755: Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2755: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2763: Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2763: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. export function NoOverload(buttonProps: ButtonProps): JSX.Element { return undefined } const c1 = {console.log(k)}}} extra />; // k has type any diff --git a/tests/baselines/reference/controlFlowIterationErrors.errors.txt b/tests/baselines/reference/controlFlowIterationErrors.errors.txt index b8c4c21906c..4fe96c97dd3 100644 --- a/tests/baselines/reference/controlFlowIterationErrors.errors.txt +++ b/tests/baselines/reference/controlFlowIterationErrors.errors.txt @@ -2,14 +2,14 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(11,17): error Type 'number' is not assignable to type 'string'. tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(22,17): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(34,13): error TS2755: No overload matches this call. +tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(34,13): error TS2763: No overload matches this call. Overload 1 of 2, '(x: string): number', gave the following error. Argument of type 'string | number' is not assignable to parameter of type 'string'. Type 'number' is not assignable to type 'string'. Overload 2 of 2, '(x: number): string', gave the following error. Argument of type 'string | number' is not assignable to parameter of type 'number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error TS2755: No overload matches this call. +tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error TS2763: No overload matches this call. Overload 1 of 2, '(x: string): number', gave the following error. Argument of type 'string | number' is not assignable to parameter of type 'string'. Type 'number' is not assignable to type 'string'. @@ -60,13 +60,13 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error while (cond) { x = foo(x); ~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(x: string): number', gave the following error. -!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'string'. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 2, '(x: number): string', gave the following error. -!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'number'. -!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(x: string): number', gave the following error. +!!! error TS2763: Argument of type 'string | number' is not assignable to parameter of type 'string'. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 2, '(x: number): string', gave the following error. +!!! error TS2763: Argument of type 'string | number' is not assignable to parameter of type 'number'. +!!! error TS2763: Type 'string' is not assignable to type 'number'. x; } x; @@ -79,13 +79,13 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error x; x = foo(x); ~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(x: string): number', gave the following error. -!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'string'. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 2, '(x: number): string', gave the following error. -!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'number'. -!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(x: string): number', gave the following error. +!!! error TS2763: Argument of type 'string | number' is not assignable to parameter of type 'string'. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 2, '(x: number): string', gave the following error. +!!! error TS2763: Argument of type 'string | number' is not assignable to parameter of type 'number'. +!!! error TS2763: Type 'string' is not assignable to type 'number'. } x; } diff --git a/tests/baselines/reference/for-of39.errors.txt b/tests/baselines/reference/for-of39.errors.txt index 77f8bff4412..364f225e497 100644 --- a/tests/baselines/reference/for-of39.errors.txt +++ b/tests/baselines/reference/for-of39.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2755: No overload matches this call. +tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2763: No overload matches this call. Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable'. Types of property '[Symbol.iterator]' are incompatible. @@ -18,21 +18,21 @@ tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2755: No ==== tests/cases/conformance/es6/for-ofStatements/for-of39.ts (1 errors) ==== var map = new Map([["", true], ["", 0]]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. -!!! error TS2755: Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable'. -!!! error TS2755: Types of property '[Symbol.iterator]' are incompatible. -!!! error TS2755: Type '() => IterableIterator<[string, number] | [string, true]>' is not assignable to type '() => Iterator'. -!!! error TS2755: Type 'IterableIterator<[string, number] | [string, true]>' is not assignable to type 'Iterator'. -!!! error TS2755: Types of property 'next' are incompatible. -!!! error TS2755: Type '(value?: any) => IteratorResult<[string, number] | [string, true]>' is not assignable to type '(value?: any) => IteratorResult'. -!!! error TS2755: Type 'IteratorResult<[string, number] | [string, true]>' is not assignable to type 'IteratorResult'. -!!! error TS2755: Type '[string, number] | [string, true]' is not assignable to type 'readonly [string, boolean]'. -!!! error TS2755: Type '[string, number]' is not assignable to type 'readonly [string, boolean]'. -!!! error TS2755: Types of property '1' are incompatible. -!!! error TS2755: Type 'number' is not assignable to type 'boolean'. -!!! error TS2755: Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map', gave the following error. -!!! error TS2755: Type 'number' is not assignable to type 'boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. +!!! error TS2763: Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2763: Types of property '[Symbol.iterator]' are incompatible. +!!! error TS2763: Type '() => IterableIterator<[string, number] | [string, true]>' is not assignable to type '() => Iterator'. +!!! error TS2763: Type 'IterableIterator<[string, number] | [string, true]>' is not assignable to type 'Iterator'. +!!! error TS2763: Types of property 'next' are incompatible. +!!! error TS2763: Type '(value?: any) => IteratorResult<[string, number] | [string, true]>' is not assignable to type '(value?: any) => IteratorResult'. +!!! error TS2763: Type 'IteratorResult<[string, number] | [string, true]>' is not assignable to type 'IteratorResult'. +!!! error TS2763: Type '[string, number] | [string, true]' is not assignable to type 'readonly [string, boolean]'. +!!! error TS2763: Type '[string, number]' is not assignable to type 'readonly [string, boolean]'. +!!! error TS2763: Types of property '1' are incompatible. +!!! error TS2763: Type 'number' is not assignable to type 'boolean'. +!!! error TS2763: Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map', gave the following error. +!!! error TS2763: Type 'number' is not assignable to type 'boolean'. for (var [k, v] of map) { k; v; diff --git a/tests/baselines/reference/functionOverloads2.errors.txt b/tests/baselines/reference/functionOverloads2.errors.txt index 785844037fa..e07242a9c0d 100644 --- a/tests/baselines/reference/functionOverloads2.errors.txt +++ b/tests/baselines/reference/functionOverloads2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No overload matches this call. +tests/cases/compiler/functionOverloads2.ts(4,9): error TS2763: No overload matches this call. Overload 1 of 2, '(bar: string): string', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. Overload 2 of 2, '(bar: number): number', gave the following error. @@ -11,8 +11,8 @@ tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No overload match function foo(bar: any): any { return bar }; var x = foo(true); ~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(bar: string): string', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(bar: number): number', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. \ No newline at end of file +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(bar: string): string', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(bar: number): number', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index ce7472e1936..e3e7d3a25e7 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No overload matches this call. +tests/cases/compiler/functionOverloads40.ts(4,9): error TS2763: No overload matches this call. Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. Type 'string' is not assignable to type 'number'. Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. @@ -11,9 +11,9 @@ tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No overload matc function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{a:'bar'}]); ~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! error TS2763: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! error TS2763: 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 a26840f22f0..f475095fdb9 100644 --- a/tests/baselines/reference/functionOverloads41.errors.txt +++ b/tests/baselines/reference/functionOverloads41.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No overload matches this call. +tests/cases/compiler/functionOverloads41.ts(4,9): error TS2763: No overload matches this call. Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. Property 'a' is missing in type '{}' but required in type '{ a: number; }'. Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. @@ -11,9 +11,9 @@ tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No overload matc function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{}]); ~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. -!!! error TS2755: Property 'a' is missing in type '{}' but required in type '{ a: number; }'. -!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. -!!! error TS2755: Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2763: Property 'a' is missing in type '{}' but required in type '{ a: number; }'. +!!! error TS2763: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! error TS2763: Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt index 10673021477..bc4ecd03fdb 100644 --- a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt +++ b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(23,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(52,22): error TS2755: No overload matches this call. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(52,22): error TS2763: No overload matches this call. Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. @@ -9,7 +9,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(68,22): error TS2755: No overload matches this call. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(68,22): error TS2763: No overload matches this call. Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. @@ -20,7 +20,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(84,22): error TS2755: No overload matches this call. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(84,22): error TS2763: No overload matches this call. Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. @@ -88,14 +88,14 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. -!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. -!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2763: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. +!!! error TS2763: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. } ////////////////////////////////////// @@ -113,17 +113,17 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. -!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. -!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2755: Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. -!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2763: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. +!!! error TS2763: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. +!!! error TS2763: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. } ////////////////////////////////////// @@ -141,13 +141,13 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. -!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2755: Type 'number' is not assignable to type 'boolean'. -!!! error TS2755: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. -!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2763: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: Type 'number' is not assignable to type 'boolean'. +!!! error TS2763: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. +!!! error TS2763: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. } \ No newline at end of file diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt index 2f3a813bf85..8b7672c3b24 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No overload matches this call. +tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2763: No overload matches this call. Overload 1 of 2, '(arg1: number[]): any', gave the following error. Type 'string' is not assignable to type 'number'. @@ -14,8 +14,8 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No ov this.test([]); this.test([1, 2, "hi", 5]); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(arg1: number[]): any', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(arg1: number[]): any', gave the following error. +!!! error TS2763: Type 'string' 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 296b749cce8..eb1496057cc 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -9,7 +9,7 @@ tests/cases/compiler/incompatibleTypes.ts(26,12): error TS2416: Property 'p1' in Type 'number' is not assignable to type 'string'. tests/cases/compiler/incompatibleTypes.ts(34,12): error TS2416: Property 'p1' in type 'C4' is not assignable to the same property in base type 'IFoo4'. Type '{ c: { b: string; }; d: string; }' is missing the following properties from type '{ a: { a: string; }; b: string; }': a, b -tests/cases/compiler/incompatibleTypes.ts(42,1): error TS2755: No overload matches this call. +tests/cases/compiler/incompatibleTypes.ts(42,1): error TS2763: No overload matches this call. Overload 1 of 2, '(i: IFoo1): void', gave the following error. Argument of type 'C1' is not assignable to parameter of type 'IFoo1'. Types of property 'p1' are incompatible. @@ -20,7 +20,7 @@ tests/cases/compiler/incompatibleTypes.ts(42,1): error TS2755: No overload match Types of property 'p1' are incompatible. Type '() => string' is not assignable to type '(s: string) => number'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/incompatibleTypes.ts(49,1): error TS2755: No overload matches this call. +tests/cases/compiler/incompatibleTypes.ts(49,1): error TS2763: No overload matches this call. Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'. Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. @@ -92,17 +92,17 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => var c2: C2; if1(c1); ~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(i: IFoo1): void', gave the following error. -!!! error TS2755: Argument of type 'C1' is not assignable to parameter of type 'IFoo1'. -!!! error TS2755: Types of property 'p1' are incompatible. -!!! error TS2755: Type '() => string' is not assignable to type '() => number'. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! error TS2755: Overload 2 of 2, '(i: IFoo2): void', gave the following error. -!!! error TS2755: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. -!!! error TS2755: Types of property 'p1' are incompatible. -!!! error TS2755: Type '() => string' is not assignable to type '(s: string) => number'. -!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(i: IFoo1): void', gave the following error. +!!! error TS2763: Argument of type 'C1' is not assignable to parameter of type 'IFoo1'. +!!! error TS2763: Types of property 'p1' are incompatible. +!!! error TS2763: Type '() => string' is not assignable to type '() => number'. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! error TS2763: Overload 2 of 2, '(i: IFoo2): void', gave the following error. +!!! error TS2763: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. +!!! error TS2763: Types of property 'p1' are incompatible. +!!! error TS2763: Type '() => string' is not assignable to type '(s: string) => number'. +!!! error TS2763: Type 'string' is not assignable to type 'number'. function of1(n: { a: { a: string; }; b: string; }): number; @@ -111,13 +111,13 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => of1({ e: 0, f: 0 }); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. -!!! error TS2755: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'. -!!! error TS2755: Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. -!!! error TS2755: Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error. -!!! error TS2755: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. -!!! error TS2755: Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. +!!! error TS2763: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'. +!!! error TS2763: Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. +!!! error TS2763: Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error. +!!! error TS2763: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. +!!! error TS2763: Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. interface IMap { [key:string]:string; diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt index c11826196c4..dcd7912511e 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt @@ -1,10 +1,10 @@ tests/cases/compiler/inheritedConstructorWithRestParams2.ts(32,13): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. -tests/cases/compiler/inheritedConstructorWithRestParams2.ts(33,1): error TS2755: No overload matches this call. +tests/cases/compiler/inheritedConstructorWithRestParams2.ts(33,1): error TS2763: No overload matches this call. Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. Argument of type '""' is not assignable to parameter of type 'number'. Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. Argument of type '3' is not assignable to parameter of type 'string'. -tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2755: No overload matches this call. +tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2763: No overload matches this call. Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. Argument of type '""' is not assignable to parameter of type 'number'. Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. @@ -48,15 +48,15 @@ tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2755: !!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new Derived("", 3, "", 3); ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. -!!! error TS2755: Argument of type '""' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. -!!! error TS2755: Argument of type '3' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. +!!! error TS2763: Argument of type '""' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. +!!! error TS2763: Argument of type '3' is not assignable to parameter of type 'string'. new Derived("", 3, "", ""); ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. -!!! error TS2755: Argument of type '""' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. -!!! error TS2755: Argument of type '3' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. +!!! error TS2763: Argument of type '""' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. +!!! error TS2763: Argument of type '3' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern28.errors.txt b/tests/baselines/reference/iterableArrayPattern28.errors.txt index 2591d3f9ef7..1d7a98f24cb 100644 --- a/tests/baselines/reference/iterableArrayPattern28.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern28.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error TS2755: No overload matches this call. +tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error TS2763: No overload matches this call. Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. Types of property '[Symbol.iterator]' are incompatible. @@ -19,18 +19,18 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. -!!! error TS2755: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. -!!! error TS2755: Types of property '[Symbol.iterator]' are incompatible. -!!! error TS2755: Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator'. -!!! error TS2755: Type 'IterableIterator<[string, number] | [string, boolean]>' is not assignable to type 'Iterator'. -!!! error TS2755: Types of property 'next' are incompatible. -!!! error TS2755: Type '(value?: any) => IteratorResult<[string, number] | [string, boolean]>' is not assignable to type '(value?: any) => IteratorResult'. -!!! error TS2755: Type 'IteratorResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. -!!! error TS2755: Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. -!!! error TS2755: Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. -!!! error TS2755: Types of property '1' are incompatible. -!!! error TS2755: Type 'boolean' is not assignable to type 'number'. -!!! error TS2755: Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. +!!! error TS2763: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2763: Types of property '[Symbol.iterator]' are incompatible. +!!! error TS2763: Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator'. +!!! error TS2763: Type 'IterableIterator<[string, number] | [string, boolean]>' is not assignable to type 'Iterator'. +!!! error TS2763: Types of property 'next' are incompatible. +!!! error TS2763: Type '(value?: any) => IteratorResult<[string, number] | [string, boolean]>' is not assignable to type '(value?: any) => IteratorResult'. +!!! error TS2763: Type 'IteratorResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. +!!! error TS2763: Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. +!!! error TS2763: Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. +!!! error TS2763: Types of property '1' are incompatible. +!!! error TS2763: Type 'boolean' is not assignable to type 'number'. +!!! error TS2763: Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt index b3ce072c8e4..7a3695df7e3 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2763: No overload matches this call. Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. Types of property 'slice' are incompatible. @@ -27,13 +27,13 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755 var array: number[] = [0, 1]; array.concat([...new SymbolIterator]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. -!!! error TS2755: Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. -!!! error TS2755: Types of property 'slice' are incompatible. -!!! error TS2755: Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'. -!!! error TS2755: Type 'symbol[]' is not assignable to type 'number[]'. -!!! error TS2755: Type 'symbol' is not assignable to type 'number'. -!!! error TS2755: Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. -!!! error TS2755: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. -!!! error TS2755: Type 'symbol[]' is not assignable to type 'ConcatArray'. \ No newline at end of file +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. +!!! error TS2763: Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. +!!! error TS2763: Types of property 'slice' are incompatible. +!!! error TS2763: Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'. +!!! error TS2763: Type 'symbol[]' is not assignable to type 'number[]'. +!!! error TS2763: Type 'symbol' is not assignable to type 'number'. +!!! error TS2763: Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. +!!! error TS2763: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. +!!! error TS2763: Type 'symbol[]' is not assignable to type 'ConcatArray'. \ No newline at end of file diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt index 3365a92b749..da785d6b8eb 100644 --- a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,1): error TS2755: No overload matches this call. +tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,1): error TS2763: No overload matches this call. Overload 1 of 2, '(x: { s: string; }): string', gave the following error. Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. @@ -6,7 +6,7 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,1): error TS275 Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'w' must be of type 'A', but here has type 'C'. -tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS2755: No overload matches this call. +tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS2763: No overload matches this call. Overload 1 of 2, '(x: { s: string; }): string', gave the following error. Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. @@ -36,13 +36,13 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS275 v({ s: "", n: 0 }).toLowerCase(); ~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. -!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. -!!! error TS2755: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. -!!! error TS2755: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. -!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. -!!! error TS2755: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. +!!! error TS2763: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. +!!! error TS2763: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. +!!! error TS2763: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. +!!! error TS2763: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. +!!! error TS2763: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. var w: A; var w: C; @@ -52,10 +52,10 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS275 w({ s: "", n: 0 }).toLowerCase(); ~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. -!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. -!!! error TS2755: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. -!!! error TS2755: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. -!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. -!!! error TS2755: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. \ No newline at end of file +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. +!!! error TS2763: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. +!!! error TS2763: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. +!!! error TS2763: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. +!!! error TS2763: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. +!!! error TS2763: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt index 576ca81fe73..e92f1440618 100644 --- a/tests/baselines/reference/overload1.errors.txt +++ b/tests/baselines/reference/overload1.errors.txt @@ -3,7 +3,7 @@ tests/cases/compiler/overload1.ts(29,1): error TS2322: Type 'number' is not assi tests/cases/compiler/overload1.ts(31,11): error TS2554: Expected 1-2 arguments, but got 3. tests/cases/compiler/overload1.ts(32,5): error TS2554: Expected 1-2 arguments, but got 0. tests/cases/compiler/overload1.ts(33,1): error TS2322: Type 'C' is not assignable to type 'string'. -tests/cases/compiler/overload1.ts(34,3): error TS2755: No overload matches this call. +tests/cases/compiler/overload1.ts(34,3): error TS2763: No overload matches this call. Overload 1 of 2, '(s1: string, s2: number): string', gave the following error. Argument of type '2' is not assignable to parameter of type 'string'. Overload 2 of 2, '(s1: number, s2: string): number', gave the following error. @@ -57,11 +57,11 @@ tests/cases/compiler/overload1.ts(34,3): error TS2755: No overload matches this !!! error TS2322: Type 'C' is not assignable to type 'string'. z=x.h(2,2); // no match ~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(s1: string, s2: number): string', gave the following error. -!!! error TS2755: Argument of type '2' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(s1: number, s2: string): number', gave the following error. -!!! error TS2755: Argument of type '2' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(s1: string, s2: number): string', gave the following error. +!!! error TS2763: Argument of type '2' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(s1: number, s2: string): number', gave the following error. +!!! error TS2763: Argument of type '2' is not assignable to parameter of type 'string'. z=x.h("hello",0); // good var v=x.g; diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index d2c21b4ea7b..bb4952cef67 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,1): error TS2763: No overload matches this call. Overload 1 of 2, '(s: string): string', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. Overload 2 of 2, '(s: number): number', gave the following error. @@ -8,12 +8,12 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): e tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,1): error TS2763: No overload matches this call. Overload 1 of 2, '(n: string, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. Overload 2 of 2, '(n: number, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,1): error TS2763: No overload matches this call. Overload 1 of 2, '(n: any, m: number): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 2, '(n: any, m: string): any', gave the following error. @@ -51,11 +51,11 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // No candidate overloads found fn1({}); // Error ~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(s: string): string', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(s: number): number', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(s: string): string', gave the following error. +!!! error TS2763: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(s: number): number', gave the following error. +!!! error TS2763: Argument of type '{}' is not assignable to parameter of type 'number'. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments function fn2(s: string, n: number): number; @@ -124,18 +124,18 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4(true, null); // Error ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(n: string, m: any): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(n: number, m: any): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(n: string, m: any): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(n: number, m: any): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. fn4(null, true); // Error ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(n: any, m: number): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 2, '(n: any, m: string): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(n: any, m: number): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 2, '(n: any, m: string): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors function fn5(f: (n: string) => void): string; diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index 2eaf7490759..295c219e26e 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,1): error TS2763: No overload matches this call. Overload 1 of 2, '(s: string): fn1', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. Overload 2 of 2, '(s: number): fn1', gave the following error. @@ -47,11 +47,11 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru // No candidate overloads found new fn1({}); // Error ~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(s: string): fn1', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(s: number): fn1', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(s: string): fn1', gave the following error. +!!! error TS2763: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(s: number): fn1', gave the following error. +!!! error TS2763: Argument of type '{}' is not assignable to parameter of type 'number'. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments class fn2 { diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index c4972bb89eb..0f0468bf630 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,1): error TS2763: No overload matches this call. Overload 1 of 2, '(s: string): string', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. Overload 2 of 2, '(s: number): number', gave the following error. @@ -8,12 +8,12 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,1): error TS2763: No overload matches this call. Overload 1 of 2, '(n: string, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. Overload 2 of 2, '(n: number, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,1): error TS2763: No overload matches this call. Overload 1 of 2, '(n: any, m: number): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 2, '(n: any, m: string): any', gave the following error. @@ -51,11 +51,11 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // No candidate overloads found new fn1({}); // Error ~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(s: string): string', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(s: number): number', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(s: string): string', gave the following error. +!!! error TS2763: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(s: number): number', gave the following error. +!!! error TS2763: Argument of type '{}' is not assignable to parameter of type 'number'. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments interface fn2 { @@ -131,18 +131,18 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints new fn4(true, null); // Error ~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(n: string, m: any): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(n: number, m: any): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(n: string, m: any): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(n: number, m: any): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. new fn4(null, true); // Error ~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(n: any, m: number): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 2, '(n: any, m: string): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(n: any, m: number): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 2, '(n: any, m: string): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors interface fn5 { diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index 06050fb2192..ad3b6779be5 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -1,14 +1,14 @@ -tests/cases/compiler/overloadResolutionTest1.ts(7,12): error TS2755: No overload matches this call. +tests/cases/compiler/overloadResolutionTest1.ts(7,12): error TS2763: No overload matches this call. Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. Type 'string' is not assignable to type 'number'. Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. Type 'string' is not assignable to type 'boolean'. -tests/cases/compiler/overloadResolutionTest1.ts(18,10): error TS2755: No overload matches this call. +tests/cases/compiler/overloadResolutionTest1.ts(18,10): error TS2763: No overload matches this call. Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. Type 'string' is not assignable to type 'number'. Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. Type 'string' is not assignable to type 'boolean'. -tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload matches this call. +tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2763: No overload matches this call. Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. Type 'true' is not assignable to type 'number'. Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. @@ -24,11 +24,11 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload var x11 = foo([{a:0}]); // works var x111 = foo([{a:"s"}]); // error - does not match any signature ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! error TS2763: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! error TS2763: 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 @@ -41,11 +41,11 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload var x3 = foo2({a:true}); // works var x4 = foo2({a:"s"}); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! error TS2763: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'boolean'. function foo4(bar:{a:number;}):number; @@ -53,8 +53,8 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload function foo4(bar:{a:any;}):any{ return bar }; var x = foo4({a:true}); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'number'. -!!! error TS2755: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'number'. +!!! error TS2763: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadingOnConstants2.errors.txt b/tests/baselines/reference/overloadingOnConstants2.errors.txt index aafe28250ad..e252ebc8d69 100644 --- a/tests/baselines/reference/overloadingOnConstants2.errors.txt +++ b/tests/baselines/reference/overloadingOnConstants2.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/overloadingOnConstants2.ts(9,10): error TS2394: This overload signature is not compatible with its implementation signature. -tests/cases/compiler/overloadingOnConstants2.ts(15,9): error TS2755: No overload matches this call. +tests/cases/compiler/overloadingOnConstants2.ts(15,9): error TS2763: No overload matches this call. Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. Argument of type '"um"' is not assignable to parameter of type '"hi"'. Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. @@ -27,11 +27,11 @@ tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overl var b: E = foo("bye", []); // E var c = foo("um", []); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. -!!! error TS2755: Argument of type '"um"' is not assignable to parameter of type '"hi"'. -!!! error TS2755: Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. -!!! error TS2755: Argument of type '"um"' is not assignable to parameter of type '"bye"'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. +!!! error TS2763: Argument of type '"um"' is not assignable to parameter of type '"hi"'. +!!! error TS2763: Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. +!!! error TS2763: Argument of type '"um"' is not assignable to parameter of type '"bye"'. //function bar(x: "hi", items: string[]): D; diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt index 75688b0d459..e6f568f0d29 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -3,7 +3,7 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,37): Property 'x' is missing in type 'D' but required in type 'A'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,38): error TS2344: Type 'D' does not satisfy the constraint 'A'. -tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,23): error TS2755: No overload matches this call. +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,23): error TS2763: No overload matches this call. Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. Type 'G' is not assignable to type 'number'. @@ -56,16 +56,16 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): ~~~~~~~~~~~~~ }); ~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. -!!! error TS2755: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. -!!! error TS2755: Type 'G' is not assignable to type 'number'. -!!! error TS2755: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. -!!! error TS2755: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. -!!! error TS2755: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2755: Property 'q' is missing in type 'C' but required in type 'D'. -!!! error TS2755: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. -!!! error TS2755: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. -!!! error TS2755: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2755: Property 'q' is missing in type 'B' but required in type 'D'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. +!!! error TS2763: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. +!!! error TS2763: Type 'G' is not assignable to type 'number'. +!!! error TS2763: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. +!!! error TS2763: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. +!!! error TS2763: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2763: Property 'q' is missing in type 'C' but required in type 'D'. +!!! error TS2763: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. +!!! error TS2763: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. +!!! error TS2763: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2763: Property 'q' is missing in type 'B' but required in type 'D'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt index 3bdc2092e9f..0c9a607b13c 100644 --- a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,1): error TS2755: No overload matches this call. +tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,1): error TS2763: No overload matches this call. Overload 1 of 2, '(s: string): number', gave the following error. Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b tests/cases/compiler/overloadsWithProvisionalErrors.ts(7,17): error TS2304: Cannot find name 'blah'. -tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,1): error TS2755: No overload matches this call. +tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,1): error TS2763: No overload matches this call. Overload 1 of 2, '(s: string): number', gave the following error. Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. @@ -20,20 +20,20 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cann func(s => ({})); // Error for no applicable overload (object type is missing a and b) ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(s: string): number', gave the following error. -!!! error TS2755: Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. -!!! error TS2755: Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(s: string): number', gave the following error. +!!! error TS2763: Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. +!!! error TS2763: Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) ~~~~ !!! error TS2304: Cannot find name 'blah'. func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(s: string): number', gave the following error. -!!! error TS2755: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. -!!! error TS2755: Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(s: string): number', gave the following error. +!!! error TS2763: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. +!!! error TS2763: Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. ~~~~ !!! error TS2304: Cannot find name 'blah'. \ No newline at end of file diff --git a/tests/baselines/reference/promiseTypeInference.errors.txt b/tests/baselines/reference/promiseTypeInference.errors.txt index c2f3c51f0ec..9207b909984 100644 --- a/tests/baselines/reference/promiseTypeInference.errors.txt +++ b/tests/baselines/reference/promiseTypeInference.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No overload matches this call. +tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2763: No overload matches this call. Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. @@ -23,15 +23,15 @@ tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No overload m var $$x = load("something").then(s => convert(s)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. -!!! error TS2755: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! error TS2755: Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. -!!! error TS2755: Type 'IPromise' is not assignable to type 'number | PromiseLike'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'PromiseLike'. -!!! error TS2755: Types of property 'then' are incompatible. -!!! error TS2755: Type '(success?: (value: number) => IPromise) => IPromise' is not assignable to type '(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. -!!! error TS2755: Types of parameters 'success' and 'onfulfilled' are incompatible. -!!! error TS2755: Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. -!!! error TS2755: Type 'TResult1' is not assignable to type 'IPromise'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. +!!! error TS2763: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! error TS2763: Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. +!!! error TS2763: Type 'IPromise' is not assignable to type 'number | PromiseLike'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'PromiseLike'. +!!! error TS2763: Types of property 'then' are incompatible. +!!! error TS2763: Type '(success?: (value: number) => IPromise) => IPromise' is not assignable to type '(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. +!!! error TS2763: Types of parameters 'success' and 'onfulfilled' are incompatible. +!!! error TS2763: Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. +!!! error TS2763: Type 'TResult1' is not assignable to type 'IPromise'. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index 2a473c2d22f..a0dd30498aa 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -11,7 +11,7 @@ tests/cases/compiler/recursiveFunctionTypes.ts(30,10): error TS2394: This overlo tests/cases/compiler/recursiveFunctionTypes.ts(33,8): error TS2554: Expected 0-1 arguments, but got 2. tests/cases/compiler/recursiveFunctionTypes.ts(34,4): error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. tests/cases/compiler/recursiveFunctionTypes.ts(42,8): error TS2554: Expected 0-1 arguments, but got 2. -tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2755: No overload matches this call. +tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2763: No overload matches this call. Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. Overload 2 of 4, '(a: number): number', gave the following error. @@ -91,11 +91,11 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2755: No overload !!! error TS2554: Expected 0-1 arguments, but got 2. f7(""); // ok (function takes an any param) ~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. -!!! error TS2755: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. -!!! error TS2755: Overload 2 of 4, '(a: number): number', gave the following error. -!!! error TS2755: Argument of type '""' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 3 of 4, '(a?: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }', gave the following error. -!!! error TS2755: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. +!!! error TS2763: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. +!!! error TS2763: Overload 2 of 4, '(a: number): number', gave the following error. +!!! error TS2763: Argument of type '""' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 3 of 4, '(a?: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }', gave the following error. +!!! error TS2763: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. f7(); // ok \ No newline at end of file diff --git a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt index e1a2004542c..eb6f115089e 100644 --- a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt +++ b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(7,1): error TS2755: No overload matches this call. +tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(7,1): error TS2763: No overload matches this call. Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. Argument of type '1' is not assignable to parameter of type 'string'. -tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2755: No overload matches this call. +tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2763: No overload matches this call. Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'. Types of parameters 'x' and 'x' are incompatible. @@ -23,19 +23,19 @@ tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2 // both are errors x3(1, (x: string) => 1); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. -!!! error TS2755: Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'. -!!! error TS2755: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. -!!! error TS2755: Argument of type '1' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. +!!! error TS2763: Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'. +!!! error TS2763: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. +!!! error TS2763: Argument of type '1' is not assignable to parameter of type 'string'. x3(1, (x: 'hm') => 1); ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. -!!! error TS2755: Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'. -!!! error TS2755: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2755: Type 'number' is not assignable to type '"hm"'. -!!! error TS2755: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. -!!! error TS2755: Argument of type '1' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. +!!! error TS2763: Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'. +!!! error TS2763: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2763: Type 'number' is not assignable to type '"hm"'. +!!! error TS2763: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. +!!! error TS2763: Argument of type '1' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt index 541a327b311..30cd75338e6 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -1,23 +1,23 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(9,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(11,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(11,9): error TS2763: No overload matches this call. Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,9): error TS2763: No overload matches this call. Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,9): error TS2763: No overload matches this call. Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,9): error TS2763: No overload matches this call. Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. @@ -44,25 +44,25 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio !!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var c = foo([], 1, 2); // boolean ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var d = foo([], 1, true); // boolean (with error) ~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var e = foo([], 1, "2"); // {} ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var f = foo([], 1, 2, 3); // any (with error) ~ !!! error TS2554: Expected 1-3 arguments, but got 4. @@ -72,11 +72,11 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var w = foo `${1}${2}`; // boolean var x = foo `${1}${true}`; // boolean (with error) ~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. var y = foo `${1}${"2"}`; // {} var z = foo `${1}${2}${3}`; // any (with error) ~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt index 409cf9fb676..d2c259d125b 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt @@ -1,23 +1,23 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(9,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,9): error TS2763: No overload matches this call. Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,9): error TS2763: No overload matches this call. Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,9): error TS2763: No overload matches this call. Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,9): error TS2763: No overload matches this call. Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. @@ -44,25 +44,25 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio !!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var c = foo([], 1, 2); // boolean ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var d = foo([], 1, true); // boolean (with error) ~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var e = foo([], 1, "2"); // {} ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var f = foo([], 1, 2, 3); // any (with error) ~ !!! error TS2554: Expected 1-3 arguments, but got 4. @@ -72,11 +72,11 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var w = foo `${1}${2}`; // boolean var x = foo `${1}${true}`; // boolean (with error) ~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. var y = foo `${1}${"2"}`; // {} var z = foo `${1}${2}${3}`; // any (with error) ~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt index 1432360eba8..12fd697fc67 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(9,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(9,1): error TS2763: No overload matches this call. Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(62,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(62,1): error TS2763: No overload matches this call. Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,1): error TS2763: No overload matches this call. Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. @@ -29,11 +29,11 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // No candidate overloads found fn1 `${ {} }`; // Error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. +!!! error TS2763: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. +!!! error TS2763: Argument of type '{}' is not assignable to parameter of type 'number'. function fn2(strs: TemplateStringsArray, s: string, n: number): number; function fn2(strs: TemplateStringsArray, n: number, t: T): T; @@ -93,18 +93,18 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4 `${ true }${ null }`; ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt index c3b049af05f..312f22e0e71 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,1): error TS2763: No overload matches this call. Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,1): error TS2763: No overload matches this call. Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,1): error TS2763: No overload matches this call. Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. @@ -29,11 +29,11 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // No candidate overloads found fn1 `${ {} }`; // Error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. +!!! error TS2763: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. +!!! error TS2763: Argument of type '{}' is not assignable to parameter of type 'number'. function fn2(strs: TemplateStringsArray, s: string, n: number): number; function fn2(strs: TemplateStringsArray, n: number, t: T): T; @@ -93,18 +93,18 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4 `${ true }${ null }`; ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; diff --git a/tests/baselines/reference/tsxElementResolution9.errors.txt b/tests/baselines/reference/tsxElementResolution9.errors.txt index 37a847d0126..3aa151d7f5d 100644 --- a/tests/baselines/reference/tsxElementResolution9.errors.txt +++ b/tests/baselines/reference/tsxElementResolution9.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/jsx/file.tsx(11,1): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(11,1): error TS2763: No overload matches this call. Overload 1 of 2, '(n: string): { x: number; }', gave the following error. Type '{}' is not assignable to type 'string'. Overload 2 of 2, '(n: number): { y: string; }', gave the following error. Type '{}' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(18,1): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(18,1): error TS2763: No overload matches this call. Overload 1 of 2, '(n: string): { x: number; }', gave the following error. Type '{}' is not assignable to type 'string'. Overload 2 of 2, '(n: number): { y: string; }', gave the following error. Type '{}' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(25,1): error TS2763: No overload matches this call. Overload 1 of 2, '(n: string): { x: number; }', gave the following error. Type '{ x: number; }' is not assignable to type 'string'. Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. @@ -28,11 +28,11 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches th var Obj1: Obj1; ; // Error, return type is not an object type ~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. -!!! error TS2755: Type '{}' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. -!!! error TS2755: Type '{}' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +!!! error TS2763: Type '{}' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. +!!! error TS2763: Type '{}' is not assignable to type 'number'. interface Obj2 { (n: string): { x: number }; @@ -41,11 +41,11 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches th var Obj2: Obj2; ; // Error, return type is not an object type ~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. -!!! error TS2755: Type '{}' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. -!!! error TS2755: Type '{}' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +!!! error TS2763: Type '{}' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. +!!! error TS2763: Type '{}' is not assignable to type 'number'. interface Obj3 { (n: string): { x: number }; @@ -54,9 +54,9 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches th var Obj3: Obj3; ; // OK ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. -!!! error TS2755: Type '{ x: number; }' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. -!!! error TS2755: Type '{ x: number; }' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +!!! error TS2763: Type '{ x: number; }' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. +!!! error TS2763: Type '{ x: number; }' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt index bd90b09a12a..c9f17da6254 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt @@ -1,55 +1,55 @@ -tests/cases/conformance/jsx/file.tsx(12,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(12,12): error TS2763: No overload matches this call. Overload 1 of 2, '(): Element', gave the following error. Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. Property 'extraProp' does not exist on type 'IntrinsicAttributes'. Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -tests/cases/conformance/jsx/file.tsx(13,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(13,12): error TS2763: No overload matches this call. Overload 1 of 2, '(): Element', gave the following error. Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. Property 'yy' does not exist on type 'IntrinsicAttributes'. Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. -tests/cases/conformance/jsx/file.tsx(14,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(14,12): error TS2763: No overload matches this call. Overload 1 of 2, '(): Element', gave the following error. Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'. Property 'yy1' does not exist on type 'IntrinsicAttributes'. Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type 'true' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(16,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(16,12): error TS2763: No overload matches this call. Overload 1 of 2, '(): Element', gave the following error. Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. Property 'y1' does not exist on type 'IntrinsicAttributes'. Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -tests/cases/conformance/jsx/file.tsx(17,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(17,12): error TS2763: No overload matches this call. Overload 1 of 2, '(): Element', gave the following error. Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. Types of property 'yy' are incompatible. Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(25,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(25,12): error TS2763: No overload matches this call. Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. Type 'true' is not assignable to type 'string'. Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. -tests/cases/conformance/jsx/file.tsx(26,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(26,12): error TS2763: No overload matches this call. Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(33,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(33,12): error TS2763: No overload matches this call. Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. Type 'true' is not assignable to type 'string'. Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. Type 'true' is not assignable to type 'string'. Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(34,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(34,12): error TS2763: No overload matches this call. Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. @@ -58,7 +58,7 @@ tests/cases/conformance/jsx/file.tsx(34,12): error TS2755: No overload matches t Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(35,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(35,12): error TS2763: No overload matches this call. Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. @@ -66,7 +66,7 @@ tests/cases/conformance/jsx/file.tsx(35,12): error TS2755: No overload matches t Type 'string' is not assignable to type 'Element'. Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches this call. Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. @@ -90,48 +90,48 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches t // Error const c0 = ; // extra property; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. -!!! error TS2755: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2755: Property 'extraProp' does not exist on type 'IntrinsicAttributes'. -!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -!!! error TS2755: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -!!! error TS2755: Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2763: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2763: Property 'extraProp' does not exist on type 'IntrinsicAttributes'. +!!! error TS2763: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2763: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. +!!! error TS2763: Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c1 = ; // missing property; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. -!!! error TS2755: Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2755: Property 'yy' does not exist on type 'IntrinsicAttributes'. -!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -!!! error TS2755: Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2763: Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2763: Property 'yy' does not exist on type 'IntrinsicAttributes'. +!!! error TS2763: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2763: Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. const c2 = ; // type incompatible; ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. -!!! error TS2755: Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2755: Property 'yy1' does not exist on type 'IntrinsicAttributes'. -!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2763: Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2763: Property 'yy1' does not exist on type 'IntrinsicAttributes'. +!!! error TS2763: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. const c3 = ; // This is OK becuase all attribute are spread const c4 = ; // extra property; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. -!!! error TS2755: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2755: Property 'y1' does not exist on type 'IntrinsicAttributes'. -!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -!!! error TS2755: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -!!! error TS2755: Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2763: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2763: Property 'y1' does not exist on type 'IntrinsicAttributes'. +!!! error TS2763: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2763: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. +!!! error TS2763: Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c5 = ; // type incompatible; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. -!!! error TS2755: Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. -!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -!!! error TS2755: Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. -!!! error TS2755: Types of property 'yy' are incompatible. -!!! error TS2755: Type 'boolean' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2763: Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. +!!! error TS2763: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2763: Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. +!!! error TS2763: Types of property 'yy' are incompatible. +!!! error TS2763: Type 'boolean' is not assignable to type 'number'. const c6 = ; // Should error as there is extra attribute that doesn't match any. Current it is not const c7 = ; // Should error as there is extra attribute that doesn't match any. Current it is not @@ -141,19 +141,19 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches t // Error const d1 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. -!!! error TS2755: Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. +!!! error TS2763: Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. const d2 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. -!!! error TS2755: Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. -!!! error TS2755: Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. -!!! error TS2755: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. +!!! error TS2763: Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. +!!! error TS2763: Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. +!!! error TS2763: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'number'. declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element; declare function TestingOptional(a: {y1?: string, y2?: number, children: JSX.Element}): JSX.Element; @@ -162,42 +162,42 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches t // Error const e1 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. -!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! error TS2763: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'boolean'. const e2 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. -!!! error TS2755: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! error TS2755: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. -!!! error TS2755: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. -!!! error TS2755: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. -!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2763: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2763: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2763: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2763: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. +!!! error TS2763: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. +!!! error TS2763: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'boolean'. const e3 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. -!!! error TS2755: Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! error TS2755: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'Element'. -!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2763: Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2763: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2763: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'Element'. +!!! error TS2763: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'boolean'. const e4 = Hi ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. -!!! error TS2755: Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! error TS2755: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. -!!! error TS2755: 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. -!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2763: Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2763: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2763: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2763: 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. +!!! error TS2763: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt index 680f2903b77..214418e3375 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(48,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(48,12): error TS2763: No overload matches this call. Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. @@ -8,21 +8,21 @@ tests/cases/conformance/jsx/file.tsx(48,12): error TS2755: No overload matches t Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. -tests/cases/conformance/jsx/file.tsx(54,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(54,12): error TS2763: No overload matches this call. Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Type 'number' is not assignable to type 'string'. Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. Type 'number' is not assignable to type 'string'. Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(55,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(55,12): error TS2763: No overload matches this call. Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Type 'true' is not assignable to type 'string'. Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. Type 'true' is not assignable to type 'string'. Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type 'true' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(56,12): error TS2763: No overload matches this call. Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. @@ -81,16 +81,16 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No overload matches t // Error const b0 = {}}>GO; // extra property; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2755: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2755: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2755: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. -!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. -!!! error TS2755: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. -!!! error TS2755: Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2763: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2763: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! error TS2763: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. +!!! error TS2763: Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. const b1 = {}} {...obj0}>Hello world; // extra property; const b2 = ; // extra property const b3 = {}}} />; // extra property @@ -98,28 +98,28 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No overload matches t const b5 = ; // Spread retain method declaration (see GitHub #13365), so now there is an extra attributes const b6 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. -!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! error TS2763: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! error TS2763: Type 'number' is not assignable to type 'string'. const b7 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. -!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! error TS2763: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. const b8 = ; // incorrect type for specified hyphanated name ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2755: Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. -!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2755: Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. -!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2763: Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. +!!! error TS2763: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2763: Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. +!!! error TS2763: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt index ea279fdedfb..fffd57b6272 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(9,14): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(9,14): error TS2763: No overload matches this call. Overload 1 of 3, '(): Element', gave the following error. Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. Property 'a' does not exist on type 'IntrinsicAttributes'. @@ -6,7 +6,7 @@ tests/cases/conformance/jsx/file.tsx(9,14): error TS2755: No overload matches th Type 'number' is not assignable to type 'string'. Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. -tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(10,14): error TS2763: No overload matches this call. Overload 1 of 3, '(): Element', gave the following error. Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. @@ -28,23 +28,23 @@ tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No overload matches t function Baz(arg1: T, arg2: U) { let a0 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(): Element', gave the following error. -!!! error TS2755: Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2755: Property 'a' does not exist on type 'IntrinsicAttributes'. -!!! error TS2755: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! error TS2755: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. -!!! error TS2755: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(): Element', gave the following error. +!!! error TS2763: Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2763: Property 'a' does not exist on type 'IntrinsicAttributes'. +!!! error TS2763: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! error TS2763: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. +!!! error TS2763: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. let a2 = // missing a ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(): Element', gave the following error. -!!! error TS2755: Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. -!!! error TS2755: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. -!!! error TS2755: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }'. -!!! error TS2755: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: string; "ignore-prop": boolean; }'. -!!! error TS2755: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. -!!! error TS2755: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. -!!! error TS2755: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(): Element', gave the following error. +!!! error TS2763: Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. +!!! error TS2763: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. +!!! error TS2763: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }'. +!!! error TS2763: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: string; "ignore-prop": boolean; }'. +!!! error TS2763: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. +!!! error TS2763: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. +!!! error TS2763: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. } \ No newline at end of file diff --git a/tests/baselines/reference/unionTypeCallSignatures.errors.txt b/tests/baselines/reference/unionTypeCallSignatures.errors.txt index d842c9b235f..952196e6e02 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeCallSignatures.errors.txt @@ -1,10 +1,10 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(9,43): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(10,1): error TS2755: No overload matches this call. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(10,1): error TS2763: No overload matches this call. Overload 1 of 2, '(a: number): number | Date', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 2, '(a: string): string | boolean', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,1): error TS2755: No overload matches this call. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,1): error TS2763: No overload matches this call. Overload 1 of 2, '(a: number): number | Date', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 2, '(a: string): string | boolean', gave the following error. @@ -49,22 +49,22 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. var unionOfDifferentReturnType1: { (a: number): number; (a: string): string; } | { (a: number): Date; (a: string): boolean; }; numOrDate = unionOfDifferentReturnType1(10); strOrBoolean = unionOfDifferentReturnType1("hello"); unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. unionOfDifferentReturnType1(); // error missing parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. diff --git a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt index 5913799605b..cbd108cac27 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt @@ -1,10 +1,10 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(9,47): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(10,1): error TS2755: No overload matches this call. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(10,1): error TS2763: No overload matches this call. Overload 1 of 2, '(a: number): number | Date', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 2, '(a: string): string | boolean', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,1): error TS2755: No overload matches this call. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,1): error TS2763: No overload matches this call. Overload 1 of 2, '(a: number): number | Date', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 2, '(a: string): string | boolean', gave the following error. @@ -48,22 +48,22 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. new unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. var unionOfDifferentReturnType1: { new (a: number): number; new (a: string): string; } | { new (a: number): Date; new (a: string): boolean; }; numOrDate = new unionOfDifferentReturnType1(10); strOrBoolean = new unionOfDifferentReturnType1("hello"); new unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. new unionOfDifferentReturnType1(); // error missing parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. From 2e5249835dc6c17106918e267213f8d8798532ee Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 28 Jun 2019 16:54:42 -1000 Subject: [PATCH 43/95] Remove logic that pads array literals contextually typed by tuple types --- src/compiler/checker.ts | 50 ++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index cf614ee2013..c62263957c7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -722,6 +722,7 @@ namespace ts { NoIndexSignatures = 1 << 0, Writing = 1 << 1, CacheSymbol = 1 << 2, + NoTupleBoundsCheck = 1 << 3, } const enum CallbackCheck { @@ -5115,21 +5116,25 @@ namespace ts { } else if (isArrayLikeType(parentType)) { const indexType = getLiteralType(index); - const declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, declaration.name), declaration.name); + const accessFlags = hasDefaultValue(declaration) ? AccessFlags.NoTupleBoundsCheck : 0; + const declaredType = getConstraintForLocation(getIndexedAccessTypeOrUndefined(parentType, indexType, declaration.name, accessFlags) || errorType, declaration.name); type = getFlowTypeOfDestructuring(declaration, declaredType); } else { type = elementType; } } - // In strict null checking mode, if a default value of a non-undefined type is specified, remove - // undefined from the final type. - if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkDeclarationInitializer(declaration)) & TypeFlags.Undefined)) { - type = getTypeWithFacts(type, TypeFacts.NEUndefined); + if (!declaration.initializer) { + return type; } - return declaration.initializer && !getEffectiveTypeAnnotationNode(walkUpBindingElementsAndPatterns(declaration)) ? - getUnionType([type, checkDeclarationInitializer(declaration)], UnionReduction.Subtype) : - type; + if (getEffectiveTypeAnnotationNode(walkUpBindingElementsAndPatterns(declaration))) { + // In strict null checking mode, if a default value of a non-undefined type is specified, remove + // undefined from the final type. + return strictNullChecks && !(getFalsyFlags(checkDeclarationInitializer(declaration)) & TypeFlags.Undefined) ? + getTypeWithFacts(type, TypeFacts.NEUndefined) : + type; + } + return getUnionType([getTypeWithFacts(type, TypeFacts.NEUndefined), checkDeclarationInitializer(declaration)], UnionReduction.Subtype); } function getTypeForDeclarationFromJSDocComment(declaration: Node) { @@ -10131,7 +10136,7 @@ namespace ts { propType; } if (everyType(objectType, isTupleType) && isNumericLiteralName(propName) && +propName >= 0) { - if (accessNode && everyType(objectType, t => !(t).target.hasRestElement)) { + if (accessNode && everyType(objectType, t => !(t).target.hasRestElement) && !(accessFlags & AccessFlags.NoTupleBoundsCheck)) { const indexNode = getIndexNodeForAccessExpression(accessNode); if (isTupleType(objectType)) { error(indexNode, Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2, @@ -19196,26 +19201,7 @@ namespace ts { function getArrayLiteralTupleTypeIfApplicable(elementTypes: Type[], contextualType: Type | undefined, hasRestElement: boolean, elementCount = elementTypes.length, readonly = false) { // Infer a tuple type when the contextual type is or contains a tuple-like type if (readonly || (contextualType && forEachType(contextualType, isTupleLikeType))) { - const minLength = elementCount - (hasRestElement ? 1 : 0); - const pattern = contextualType && contextualType.pattern; - // If array literal is contextually typed by a binding pattern or an assignment pattern, pad the resulting - // tuple type with the corresponding binding or assignment element types to make the lengths equal. - if (!hasRestElement && pattern && (pattern.kind === SyntaxKind.ArrayBindingPattern || pattern.kind === SyntaxKind.ArrayLiteralExpression)) { - const patternElements = (pattern).elements; - for (let i = elementCount; i < patternElements.length; i++) { - const e = patternElements[i]; - if (hasDefaultValue(e)) { - elementTypes.push((contextualType).typeArguments![i]); - } - else if (i < patternElements.length - 1 || !(e.kind === SyntaxKind.BindingElement && (e).dotDotDotToken || e.kind === SyntaxKind.SpreadElement)) { - if (e.kind !== SyntaxKind.OmittedExpression) { - error(e, Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); - } - elementTypes.push(strictNullChecks ? implicitNeverType : undefinedWideningType); - } - } - } - return createTupleType(elementTypes, minLength, hasRestElement, readonly); + return createTupleType(elementTypes, elementCount - (hasRestElement ? 1 : 0), hasRestElement, readonly); } } @@ -23655,8 +23641,10 @@ namespace ts { if (isArrayLikeType(sourceType)) { // We create a synthetic expression so that getIndexedAccessType doesn't get confused // when the element is a SyntaxKind.ElementAccessExpression. - const elementType = getIndexedAccessType(sourceType, indexType, createSyntheticExpression(element, indexType)); - const type = getFlowTypeOfDestructuring(element, elementType); + const accessFlags = hasDefaultValue(element) ? AccessFlags.NoTupleBoundsCheck : 0; + const elementType = getIndexedAccessTypeOrUndefined(sourceType, indexType, createSyntheticExpression(element, indexType), accessFlags) || errorType; + const assignedType = hasDefaultValue(element) ? getTypeWithFacts(elementType, TypeFacts.NEUndefined) : elementType; + const type = getFlowTypeOfDestructuring(element, assignedType); return checkDestructuringAssignment(element, type, checkMode); } return checkDestructuringAssignment(element, elementType, checkMode); From fbb79400bb5cd6226fd019ddb9f400572f48b83f Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 28 Jun 2019 16:54:55 -1000 Subject: [PATCH 44/95] Accept new baselines --- ...nEmitDestructuringArrayPattern2.errors.txt | 12 +++++----- ...clarationEmitDestructuringArrayPattern2.js | 2 +- ...rationEmitDestructuringArrayPattern2.types | 8 +++---- .../declarationsAndAssignments.errors.txt | 24 +++++++++---------- .../declarationsAndAssignments.types | 18 +++++++------- ...BindingPatternAndAssignment1ES5.errors.txt | 12 +++++----- ...ArrayBindingPatternAndAssignment1ES5.types | 22 ++++++++--------- ...atternAndAssignment1ES5iterable.errors.txt | 12 +++++----- ...dingPatternAndAssignment1ES5iterable.types | 22 ++++++++--------- ...BindingPatternAndAssignment1ES6.errors.txt | 12 +++++----- ...ArrayBindingPatternAndAssignment1ES6.types | 22 ++++++++--------- ...rayBindingPatternAndAssignment2.errors.txt | 8 +++---- ...ingArrayBindingPatternAndAssignment2.types | 2 +- ...ingArrayBindingPatternAndAssignment3.types | 6 ++--- ...destructuringVariableDeclaration1ES5.types | 6 ++--- ...destructuringVariableDeclaration1ES6.types | 6 ++--- .../destructuringVariableDeclaration2.types | 2 +- .../reference/downlevelLetConst12.errors.txt | 8 +++---- .../reference/downlevelLetConst12.types | 8 +++---- ...plicitAnyDestructuringVarDeclaration.types | 2 +- .../reference/recursiveLetConst.types | 2 +- ...entArrayBindingPatternDefaultValues3.types | 18 +++++++------- 22 files changed, 117 insertions(+), 117 deletions(-) diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.errors.txt b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.errors.txt index 26998fd83ae..e782352073a 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.errors.txt +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts(4,6): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts(4,11): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts(4,16): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts(4,6): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts(4,11): error TS2493: Tuple type '[]' of length '0' has no element at index '1'. +tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts(4,16): error TS2493: Tuple type '[]' of length '0' has no element at index '2'. ==== tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts (3 errors) ==== @@ -9,11 +9,11 @@ tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts(4,16): error T var [x11 = 0, y11 = ""] = [1, "hello"]; var [a11, b11, c11] = []; ~~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ~~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '1'. ~~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '2'. var [a2, [b2, { x12, y12: c2 }]=["abc", { x12: 10, y12: false }]] = [1, ["hello", { x12: 5, y12: true }]]; diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.js b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.js index 818b3a6f7a9..663b2d3567b 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.js +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.js @@ -22,7 +22,7 @@ var _m = [[x13, y13], { x: x13, y: y13 }], a3 = _m[0], b3 = _m[1]; //// [declarationEmitDestructuringArrayPattern2.d.ts] declare var x10: number, y10: string, z10: boolean; declare var x11: number, y11: string; -declare var a11: any, b11: any, c11: any; +declare var a11: undefined, b11: undefined, c11: undefined; declare var a2: number, b2: string, x12: number, c2: boolean; declare var x13: number, y13: string; declare var a3: (string | number)[], b3: { diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types index 37781e0a1ae..b473e544ae1 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types @@ -20,10 +20,10 @@ var [x11 = 0, y11 = ""] = [1, "hello"]; >"hello" : "hello" var [a11, b11, c11] = []; ->a11 : any ->b11 : any ->c11 : any ->[] : [undefined?, undefined?, undefined?] +>a11 : undefined +>b11 : undefined +>c11 : undefined +>[] : [] var [a2, [b2, { x12, y12: c2 }]=["abc", { x12: 10, y12: false }]] = [1, ["hello", { x12: 5, y12: true }]]; >a2 : number diff --git a/tests/baselines/reference/declarationsAndAssignments.errors.txt b/tests/baselines/reference/declarationsAndAssignments.errors.txt index b13aacbfbc3..d6f0ab3873a 100644 --- a/tests/baselines/reference/declarationsAndAssignments.errors.txt +++ b/tests/baselines/reference/declarationsAndAssignments.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(5,16): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(5,16): error TS2493: Tuple type '[number, string]' of length '2' has no element at index '2'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(22,17): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{}'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(22,23): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{}'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(23,25): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x: any; }'. @@ -6,11 +6,11 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(24,19): tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(28,28): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x: any; }'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(29,22): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{ y: any; }'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(58,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string | number', but here has type 'string'. -tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,10): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,13): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,16): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(63,13): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(63,16): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,10): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,13): error TS2493: Tuple type '[]' of length '0' has no element at index '1'. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,16): error TS2493: Tuple type '[]' of length '0' has no element at index '2'. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(63,13): error TS2493: Tuple type '[number]' of length '1' has no element at index '1'. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(63,16): error TS2493: Tuple type '[number]' of length '1' has no element at index '2'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(67,9): error TS2461: Type '{}' is not an array type. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(68,9): error TS2461: Type '{ 0: number; 1: number; }' is not an array type. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(73,11): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. @@ -29,7 +29,7 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9): var [x, y] = [1, "hello"]; var [x, y, z] = [1, "hello"]; ~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[number, string]' of length '2' has no element at index '2'. var [,, x] = [0, 1, 2]; var x: number; var y: string; @@ -103,16 +103,16 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9): function f8() { var [a, b, c] = []; // Error, [] is an empty tuple ~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '1'. ~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '2'. var [d, e, f] = [1]; // Error, [1] is a tuple ~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[number]' of length '1' has no element at index '1'. ~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[number]' of length '1' has no element at index '2'. } function f9() { diff --git a/tests/baselines/reference/declarationsAndAssignments.types b/tests/baselines/reference/declarationsAndAssignments.types index 89ddd0eb5e5..ed157a7e69c 100644 --- a/tests/baselines/reference/declarationsAndAssignments.types +++ b/tests/baselines/reference/declarationsAndAssignments.types @@ -23,8 +23,8 @@ function f0() { var [x, y, z] = [1, "hello"]; >x : number >y : string ->z : any ->[1, "hello"] : [number, string, undefined?] +>z : undefined +>[1, "hello"] : [number, string] >1 : 1 >"hello" : "hello" @@ -255,16 +255,16 @@ function f8() { >f8 : () => void var [a, b, c] = []; // Error, [] is an empty tuple ->a : any ->b : any ->c : any ->[] : [undefined?, undefined?, undefined?] +>a : undefined +>b : undefined +>c : undefined +>[] : [] var [d, e, f] = [1]; // Error, [1] is a tuple >d : number ->e : any ->f : any ->[1] : [number, undefined?, undefined?] +>e : undefined +>f : undefined +>[1] : [number] >1 : 1 } diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.errors.txt index 1f1bc85757b..17a9dc13f9a 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts(43,6): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts(44,8): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts(44,18): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts(43,6): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts(44,8): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts(44,18): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ==== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts (3 errors) ==== @@ -48,12 +48,12 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss var [c0, c1] = [...temp]; var [c2] = []; ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. var [[c5], c6]: [[string|number], boolean] = [[1], true]; var [, c7] = [1, 2, 3]; var [,,, c8] = [1, 2, 3, 4]; diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types index 03990bc0846..d9e9cb494d2 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types @@ -92,19 +92,19 @@ var [c0, c1] = [...temp]; >temp : number[] var [c2] = []; ->c2 : any ->[] : [undefined?] +>c2 : undefined +>[] : [] var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] ->c3 : any ->c4 : any ->[[[]], [[[[]]]]] : [[[undefined?]], [[[[undefined?]]]]] ->[[]] : [[undefined?]] ->[] : [undefined?] ->[[[[]]]] : [[[[undefined?]]]] ->[[[]]] : [[[undefined?]]] ->[[]] : [[undefined?]] ->[] : [undefined?] +>c3 : undefined +>c4 : undefined +>[[[]], [[[[]]]]] : [[[]], [[[[]]]]] +>[[]] : [[]] +>[] : [] +>[[[[]]]] : [[[[]]]] +>[[[]]] : [[[]]] +>[[]] : [[]] +>[] : [] var [[c5], c6]: [[string|number], boolean] = [[1], true]; >c5 : string | number diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt index 6a2647013fb..21e239114cb 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(43,6): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(44,8): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(44,18): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(43,6): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(44,8): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(44,18): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ==== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts (3 errors) ==== @@ -48,12 +48,12 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss var [c0, c1] = [...temp]; var [c2] = []; ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. var [[c5], c6]: [[string|number], boolean] = [[1], true]; var [, c7] = [1, 2, 3]; var [,,, c8] = [1, 2, 3, 4]; diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.types index cb2e8018232..6d232030fae 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.types @@ -92,19 +92,19 @@ var [c0, c1] = [...temp]; >temp : number[] var [c2] = []; ->c2 : any ->[] : [undefined?] +>c2 : undefined +>[] : [] var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] ->c3 : any ->c4 : any ->[[[]], [[[[]]]]] : [[[undefined?]], [[[[undefined?]]]]] ->[[]] : [[undefined?]] ->[] : [undefined?] ->[[[[]]]] : [[[[undefined?]]]] ->[[[]]] : [[[undefined?]]] ->[[]] : [[undefined?]] ->[] : [undefined?] +>c3 : undefined +>c4 : undefined +>[[[]], [[[[]]]]] : [[[]], [[[[]]]]] +>[[]] : [[]] +>[] : [] +>[[[[]]]] : [[[[]]]] +>[[[]]] : [[[]]] +>[[]] : [[]] +>[] : [] var [[c5], c6]: [[string|number], boolean] = [[1], true]; >c5 : string | number diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.errors.txt index 4dc6085e662..3dc897456aa 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts(43,6): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts(44,8): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts(44,18): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts(43,6): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts(44,8): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts(44,18): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ==== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts (3 errors) ==== @@ -48,12 +48,12 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss var [c0, c1] = [...temp]; var [c2] = []; ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. var [[c5], c6]: [[string|number], boolean] = [[1], true]; var [, c7] = [1, 2, 3]; var [,,, c8] = [1, 2, 3, 4]; diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types index 9a00291f79c..feb0116ea04 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types @@ -92,19 +92,19 @@ var [c0, c1] = [...temp]; >temp : number[] var [c2] = []; ->c2 : any ->[] : [undefined?] +>c2 : undefined +>[] : [] var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] ->c3 : any ->c4 : any ->[[[]], [[[[]]]]] : [[[undefined?]], [[[[undefined?]]]]] ->[[]] : [[undefined?]] ->[] : [undefined?] ->[[[[]]]] : [[[[undefined?]]]] ->[[[]]] : [[[undefined?]]] ->[[]] : [[undefined?]] ->[] : [undefined?] +>c3 : undefined +>c4 : undefined +>[[[]], [[[[]]]]] : [[[]], [[[[]]]]] +>[[]] : [[]] +>[] : [] +>[[[[]]]] : [[[[]]]] +>[[[]]] : [[[]]] +>[[]] : [[]] +>[] : [] var [[c5], c6]: [[string|number], boolean] = [[1], true]; >c5 : string | number diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt index 6d16229f333..dd01ac96519 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,6): error TS2461: Type 'undefined' is not an array type. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,6): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,6): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,12): error TS2461: Type 'undefined' is not an array type. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,12): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,12): error TS2493: Tuple type '[]' of length '0' has no element at index '1'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(4,5): error TS2461: Type 'undefined' is not an array type. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(9,51): error TS2322: Type 'number' is not assignable to type 'boolean'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(22,5): error TS2739: Type 'number[]' is missing the following properties from type '[number, number]': 0, 1 @@ -16,11 +16,11 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss ~~~~ !!! error TS2461: Type 'undefined' is not an array type. ~~~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ~~~~~~ !!! error TS2461: Type 'undefined' is not an array type. ~~~~~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '1'. var [[a2], [[a3]]] = undefined // Error ~~~~~~~~~~~~~~ !!! error TS2461: Type 'undefined' is not an array type. diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.types index 77681f8d8c8..86723735bb5 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.types @@ -4,7 +4,7 @@ var [[a0], [[a1]]] = [] // Error >a0 : any >a1 : any ->[] : [undefined?, undefined?] +>[] : [] var [[a2], [[a3]]] = undefined // Error >a2 : any diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.types index 0fb81ba6aa3..5a0e03dda6e 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.types @@ -3,7 +3,7 @@ const [a, b = a] = [1]; // ok >a : any >b : any >a : any ->[1] : [number, any?] +>[1] : [number] >1 : 1 const [c, d = c, e = e] = [1]; // error for e = e @@ -12,7 +12,7 @@ const [c, d = c, e = e] = [1]; // error for e = e >c : any >e : any >e : any ->[1] : [number, any?, any?] +>[1] : [number] >1 : 1 const [f, g = f, h = i, i = f] = [1]; // error for h = i @@ -23,7 +23,7 @@ const [f, g = f, h = i, i = f] = [1]; // error for h = i >i : any >i : any >f : any ->[1] : [number, any?, any?, any?] +>[1] : [number] >1 : 1 (function ([a, b = a]) { // ok diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES5.types b/tests/baselines/reference/destructuringVariableDeclaration1ES5.types index fc153be7c60..0e1a89eff93 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES5.types +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES5.types @@ -151,9 +151,9 @@ var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; >f4 : number >f5 : number > : undefined ->{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }, undefined?]; } ->f : [number, number, { f3: number; f5: number; }, undefined?] ->[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }, undefined?] +>{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }]; } +>f : [number, number, { f3: number; f5: number; }] +>[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }] >1 : 1 >2 : 2 >{ f3: 4, f5: 0 } : { f3: number; f5: number; } diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES6.types b/tests/baselines/reference/destructuringVariableDeclaration1ES6.types index bf00e1955ca..d47ec0e0d74 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES6.types +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES6.types @@ -151,9 +151,9 @@ var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; >f4 : number >f5 : number > : undefined ->{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }, undefined?]; } ->f : [number, number, { f3: number; f5: number; }, undefined?] ->[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }, undefined?] +>{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }]; } +>f : [number, number, { f3: number; f5: number; }] +>[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }] >1 : 1 >2 : 2 >{ f3: 4, f5: 0 } : { f3: number; f5: number; } diff --git a/tests/baselines/reference/destructuringVariableDeclaration2.types b/tests/baselines/reference/destructuringVariableDeclaration2.types index ddb560f4e24..3b4fe8af85f 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration2.types +++ b/tests/baselines/reference/destructuringVariableDeclaration2.types @@ -60,7 +60,7 @@ var [c1, c2, { c3: c4, c5 }, , ...c6] = [1, 2, { c3: 4, c5: 0 }]; // Error >c5 : number > : undefined >c6 : [] ->[1, 2, { c3: 4, c5: 0 }] : [number, number, { c3: number; c5: number; }, undefined?] +>[1, 2, { c3: 4, c5: 0 }] : [number, number, { c3: number; c5: number; }] >1 : 1 >2 : 2 >{ c3: 4, c5: 0 } : { c3: number; c5: number; } diff --git a/tests/baselines/reference/downlevelLetConst12.errors.txt b/tests/baselines/reference/downlevelLetConst12.errors.txt index 7d5c6828207..8c4bcb9d4f7 100644 --- a/tests/baselines/reference/downlevelLetConst12.errors.txt +++ b/tests/baselines/reference/downlevelLetConst12.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/downlevelLetConst12.ts(6,6): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/compiler/downlevelLetConst12.ts(9,8): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/compiler/downlevelLetConst12.ts(6,6): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/compiler/downlevelLetConst12.ts(9,8): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ==== tests/cases/compiler/downlevelLetConst12.ts (2 errors) ==== @@ -10,10 +10,10 @@ tests/cases/compiler/downlevelLetConst12.ts(9,8): error TS2525: Initializer prov let [baz] = []; ~~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. let {a: baz2} = { a: 1 }; const [baz3] = [] ~~~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. const {a: baz4} = { a: 1 }; \ No newline at end of file diff --git a/tests/baselines/reference/downlevelLetConst12.types b/tests/baselines/reference/downlevelLetConst12.types index 25316e67eb4..3f64d06788c 100644 --- a/tests/baselines/reference/downlevelLetConst12.types +++ b/tests/baselines/reference/downlevelLetConst12.types @@ -11,8 +11,8 @@ const bar = 1; >1 : 1 let [baz] = []; ->baz : any ->[] : [undefined?] +>baz : undefined +>[] : [] let {a: baz2} = { a: 1 }; >a : any @@ -22,8 +22,8 @@ let {a: baz2} = { a: 1 }; >1 : 1 const [baz3] = [] ->baz3 : any ->[] : [undefined?] +>baz3 : undefined +>[] : [] const {a: baz4} = { a: 1 }; >a : any diff --git a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration.types b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration.types index 823af520806..8a60da05e6d 100644 --- a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration.types +++ b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration.types @@ -44,5 +44,5 @@ var [a4] = [undefined], {b4} = { b4: null }, c4 = undefined, d4 = null; // error var [a5 = undefined] = []; // error >a5 : any >undefined : undefined ->[] : [undefined?] +>[] : [] diff --git a/tests/baselines/reference/recursiveLetConst.types b/tests/baselines/reference/recursiveLetConst.types index 90b0d7baab1..7525d6242b6 100644 --- a/tests/baselines/reference/recursiveLetConst.types +++ b/tests/baselines/reference/recursiveLetConst.types @@ -49,7 +49,7 @@ for (let [v] of v) { } let [x2 = x2] = [] >x2 : any >x2 : any ->[] : [any?] +>[] : [] let z0 = () => z0; >z0 : () => any diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types index fb9e4aca6b5..2f9d1dac6e3 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types @@ -234,11 +234,11 @@ let multiRobotAInfo: (string | string[])[]; [nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB : [string, string[]] ->[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string?, string?]] +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, []] >nameMB = "helloNoName" : "helloNoName" >nameMB : string >"helloNoName" : "helloNoName" ->[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string?, string?] +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [] >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] >primarySkillB = "noSkill" : "noSkill" >primarySkillB : string @@ -246,16 +246,16 @@ let multiRobotAInfo: (string | string[])[]; >secondarySkillB = "noSkill" : "noSkill" >secondarySkillB : string >"noSkill" : "noSkill" ->[] : [string?, string?] +>[] : [] >multiRobotB : [string, string[]] [nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB() : [string, string[]] ->[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string?, string?]] +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, []] >nameMB = "helloNoName" : "helloNoName" >nameMB : string >"helloNoName" : "helloNoName" ->[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string?, string?] +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [] >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] >primarySkillB = "noSkill" : "noSkill" >primarySkillB : string @@ -263,17 +263,17 @@ let multiRobotAInfo: (string | string[])[]; >secondarySkillB = "noSkill" : "noSkill" >secondarySkillB : string >"noSkill" : "noSkill" ->[] : [string?, string?] +>[] : [] >getMultiRobotB() : [string, string[]] >getMultiRobotB : () => [string, string[]] [nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string?, string?]] +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, []] >nameMB = "helloNoName" : "helloNoName" >nameMB : string >"helloNoName" : "helloNoName" ->[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string?, string?] +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [] >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] >primarySkillB = "noSkill" : "noSkill" >primarySkillB : string @@ -281,7 +281,7 @@ let multiRobotAInfo: (string | string[])[]; >secondarySkillB = "noSkill" : "noSkill" >secondarySkillB : string >"noSkill" : "noSkill" ->[] : [string?, string?] +>[] : [] ["trimmer", ["trimming", "edging"]]; >["trimmer", ["trimming", "edging"]] : [string, [string, string]] From b7b7a6626c4ffe6d3d7450025da88548c419ac08 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 28 Jun 2019 17:09:22 -1000 Subject: [PATCH 45/95] Add regression tests --- tests/cases/compiler/destructuringTuple.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/cases/compiler/destructuringTuple.ts b/tests/cases/compiler/destructuringTuple.ts index c6a8431da0b..1b92b239875 100644 --- a/tests/cases/compiler/destructuringTuple.ts +++ b/tests/cases/compiler/destructuringTuple.ts @@ -7,3 +7,9 @@ const [a, b, c, ...rest] = tuple; declare var receiver: typeof tuple; [...receiver] = tuple; + +// Repros from #32140 + +const [oops1] = [1, 2, 3].reduce((accu, el) => accu.concat(el), []); + +const [oops2] = [1, 2, 3].reduce((acc: number[], e) => acc.concat(e), []); From 4c99084b383b0664fdc46c7307148ab1b12bae0a Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 28 Jun 2019 17:10:09 -1000 Subject: [PATCH 46/95] Accept new baselines --- .../reference/destructuringTuple.errors.txt | 23 +++++++++++ .../baselines/reference/destructuringTuple.js | 9 +++++ .../reference/destructuringTuple.symbols | 24 +++++++++++ .../reference/destructuringTuple.types | 40 +++++++++++++++++++ 4 files changed, 96 insertions(+) create mode 100644 tests/baselines/reference/destructuringTuple.errors.txt diff --git a/tests/baselines/reference/destructuringTuple.errors.txt b/tests/baselines/reference/destructuringTuple.errors.txt new file mode 100644 index 00000000000..cd366409dc8 --- /dev/null +++ b/tests/baselines/reference/destructuringTuple.errors.txt @@ -0,0 +1,23 @@ +tests/cases/compiler/destructuringTuple.ts(11,8): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/compiler/destructuringTuple.ts(11,60): error TS2345: Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. + + +==== tests/cases/compiler/destructuringTuple.ts (2 errors) ==== + declare var tuple: [boolean, number, ...string[]]; + + const [a, b, c, ...rest] = tuple; + + declare var receiver: typeof tuple; + + [...receiver] = tuple; + + // Repros from #32140 + + const [oops1] = [1, 2, 3].reduce((accu, el) => accu.concat(el), []); + ~~~~~ +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. + ~~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. + + const [oops2] = [1, 2, 3].reduce((acc: number[], e) => acc.concat(e), []); + \ No newline at end of file diff --git a/tests/baselines/reference/destructuringTuple.js b/tests/baselines/reference/destructuringTuple.js index a8a0bc6f5e3..8d580dfba51 100644 --- a/tests/baselines/reference/destructuringTuple.js +++ b/tests/baselines/reference/destructuringTuple.js @@ -6,9 +6,18 @@ const [a, b, c, ...rest] = tuple; declare var receiver: typeof tuple; [...receiver] = tuple; + +// Repros from #32140 + +const [oops1] = [1, 2, 3].reduce((accu, el) => accu.concat(el), []); + +const [oops2] = [1, 2, 3].reduce((acc: number[], e) => acc.concat(e), []); //// [destructuringTuple.js] "use strict"; var a = tuple[0], b = tuple[1], c = tuple[2], rest = tuple.slice(3); receiver = tuple.slice(0); +// Repros from #32140 +var oops1 = [1, 2, 3].reduce(function (accu, el) { return accu.concat(el); }, [])[0]; +var oops2 = [1, 2, 3].reduce(function (acc, e) { return acc.concat(e); }, [])[0]; diff --git a/tests/baselines/reference/destructuringTuple.symbols b/tests/baselines/reference/destructuringTuple.symbols index 73480505c3b..82e006ca8c1 100644 --- a/tests/baselines/reference/destructuringTuple.symbols +++ b/tests/baselines/reference/destructuringTuple.symbols @@ -17,3 +17,27 @@ declare var receiver: typeof tuple; >receiver : Symbol(receiver, Decl(destructuringTuple.ts, 4, 11)) >tuple : Symbol(tuple, Decl(destructuringTuple.ts, 0, 11)) +// Repros from #32140 + +const [oops1] = [1, 2, 3].reduce((accu, el) => accu.concat(el), []); +>oops1 : Symbol(oops1, Decl(destructuringTuple.ts, 10, 7)) +>[1, 2, 3].reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>accu : Symbol(accu, Decl(destructuringTuple.ts, 10, 34)) +>el : Symbol(el, Decl(destructuringTuple.ts, 10, 39)) +>accu.concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>accu : Symbol(accu, Decl(destructuringTuple.ts, 10, 34)) +>concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>el : Symbol(el, Decl(destructuringTuple.ts, 10, 39)) + +const [oops2] = [1, 2, 3].reduce((acc: number[], e) => acc.concat(e), []); +>oops2 : Symbol(oops2, Decl(destructuringTuple.ts, 12, 7)) +>[1, 2, 3].reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>acc : Symbol(acc, Decl(destructuringTuple.ts, 12, 34)) +>e : Symbol(e, Decl(destructuringTuple.ts, 12, 48)) +>acc.concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>acc : Symbol(acc, Decl(destructuringTuple.ts, 12, 34)) +>concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>e : Symbol(e, Decl(destructuringTuple.ts, 12, 48)) + diff --git a/tests/baselines/reference/destructuringTuple.types b/tests/baselines/reference/destructuringTuple.types index fe3bf84746f..466e4495a16 100644 --- a/tests/baselines/reference/destructuringTuple.types +++ b/tests/baselines/reference/destructuringTuple.types @@ -20,3 +20,43 @@ declare var receiver: typeof tuple; >receiver : [boolean, number, ...string[]] >tuple : [boolean, number, ...string[]] +// Repros from #32140 + +const [oops1] = [1, 2, 3].reduce((accu, el) => accu.concat(el), []); +>oops1 : undefined +>[1, 2, 3].reduce((accu, el) => accu.concat(el), []) : [] +>[1, 2, 3].reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>[1, 2, 3] : number[] +>1 : 1 +>2 : 2 +>3 : 3 +>reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>(accu, el) => accu.concat(el) : (accu: [], el: number) => any +>accu : [] +>el : number +>accu.concat(el) : any +>accu.concat : { (...items: ConcatArray[]): never[]; (...items: ConcatArray[]): never[]; } +>accu : [] +>concat : { (...items: ConcatArray[]): never[]; (...items: ConcatArray[]): never[]; } +>el : number +>[] : [] + +const [oops2] = [1, 2, 3].reduce((acc: number[], e) => acc.concat(e), []); +>oops2 : number +>[1, 2, 3].reduce((acc: number[], e) => acc.concat(e), []) : number[] +>[1, 2, 3].reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>[1, 2, 3] : number[] +>1 : 1 +>2 : 2 +>3 : 3 +>reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>(acc: number[], e) => acc.concat(e) : (acc: number[], e: number) => number[] +>acc : number[] +>e : number +>acc.concat(e) : number[] +>acc.concat : { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; } +>acc : number[] +>concat : { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; } +>e : number +>[] : never[] + From eb1b2251b8d8ed28f81dd8c1f18347b28ed00ac0 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 30 Jun 2019 08:02:18 -1000 Subject: [PATCH 47/95] Pad tuple type initializers of parameter array binding elements --- src/compiler/checker.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c62263957c7..533231a575b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -24233,10 +24233,13 @@ namespace ts { function checkDeclarationInitializer(declaration: HasExpressionInitializer) { const initializer = getEffectiveInitializer(declaration)!; const type = getTypeOfExpression(initializer, /*cache*/ true); + const padded = isParameter(declaration) && declaration.name.kind === SyntaxKind.ArrayBindingPattern && + isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? + padTupleType(type, declaration.name) : type; const widened = getCombinedNodeFlags(declaration) & NodeFlags.Const || isDeclarationReadonly(declaration) || isTypeAssertion(initializer) || - isLiteralOfContextualType(type, getContextualType(initializer)) ? type : getWidenedLiteralType(type); + isLiteralOfContextualType(padded, getContextualType(initializer)) ? padded : getWidenedLiteralType(padded); if (isInJSFile(declaration)) { if (widened.flags & TypeFlags.Nullable) { reportImplicitAny(declaration, anyType); @@ -24250,6 +24253,22 @@ namespace ts { return widened; } + function padTupleType(type: TupleTypeReference, pattern: ArrayBindingPattern) { + const patternElements = pattern.elements; + const arity = getTypeReferenceArity(type); + const elementTypes = arity ? type.typeArguments!.slice() : []; + for (let i = arity; i < patternElements.length; i++) { + const e = patternElements[i]; + if (i < patternElements.length - 1 || !(e.kind === SyntaxKind.BindingElement && (e).dotDotDotToken)) { + elementTypes.push(!isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType); + if (!isOmittedExpression(e) && !hasDefaultValue(e)) { + reportImplicitAny(e, anyType); + } + } + } + return createTupleType(elementTypes, type.target.minLength, /*hasRestElement*/ false, type.target.readonly); + } + function isLiteralOfContextualType(candidateType: Type, contextualType: Type | undefined): boolean { if (contextualType) { if (contextualType.flags & TypeFlags.UnionOrIntersection) { From 32f1b4e56c820f2647817b8dbd42bc182521925d Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 30 Jun 2019 08:02:53 -1000 Subject: [PATCH 48/95] Accept new baselines --- ...estructuringVariableDeclaration1ES5iterable.types | 6 +++--- .../destructuringWithLiteralInitializers.types | 4 ++-- .../reference/downlevelLetConst16.errors.txt | 8 ++++---- tests/baselines/reference/downlevelLetConst16.types | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.types b/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.types index 9c943356d80..1476797e74a 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.types +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.types @@ -151,9 +151,9 @@ var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; >f4 : number >f5 : number > : undefined ->{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }, undefined?]; } ->f : [number, number, { f3: number; f5: number; }, undefined?] ->[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }, undefined?] +>{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }]; } +>f : [number, number, { f3: number; f5: number; }] +>[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }] >1 : 1 >2 : 2 >{ f3: 4, f5: 0 } : { f3: number; f5: number; } diff --git a/tests/baselines/reference/destructuringWithLiteralInitializers.types b/tests/baselines/reference/destructuringWithLiteralInitializers.types index f19c1cf2b7e..9a64518a8cb 100644 --- a/tests/baselines/reference/destructuringWithLiteralInitializers.types +++ b/tests/baselines/reference/destructuringWithLiteralInitializers.types @@ -274,7 +274,7 @@ function g4([x, y = 0] = [0]) { } >x : number >y : number >0 : 0 ->[0] : [number, number?] +>[0] : [number] >0 : 0 g4(); @@ -295,7 +295,7 @@ function g5([x = 0, y = 0] = []) { } >0 : 0 >y : number >0 : 0 ->[] : [number?, number?] +>[] : [] g5(); >g5() : void diff --git a/tests/baselines/reference/downlevelLetConst16.errors.txt b/tests/baselines/reference/downlevelLetConst16.errors.txt index 955c79378fe..664fadccac9 100644 --- a/tests/baselines/reference/downlevelLetConst16.errors.txt +++ b/tests/baselines/reference/downlevelLetConst16.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/downlevelLetConst16.ts(151,15): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/compiler/downlevelLetConst16.ts(164,17): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/compiler/downlevelLetConst16.ts(151,15): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/compiler/downlevelLetConst16.ts(164,17): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. tests/cases/compiler/downlevelLetConst16.ts(195,14): error TS2461: Type 'undefined' is not an array type. tests/cases/compiler/downlevelLetConst16.ts(202,15): error TS2339: Property 'a' does not exist on type 'undefined'. tests/cases/compiler/downlevelLetConst16.ts(216,16): error TS2461: Type 'undefined' is not an array type. @@ -159,7 +159,7 @@ tests/cases/compiler/downlevelLetConst16.ts(223,17): error TS2339: Property 'a' } for (let [y] = []; ;) { ~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. use(y); } for (let {a: z} = {a: 1}; ;) { @@ -174,7 +174,7 @@ tests/cases/compiler/downlevelLetConst16.ts(223,17): error TS2339: Property 'a' } for (const [y] = []; ;) { ~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. use(y); } for (const {a: z} = { a: 1 }; ;) { diff --git a/tests/baselines/reference/downlevelLetConst16.types b/tests/baselines/reference/downlevelLetConst16.types index 450773fd9bb..ac9dc31eb04 100644 --- a/tests/baselines/reference/downlevelLetConst16.types +++ b/tests/baselines/reference/downlevelLetConst16.types @@ -515,13 +515,13 @@ function foo3() { >x : any } for (let [y] = []; ;) { ->y : any ->[] : [undefined?] +>y : undefined +>[] : [] use(y); >use(y) : any >use : (a: any) => any ->y : any +>y : undefined } for (let {a: z} = {a: 1}; ;) { >a : any @@ -554,13 +554,13 @@ function foo4() { >x : 1 } for (const [y] = []; ;) { ->y : any ->[] : [undefined?] +>y : undefined +>[] : [] use(y); >use(y) : any >use : (a: any) => any ->y : any +>y : undefined } for (const {a: z} = { a: 1 }; ;) { >a : any From 5ad3d1bf084b356b20b7a94c5f81a1695e021840 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 30 Jun 2019 08:18:01 -1000 Subject: [PATCH 49/95] Add more tests --- .../destructuringWithLiteralInitializers2.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts diff --git a/tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts b/tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts new file mode 100644 index 00000000000..7654a9ac336 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts @@ -0,0 +1,29 @@ +// @strict: true + +function f00([x, y]) {} +function f01([x, y] = []) {} +function f02([x, y] = [1]) {} +function f03([x, y] = [1, 'foo']) {} + +function f10([x = 0, y]) {} +function f11([x = 0, y] = []) {} +function f12([x = 0, y] = [1]) {} +function f13([x = 0, y] = [1, 'foo']) {} + +function f20([x = 0, y = 'bar']) {} +function f21([x = 0, y = 'bar'] = []) {} +function f22([x = 0, y = 'bar'] = [1]) {} +function f23([x = 0, y = 'bar'] = [1, 'foo']) {} + +declare const nx: number | undefined; +declare const sx: string | undefined; + +function f30([x = 0, y = 'bar']) {} +function f31([x = 0, y = 'bar'] = []) {} +function f32([x = 0, y = 'bar'] = [nx]) {} +function f33([x = 0, y = 'bar'] = [nx, sx]) {} + +function f40([x = 0, y = 'bar']) {} +function f41([x = 0, y = 'bar'] = []) {} +function f42([x = 0, y = 'bar'] = [sx]) {} +function f43([x = 0, y = 'bar'] = [sx, nx]) {} From cc7a24c27f1428a7c476a704f778a6579a287633 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 30 Jun 2019 08:18:08 -1000 Subject: [PATCH 50/95] Accept new baselines --- ...cturingWithLiteralInitializers2.errors.txt | 55 ++++++ .../destructuringWithLiteralInitializers2.js | 92 ++++++++++ ...tructuringWithLiteralInitializers2.symbols | 113 ++++++++++++ ...estructuringWithLiteralInitializers2.types | 165 ++++++++++++++++++ 4 files changed, 425 insertions(+) create mode 100644 tests/baselines/reference/destructuringWithLiteralInitializers2.errors.txt create mode 100644 tests/baselines/reference/destructuringWithLiteralInitializers2.js create mode 100644 tests/baselines/reference/destructuringWithLiteralInitializers2.symbols create mode 100644 tests/baselines/reference/destructuringWithLiteralInitializers2.types diff --git a/tests/baselines/reference/destructuringWithLiteralInitializers2.errors.txt b/tests/baselines/reference/destructuringWithLiteralInitializers2.errors.txt new file mode 100644 index 00000000000..983f853f9a4 --- /dev/null +++ b/tests/baselines/reference/destructuringWithLiteralInitializers2.errors.txt @@ -0,0 +1,55 @@ +tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts(1,15): error TS7031: Binding element 'x' implicitly has an 'any' type. +tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts(1,18): error TS7031: Binding element 'y' implicitly has an 'any' type. +tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts(2,15): error TS7031: Binding element 'x' implicitly has an 'any' type. +tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts(2,18): error TS7031: Binding element 'y' implicitly has an 'any' type. +tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts(3,18): error TS7031: Binding element 'y' implicitly has an 'any' type. +tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts(6,22): error TS7031: Binding element 'y' implicitly has an 'any' type. +tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts(7,22): error TS7031: Binding element 'y' implicitly has an 'any' type. +tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts(8,22): error TS7031: Binding element 'y' implicitly has an 'any' type. + + +==== tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts (8 errors) ==== + function f00([x, y]) {} + ~ +!!! error TS7031: Binding element 'x' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'y' implicitly has an 'any' type. + function f01([x, y] = []) {} + ~ +!!! error TS7031: Binding element 'x' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'y' implicitly has an 'any' type. + function f02([x, y] = [1]) {} + ~ +!!! error TS7031: Binding element 'y' implicitly has an 'any' type. + function f03([x, y] = [1, 'foo']) {} + + function f10([x = 0, y]) {} + ~ +!!! error TS7031: Binding element 'y' implicitly has an 'any' type. + function f11([x = 0, y] = []) {} + ~ +!!! error TS7031: Binding element 'y' implicitly has an 'any' type. + function f12([x = 0, y] = [1]) {} + ~ +!!! error TS7031: Binding element 'y' implicitly has an 'any' type. + function f13([x = 0, y] = [1, 'foo']) {} + + function f20([x = 0, y = 'bar']) {} + function f21([x = 0, y = 'bar'] = []) {} + function f22([x = 0, y = 'bar'] = [1]) {} + function f23([x = 0, y = 'bar'] = [1, 'foo']) {} + + declare const nx: number | undefined; + declare const sx: string | undefined; + + function f30([x = 0, y = 'bar']) {} + function f31([x = 0, y = 'bar'] = []) {} + function f32([x = 0, y = 'bar'] = [nx]) {} + function f33([x = 0, y = 'bar'] = [nx, sx]) {} + + function f40([x = 0, y = 'bar']) {} + function f41([x = 0, y = 'bar'] = []) {} + function f42([x = 0, y = 'bar'] = [sx]) {} + function f43([x = 0, y = 'bar'] = [sx, nx]) {} + \ No newline at end of file diff --git a/tests/baselines/reference/destructuringWithLiteralInitializers2.js b/tests/baselines/reference/destructuringWithLiteralInitializers2.js new file mode 100644 index 00000000000..1f3ee956144 --- /dev/null +++ b/tests/baselines/reference/destructuringWithLiteralInitializers2.js @@ -0,0 +1,92 @@ +//// [destructuringWithLiteralInitializers2.ts] +function f00([x, y]) {} +function f01([x, y] = []) {} +function f02([x, y] = [1]) {} +function f03([x, y] = [1, 'foo']) {} + +function f10([x = 0, y]) {} +function f11([x = 0, y] = []) {} +function f12([x = 0, y] = [1]) {} +function f13([x = 0, y] = [1, 'foo']) {} + +function f20([x = 0, y = 'bar']) {} +function f21([x = 0, y = 'bar'] = []) {} +function f22([x = 0, y = 'bar'] = [1]) {} +function f23([x = 0, y = 'bar'] = [1, 'foo']) {} + +declare const nx: number | undefined; +declare const sx: string | undefined; + +function f30([x = 0, y = 'bar']) {} +function f31([x = 0, y = 'bar'] = []) {} +function f32([x = 0, y = 'bar'] = [nx]) {} +function f33([x = 0, y = 'bar'] = [nx, sx]) {} + +function f40([x = 0, y = 'bar']) {} +function f41([x = 0, y = 'bar'] = []) {} +function f42([x = 0, y = 'bar'] = [sx]) {} +function f43([x = 0, y = 'bar'] = [sx, nx]) {} + + +//// [destructuringWithLiteralInitializers2.js] +"use strict"; +function f00(_a) { + var x = _a[0], y = _a[1]; +} +function f01(_a) { + var _b = _a === void 0 ? [] : _a, x = _b[0], y = _b[1]; +} +function f02(_a) { + var _b = _a === void 0 ? [1] : _a, x = _b[0], y = _b[1]; +} +function f03(_a) { + var _b = _a === void 0 ? [1, 'foo'] : _a, x = _b[0], y = _b[1]; +} +function f10(_a) { + var _b = _a[0], x = _b === void 0 ? 0 : _b, y = _a[1]; +} +function f11(_a) { + var _b = _a === void 0 ? [] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, y = _b[1]; +} +function f12(_a) { + var _b = _a === void 0 ? [1] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, y = _b[1]; +} +function f13(_a) { + var _b = _a === void 0 ? [1, 'foo'] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, y = _b[1]; +} +function f20(_a) { + var _b = _a[0], x = _b === void 0 ? 0 : _b, _c = _a[1], y = _c === void 0 ? 'bar' : _c; +} +function f21(_a) { + var _b = _a === void 0 ? [] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d; +} +function f22(_a) { + var _b = _a === void 0 ? [1] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d; +} +function f23(_a) { + var _b = _a === void 0 ? [1, 'foo'] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d; +} +function f30(_a) { + var _b = _a[0], x = _b === void 0 ? 0 : _b, _c = _a[1], y = _c === void 0 ? 'bar' : _c; +} +function f31(_a) { + var _b = _a === void 0 ? [] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d; +} +function f32(_a) { + var _b = _a === void 0 ? [nx] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d; +} +function f33(_a) { + var _b = _a === void 0 ? [nx, sx] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d; +} +function f40(_a) { + var _b = _a[0], x = _b === void 0 ? 0 : _b, _c = _a[1], y = _c === void 0 ? 'bar' : _c; +} +function f41(_a) { + var _b = _a === void 0 ? [] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d; +} +function f42(_a) { + var _b = _a === void 0 ? [sx] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d; +} +function f43(_a) { + var _b = _a === void 0 ? [sx, nx] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d; +} diff --git a/tests/baselines/reference/destructuringWithLiteralInitializers2.symbols b/tests/baselines/reference/destructuringWithLiteralInitializers2.symbols new file mode 100644 index 00000000000..44224ac22a4 --- /dev/null +++ b/tests/baselines/reference/destructuringWithLiteralInitializers2.symbols @@ -0,0 +1,113 @@ +=== tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts === +function f00([x, y]) {} +>f00 : Symbol(f00, Decl(destructuringWithLiteralInitializers2.ts, 0, 0)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 0, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 0, 16)) + +function f01([x, y] = []) {} +>f01 : Symbol(f01, Decl(destructuringWithLiteralInitializers2.ts, 0, 23)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 1, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 1, 16)) + +function f02([x, y] = [1]) {} +>f02 : Symbol(f02, Decl(destructuringWithLiteralInitializers2.ts, 1, 28)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 2, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 2, 16)) + +function f03([x, y] = [1, 'foo']) {} +>f03 : Symbol(f03, Decl(destructuringWithLiteralInitializers2.ts, 2, 29)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 3, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 3, 16)) + +function f10([x = 0, y]) {} +>f10 : Symbol(f10, Decl(destructuringWithLiteralInitializers2.ts, 3, 36)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 5, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 5, 20)) + +function f11([x = 0, y] = []) {} +>f11 : Symbol(f11, Decl(destructuringWithLiteralInitializers2.ts, 5, 27)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 6, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 6, 20)) + +function f12([x = 0, y] = [1]) {} +>f12 : Symbol(f12, Decl(destructuringWithLiteralInitializers2.ts, 6, 32)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 7, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 7, 20)) + +function f13([x = 0, y] = [1, 'foo']) {} +>f13 : Symbol(f13, Decl(destructuringWithLiteralInitializers2.ts, 7, 33)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 8, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 8, 20)) + +function f20([x = 0, y = 'bar']) {} +>f20 : Symbol(f20, Decl(destructuringWithLiteralInitializers2.ts, 8, 40)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 10, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 10, 20)) + +function f21([x = 0, y = 'bar'] = []) {} +>f21 : Symbol(f21, Decl(destructuringWithLiteralInitializers2.ts, 10, 35)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 11, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 11, 20)) + +function f22([x = 0, y = 'bar'] = [1]) {} +>f22 : Symbol(f22, Decl(destructuringWithLiteralInitializers2.ts, 11, 40)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 12, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 12, 20)) + +function f23([x = 0, y = 'bar'] = [1, 'foo']) {} +>f23 : Symbol(f23, Decl(destructuringWithLiteralInitializers2.ts, 12, 41)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 13, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 13, 20)) + +declare const nx: number | undefined; +>nx : Symbol(nx, Decl(destructuringWithLiteralInitializers2.ts, 15, 13)) + +declare const sx: string | undefined; +>sx : Symbol(sx, Decl(destructuringWithLiteralInitializers2.ts, 16, 13)) + +function f30([x = 0, y = 'bar']) {} +>f30 : Symbol(f30, Decl(destructuringWithLiteralInitializers2.ts, 16, 37)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 18, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 18, 20)) + +function f31([x = 0, y = 'bar'] = []) {} +>f31 : Symbol(f31, Decl(destructuringWithLiteralInitializers2.ts, 18, 35)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 19, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 19, 20)) + +function f32([x = 0, y = 'bar'] = [nx]) {} +>f32 : Symbol(f32, Decl(destructuringWithLiteralInitializers2.ts, 19, 40)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 20, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 20, 20)) +>nx : Symbol(nx, Decl(destructuringWithLiteralInitializers2.ts, 15, 13)) + +function f33([x = 0, y = 'bar'] = [nx, sx]) {} +>f33 : Symbol(f33, Decl(destructuringWithLiteralInitializers2.ts, 20, 42)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 21, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 21, 20)) +>nx : Symbol(nx, Decl(destructuringWithLiteralInitializers2.ts, 15, 13)) +>sx : Symbol(sx, Decl(destructuringWithLiteralInitializers2.ts, 16, 13)) + +function f40([x = 0, y = 'bar']) {} +>f40 : Symbol(f40, Decl(destructuringWithLiteralInitializers2.ts, 21, 46)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 23, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 23, 20)) + +function f41([x = 0, y = 'bar'] = []) {} +>f41 : Symbol(f41, Decl(destructuringWithLiteralInitializers2.ts, 23, 35)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 24, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 24, 20)) + +function f42([x = 0, y = 'bar'] = [sx]) {} +>f42 : Symbol(f42, Decl(destructuringWithLiteralInitializers2.ts, 24, 40)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 25, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 25, 20)) +>sx : Symbol(sx, Decl(destructuringWithLiteralInitializers2.ts, 16, 13)) + +function f43([x = 0, y = 'bar'] = [sx, nx]) {} +>f43 : Symbol(f43, Decl(destructuringWithLiteralInitializers2.ts, 25, 42)) +>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 26, 14)) +>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 26, 20)) +>sx : Symbol(sx, Decl(destructuringWithLiteralInitializers2.ts, 16, 13)) +>nx : Symbol(nx, Decl(destructuringWithLiteralInitializers2.ts, 15, 13)) + diff --git a/tests/baselines/reference/destructuringWithLiteralInitializers2.types b/tests/baselines/reference/destructuringWithLiteralInitializers2.types new file mode 100644 index 00000000000..7f955912e74 --- /dev/null +++ b/tests/baselines/reference/destructuringWithLiteralInitializers2.types @@ -0,0 +1,165 @@ +=== tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts === +function f00([x, y]) {} +>f00 : ([x, y]: [any, any]) => void +>x : any +>y : any + +function f01([x, y] = []) {} +>f01 : ([x, y]?: [any?, any?]) => void +>x : any +>y : any +>[] : [] + +function f02([x, y] = [1]) {} +>f02 : ([x, y]?: [number, any?]) => void +>x : number +>y : any +>[1] : [number] +>1 : 1 + +function f03([x, y] = [1, 'foo']) {} +>f03 : ([x, y]?: [number, string]) => void +>x : number +>y : string +>[1, 'foo'] : [number, string] +>1 : 1 +>'foo' : "foo" + +function f10([x = 0, y]) {} +>f10 : ([x, y]: [number | undefined, any]) => void +>x : number +>0 : 0 +>y : any + +function f11([x = 0, y] = []) {} +>f11 : ([x, y]?: [(number | undefined)?, any?]) => void +>x : number +>0 : 0 +>y : any +>[] : [] + +function f12([x = 0, y] = [1]) {} +>f12 : ([x, y]?: [number, any?]) => void +>x : number +>0 : 0 +>y : any +>[1] : [number] +>1 : 1 + +function f13([x = 0, y] = [1, 'foo']) {} +>f13 : ([x, y]?: [number, string]) => void +>x : number +>0 : 0 +>y : string +>[1, 'foo'] : [number, string] +>1 : 1 +>'foo' : "foo" + +function f20([x = 0, y = 'bar']) {} +>f20 : ([x, y]: [(number | undefined)?, (string | undefined)?]) => void +>x : number +>0 : 0 +>y : string +>'bar' : "bar" + +function f21([x = 0, y = 'bar'] = []) {} +>f21 : ([x, y]?: [(number | undefined)?, (string | undefined)?]) => void +>x : number +>0 : 0 +>y : string +>'bar' : "bar" +>[] : [] + +function f22([x = 0, y = 'bar'] = [1]) {} +>f22 : ([x, y]?: [number, (string | undefined)?]) => void +>x : number +>0 : 0 +>y : string +>'bar' : "bar" +>[1] : [number] +>1 : 1 + +function f23([x = 0, y = 'bar'] = [1, 'foo']) {} +>f23 : ([x, y]?: [number, string]) => void +>x : number +>0 : 0 +>y : string +>'bar' : "bar" +>[1, 'foo'] : [number, string] +>1 : 1 +>'foo' : "foo" + +declare const nx: number | undefined; +>nx : number | undefined + +declare const sx: string | undefined; +>sx : string | undefined + +function f30([x = 0, y = 'bar']) {} +>f30 : ([x, y]: [(number | undefined)?, (string | undefined)?]) => void +>x : number +>0 : 0 +>y : string +>'bar' : "bar" + +function f31([x = 0, y = 'bar'] = []) {} +>f31 : ([x, y]?: [(number | undefined)?, (string | undefined)?]) => void +>x : number +>0 : 0 +>y : string +>'bar' : "bar" +>[] : [] + +function f32([x = 0, y = 'bar'] = [nx]) {} +>f32 : ([x, y]?: [number | undefined, (string | undefined)?]) => void +>x : number +>0 : 0 +>y : string +>'bar' : "bar" +>[nx] : [number | undefined] +>nx : number | undefined + +function f33([x = 0, y = 'bar'] = [nx, sx]) {} +>f33 : ([x, y]?: [number | undefined, string | undefined]) => void +>x : number +>0 : 0 +>y : string +>'bar' : "bar" +>[nx, sx] : [number | undefined, string | undefined] +>nx : number | undefined +>sx : string | undefined + +function f40([x = 0, y = 'bar']) {} +>f40 : ([x, y]: [(number | undefined)?, (string | undefined)?]) => void +>x : number +>0 : 0 +>y : string +>'bar' : "bar" + +function f41([x = 0, y = 'bar'] = []) {} +>f41 : ([x, y]?: [(number | undefined)?, (string | undefined)?]) => void +>x : number +>0 : 0 +>y : string +>'bar' : "bar" +>[] : [] + +function f42([x = 0, y = 'bar'] = [sx]) {} +>f42 : ([x, y]?: [string | undefined, (string | undefined)?]) => void +>x : string | number +>0 : 0 +>y : string +>'bar' : "bar" +>[sx] : [string | undefined] +>sx : string | undefined + +function f43([x = 0, y = 'bar'] = [sx, nx]) {} +>f43 : ([x, y]?: [string | undefined, number | undefined]) => void +>x : string | number +>0 : 0 +>y : string | number +>'bar' : "bar" +>[sx, nx] : [string | undefined, number | undefined] +>sx : string | undefined +>nx : number | undefined + From 17153a6e5fb6bc34422a460b4d0246afd4cc0dd2 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 30 Jun 2019 08:54:48 -1000 Subject: [PATCH 51/95] Fix linting error --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 533231a575b..9c7a538172c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -24259,7 +24259,7 @@ namespace ts { const elementTypes = arity ? type.typeArguments!.slice() : []; for (let i = arity; i < patternElements.length; i++) { const e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === SyntaxKind.BindingElement && (e).dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === SyntaxKind.BindingElement && e.dotDotDotToken)) { elementTypes.push(!isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType); if (!isOmittedExpression(e) && !hasDefaultValue(e)) { reportImplicitAny(e, anyType); From 19061420af15698672505e11a889315ca1c12532 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 1 Jul 2019 10:22:11 -0700 Subject: [PATCH 52/95] Update baselines --- .../reference/api/tsserverlibrary.d.ts | 4 +- tests/baselines/reference/api/typescript.d.ts | 4 +- .../checkJsxChildrenCanBeTupleType.errors.txt | 34 +- .../reference/promisePermutations.errors.txt | 392 +++++++++--------- .../reference/promisePermutations2.errors.txt | 144 +++---- .../reference/promisePermutations3.errors.txt | 248 +++++------ ...actDefaultPropsInferenceSuccess.errors.txt | 69 +-- .../reference/strictBindCallApply1.errors.txt | 100 +++-- .../tsxNotUsingApparentTypeOfSFC.errors.txt | 16 +- .../reference/underscoreTest1.errors.txt | 25 +- 10 files changed, 552 insertions(+), 484 deletions(-) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index e9d797bfa0d..54a31fb07a8 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2453,7 +2453,7 @@ declare namespace ts { messageText: string; category: DiagnosticCategory; code: number; - next?: DiagnosticMessageChain; + next?: DiagnosticMessageChain[]; } interface Diagnostic extends DiagnosticRelatedInformation { /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */ @@ -4272,7 +4272,7 @@ declare namespace ts { function formatDiagnostics(diagnostics: ReadonlyArray, host: FormatDiagnosticsHost): string; function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string; function formatDiagnosticsWithColorAndContext(diagnostics: ReadonlyArray, host: FormatDiagnosticsHost): string; - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain | undefined, newLine: string): string; + function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent?: number): string; function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): ReadonlyArray; /** * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions' diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index be8eea8062b..89c0831d981 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2453,7 +2453,7 @@ declare namespace ts { messageText: string; category: DiagnosticCategory; code: number; - next?: DiagnosticMessageChain; + next?: DiagnosticMessageChain[]; } interface Diagnostic extends DiagnosticRelatedInformation { /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */ @@ -4272,7 +4272,7 @@ declare namespace ts { function formatDiagnostics(diagnostics: ReadonlyArray, host: FormatDiagnosticsHost): string; function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string; function formatDiagnosticsWithColorAndContext(diagnostics: ReadonlyArray, host: FormatDiagnosticsHost): string; - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain | undefined, newLine: string): string; + function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent?: number): string; function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): ReadonlyArray; /** * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions' diff --git a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt index 5e38aa9c574..d66298c0368 100644 --- a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt @@ -1,4 +1,14 @@ -tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2763: No overload matches this call. + Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. + Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. + Types of property 'children' are incompatible. + Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. + Types of property 'length' are incompatible. + Type '3' is not assignable to type '2'. + Overload 2 of 2, '(props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. + Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. + Types of property 'children' are incompatible. + Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. ==== tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx (1 errors) ==== @@ -20,17 +30,17 @@ tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2 const testErr = ~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx:17:18: Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. - Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. - Types of property 'children' are incompatible. - Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. - Types of property 'length' are incompatible. - Type '3' is not assignable to type '2'. -!!! related TS2760 tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx:17:18: Overload 2 of 2, '(props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. - Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. - Types of property 'children' are incompatible. - Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. +!!! error TS2763: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. +!!! error TS2763: Types of property 'children' are incompatible. +!!! error TS2763: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. +!!! error TS2763: Types of property 'length' are incompatible. +!!! error TS2763: Type '3' is not assignable to type '2'. +!!! error TS2763: Overload 2 of 2, '(props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. +!!! error TS2763: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. +!!! error TS2763: Types of property 'children' are incompatible. +!!! error TS2763: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.

diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index 2a27563fa24..cfc491027ee 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -1,125 +1,125 @@ -tests/cases/compiler/promisePermutations.ts(74,70): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(74,70): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(79,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(79,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(82,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(82,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(83,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(83,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(84,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(84,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(88,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(88,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(91,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(91,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(92,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(92,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations.ts(93,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(93,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(97,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(97,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(100,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(100,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(101,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(101,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations.ts(102,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(102,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(106,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(106,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(109,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(109,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(110,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(110,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(111,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(111,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(117,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(117,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(120,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(120,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(121,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(121,19): error TS2763: No overload matches this call. The last overload gave the following error. 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 TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(122,19): error TS2763: No overload matches this call. The last overload gave the following error. 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 TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(126,19): error TS2763: No overload matches this call. The last overload gave the following error. 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,33): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(129,33): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(132,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(132,19): error TS2763: No overload matches this call. The last overload gave the following error. 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 TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(133,19): error TS2763: No overload matches this call. The last overload gave the following error. 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 TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(134,19): error TS2763: No overload matches this call. The last overload gave the following error. 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,33): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(137,33): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations.ts(144,35): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(144,35): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -tests/cases/compiler/promisePermutations.ts(152,36): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(152,36): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -tests/cases/compiler/promisePermutations.ts(156,21): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(156,21): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations.ts(158,21): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(158,21): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations.ts(159,21): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(159,21): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(160,21): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'Promise' is not assignable to type 'IPromise'. @@ -206,143 +206,143 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No overload m var s3c = s3.then(testFunction3P, testFunction3, testFunction3); var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'IPromise' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'IPromise' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var r4: IPromise; var sIPromise: (x: any) => IPromise; var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -350,78 +350,78 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No overload m var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok ~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); @@ -430,10 +430,10 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No overload m var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok ~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s10 = testFunction10P(x => x); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok @@ -443,51 +443,51 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No overload m var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. -!!! error TS2755: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. +!!! error TS2763: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. !!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'IPromise'. -!!! error TS2755: Types of property 'then' are incompatible. -!!! error TS2755: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. -!!! error TS2755: Types of parameters 'onfulfilled' and 'success' are incompatible. -!!! error TS2755: Types of parameters 'value' and 'value' are incompatible. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'IPromise'. +!!! error TS2763: Types of property 'then' are incompatible. +!!! error TS2763: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. +!!! error TS2763: Types of parameters 'onfulfilled' and 'success' are incompatible. +!!! error TS2763: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index 7c852d4e370..5ef78ed5769 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/promisePermutations2.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations2.ts(78,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(78,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. @@ -15,46 +15,46 @@ tests/cases/compiler/promisePermutations2.ts(82,19): error TS2345: Argument of t tests/cases/compiler/promisePermutations2.ts(83,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations2.ts(87,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(87,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(90,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations2.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(96,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(96,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(99,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(100,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations2.ts(101,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(105,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(105,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(108,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(108,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(109,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(109,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(110,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(110,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(116,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(116,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(119,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. 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 TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(125,19): error TS2763: No overload matches this call. The last overload gave the following error. 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,33): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(128,33): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. @@ -64,12 +64,12 @@ tests/cases/compiler/promisePermutations2.ts(132,19): error TS2345: Argument of 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,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations2.ts(143,35): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(143,35): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. tests/cases/compiler/promisePermutations2.ts(151,36): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -tests/cases/compiler/promisePermutations2.ts(155,21): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(155,21): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. @@ -172,12 +172,12 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error @@ -200,10 +200,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error @@ -220,10 +220,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error @@ -240,36 +240,36 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -277,10 +277,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error @@ -297,20 +297,20 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error @@ -336,10 +336,10 @@ 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 TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s10 = testFunction10P(x => x); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok @@ -357,12 +357,12 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 4e00aba27b4..89a154c9c7f 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/promisePermutations3.ts(68,69): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(73,70): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(73,70): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. @@ -9,39 +9,39 @@ tests/cases/compiler/promisePermutations3.ts(73,70): error TS2755: No overload m tests/cases/compiler/promisePermutations3.ts(78,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(81,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(81,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(82,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(82,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(83,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(83,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations3.ts(87,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(90,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(90,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(91,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(91,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations3.ts(92,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(92,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations3.ts(96,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(99,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(99,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(100,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(100,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations3.ts(101,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(101,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations3.ts(105,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. @@ -55,50 +55,50 @@ tests/cases/compiler/promisePermutations3.ts(110,19): error TS2345: Argument of Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. tests/cases/compiler/promisePermutations3.ts(116,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(119,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(119,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(120,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(120,19): error TS2763: No overload matches this call. The last overload gave the following error. 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 TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(121,19): error TS2763: No overload matches this call. The last overload gave the following error. 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,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(131,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(131,19): error TS2763: No overload matches this call. The last overload gave the following error. 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 TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(132,19): error TS2763: No overload matches this call. The last overload gave the following error. 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 TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(133,19): error TS2763: No overload matches this call. The last overload gave the following error. 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,33): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(136,33): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. tests/cases/compiler/promisePermutations3.ts(143,35): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(151,36): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(151,36): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. 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'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations3.ts(157,21): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(157,21): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations3.ts(158,21): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(158,21): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations3.ts(159,21): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(159,21): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'Promise' is not assignable to type 'IPromise'. @@ -190,12 +190,12 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s3c = s3.then(testFunction3P, testFunction3, testFunction3); var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'IPromise' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'IPromise' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var r4: IPromise; var sIPromise: (x: any) => IPromise; @@ -209,28 +209,28 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; @@ -241,22 +241,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; @@ -267,22 +267,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; @@ -318,22 +318,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; @@ -351,31 +351,31 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); @@ -394,12 +394,12 @@ 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 TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. -!!! error TS2755: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. +!!! error TS2763: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. !!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; @@ -411,31 +411,31 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'IPromise'. -!!! error TS2755: Types of property 'then' are incompatible. -!!! error TS2755: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. -!!! error TS2755: Types of parameters 'onfulfilled' and 'success' are incompatible. -!!! error TS2755: Types of parameters 'value' and 'value' are incompatible. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'IPromise'. +!!! error TS2763: Types of property 'then' are incompatible. +!!! error TS2763: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. +!!! error TS2763: Types of parameters 'onfulfilled' and 'success' are incompatible. +!!! error TS2763: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt index 9d8f05d7b35..5168e5aa361 100644 --- a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt +++ b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt @@ -1,6 +1,25 @@ -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2755: No overload matches this call. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2755: No overload matches this call. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: No overload matches this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2763: No overload matches this call. + Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. + Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2763: No overload matches this call. + Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. + Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2763: No overload matches this call. + Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. + Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. ==== tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx (3 errors) ==== @@ -32,14 +51,14 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: // Error: Void not assignable to boolean const Test2 = () => console.log(value)} />; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:27:36: Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. - Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. - Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. - Type 'void' is not assignable to type 'boolean'. -!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:27:36: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. - Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. - Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2763: Type 'void' is not assignable to type 'boolean'. +!!! error TS2763: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. class FieldFeedbackBeta

extends React.Component

{ static defaultProps: BaseProps = { @@ -57,14 +76,14 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: // Error: Void not assignable to boolean const Test2a = () => console.log(value)} error>Hah; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:43:41: Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. - Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. - Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. - Type 'void' is not assignable to type 'boolean'. -!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:43:41: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. - Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. - Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2763: Type 'void' is not assignable to type 'boolean'. +!!! error TS2763: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. interface MyPropsProps extends Props { when: (value: string) => boolean; @@ -87,12 +106,12 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: // Error: Void not assignable to boolean const Test4 = () => console.log(value)} />; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:64:37: Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. - Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. - Type 'void' is not assignable to type 'boolean'. -!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:64:37: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. - Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2763: Type 'void' is not assignable to type 'boolean'. +!!! error TS2763: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. // OK const Test5 = () => ; diff --git a/tests/baselines/reference/strictBindCallApply1.errors.txt b/tests/baselines/reference/strictBindCallApply1.errors.txt index 3a596bfdb31..e14635b1075 100644 --- a/tests/baselines/reference/strictBindCallApply1.errors.txt +++ b/tests/baselines/reference/strictBindCallApply1.errors.txt @@ -1,4 +1,11 @@ -tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2755: No overload matches this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2763: No overload matches this call. + Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. + Argument of type '20' is not assignable to parameter of type 'string'. + Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. + The 'this' context of type '(a: number, b: string) => string' is not assignable to method's 'this' of type '(this: undefined, ...args: (10 | 20)[]) => string'. + Types of parameters 'b' and 'args' are incompatible. + Type '10 | 20' is not assignable to type 'string'. + Type '10' is not assignable to type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(17,15): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(18,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(19,44): error TS2554: Expected 3 arguments, but got 4. @@ -8,8 +15,22 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(23,37): error TS2322: tests/cases/conformance/functions/strictBindCallApply1.ts(24,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. -tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2755: No overload matches this call. -tests/cases/conformance/functions/strictBindCallApply1.ts(42,11): error TS2755: No overload matches this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2763: No overload matches this call. + Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. + Argument of type '20' is not assignable to parameter of type 'string'. + Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. + The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (10 | 20)[]) => string'. + Types of parameters 'b' and 'args' are incompatible. + Type '10 | 20' is not assignable to type 'string'. + Type '10' is not assignable to type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(42,11): error TS2763: No overload matches this call. + Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type 'C'. + Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. + The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (string | number)[]) => string'. + Types of parameters 'a' and 'args' are incompatible. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/functions/strictBindCallApply1.ts(48,17): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(49,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(50,38): error TS2554: Expected 3 arguments, but got 4. @@ -18,7 +39,14 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(54,26): error TS2345: tests/cases/conformance/functions/strictBindCallApply1.ts(55,31): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(56,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. tests/cases/conformance/functions/strictBindCallApply1.ts(57,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. -tests/cases/conformance/functions/strictBindCallApply1.ts(62,11): error TS2755: No overload matches this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(62,11): error TS2763: No overload matches this call. + Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. + Argument of type '20' is not assignable to parameter of type 'string'. + Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. + The 'this' context of type 'typeof C' is not assignable to method's 'this' of type 'new (...args: (10 | 20)[]) => C'. + Types of parameters 'b' and 'args' are incompatible. + Type '10 | 20' is not assignable to type 'string'. + Type '10' is not assignable to type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(65,3): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(66,15): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(67,24): error TS2554: Expected 3 arguments, but got 4. @@ -40,14 +68,14 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f02 = foo.bind(undefined, 10, "hello"); let f03 = foo.bind(undefined, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:11:35: Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. - Argument of type '20' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:11:11: Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. - The 'this' context of type '(a: number, b: string) => string' is not assignable to method's 'this' of type '(this: undefined, ...args: (10 | 20)[]) => string'. - Types of parameters 'b' and 'args' are incompatible. - Type '10 | 20' is not assignable to type 'string'. - Type '10' is not assignable to type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. +!!! error TS2763: Argument of type '20' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. +!!! error TS2763: The 'this' context of type '(a: number, b: string) => string' is not assignable to method's 'this' of type '(this: undefined, ...args: (10 | 20)[]) => string'. +!!! error TS2763: Types of parameters 'b' and 'args' are incompatible. +!!! error TS2763: Type '10 | 20' is not assignable to type 'string'. +!!! error TS2763: Type '10' is not assignable to type 'string'. let f04 = overloaded.bind(undefined); // typeof overloaded let f05 = generic.bind(undefined); // typeof generic @@ -94,24 +122,24 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f12 = c.foo.bind(c, 10, "hello"); let f13 = c.foo.bind(c, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:41:29: Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. - Argument of type '20' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:41:11: Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. - The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (10 | 20)[]) => string'. - Types of parameters 'b' and 'args' are incompatible. - Type '10 | 20' is not assignable to type 'string'. - Type '10' is not assignable to type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. +!!! error TS2763: Argument of type '20' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. +!!! error TS2763: The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (10 | 20)[]) => string'. +!!! error TS2763: Types of parameters 'b' and 'args' are incompatible. +!!! error TS2763: Type '10 | 20' is not assignable to type 'string'. +!!! error TS2763: Type '10' is not assignable to type 'string'. let f14 = c.foo.bind(undefined); // Error ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:42:22: Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. - Argument of type 'undefined' is not assignable to parameter of type 'C'. -!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:42:11: Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. - The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (string | number)[]) => string'. - Types of parameters 'a' and 'args' are incompatible. - Type 'string | number' is not assignable to type 'number'. - Type 'string' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. +!!! error TS2763: Argument of type 'undefined' is not assignable to parameter of type 'C'. +!!! error TS2763: Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. +!!! error TS2763: The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (string | number)[]) => string'. +!!! error TS2763: Types of parameters 'a' and 'args' are incompatible. +!!! error TS2763: Type 'string | number' is not assignable to type 'number'. +!!! error TS2763: Type 'string' is not assignable to type 'number'. let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded let f16 = c.generic.bind(c); // typeof C.prototype.generic @@ -149,14 +177,14 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f22 = C.bind(undefined, 10, "hello"); let f23 = C.bind(undefined, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:62:33: Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. - Argument of type '20' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:62:11: Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. - The 'this' context of type 'typeof C' is not assignable to method's 'this' of type 'new (...args: (10 | 20)[]) => C'. - Types of parameters 'b' and 'args' are incompatible. - Type '10 | 20' is not assignable to type 'string'. - Type '10' is not assignable to type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. +!!! error TS2763: Argument of type '20' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. +!!! error TS2763: The 'this' context of type 'typeof C' is not assignable to method's 'this' of type 'new (...args: (10 | 20)[]) => C'. +!!! error TS2763: Types of parameters 'b' and 'args' are incompatible. +!!! error TS2763: Type '10 | 20' is not assignable to type 'string'. +!!! error TS2763: Type '10' is not assignable to type 'string'. C.call(c, 10, "hello"); C.call(c, 10); // Error diff --git a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt index e85f25c0fdb..80230ec72b1 100644 --- a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt +++ b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt @@ -1,6 +1,10 @@ tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(14,14): error TS2322: Type '{}' is not assignable to type 'P'. '{}' is assignable to the constraint of type 'P', but 'P' could be instantiated with a different subtype of constraint '{}'. -tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2755: No overload matches this call. +tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2763: No overload matches this call. + Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. + Type '{}' is not assignable to type 'Readonly

'. + Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. + Type '{}' is not assignable to type 'Readonly

'. ==== tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx (2 errors) ==== @@ -23,11 +27,11 @@ tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2755: No o !!! error TS2322: '{}' is assignable to the constraint of type 'P', but 'P' could be instantiated with a different subtype of constraint '{}'. let y = ; // should error ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx:15:14: Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. - Type '{}' is not assignable to type 'Readonly

'. -!!! related TS2760 tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx:15:14: Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. - Type '{}' is not assignable to type 'Readonly

'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. +!!! error TS2763: Type '{}' is not assignable to type 'Readonly

'. +!!! error TS2763: Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. +!!! error TS2763: Type '{}' is not assignable to type 'Readonly

'. let z = // should work let q = // should work diff --git a/tests/baselines/reference/underscoreTest1.errors.txt b/tests/baselines/reference/underscoreTest1.errors.txt index 256b6e873aa..e51de99e216 100644 --- a/tests/baselines/reference/underscoreTest1.errors.txt +++ b/tests/baselines/reference/underscoreTest1.errors.txt @@ -1,4 +1,11 @@ -tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2755: No overload matches this call. +tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2763: No overload matches this call. + Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. + Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. + Type 'string | number | boolean' is not assignable to type 'boolean'. + Type 'string' is not assignable to type 'boolean'. + Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. + Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. + Index signature is missing in type '(string | number | boolean)[]'. ==== tests/cases/compiler/underscoreTest1_underscoreTests.ts (1 errors) ==== @@ -29,14 +36,14 @@ tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2755: No _.all([true, 1, null, 'yes'], _.identity); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/underscoreTest1_underscoreTests.ts:26:31: Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. - Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. - Type 'string | number | boolean' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. -!!! related TS2760 tests/cases/compiler/underscoreTest1_underscoreTests.ts:26:7: Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. - Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. - Index signature is missing in type '(string | number | boolean)[]'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. +!!! error TS2763: Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. +!!! error TS2763: Type 'string | number | boolean' is not assignable to type 'boolean'. +!!! error TS2763: Type 'string' is not assignable to type 'boolean'. +!!! error TS2763: Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. +!!! error TS2763: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. +!!! error TS2763: Index signature is missing in type '(string | number | boolean)[]'. _.any([null, 0, 'yes', false]); From 27b8c45522a17a31f2d45a6bc424242fa2a9a60e Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 1 Jul 2019 10:52:32 -0700 Subject: [PATCH 53/95] Update baselines --- ...nalNoInfiniteInstantiationDepth.errors.txt | 170 ++++++++---------- ...ferredInferenceAllowsAssignment.errors.txt | 170 ++++++++---------- 2 files changed, 152 insertions(+), 188 deletions(-) diff --git a/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt b/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt index 2c5fc84b37c..c7a323f1283 100644 --- a/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt +++ b/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt @@ -15,53 +15,44 @@ tests/cases/compiler/circularlyConstrainedMappedTypeContainingConditionalNoInfin Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. Type 'GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. Type 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'GetProps[Extract>] | GetProps[Extract>] | GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]) | GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] | GetProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & string] | GetProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>] | GetProps[Extract>] | GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]) | GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] | GetProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[string] | (TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. ==== tests/cases/compiler/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.ts (1 errors) ==== @@ -146,51 +137,42 @@ tests/cases/compiler/circularlyConstrainedMappedTypeContainingConditionalNoInfin !!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. !!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. !!! error TS2344: Type 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'GetProps[Extract>] | GetProps[Extract>] | GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]) | GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] | GetProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] | GetProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>] | GetProps[Extract>] | GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]) | GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] | GetProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[string] | (TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. \ No newline at end of file diff --git a/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.errors.txt b/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.errors.txt index 6267b5299ad..0556ae25c91 100644 --- a/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.errors.txt +++ b/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.errors.txt @@ -15,53 +15,44 @@ tests/cases/compiler/reactReduxLikeDeferredInferenceAllowsAssignment.ts(76,50): Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. Type 'GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. Type 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'GetProps[Extract>] | GetProps[Extract>] | GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]) | GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] | GetProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & string] | GetProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. - Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. - Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>] | GetProps[Extract>] | GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]) | GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] | GetProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[string] | (TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. ==== tests/cases/compiler/reactReduxLikeDeferredInferenceAllowsAssignment.ts (1 errors) ==== @@ -159,53 +150,44 @@ tests/cases/compiler/reactReduxLikeDeferredInferenceAllowsAssignment.ts(76,50): !!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. !!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. !!! error TS2344: Type 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'GetProps[Extract>] | GetProps[Extract>] | GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]) | GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] | GetProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] | GetProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. -!!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>] | GetProps[Extract>] | GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]) | GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] | GetProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[string] | (TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. >; declare const connect: { From ff81d5261e4c36407d8e14b1e250d25cdc4885fe Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 1 Jul 2019 13:13:44 -0700 Subject: [PATCH 54/95] Elide the exact node version rush complains about from the docker output (#32204) --- src/testRunner/externalCompileRunner.ts | 2 +- tests/baselines/reference/docker/azure-sdk.log | 2 +- tests/baselines/reference/docker/office-ui-fabric.log | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/testRunner/externalCompileRunner.ts b/src/testRunner/externalCompileRunner.ts index 1a027f975da..4be0d1a67ab 100644 --- a/src/testRunner/externalCompileRunner.ts +++ b/src/testRunner/externalCompileRunner.ts @@ -201,7 +201,7 @@ function sanitizeTimestamps(result: string): string { function sanitizeVersionSpecifiers(result: string): string { return result .replace(/\d+.\d+.\d+-insiders.\d\d\d\d\d\d\d\d/g, "X.X.X-insiders.xxxxxxxx") - .replace(/([@v])\d+\.\d+\.\d+/g, "$1X.X.X"); + .replace(/([@v\()])\d+\.\d+\.\d+/g, "$1X.X.X"); } /** diff --git a/tests/baselines/reference/docker/azure-sdk.log b/tests/baselines/reference/docker/azure-sdk.log index 0069c7e433e..011937533de 100644 --- a/tests/baselines/reference/docker/azure-sdk.log +++ b/tests/baselines/reference/docker/azure-sdk.log @@ -82,7 +82,7 @@ rush rebuild - Errors! ( ? seconds) Standard error: -Your version of Node.js (12.4.0) has not been tested with this release of Rush. The Rush team will not accept issue reports for it. Please consider upgrading Rush or downgrading Node.js. +Your version of Node.js (X.X.X) has not been tested with this release of Rush. The Rush team will not accept issue reports for it. Please consider upgrading Rush or downgrading Node.js. XX of XX: [@azure/service-bus] completed with warnings in ? seconds XX of XX: [@azure/core-amqp] failed to build! XX of XX: [@azure/event-hubs] blocked by [@azure/core-amqp]! diff --git a/tests/baselines/reference/docker/office-ui-fabric.log b/tests/baselines/reference/docker/office-ui-fabric.log index 3657e61b3be..f2b746a7e28 100644 --- a/tests/baselines/reference/docker/office-ui-fabric.log +++ b/tests/baselines/reference/docker/office-ui-fabric.log @@ -311,7 +311,7 @@ rush rebuild - Errors! ( ? seconds) Standard error: -Your version of Node.js (12.4.0) has not been tested with this release of Rush. The Rush team will not accept issue reports for it. Please consider upgrading Rush or downgrading Node.js. +Your version of Node.js (X.X.X) has not been tested with this release of Rush. The Rush team will not accept issue reports for it. Please consider upgrading Rush or downgrading Node.js. XX of XX: [@uifabric/codepen-loader] completed with warnings in ? seconds XX of XX: [@uifabric/set-version] completed with warnings in ? seconds XX of XX: [@uifabric/merge-styles] completed with warnings in ? seconds From c91e147ddaa49850e8e8199da7b92bad623a50e4 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 1 Jul 2019 13:15:21 -0700 Subject: [PATCH 55/95] Update user baselines (#32195) --- tests/baselines/reference/user/assert.log | 3 +- .../user/chrome-devtools-frontend.log | 12 ++++--- tests/baselines/reference/user/lodash.log | 36 ++++++++++++------- tests/baselines/reference/user/prettier.log | 4 ++- tests/baselines/reference/user/puppeteer.log | 3 +- tests/baselines/reference/user/uglify-js.log | 4 ++- 6 files changed, 42 insertions(+), 20 deletions(-) diff --git a/tests/baselines/reference/user/assert.log b/tests/baselines/reference/user/assert.log index 3870753f663..223098ee682 100644 --- a/tests/baselines/reference/user/assert.log +++ b/tests/baselines/reference/user/assert.log @@ -14,7 +14,8 @@ node_modules/assert/test.js(141,10): error TS2339: Property 'b' does not exist o node_modules/assert/test.js(142,10): error TS2339: Property 'b' does not exist on type 'number[]'. node_modules/assert/test.js(143,10): error TS2339: Property 'a' does not exist on type 'number[]'. node_modules/assert/test.js(149,5): error TS2552: Cannot find name 'test'. Did you mean 'tests'? -node_modules/assert/test.js(157,51): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'never' has no compatible call signatures. +node_modules/assert/test.js(157,51): error TS2349: This expression is not callable. + Type 'never' has no call signatures. node_modules/assert/test.js(161,5): error TS2552: Cannot find name 'test'. Did you mean 'tests'? node_modules/assert/test.js(168,5): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig. node_modules/assert/test.js(182,5): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig. diff --git a/tests/baselines/reference/user/chrome-devtools-frontend.log b/tests/baselines/reference/user/chrome-devtools-frontend.log index bd6fd45ac22..d298b174de0 100644 --- a/tests/baselines/reference/user/chrome-devtools-frontend.log +++ b/tests/baselines/reference/user/chrome-devtools-frontend.log @@ -28,7 +28,8 @@ node_modules/chrome-devtools-frontend/front_end/Runtime.js(280,5): error TS2322: node_modules/chrome-devtools-frontend/front_end/Runtime.js(283,12): error TS2554: Expected 2-3 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/Runtime.js(527,49): error TS2352: Conversion of type 'Window' to type 'new () => any' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Type 'Window' provides no match for the signature 'new (): any'. -node_modules/chrome-devtools-frontend/front_end/Runtime.js(539,20): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +node_modules/chrome-devtools-frontend/front_end/Runtime.js(539,24): error TS2351: This expression is not constructable. + Type 'Function' has no construct signatures. node_modules/chrome-devtools-frontend/front_end/Runtime.js(693,7): error TS2322: Type 'Promise' is not assignable to type 'Promise'. Type 'boolean' is not assignable to type 'undefined'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(705,5): error TS2322: Type 'Promise' is not assignable to type 'Promise'. @@ -6104,7 +6105,8 @@ node_modules/chrome-devtools-frontend/front_end/event_listeners/EventListenersUt node_modules/chrome-devtools-frontend/front_end/event_listeners/EventListenersUtils.js(295,16): error TS2339: Property 'devtoolsFrameworkEventListeners' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/event_listeners/EventListenersUtils.js(295,68): error TS2339: Property 'devtoolsFrameworkEventListeners' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/event_listeners/EventListenersUtils.js(296,41): error TS2339: Property 'devtoolsFrameworkEventListeners' does not exist on type 'Window'. -node_modules/chrome-devtools-frontend/front_end/event_listeners/EventListenersUtils.js(306,37): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]) | ((callbackfn: (value: { handler: any; useCapture: boolean; passive: boolean; once: boolean; type: string; }, index: number, array: { ...; }[]) => U, thisArg?: any) => U[])' has no compatible call signatures. +node_modules/chrome-devtools-frontend/front_end/event_listeners/EventListenersUtils.js(306,66): error TS2349: This expression is not callable. + Each member of the union type '((callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]) | ((callbackfn: (value: { handler: any; useCapture: boolean; passive: boolean; once: boolean; type: string; }, index: number, array: { ...; }[]) => U, thisArg?: any) => U[])' has signatures, but none of those signatures are compatible with each other. node_modules/chrome-devtools-frontend/front_end/event_listeners/EventListenersUtils.js(324,5): error TS2741: Property 'internalHandlers' is missing in type '{ eventListeners: any[]; }' but required in type '{ eventListeners: any[]; internalHandlers: (() => any)[]; }'. node_modules/chrome-devtools-frontend/front_end/event_listeners/EventListenersUtils.js(345,33): error TS2694: Namespace 'EventListeners' has no exported member 'EventListenerObjectInInspectedPage'. node_modules/chrome-devtools-frontend/front_end/event_listeners/EventListenersUtils.js(420,32): error TS2352: Conversion of type '{ fn: any; data: any; _data: any; }' to type '(arg0: Node) => any' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. @@ -8941,7 +8943,8 @@ node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(131, Property '_populated' does not exist on type 'ProfileDataGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(133,15): error TS2339: Property '_populated' does not exist on type 'ProfileDataGridNode | ProfileDataGridTree'. Property '_populated' does not exist on type 'ProfileDataGridNode'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(140,7): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((comparator: (arg0: T, arg1: T) => any, force: boolean) => any) | ((comparator: (arg0: T, arg1: T) => any, force: boolean) => void)' has no compatible call signatures. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(140,17): error TS2349: This expression is not callable. + Each member of the union type '((comparator: (arg0: T, arg1: T) => any, force: boolean) => any) | ((comparator: (arg0: T, arg1: T) => any, force: boolean) => void)' has signatures, but none of those signatures are compatible with each other. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(153,49): error TS2339: Property '_searchMatchedSelfColumn' does not exist on type 'ProfileDataGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(158,49): error TS2339: Property '_searchMatchedTotalColumn' does not exist on type 'ProfileDataGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(163,49): error TS2339: Property '_searchMatchedFunctionColumn' does not exist on type 'ProfileDataGridNode'. @@ -10085,7 +10088,8 @@ node_modules/chrome-devtools-frontend/front_end/sdk/NetworkManager.js(955,42): e node_modules/chrome-devtools-frontend/front_end/sdk/NetworkManager.js(976,41): error TS2694: Namespace 'SDK.NetworkManager' has no exported member 'BlockedPattern'. node_modules/chrome-devtools-frontend/front_end/sdk/NetworkManager.js(1019,52): error TS2694: Namespace 'SDK.MultitargetNetworkManager' has no exported member 'InterceptionPattern'. node_modules/chrome-devtools-frontend/front_end/sdk/NetworkManager.js(1020,45): error TS2694: Namespace 'SDK.MultitargetNetworkManager' has no exported member 'RequestInterceptor'. -node_modules/chrome-devtools-frontend/front_end/sdk/NetworkManager.js(1060,13): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures. +node_modules/chrome-devtools-frontend/front_end/sdk/NetworkManager.js(1060,13): error TS2349: This expression is not callable. + Type '{}' has no call signatures. node_modules/chrome-devtools-frontend/front_end/sdk/NetworkManager.js(1084,19): error TS2339: Property 'networkAgent' does not exist on type 'Target'. node_modules/chrome-devtools-frontend/front_end/sdk/NetworkManager.js(1089,14): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. node_modules/chrome-devtools-frontend/front_end/sdk/NetworkManager.js(1101,35): error TS2345: Argument of type '{}' is not assignable to parameter of type '{ [x: string]: string; }'. diff --git a/tests/baselines/reference/user/lodash.log b/tests/baselines/reference/user/lodash.log index 18428758c6f..4ff6cd2fa20 100644 --- a/tests/baselines/reference/user/lodash.log +++ b/tests/baselines/reference/user/lodash.log @@ -37,7 +37,8 @@ node_modules/lodash/_baseDifference.js(43,5): error TS2740: Type 'SetCache' is m node_modules/lodash/_baseDifference.js(60,42): error TS2554: Expected 2 arguments, but got 3. node_modules/lodash/_baseFlatten.js(19,29): error TS2322: Type '(value: any) => boolean' is not assignable to type 'boolean | undefined'. Type '(value: any) => boolean' is not assignable to type 'true'. -node_modules/lodash/_baseFlatten.js(24,22): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Boolean' has no compatible call signatures. +node_modules/lodash/_baseFlatten.js(24,22): error TS2349: This expression is not callable. + Type 'Boolean' has no call signatures. node_modules/lodash/_baseFlatten.js(24,22): error TS2532: Object is possibly 'undefined'. node_modules/lodash/_baseFlatten.js(24,22): error TS2722: Cannot invoke an object which is possibly 'undefined'. node_modules/lodash/_baseHas.js(16,56): error TS2345: Argument of type 'string | any[]' is not assignable to parameter of type 'string | number | symbol'. @@ -76,7 +77,8 @@ node_modules/lodash/_baseUniq.js(33,43): error TS2554: Expected 0 arguments, but node_modules/lodash/_baseUniq.js(39,5): error TS2322: Type 'SetCache' is not assignable to type 'any[]'. node_modules/lodash/_baseUniq.js(62,40): error TS2554: Expected 2 arguments, but got 3. node_modules/lodash/_baseWrapperValue.js(18,21): error TS2339: Property 'value' does not exist on type 'LazyWrapper'. -node_modules/lodash/_cloneArrayBuffer.js(11,16): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +node_modules/lodash/_cloneArrayBuffer.js(11,20): error TS2351: This expression is not constructable. + Type 'Function' has no construct signatures. node_modules/lodash/_cloneBuffer.js(4,69): error TS2339: Property 'nodeType' does not exist on type '(buffer: any, isDeep?: boolean | undefined) => any'. node_modules/lodash/_cloneBuffer.js(7,80): error TS2339: Property 'nodeType' does not exist on type '{ "../../../tests/cases/user/lodash/node_modules/lodash/_cloneBuffer": (buffer: any, isDeep?: boolean | undefined) => any; }'. node_modules/lodash/_cloneBuffer.js(22,14): error TS2577: Return type annotation circularly references itself. @@ -85,14 +87,22 @@ node_modules/lodash/_copySymbols.js(13,40): error TS2554: Expected 0 arguments, node_modules/lodash/_copySymbolsIn.js(13,42): error TS2554: Expected 0 arguments, but got 1. node_modules/lodash/_createAggregator.js(19,60): error TS2554: Expected 0-1 arguments, but got 2. node_modules/lodash/_createCompounder.js(20,24): error TS2554: Expected 3 arguments, but got 1. -node_modules/lodash/_createCtor.js(19,22): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -node_modules/lodash/_createCtor.js(20,22): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -node_modules/lodash/_createCtor.js(21,22): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -node_modules/lodash/_createCtor.js(22,22): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -node_modules/lodash/_createCtor.js(23,22): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -node_modules/lodash/_createCtor.js(24,22): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -node_modules/lodash/_createCtor.js(25,22): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -node_modules/lodash/_createCtor.js(26,22): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +node_modules/lodash/_createCtor.js(19,26): error TS2351: This expression is not constructable. + Type 'Function' has no construct signatures. +node_modules/lodash/_createCtor.js(20,26): error TS2351: This expression is not constructable. + Type 'Function' has no construct signatures. +node_modules/lodash/_createCtor.js(21,26): error TS2351: This expression is not constructable. + Type 'Function' has no construct signatures. +node_modules/lodash/_createCtor.js(22,26): error TS2351: This expression is not constructable. + Type 'Function' has no construct signatures. +node_modules/lodash/_createCtor.js(23,26): error TS2351: This expression is not constructable. + Type 'Function' has no construct signatures. +node_modules/lodash/_createCtor.js(24,26): error TS2351: This expression is not constructable. + Type 'Function' has no construct signatures. +node_modules/lodash/_createCtor.js(25,26): error TS2351: This expression is not constructable. + Type 'Function' has no construct signatures. +node_modules/lodash/_createCtor.js(26,26): error TS2351: This expression is not constructable. + Type 'Function' has no construct signatures. node_modules/lodash/_createCurry.js(37,46): error TS2339: Property 'placeholder' does not exist on type '(...args: any[]) => any'. node_modules/lodash/_createFind.js(16,46): error TS2554: Expected 0-1 arguments, but got 2. node_modules/lodash/_createFind.js(21,34): error TS2454: Variable 'iteratee' is used before being assigned. @@ -143,7 +153,8 @@ node_modules/lodash/_getRawTag.js(36,7): error TS2454: Variable 'unmasked' is us node_modules/lodash/_getSymbolsIn.js(19,34): error TS2554: Expected 0 arguments, but got 1. node_modules/lodash/_hasPath.js(35,50): error TS2454: Variable 'key' is used before being assigned. node_modules/lodash/_hashDelete.js(7,20): error TS8024: JSDoc '@param' tag has name 'hash', but there is no parameter with that name. -node_modules/lodash/_initCloneArray.js(16,16): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +node_modules/lodash/_initCloneArray.js(16,20): error TS2351: This expression is not constructable. + Type 'Function' has no construct signatures. node_modules/lodash/_initCloneArray.js(20,26): error TS2339: Property 'index' does not exist on type 'any[]'. node_modules/lodash/_initCloneArray.js(21,26): error TS2339: Property 'input' does not exist on type 'any[]'. node_modules/lodash/_insertWrapDetails.js(10,5): error TS1223: 'returns' tag already specified. @@ -190,7 +201,8 @@ node_modules/lodash/core.js(68,58): error TS2339: Property 'Object' does not exi node_modules/lodash/core.js(77,82): error TS2339: Property 'nodeType' does not exist on type 'NodeModule'. node_modules/lodash/core.js(540,31): error TS2322: Type '(value: any) => boolean' is not assignable to type 'boolean | undefined'. Type '(value: any) => boolean' is not assignable to type 'true'. -node_modules/lodash/core.js(545,24): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Boolean' has no compatible call signatures. +node_modules/lodash/core.js(545,24): error TS2349: This expression is not callable. + Type 'Boolean' has no call signatures. node_modules/lodash/core.js(545,24): error TS2532: Object is possibly 'undefined'. node_modules/lodash/core.js(545,24): error TS2722: Cannot invoke an object which is possibly 'undefined'. node_modules/lodash/core.js(664,42): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. diff --git a/tests/baselines/reference/user/prettier.log b/tests/baselines/reference/user/prettier.log index 6ee6e91cb6b..c69f88a4a78 100644 --- a/tests/baselines/reference/user/prettier.log +++ b/tests/baselines/reference/user/prettier.log @@ -81,7 +81,9 @@ src/language-html/ast.js(90,17): error TS2339: Property 'namespace' does not exi src/language-html/ast.js(90,34): error TS2339: Property 'namespace' does not exist on type 'Node'. src/language-html/ast.js(90,57): error TS2339: Property 'name' does not exist on type 'Node'. src/language-html/ast.js(90,69): error TS2339: Property 'name' does not exist on type 'Node'. -src/language-html/conditional-comment.js(23,16): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'RegExp | ((node: any) => { type: string; sourceSpan: any; })' has no compatible call signatures. +src/language-html/conditional-comment.js(23,16): error TS2349: This expression is not callable. + Not all constituents of type 'RegExp | ((node: any) => { type: string; sourceSpan: any; })' are callable. + Type 'RegExp' has no call signatures. src/language-html/index.js(8,26): error TS2307: Cannot find module 'linguist-languages/data/html'. src/language-html/index.js(8,59): error TS2345: Argument of type '{ override: { name: string; since: string; parsers: string[]; vscodeLanguageIds: string[]; extensions: string[]; filenames: never[]; }; }' is not assignable to parameter of type '{ extend: any; override: any; }'. Property 'extend' is missing in type '{ override: { name: string; since: string; parsers: string[]; vscodeLanguageIds: string[]; extensions: string[]; filenames: never[]; }; }' but required in type '{ extend: any; override: any; }'. diff --git a/tests/baselines/reference/user/puppeteer.log b/tests/baselines/reference/user/puppeteer.log index 6aa8c77000a..b60877f29ad 100644 --- a/tests/baselines/reference/user/puppeteer.log +++ b/tests/baselines/reference/user/puppeteer.log @@ -58,7 +58,8 @@ lib/Page.js(189,15): error TS2503: Cannot find namespace 'Protocol'. lib/Page.js(284,15): error TS2503: Cannot find namespace 'Protocol'. lib/Page.js(369,20): error TS2503: Cannot find namespace 'Protocol'. lib/Page.js(432,7): error TS2740: Type '(...args: any[]) => Promise' is missing the following properties from type 'Window': Blob, TextDecoder, TextEncoder, URL, and 232 more. -lib/Page.js(442,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Window' has no compatible call signatures. +lib/Page.js(442,9): error TS2349: This expression is not callable. + Type 'Window' has no call signatures. lib/Page.js(478,15): error TS2503: Cannot find namespace 'Protocol'. lib/Page.js(488,22): error TS2503: Cannot find namespace 'Protocol'. lib/Page.js(501,15): error TS2503: Cannot find namespace 'Protocol'. diff --git a/tests/baselines/reference/user/uglify-js.log b/tests/baselines/reference/user/uglify-js.log index 9b8f9ce9ed0..a01073ce3a2 100644 --- a/tests/baselines/reference/user/uglify-js.log +++ b/tests/baselines/reference/user/uglify-js.log @@ -11,7 +11,9 @@ node_modules/uglify-js/lib/compress.js(184,42): error TS2554: Expected 0 argumen node_modules/uglify-js/lib/compress.js(535,41): error TS2554: Expected 0 arguments, but got 1. node_modules/uglify-js/lib/compress.js(861,33): error TS2554: Expected 0 arguments, but got 1. node_modules/uglify-js/lib/compress.js(1121,38): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. -node_modules/uglify-js/lib/compress.js(1135,51): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'true | ((node: any) => any)' has no compatible call signatures. +node_modules/uglify-js/lib/compress.js(1135,51): error TS2349: This expression is not callable. + Not all constituents of type 'true | ((node: any) => any)' are callable. + Type 'true' has no call signatures. node_modules/uglify-js/lib/compress.js(1199,53): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. node_modules/uglify-js/lib/compress.js(1240,112): error TS2454: Variable 'args' is used before being assigned. node_modules/uglify-js/lib/compress.js(1241,29): error TS2532: Object is possibly 'undefined'. From 3765651d826a504bc80b3a69024c0d9a25e7e114 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 1 Jul 2019 13:39:18 -0700 Subject: [PATCH 56/95] Fix not emitted statement in then clauses producing syntactically invalid output (#32010) * Fix not emitted statement in then clauses producing syntactically invalid output * Refactor to common code, apply to all embedded statements --- src/compiler/factory.ts | 24 +++++---- tests/baselines/reference/constEnum4.js | 3 ++ ...EmbeddedStatementsReplacedWithSemicolon.js | 47 +++++++++++++++++ ...dedStatementsReplacedWithSemicolon.symbols | 40 +++++++++++++++ ...eddedStatementsReplacedWithSemicolon.types | 51 +++++++++++++++++++ .../reference/labeledStatementWithLabel.js | 6 +-- .../labeledStatementWithLabel_es2015.js | 6 +-- .../labeledStatementWithLabel_strict.js | 6 +-- ...EmbeddedStatementsReplacedWithSemicolon.ts | 24 +++++++++ 9 files changed, 189 insertions(+), 18 deletions(-) create mode 100644 tests/baselines/reference/elidedEmbeddedStatementsReplacedWithSemicolon.js create mode 100644 tests/baselines/reference/elidedEmbeddedStatementsReplacedWithSemicolon.symbols create mode 100644 tests/baselines/reference/elidedEmbeddedStatementsReplacedWithSemicolon.types create mode 100644 tests/cases/compiler/elidedEmbeddedStatementsReplacedWithSemicolon.ts diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index f67ec39b0a4..f88950f531a 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -1544,8 +1544,8 @@ namespace ts { export function createIf(expression: Expression, thenStatement: Statement, elseStatement?: Statement) { const node = createSynthesizedNode(SyntaxKind.IfStatement); node.expression = expression; - node.thenStatement = thenStatement; - node.elseStatement = elseStatement; + node.thenStatement = asEmbeddedStatement(thenStatement); + node.elseStatement = asEmbeddedStatement(elseStatement); return node; } @@ -1559,7 +1559,7 @@ namespace ts { export function createDo(statement: Statement, expression: Expression) { const node = createSynthesizedNode(SyntaxKind.DoStatement); - node.statement = statement; + node.statement = asEmbeddedStatement(statement); node.expression = expression; return node; } @@ -1574,7 +1574,7 @@ namespace ts { export function createWhile(expression: Expression, statement: Statement) { const node = createSynthesizedNode(SyntaxKind.WhileStatement); node.expression = expression; - node.statement = statement; + node.statement = asEmbeddedStatement(statement); return node; } @@ -1590,7 +1590,7 @@ namespace ts { node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; - node.statement = statement; + node.statement = asEmbeddedStatement(statement); return node; } @@ -1607,7 +1607,7 @@ namespace ts { const node = createSynthesizedNode(SyntaxKind.ForInStatement); node.initializer = initializer; node.expression = expression; - node.statement = statement; + node.statement = asEmbeddedStatement(statement); return node; } @@ -1624,7 +1624,7 @@ namespace ts { node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = expression; - node.statement = statement; + node.statement = asEmbeddedStatement(statement); return node; } @@ -1676,7 +1676,7 @@ namespace ts { export function createWith(expression: Expression, statement: Statement) { const node = createSynthesizedNode(SyntaxKind.WithStatement); node.expression = expression; - node.statement = statement; + node.statement = asEmbeddedStatement(statement); return node; } @@ -1704,7 +1704,7 @@ namespace ts { export function createLabel(label: string | Identifier, statement: Statement) { const node = createSynthesizedNode(SyntaxKind.LabeledStatement); node.label = asName(label); - node.statement = statement; + node.statement = asEmbeddedStatement(statement); return node; } @@ -3080,6 +3080,12 @@ namespace ts { return typeof value === "number" ? createToken(value) : value; } + function asEmbeddedStatement(statement: T): T | EmptyStatement; + function asEmbeddedStatement(statement: T | undefined): T | EmptyStatement | undefined; + function asEmbeddedStatement(statement: T | undefined): T | EmptyStatement | undefined { + return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginalNode(createEmptyStatement(), statement), statement) : statement; + } + /** * Clears any EmitNode entries from parse-tree nodes. * @param sourceFile A source file. diff --git a/tests/baselines/reference/constEnum4.js b/tests/baselines/reference/constEnum4.js index dc7c4b0e593..3c70df17dd3 100644 --- a/tests/baselines/reference/constEnum4.js +++ b/tests/baselines/reference/constEnum4.js @@ -9,5 +9,8 @@ else //// [constEnum4.js] if (1) + ; else if (2) + ; else + ; diff --git a/tests/baselines/reference/elidedEmbeddedStatementsReplacedWithSemicolon.js b/tests/baselines/reference/elidedEmbeddedStatementsReplacedWithSemicolon.js new file mode 100644 index 00000000000..00ed2e49aa8 --- /dev/null +++ b/tests/baselines/reference/elidedEmbeddedStatementsReplacedWithSemicolon.js @@ -0,0 +1,47 @@ +//// [elidedEmbeddedStatementsReplacedWithSemicolon.ts] +if (1) + const enum A {} +else + const enum B {} + +do + const enum C {} +while (0); + +while (0) + const enum D {} + +for (;0;) + const enum E {} + +for (let _ in []) + const enum F {} + +for (let _ of []) + const enum G {} + +// @ts-ignore suppress `with` statement error +with (window) + const enum H {} + +//// [elidedEmbeddedStatementsReplacedWithSemicolon.js] +if (1) + ; +else + ; +do + ; +while (0); +while (0) + ; +for (; 0;) + ; +for (var _ in []) + ; +for (var _i = 0, _a = []; _i < _a.length; _i++) { + var _ = _a[_i]; + ; +} +// @ts-ignore suppress `with` statement error +with (window) + ; diff --git a/tests/baselines/reference/elidedEmbeddedStatementsReplacedWithSemicolon.symbols b/tests/baselines/reference/elidedEmbeddedStatementsReplacedWithSemicolon.symbols new file mode 100644 index 00000000000..e32425754f8 --- /dev/null +++ b/tests/baselines/reference/elidedEmbeddedStatementsReplacedWithSemicolon.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/elidedEmbeddedStatementsReplacedWithSemicolon.ts === +if (1) + const enum A {} +>A : Symbol(A, Decl(elidedEmbeddedStatementsReplacedWithSemicolon.ts, 0, 6)) + +else + const enum B {} +>B : Symbol(B, Decl(elidedEmbeddedStatementsReplacedWithSemicolon.ts, 2, 4)) + +do + const enum C {} +>C : Symbol(C, Decl(elidedEmbeddedStatementsReplacedWithSemicolon.ts, 5, 2)) + +while (0); + +while (0) + const enum D {} +>D : Symbol(D, Decl(elidedEmbeddedStatementsReplacedWithSemicolon.ts, 9, 9)) + +for (;0;) + const enum E {} +>E : Symbol(E, Decl(elidedEmbeddedStatementsReplacedWithSemicolon.ts, 12, 9)) + +for (let _ in []) +>_ : Symbol(_, Decl(elidedEmbeddedStatementsReplacedWithSemicolon.ts, 15, 8)) + + const enum F {} +>F : Symbol(F, Decl(elidedEmbeddedStatementsReplacedWithSemicolon.ts, 15, 17)) + +for (let _ of []) +>_ : Symbol(_, Decl(elidedEmbeddedStatementsReplacedWithSemicolon.ts, 18, 8)) + + const enum G {} +>G : Symbol(G, Decl(elidedEmbeddedStatementsReplacedWithSemicolon.ts, 18, 17)) + +// @ts-ignore suppress `with` statement error +with (window) +>window : Symbol(window, Decl(lib.dom.d.ts, --, --)) + + const enum H {} diff --git a/tests/baselines/reference/elidedEmbeddedStatementsReplacedWithSemicolon.types b/tests/baselines/reference/elidedEmbeddedStatementsReplacedWithSemicolon.types new file mode 100644 index 00000000000..2c4dc4daeb7 --- /dev/null +++ b/tests/baselines/reference/elidedEmbeddedStatementsReplacedWithSemicolon.types @@ -0,0 +1,51 @@ +=== tests/cases/compiler/elidedEmbeddedStatementsReplacedWithSemicolon.ts === +if (1) +>1 : 1 + + const enum A {} +>A : A + +else + const enum B {} +>B : B + +do + const enum C {} +>C : C + +while (0); +>0 : 0 + +while (0) +>0 : 0 + + const enum D {} +>D : D + +for (;0;) +>0 : 0 + + const enum E {} +>E : E + +for (let _ in []) +>_ : string +>[] : undefined[] + + const enum F {} +>F : F + +for (let _ of []) +>_ : any +>[] : undefined[] + + const enum G {} +>G : G + +// @ts-ignore suppress `with` statement error +with (window) +>window : Window + + const enum H {} +>H : error + diff --git a/tests/baselines/reference/labeledStatementWithLabel.js b/tests/baselines/reference/labeledStatementWithLabel.js index 4d5dc499e25..ada819c9908 100644 --- a/tests/baselines/reference/labeledStatementWithLabel.js +++ b/tests/baselines/reference/labeledStatementWithLabel.js @@ -64,7 +64,7 @@ label: { (function (E) { })(E || (E = {})); } -label: +label: ; label: { var C = /** @class */ (function () { function C() { @@ -75,6 +75,6 @@ label: { label: var a = 1; label: var b = 1; label: var c = 1; -label: -label: +label: ; +label: ; label: diff --git a/tests/baselines/reference/labeledStatementWithLabel_es2015.js b/tests/baselines/reference/labeledStatementWithLabel_es2015.js index e2eea4c53be..34ceb7bc17a 100644 --- a/tests/baselines/reference/labeledStatementWithLabel_es2015.js +++ b/tests/baselines/reference/labeledStatementWithLabel_es2015.js @@ -33,12 +33,12 @@ label: { (function (E) { })(E || (E = {})); } -label: +label: ; label: class C { } label: var a = 1; label: let b = 1; label: const c = 1; -label: -label: +label: ; +label: ; label: diff --git a/tests/baselines/reference/labeledStatementWithLabel_strict.js b/tests/baselines/reference/labeledStatementWithLabel_strict.js index c4ac2caed06..bcf211fdbfd 100644 --- a/tests/baselines/reference/labeledStatementWithLabel_strict.js +++ b/tests/baselines/reference/labeledStatementWithLabel_strict.js @@ -35,12 +35,12 @@ label: { (function (E) { })(E || (E = {})); } -label: +label: ; label: class C { } label: var a = 1; label: let b = 1; label: const c = 1; -label: -label: +label: ; +label: ; label: diff --git a/tests/cases/compiler/elidedEmbeddedStatementsReplacedWithSemicolon.ts b/tests/cases/compiler/elidedEmbeddedStatementsReplacedWithSemicolon.ts new file mode 100644 index 00000000000..dd9f6cc09f3 --- /dev/null +++ b/tests/cases/compiler/elidedEmbeddedStatementsReplacedWithSemicolon.ts @@ -0,0 +1,24 @@ +if (1) + const enum A {} +else + const enum B {} + +do + const enum C {} +while (0); + +while (0) + const enum D {} + +for (;0;) + const enum E {} + +for (let _ in []) + const enum F {} + +for (let _ of []) + const enum G {} + +// @ts-ignore suppress `with` statement error +with (window) + const enum H {} \ No newline at end of file From 055a07ea4aeef266e13e16bc5136f8b87cc0ee49 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 1 Jul 2019 14:15:30 -0700 Subject: [PATCH 57/95] Check for parse errors in emitted JS (#32009) --- src/harness/harness.ts | 7 +++++++ tests/baselines/reference/emitBOM.js | 16 ++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/harness/harness.ts b/src/harness/harness.ts index f03103d0239..c6842115095 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -1311,6 +1311,13 @@ namespace Harness { if (jsCode.length && jsCode.charCodeAt(jsCode.length - 1) !== ts.CharacterCodes.lineFeed) { jsCode += "\r\n"; } + if (!result.diagnostics.length && !ts.endsWith(file.file, ts.Extension.Json)) { + const fileParseResult = ts.createSourceFile(file.file, file.text, options.target || ts.ScriptTarget.ES3, /*parentNodes*/ false, ts.endsWith(file.file, "x") ? ts.ScriptKind.JSX : ts.ScriptKind.JS); + if (ts.length(fileParseResult.parseDiagnostics)) { + jsCode += getErrorBaseline([file.asTestFile()], fileParseResult.parseDiagnostics); + return; + } + } jsCode += fileOutput(file, harnessSettings); }); diff --git a/tests/baselines/reference/emitBOM.js b/tests/baselines/reference/emitBOM.js index 3f3d61fd2f9..2890ba0d81d 100644 --- a/tests/baselines/reference/emitBOM.js +++ b/tests/baselines/reference/emitBOM.js @@ -2,10 +2,18 @@ // JS and d.ts output should have a BOM but not the sourcemap var x; -//// [emitBOM.js] -// JS and d.ts output should have a BOM but not the sourcemap -var x; -//# sourceMappingURL=emitBOM.js.map +tests/cases/compiler/emitBOM.js(1,2): error TS1127: Invalid character. +tests/cases/compiler/emitBOM.js(1,3): error TS1127: Invalid character. + + +==== tests/cases/compiler/emitBOM.js (2 errors) ==== + // JS and d.ts output should have a BOM but not the sourcemap + +!!! error TS1127: Invalid character. + +!!! error TS1127: Invalid character. + var x; + //# sourceMappingURL=emitBOM.js.map //// [emitBOM.d.ts] declare var x: any; From 3e6856137ad2618dcdfe13ee49a06cca8e4d7ee2 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 1 Jul 2019 14:56:57 -0700 Subject: [PATCH 58/95] Add support for sharding tests across multiple workers (#32173) * Add support for sharding tests across multiple workers * Disable unittests when runners are expressly provided (unless they contain the unittest runner) --- Gulpfile.js | 4 ++++ scripts/build/options.js | 2 +- scripts/build/tests.js | 14 ++++++++++---- src/harness/harness.ts | 2 +- src/harness/runnerbase.ts | 11 +++++++++++ src/testRunner/externalCompileRunner.ts | 4 ++-- src/testRunner/parallel/host.ts | 2 +- src/testRunner/projectsRunner.ts | 6 +++++- src/testRunner/runner.ts | 11 +++++++++++ src/testRunner/rwcRunner.ts | 2 +- src/testRunner/test262Runner.ts | 2 +- 11 files changed, 48 insertions(+), 12 deletions(-) diff --git a/Gulpfile.js b/Gulpfile.js index a8f5748271d..42987e4fd8d 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -415,6 +415,8 @@ task("runtests").flags = { " --no-lint": "Disables lint", " --timeout=": "Overrides the default test timeout.", " --built": "Compile using the built version of the compiler.", + " --shards": "Total number of shards running tests (default: 1)", + " --shardId": "1-based ID of this shard (default: 1)", } const runTestsParallel = () => runConsoleTests("built/local/run.js", "min", /*runInParallel*/ true, /*watchMode*/ false); @@ -430,6 +432,8 @@ task("runtests-parallel").flags = { " --timeout=": "Overrides the default test timeout.", " --built": "Compile using the built version of the compiler.", " --skipPercent=": "Skip expensive tests with chance to miss an edit. Default 5%.", + " --shards": "Total number of shards running tests (default: 1)", + " --shardId": "1-based ID of this shard (default: 1)", }; task("diff", () => exec(getDiffTool(), [refBaseline, localBaseline], { ignoreExitCode: true })); diff --git a/scripts/build/options.js b/scripts/build/options.js index c93a265ff88..fecac01dd05 100644 --- a/scripts/build/options.js +++ b/scripts/build/options.js @@ -5,7 +5,7 @@ const os = require("os"); /** @type {CommandLineOptions} */ module.exports = minimist(process.argv.slice(2), { boolean: ["debug", "dirty", "inspect", "light", "colors", "lint", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built"], - string: ["browser", "tests", "host", "reporter", "stackTraceLimit", "timeout"], + string: ["browser", "tests", "host", "reporter", "stackTraceLimit", "timeout", "shards", "shardId"], alias: { "b": "browser", "d": "debug", "debug-brk": "debug", diff --git a/scripts/build/tests.js b/scripts/build/tests.js index a15eb17093d..20d2a4c7c2a 100644 --- a/scripts/build/tests.js +++ b/scripts/build/tests.js @@ -36,6 +36,8 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode, const testConfigFile = "test.config"; const failed = cmdLineOptions.failed; const keepFailed = cmdLineOptions.keepFailed; + const shards = +cmdLineOptions.shards || undefined; + const shardId = +cmdLineOptions.shardId || undefined; if (!cmdLineOptions.dirty) { await cleanTestDirs(); cancelToken.throwIfCancellationRequested(); @@ -63,8 +65,8 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode, testTimeout = 400000; } - if (tests || runners || light || testTimeout || taskConfigsFolder || keepFailed || skipPercent !== undefined) { - writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFolder, workerCount, stackTraceLimit, testTimeout, keepFailed); + if (tests || runners || light || testTimeout || taskConfigsFolder || keepFailed || skipPercent !== undefined || shards || shardId) { + writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFolder, workerCount, stackTraceLimit, testTimeout, keepFailed, shards, shardId); } const colors = cmdLineOptions.colors; @@ -165,8 +167,10 @@ exports.cleanTestDirs = cleanTestDirs; * @param {string} [stackTraceLimit] * @param {string | number} [timeout] * @param {boolean} [keepFailed] + * @param {number | undefined} [shards] + * @param {number | undefined} [shardId] */ -function writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFolder, workerCount, stackTraceLimit, timeout, keepFailed) { +function writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFolder, workerCount, stackTraceLimit, timeout, keepFailed, shards, shardId) { const testConfigContents = JSON.stringify({ test: tests ? [tests] : undefined, runners: runners ? runners.split(",") : undefined, @@ -177,7 +181,9 @@ function writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFold taskConfigsFolder, noColor: !cmdLineOptions.colors, timeout, - keepFailed + keepFailed, + shards, + shardId }); log.info("Running tests with config: " + testConfigContents); fs.writeFileSync("test.config", testConfigContents); diff --git a/src/harness/harness.ts b/src/harness/harness.ts index c6842115095..fe5ec344322 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -501,7 +501,7 @@ namespace Harness { } function enumerateTestFiles(runner: RunnerBase) { - return runner.enumerateTestFiles(); + return runner.getTestFiles(); } function listFiles(path: string, spec: RegExp, options: { recursive?: boolean } = {}) { diff --git a/src/harness/runnerbase.ts b/src/harness/runnerbase.ts index ce56772927e..70045c54c80 100644 --- a/src/harness/runnerbase.ts +++ b/src/harness/runnerbase.ts @@ -2,6 +2,9 @@ type TestRunnerKind = CompilerTestKind | FourslashTestKind | "project" | "rwc" | type CompilerTestKind = "conformance" | "compiler"; type FourslashTestKind = "fourslash" | "fourslash-shims" | "fourslash-shims-pp" | "fourslash-server"; +let shards = 1; +let shardId = 1; + abstract class RunnerBase { // contains the tests to run public tests: (string | Harness.FileBasedTest)[] = []; @@ -19,6 +22,14 @@ abstract class RunnerBase { abstract enumerateTestFiles(): (string | Harness.FileBasedTest)[]; + getTestFiles(): ReturnType { + const all = this.enumerateTestFiles(); + if (shards === 1) { + return all as ReturnType; + } + return all.filter((_val, idx) => idx % shards === (shardId - 1)) as ReturnType; + } + /** The working directory where tests are found. Needed for batch testing where the input path will differ from the output path inside baselines */ public workingDirectory = ""; diff --git a/src/testRunner/externalCompileRunner.ts b/src/testRunner/externalCompileRunner.ts index 4be0d1a67ab..dbe7bc5854f 100644 --- a/src/testRunner/externalCompileRunner.ts +++ b/src/testRunner/externalCompileRunner.ts @@ -24,7 +24,7 @@ abstract class ExternalCompileRunnerBase extends RunnerBase { */ initializeTests(): void { // Read in and evaluate the test list - const testList = this.tests && this.tests.length ? this.tests : this.enumerateTestFiles(); + const testList = this.tests && this.tests.length ? this.tests : this.getTestFiles(); // tslint:disable-next-line:no-this-assignment const cls = this; @@ -113,7 +113,7 @@ class DockerfileRunner extends ExternalCompileRunnerBase { } initializeTests(): void { // Read in and evaluate the test list - const testList = this.tests && this.tests.length ? this.tests : this.enumerateTestFiles(); + const testList = this.tests && this.tests.length ? this.tests : this.getTestFiles(); // tslint:disable-next-line:no-this-assignment const cls = this; diff --git a/src/testRunner/parallel/host.ts b/src/testRunner/parallel/host.ts index 7780cfbd646..ee66fd738b0 100644 --- a/src/testRunner/parallel/host.ts +++ b/src/testRunner/parallel/host.ts @@ -222,7 +222,7 @@ namespace Harness.Parallel.Host { console.log("Discovering runner-based tests..."); const discoverStart = +(new Date()); for (const runner of runners) { - for (const test of runner.enumerateTestFiles()) { + for (const test of runner.getTestFiles()) { const file = typeof test === "string" ? test : test.file; let size: number; if (!perfData) { diff --git a/src/testRunner/projectsRunner.ts b/src/testRunner/projectsRunner.ts index f4e51afab4c..ea8efd838d4 100644 --- a/src/testRunner/projectsRunner.ts +++ b/src/testRunner/projectsRunner.ts @@ -32,7 +32,11 @@ namespace project { export class ProjectRunner extends RunnerBase { public enumerateTestFiles() { - return this.enumerateFiles("tests/cases/project", /\.json$/, { recursive: true }); + const all = this.enumerateFiles("tests/cases/project", /\.json$/, { recursive: true }); + if (shards === 1) { + return all; + } + return all.filter((_val, idx) => idx % shards === (shardId - 1)); } public kind(): TestRunnerKind { diff --git a/src/testRunner/runner.ts b/src/testRunner/runner.ts index 685937196cb..3532f972230 100644 --- a/src/testRunner/runner.ts +++ b/src/testRunner/runner.ts @@ -80,6 +80,8 @@ interface TestConfig { timeout?: number; keepFailed?: boolean; skipPercent?: number; + shardId?: number; + shards?: number; } interface TaskSet { @@ -114,6 +116,12 @@ function handleTestConfig() { if (testConfig.skipPercent !== undefined) { skipPercent = testConfig.skipPercent; } + if (testConfig.shardId) { + shardId = testConfig.shardId; + } + if (testConfig.shards) { + shards = testConfig.shards; + } if (testConfig.stackTraceLimit === "full") { (Error).stackTraceLimit = Infinity; @@ -129,6 +137,9 @@ function handleTestConfig() { const runnerConfig = testConfig.runners || testConfig.test; if (runnerConfig && runnerConfig.length > 0) { + if (testConfig.runners) { + runUnitTests = runnerConfig.indexOf("unittest") !== -1; + } for (const option of runnerConfig) { if (!option) { continue; diff --git a/src/testRunner/rwcRunner.ts b/src/testRunner/rwcRunner.ts index 729ed167fff..b510b98668a 100644 --- a/src/testRunner/rwcRunner.ts +++ b/src/testRunner/rwcRunner.ts @@ -225,7 +225,7 @@ class RWCRunner extends RunnerBase { */ public initializeTests(): void { // Read in and evaluate the test list - for (const test of this.tests && this.tests.length ? this.tests : this.enumerateTestFiles()) { + for (const test of this.tests && this.tests.length ? this.tests : this.getTestFiles()) { this.runTest(typeof test === "string" ? test : test.file); } } diff --git a/src/testRunner/test262Runner.ts b/src/testRunner/test262Runner.ts index 3edb065b325..c435c3e23ca 100644 --- a/src/testRunner/test262Runner.ts +++ b/src/testRunner/test262Runner.ts @@ -97,7 +97,7 @@ class Test262BaselineRunner extends RunnerBase { public initializeTests() { // this will set up a series of describe/it blocks to run between the setup and cleanup phases if (this.tests.length === 0) { - const testFiles = this.enumerateTestFiles(); + const testFiles = this.getTestFiles(); testFiles.forEach(fn => { this.runTest(fn); }); From f139455229d0789cd79a433cd5fd07bcc30a1f52 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 1 Jul 2019 15:06:16 -0700 Subject: [PATCH 59/95] Address PR comments --- src/compiler/checker.ts | 8 ++-- src/compiler/utilities.ts | 43 ++++--------------- .../reference/functionOverloads40.errors.txt | 2 + .../reference/functionOverloads41.errors.txt | 2 + .../overloadResolutionTest1.errors.txt | 8 +++- ...nWithConstraintCheckingDeferred.errors.txt | 2 + .../overloadsWithProvisionalErrors.errors.txt | 3 ++ .../reference/promiseTypeInference.errors.txt | 3 ++ ...elessFunctionComponentOverload4.errors.txt | 13 ++++++ ...elessFunctionComponentOverload5.errors.txt | 11 ++++- ...ionComponentsWithTypeArguments4.errors.txt | 4 ++ 11 files changed, 58 insertions(+), 41 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index eeb72f42df8..b0fb305d317 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21693,10 +21693,10 @@ namespace ts { i++; } - const related = map( - max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics), - d => typeof d.messageText === "string" ? (d as DiagnosticMessageChain) : d.messageText); - diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(related, Diagnostics.No_overload_matches_this_call))); + const diags = max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics); + const chain = map(diags, d => typeof d.messageText === "string" ? (d as DiagnosticMessageChain) : d.messageText); + const related = flatMap(diags, d => (d as Diagnostic).relatedInformation) as DiagnosticRelatedInformation[]; + diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(chain, Diagnostics.No_overload_matches_this_call), related)); } } else if (candidateForArgumentArityError) { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 56f11078fc0..33c75a05fce 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -7170,36 +7170,6 @@ namespace ts { return d1.relatedInformation ? Comparison.LessThan : Comparison.GreaterThan; } - // function compareMessageText(t1: string | DiagnosticMessageChain[], t2: string | DiagnosticMessageChain[]): Comparison { - // if (typeof t1 === 'string' && typeof t2 === 'string') { - // return compareStringsCaseSensitive(t1, t2) - // } - // else if (Array.isArray(t1) && Array.isArray(t2)) { - // if (t1.length < t2.length) { - // return Comparison.LessThan; - // } - // else if (t1.length > t2.length) { - // return Comparison.GreaterThan; - // } - // else { - // for (let i = 0; i < t1.length; i++) { - // t1[i].messageText - // const res = cmps(t1[i], t2[i]); - // if (res) { - // return res; - // } - // } - // return Comparison.EqualTo; - // } - // } - // else if (typeof t1 === 'string') { - // return Comparison.LessThan; - // } - // else { - // return Comparison.GreaterThan; - // } - // } - function compareMessageText(t1: string | DiagnosticMessageChain, t2: string | DiagnosticMessageChain): Comparison { if (typeof t1 === "string" && typeof t2 === "string") { return compareStringsCaseSensitive(t1, t2); @@ -7223,16 +7193,19 @@ namespace ts { if (!t2.next) { return Comparison.GreaterThan; } - res = compareValues(t1.next.length, t2.next.length); - if (res) { - return res; - } - for (let i = 0; i < t1.next.length; i++) { + const len = Math.min(t1.next.length, t2.next.length); + for (let i = 0; i < len; i++) { res = compareMessageText(t1.next[i], t2.next[i]); if (res) { return res; } } + if (t1.next.length < t2.next.length) { + return Comparison.LessThan; + } + else if (t1.next.length > t2.next.length) { + return Comparison.GreaterThan; + } return Comparison.EqualTo; } diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index e3e7d3a25e7..ecfda613f8b 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -16,4 +16,6 @@ tests/cases/compiler/functionOverloads40.ts(4,9): error TS2763: No overload matc !!! error TS2763: Type 'string' is not assignable to type 'number'. !!! error TS2763: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. !!! error TS2763: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/compiler/functionOverloads40.ts:1:19: The expected type comes from property 'a' which is declared here on type '{ a: number; }' +!!! related TS6500 tests/cases/compiler/functionOverloads40.ts:2:19: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads41.errors.txt b/tests/baselines/reference/functionOverloads41.errors.txt index f475095fdb9..1ae82358453 100644 --- a/tests/baselines/reference/functionOverloads41.errors.txt +++ b/tests/baselines/reference/functionOverloads41.errors.txt @@ -16,4 +16,6 @@ tests/cases/compiler/functionOverloads41.ts(4,9): error TS2763: No overload matc !!! error TS2763: Property 'a' is missing in type '{}' but required in type '{ a: number; }'. !!! error TS2763: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. !!! error TS2763: Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. +!!! related TS2728 tests/cases/compiler/functionOverloads41.ts:1:19: 'a' is declared here. +!!! related TS2728 tests/cases/compiler/functionOverloads41.ts:2:19: 'a' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index ad3b6779be5..a3e0a1c26a9 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -29,6 +29,8 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2763: No overload !!! error TS2763: Type 'string' is not assignable to type 'number'. !!! error TS2763: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. !!! error TS2763: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:1:19: The expected type comes from property 'a' which is declared here on type '{ a: number; }' +!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:2:19: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string @@ -46,6 +48,8 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2763: No overload !!! error TS2763: Type 'string' is not assignable to type 'number'. !!! error TS2763: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. !!! error TS2763: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:12:20: The expected type comes from property 'a' which is declared here on type '{ a: number; }' +!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:13:20: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' function foo4(bar:{a:number;}):number; @@ -57,4 +61,6 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2763: No overload !!! error TS2763: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. !!! error TS2763: Type 'true' is not assignable to type 'number'. !!! error TS2763: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. -!!! error TS2763: Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:21:20: The expected type comes from property 'a' which is declared here on type '{ a: number; }' +!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:22:20: The expected type comes from property 'a' which is declared here on type '{ a: string; }' \ No newline at end of file diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt index e6f568f0d29..8e9d1136547 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -68,4 +68,6 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): !!! error TS2763: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. !!! error TS2763: Types of parameters 'x' and 'x' are incompatible. !!! error TS2763: Property 'q' is missing in type 'B' but required in type 'D'. +!!! related TS2728 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. +!!! related TS2728 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt index 0c9a607b13c..a806a1ddf82 100644 --- a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt @@ -25,6 +25,7 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cann !!! error TS2763: Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. !!! error TS2763: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. !!! error TS2763: Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b +!!! related TS6502 tests/cases/compiler/overloadsWithProvisionalErrors.ts:3:14: The expected type comes from the return type of this signature. func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) ~~~~ !!! error TS2304: Cannot find name 'blah'. @@ -35,5 +36,7 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cann !!! error TS2763: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. !!! error TS2763: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. !!! error TS2763: Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. +!!! related TS2728 tests/cases/compiler/overloadsWithProvisionalErrors.ts:3:42: 'b' is declared here. +!!! related TS6502 tests/cases/compiler/overloadsWithProvisionalErrors.ts:3:14: The expected type comes from the return type of this signature. ~~~~ !!! error TS2304: Cannot find name 'blah'. \ No newline at end of file diff --git a/tests/baselines/reference/promiseTypeInference.errors.txt b/tests/baselines/reference/promiseTypeInference.errors.txt index 9207b909984..d08c33a3957 100644 --- a/tests/baselines/reference/promiseTypeInference.errors.txt +++ b/tests/baselines/reference/promiseTypeInference.errors.txt @@ -34,4 +34,7 @@ tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2763: No overload m !!! error TS2763: Types of parameters 'success' and 'onfulfilled' are incompatible. !!! error TS2763: Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. !!! error TS2763: Type 'TResult1' is not assignable to type 'IPromise'. +!!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. +!!! related TS6502 tests/cases/compiler/promiseTypeInference.ts:2:23: The expected type comes from the return type of this signature. +!!! related TS6502 /.ts/lib.es5.d.ts:1406:57: The expected type comes from the return type of this signature. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt index c9f17da6254..9fc44f4dc8c 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt @@ -105,6 +105,7 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches t !!! error TS2763: Property 'yy' does not exist on type 'IntrinsicAttributes'. !!! error TS2763: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. !!! error TS2763: Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:3:43: 'yy1' is declared here. const c2 = ; // type incompatible; ~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2763: No overload matches this call. @@ -113,6 +114,7 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches t !!! error TS2763: Property 'yy1' does not exist on type 'IntrinsicAttributes'. !!! error TS2763: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. !!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:43: The expected type comes from property 'yy1' which is declared here on type 'IntrinsicAttributes & { yy: number; yy1: string; }' const c3 = ; // This is OK becuase all attribute are spread const c4 = ; // extra property; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -146,6 +148,8 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches t !!! error TS2763: Type 'true' is not assignable to type 'string'. !!! error TS2763: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. !!! error TS2763: Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:21:38: The expected type comes from property 'extra-data' which is declared here on type 'IntrinsicAttributes & { "extra-data": string; }' +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:22:38: 'yy' is declared here. const d2 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2763: No overload matches this call. @@ -154,6 +158,7 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches t !!! error TS2763: Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. !!! error TS2763: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. !!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:22:50: The expected type comes from property 'direction' which is declared here on type 'IntrinsicAttributes & { yy: string; direction?: number; }' declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element; declare function TestingOptional(a: {y1?: string, y2?: number, children: JSX.Element}): JSX.Element; @@ -169,6 +174,9 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches t !!! error TS2763: Type 'true' is not assignable to type 'string'. !!! error TS2763: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. !!! error TS2763: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:28:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; }' +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:29:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }' +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:64: The expected type comes from property 'y3' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' const e2 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2763: No overload matches this call. @@ -180,6 +188,7 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches t !!! error TS2763: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. !!! error TS2763: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. !!! error TS2763: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' const e3 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2763: No overload matches this call. @@ -190,6 +199,8 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches t !!! error TS2763: Type 'string' is not assignable to type 'Element'. !!! error TS2763: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. !!! error TS2763: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:29:64: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }' +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' const e4 = Hi ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2763: No overload matches this call. @@ -200,4 +211,6 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches t !!! error TS2763: 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. !!! error TS2763: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. !!! error TS2763: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:29:64: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }' +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt index 214418e3375..df01c8fe94c 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt @@ -105,6 +105,9 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2763: No overload matches t !!! error TS2763: Type 'number' is not assignable to type 'string'. !!! error TS2763: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. !!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & ButtonProps' +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & LinkProps' +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & HyphenProps' const b7 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2763: No overload matches this call. @@ -114,6 +117,9 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2763: No overload matches t !!! error TS2763: Type 'true' is not assignable to type 'string'. !!! error TS2763: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. !!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:5:5: The expected type comes from property 'className' which is declared here on type 'IntrinsicAttributes & ButtonProps' +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:5:5: The expected type comes from property 'className' which is declared here on type 'IntrinsicAttributes & LinkProps' +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:5:5: The expected type comes from property 'className' which is declared here on type 'IntrinsicAttributes & HyphenProps' const b8 = ; // incorrect type for specified hyphanated name ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2763: No overload matches this call. @@ -122,4 +128,7 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2763: No overload matches t !!! error TS2763: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. !!! error TS2763: Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. !!! error TS2763: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. -!!! error TS2763: Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:9:5: 'onClick' is declared here. +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:13:5: 'to' is declared here. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:17:5: The expected type comes from property 'data-format' which is declared here on type 'IntrinsicAttributes & HyphenProps' \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt index fffd57b6272..5508a111e4d 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt @@ -36,6 +36,8 @@ tests/cases/conformance/jsx/file.tsx(10,14): error TS2763: No overload matches t !!! error TS2763: Type 'number' is not assignable to type 'string'. !!! error TS2763: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. !!! error TS2763: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:52: The expected type comes from property 'a' which is declared here on type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }' +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:5:49: 'b' is declared here. let a2 = // missing a ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2763: No overload matches this call. @@ -47,4 +49,6 @@ tests/cases/conformance/jsx/file.tsx(10,14): error TS2763: No overload matches t !!! error TS2763: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. !!! error TS2763: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. !!! error TS2763: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:4:52: 'a' is declared here. +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:5:55: 'a' is declared here. } \ No newline at end of file From 41ebeec05756abb164566a34296ff380c9b44cf9 Mon Sep 17 00:00:00 2001 From: Florian Regensburger Date: Tue, 2 Jul 2019 00:36:44 +0200 Subject: [PATCH 60/95] Revert unrelated fourslash test changes --- tests/cases/fourslash/codeFixAwaitInSyncFunction4.ts | 2 +- tests/cases/fourslash/codeFixAwaitInSyncFunction7.ts | 4 ++-- .../fourslash/codeFixAwaitShouldNotCrashIfNotInFunction.ts | 1 - .../codeFixClassImplementInterfaceIndexSignaturesNoFix.ts | 2 +- .../codeFixUnusedIdentifier_destructure_allUnused.ts | 2 +- .../codeFixUnusedIdentifier_destructure_allUnused_all.ts | 6 +++--- .../codeFixUnusedIdentifier_destructure_allUnused_for.ts | 4 ++-- .../codeFixUnusedIdentifier_destructure_allUnused_nested.ts | 4 ++-- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/tests/cases/fourslash/codeFixAwaitInSyncFunction4.ts b/tests/cases/fourslash/codeFixAwaitInSyncFunction4.ts index 24506bb39cb..dd123e25d0b 100644 --- a/tests/cases/fourslash/codeFixAwaitInSyncFunction4.ts +++ b/tests/cases/fourslash/codeFixAwaitInSyncFunction4.ts @@ -1,7 +1,7 @@ /// ////class Foo { -//// constructor() { +//// constructor { //// await Promise.resolve(); //// } ////} diff --git a/tests/cases/fourslash/codeFixAwaitInSyncFunction7.ts b/tests/cases/fourslash/codeFixAwaitInSyncFunction7.ts index 1d058fe473b..a467e9ee0ce 100644 --- a/tests/cases/fourslash/codeFixAwaitInSyncFunction7.ts +++ b/tests/cases/fourslash/codeFixAwaitInSyncFunction7.ts @@ -1,7 +1,7 @@ /// ////function f() { -//// for await (const x of []) { +//// for await (const x of g()) { //// console.log(x); //// } ////} @@ -10,7 +10,7 @@ verify.codeFix({ description: "Add async modifier to containing function", newFileContent: `async function f() { - for await (const x of []) { + for await (const x of g()) { console.log(x); } }`, diff --git a/tests/cases/fourslash/codeFixAwaitShouldNotCrashIfNotInFunction.ts b/tests/cases/fourslash/codeFixAwaitShouldNotCrashIfNotInFunction.ts index 4d916fe25b6..1ce5c771ed4 100644 --- a/tests/cases/fourslash/codeFixAwaitShouldNotCrashIfNotInFunction.ts +++ b/tests/cases/fourslash/codeFixAwaitShouldNotCrashIfNotInFunction.ts @@ -1,6 +1,5 @@ /// -////async function a() {} ////await a verify.not.codeFixAvailable(); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesNoFix.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesNoFix.ts index 39470dfdd50..07896b4cdb3 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesNoFix.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesNoFix.ts @@ -4,7 +4,7 @@ //// [x: string, y: number]: number; //// } //// -//// class C implements I4 {[| |]} +//// class C implements I {[| |]} verify.not.codeFixAvailable(); diff --git a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused.ts b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused.ts index 6f2dc76d0ae..4f3f9a3e61e 100644 --- a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused.ts +++ b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused.ts @@ -4,7 +4,7 @@ // @noUnusedParameters: true ////export {}; -////const { x, y } = {}; +////const { x, y } = o; verify.codeFix({ description: "Remove destructuring", diff --git a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_all.ts b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_all.ts index 176f108c517..c9d4f62f2db 100644 --- a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_all.ts +++ b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_all.ts @@ -3,8 +3,8 @@ // @noUnusedLocals: true // @noUnusedParameters: true -////const { x, y } = {}; -////const { a, b } = {}; +////const { x, y } = o; +////const { a, b } = o; ////a; ////export function f({ a, b }, { x, y }) { //// a; @@ -14,7 +14,7 @@ verify.codeFixAll({ fixId: "unusedIdentifier_delete", fixAllDescription: "Delete all unused declarations", newFileContent: -`const { a } = {}; +`const { a } = o; a; export function f({ a }) { a; diff --git a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_for.ts b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_for.ts index ea94e5275aa..27103357d3d 100644 --- a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_for.ts +++ b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_for.ts @@ -3,10 +3,10 @@ // @noUnusedLocals: true // @noUnusedParameters: true -////for (const { x } of [{}]) {} +////for (const { x } of o) {} verify.codeFix({ description: "Remove destructuring", newFileContent: -`for (const {} of [{}]) {}`, +`for (const {} of o) {}`, }); diff --git a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_nested.ts b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_nested.ts index 03a8ff826c7..73fca113928 100644 --- a/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_nested.ts +++ b/tests/cases/fourslash/codeFixUnusedIdentifier_destructure_allUnused_nested.ts @@ -4,11 +4,11 @@ // @noUnusedParameters: true ////export {}; -////const { x: { a, b } } = {{}}; +////const { x: { a, b } } = o; verify.codeFix({ description: "Remove destructuring", newFileContent: `export {}; -const { } = {{}};`, +const { } = o;`, }); From 5b24ea80a74dcb73cef336c2ee06957b858c2c89 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 1 Jul 2019 17:46:50 -1000 Subject: [PATCH 61/95] Restore union-like behavior for inference to conditional types --- src/compiler/checker.ts | 60 ++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 92df91d0084..893e7901d64 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15354,36 +15354,11 @@ namespace ts { inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } else if (target.flags & TypeFlags.Conditional && !contravariant) { - inferFromTypes(source, getTrueTypeFromConditionalType(target)); - inferFromTypes(source, getFalseTypeFromConditionalType(target)); + const targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]; + inferToMultipleTypes(source, targetTypes, /*isIntersection*/ false); } else if (target.flags & TypeFlags.UnionOrIntersection) { - // We infer from types that are not naked type variables first so that inferences we - // make from nested naked type variables and given slightly higher priority by virtue - // of being first in the candidates array. - let typeVariableCount = 0; - for (const t of (target).types) { - if (getInferenceInfoForType(t)) { - typeVariableCount++; - } - else { - inferFromTypes(source, t); - } - } - // Inferences directly to naked type variables are given lower priority as they are - // less specific. For example, when inferring from Promise to T | Promise, - // we want to infer string for T, not Promise | string. For intersection types - // we only infer to single naked type variables. - if (target.flags & TypeFlags.Union ? typeVariableCount !== 0 : typeVariableCount === 1) { - const savePriority = priority; - priority |= InferencePriority.NakedTypeVariable; - for (const t of (target).types) { - if (getInferenceInfoForType(t)) { - inferFromTypes(source, t); - } - } - priority = savePriority; - } + inferToMultipleTypes(source, (target).types, !!(target.flags & TypeFlags.Intersection)); } else if (source.flags & TypeFlags.Union) { // Source is a union or intersection type, infer from each constituent type @@ -15481,6 +15456,35 @@ namespace ts { return undefined; } + function inferToMultipleTypes(source: Type, targets: Type[], isIntersection: boolean) { + // We infer from types that are not naked type variables first so that inferences we + // make from nested naked type variables and given slightly higher priority by virtue + // of being first in the candidates array. + let typeVariableCount = 0; + for (const t of targets) { + if (getInferenceInfoForType(t)) { + typeVariableCount++; + } + else { + inferFromTypes(source, t); + } + } + // Inferences directly to naked type variables are given lower priority as they are + // less specific. For example, when inferring from Promise to T | Promise, + // we want to infer string for T, not Promise | string. For intersection types + // we only infer to single naked type variables. + if (isIntersection ? typeVariableCount === 1 : typeVariableCount !== 0) { + const savePriority = priority; + priority |= InferencePriority.NakedTypeVariable; + for (const t of targets) { + if (getInferenceInfoForType(t)) { + inferFromTypes(source, t); + } + } + priority = savePriority; + } + } + function inferToMappedType(source: Type, target: MappedType, constraintType: Type): boolean { if (constraintType.flags & TypeFlags.Union) { let result = false; From 8e75382ce3a8aff1783efd2f9fa5e35da241daf9 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 1 Jul 2019 17:49:36 -1000 Subject: [PATCH 62/95] Add regression test --- ...onalTypeRelaxingConstraintAssignability.js | 19 +++++++- ...ypeRelaxingConstraintAssignability.symbols | 44 +++++++++++++++++++ ...lTypeRelaxingConstraintAssignability.types | 27 ++++++++++++ ...onalTypeRelaxingConstraintAssignability.ts | 15 ++++++- 4 files changed, 103 insertions(+), 2 deletions(-) diff --git a/tests/baselines/reference/conditionalTypeRelaxingConstraintAssignability.js b/tests/baselines/reference/conditionalTypeRelaxingConstraintAssignability.js index f066b18d5c6..5f142116bab 100644 --- a/tests/baselines/reference/conditionalTypeRelaxingConstraintAssignability.js +++ b/tests/baselines/reference/conditionalTypeRelaxingConstraintAssignability.js @@ -21,7 +21,21 @@ export class Elem< new Elem(undefined as ElChildren.Void); new Elem('' as ElChildren.Text); new Elem('' as ElChildren.Void | ElChildren.Text); // error -new Elem('' as ElChildren); // error +new Elem('' as ElChildren); // error + +// Repro from #31766 + +interface I { a: string } + +type DeepPartial = + T extends object ? {[K in keyof T]?: DeepPartial} : T; + +declare function f(t: T, partial: DeepPartial): T; + +function g(p1: I, p2: Partial): I { + return f(p1, p2); +} + //// [conditionalTypeRelaxingConstraintAssignability.js] "use strict"; @@ -37,3 +51,6 @@ new Elem(undefined); new Elem(''); new Elem(''); // error new Elem(''); // error +function g(p1, p2) { + return f(p1, p2); +} diff --git a/tests/baselines/reference/conditionalTypeRelaxingConstraintAssignability.symbols b/tests/baselines/reference/conditionalTypeRelaxingConstraintAssignability.symbols index 7ce85b0fbfa..cd526f9d4bc 100644 --- a/tests/baselines/reference/conditionalTypeRelaxingConstraintAssignability.symbols +++ b/tests/baselines/reference/conditionalTypeRelaxingConstraintAssignability.symbols @@ -71,3 +71,47 @@ new Elem('' as ElChildren); // error >Elem : Symbol(Elem, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 8, 83)) >ElChildren : Symbol(ElChildren, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 0, 0), Decl(conditionalTypeRelaxingConstraintAssignability.ts, 2, 20)) +// Repro from #31766 + +interface I { a: string } +>I : Symbol(I, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 22, 27)) +>a : Symbol(I.a, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 26, 13)) + +type DeepPartial = +>DeepPartial : Symbol(DeepPartial, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 26, 25)) +>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 28, 17)) + + T extends object ? {[K in keyof T]?: DeepPartial} : T; +>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 28, 17)) +>K : Symbol(K, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 29, 25)) +>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 28, 17)) +>DeepPartial : Symbol(DeepPartial, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 26, 25)) +>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 28, 17)) +>K : Symbol(K, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 29, 25)) +>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 28, 17)) + +declare function f(t: T, partial: DeepPartial): T; +>f : Symbol(f, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 29, 64)) +>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 31, 19)) +>t : Symbol(t, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 31, 22)) +>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 31, 19)) +>partial : Symbol(partial, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 31, 27)) +>DeepPartial : Symbol(DeepPartial, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 26, 25)) +>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 31, 19)) +>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 31, 19)) + +function g(p1: I, p2: Partial): I { +>g : Symbol(g, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 31, 56)) +>p1 : Symbol(p1, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 33, 11)) +>I : Symbol(I, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 22, 27)) +>p2 : Symbol(p2, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 33, 17)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>I : Symbol(I, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 22, 27)) +>I : Symbol(I, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 22, 27)) + + return f(p1, p2); +>f : Symbol(f, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 29, 64)) +>p1 : Symbol(p1, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 33, 11)) +>p2 : Symbol(p2, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 33, 17)) +} + diff --git a/tests/baselines/reference/conditionalTypeRelaxingConstraintAssignability.types b/tests/baselines/reference/conditionalTypeRelaxingConstraintAssignability.types index c827e26bddb..2df682290f5 100644 --- a/tests/baselines/reference/conditionalTypeRelaxingConstraintAssignability.types +++ b/tests/baselines/reference/conditionalTypeRelaxingConstraintAssignability.types @@ -62,3 +62,30 @@ new Elem('' as ElChildren); // error >'' as ElChildren : ElChildren >'' : "" +// Repro from #31766 + +interface I { a: string } +>a : string + +type DeepPartial = +>DeepPartial : DeepPartial + + T extends object ? {[K in keyof T]?: DeepPartial} : T; + +declare function f(t: T, partial: DeepPartial): T; +>f : (t: T, partial: DeepPartial) => T +>t : T +>partial : DeepPartial + +function g(p1: I, p2: Partial): I { +>g : (p1: I, p2: Partial) => I +>p1 : I +>p2 : Partial + + return f(p1, p2); +>f(p1, p2) : I +>f : (t: T, partial: DeepPartial) => T +>p1 : I +>p2 : Partial +} + diff --git a/tests/cases/compiler/conditionalTypeRelaxingConstraintAssignability.ts b/tests/cases/compiler/conditionalTypeRelaxingConstraintAssignability.ts index 2f18e464e3b..04eaee9b511 100644 --- a/tests/cases/compiler/conditionalTypeRelaxingConstraintAssignability.ts +++ b/tests/cases/compiler/conditionalTypeRelaxingConstraintAssignability.ts @@ -21,4 +21,17 @@ export class Elem< new Elem(undefined as ElChildren.Void); new Elem('' as ElChildren.Text); new Elem('' as ElChildren.Void | ElChildren.Text); // error -new Elem('' as ElChildren); // error \ No newline at end of file +new Elem('' as ElChildren); // error + +// Repro from #31766 + +interface I { a: string } + +type DeepPartial = + T extends object ? {[K in keyof T]?: DeepPartial} : T; + +declare function f(t: T, partial: DeepPartial): T; + +function g(p1: I, p2: Partial): I { + return f(p1, p2); +} From b24264f7685477d99dd9b324b0043559d41fb9ec Mon Sep 17 00:00:00 2001 From: typescript-bot Date: Tue, 2 Jul 2019 13:55:12 +0000 Subject: [PATCH 63/95] Update user baselines --- tests/baselines/reference/user/chrome-devtools-frontend.log | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/baselines/reference/user/chrome-devtools-frontend.log b/tests/baselines/reference/user/chrome-devtools-frontend.log index d298b174de0..228ae3113bd 100644 --- a/tests/baselines/reference/user/chrome-devtools-frontend.log +++ b/tests/baselines/reference/user/chrome-devtools-frontend.log @@ -6841,7 +6841,6 @@ node_modules/chrome-devtools-frontend/front_end/layer_viewer/LayerDetailsView.js node_modules/chrome-devtools-frontend/front_end/layer_viewer/LayerDetailsView.js(198,65): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/layer_viewer/LayerDetailsView.js(199,53): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/LayerDetailsView.js(200,52): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/layer_viewer/LayerDetailsView.js(239,3): error TS2322: Type 'symbol' is not assignable to type 'string'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/LayerDetailsView.js(246,25): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/layer_viewer/LayerDetailsView.js(247,19): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/layer_viewer/LayerDetailsView.js(248,20): error TS2555: Expected at least 2 arguments, but got 1. @@ -6934,8 +6933,6 @@ node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(718 node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(726,44): error TS2339: Property 'clientX' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(727,24): error TS2339: Property 'clientY' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(762,26): error TS2339: Property 'LayerStyle' does not exist on type 'typeof Layers3DView'. -node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(777,3): error TS2322: Type 'symbol' is not assignable to type 'string'. -node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(778,3): error TS2322: Type 'symbol' is not assignable to type 'string'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(794,28): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(795,29): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(796,29): error TS2555: Expected at least 2 arguments, but got 1. From de52797873952a58a8f2413e4eb3f095a0e0868f Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 2 Jul 2019 08:34:34 -0700 Subject: [PATCH 64/95] Update baselines --- .../reference/reactDefaultPropsInferenceSuccess.errors.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt index 5168e5aa361..b972a5bb7c5 100644 --- a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt +++ b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt @@ -59,6 +59,8 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2763: !!! error TS2763: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. !!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. !!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' +!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' class FieldFeedbackBeta

extends React.Component

{ static defaultProps: BaseProps = { @@ -84,6 +86,8 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2763: !!! error TS2763: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. !!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. !!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, "when" | "error">> & Partial>' +!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, "when" | "error">> & Partial>' interface MyPropsProps extends Props { when: (value: string) => boolean; @@ -112,6 +116,8 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2763: !!! error TS2763: Type 'void' is not assignable to type 'boolean'. !!! error TS2763: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. !!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' +!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' // OK const Test5 = () => ; From ba1a062b93c1def5b7a6329c2fe4bbba17c571ff Mon Sep 17 00:00:00 2001 From: typescript-bot Date: Wed, 3 Jul 2019 14:02:33 +0000 Subject: [PATCH 65/95] Update user baselines --- tests/baselines/reference/user/prettier.log | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/baselines/reference/user/prettier.log b/tests/baselines/reference/user/prettier.log index c69f88a4a78..4bebd0414b1 100644 --- a/tests/baselines/reference/user/prettier.log +++ b/tests/baselines/reference/user/prettier.log @@ -5,6 +5,8 @@ src/cli/util.js(60,44): error TS2345: Argument of type 'null' is not assignable src/cli/util.js(119,38): error TS2339: Property 'sync' does not exist on type '(...args: any[]) => any'. src/cli/util.js(372,29): error TS2532: Object is possibly 'undefined'. src/cli/util.js(372,64): error TS2339: Property 'length' does not exist on type 'Ignore'. +src/cli/util.js(413,36): error TS2345: Argument of type '{ dot: true; nodir: boolean; }' is not assignable to parameter of type 'GlobbyOptions'. + Object literal may only specify known properties, and 'nodir' does not exist in type 'GlobbyOptions'. src/cli/util.js(452,25): error TS2532: Object is possibly 'undefined'. src/cli/util.js(452,52): error TS2339: Property 'length' does not exist on type 'Ignore'. src/cli/util.js(510,44): error TS2345: Argument of type 'null' is not assignable to parameter of type 'number | undefined'. From d92e8ea4a1745e666775dcca61cf30d2ba061bd8 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 3 Jul 2019 09:49:00 -0700 Subject: [PATCH 66/95] Update baselines --- .../reference/destructuringTuple.errors.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/baselines/reference/destructuringTuple.errors.txt b/tests/baselines/reference/destructuringTuple.errors.txt index cd366409dc8..10b997f87cd 100644 --- a/tests/baselines/reference/destructuringTuple.errors.txt +++ b/tests/baselines/reference/destructuringTuple.errors.txt @@ -1,5 +1,9 @@ tests/cases/compiler/destructuringTuple.ts(11,8): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. -tests/cases/compiler/destructuringTuple.ts(11,60): error TS2345: Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. +tests/cases/compiler/destructuringTuple.ts(11,48): error TS2763: No overload matches this call. + Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. + Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. ==== tests/cases/compiler/destructuringTuple.ts (2 errors) ==== @@ -16,8 +20,12 @@ tests/cases/compiler/destructuringTuple.ts(11,60): error TS2345: Argument of typ const [oops1] = [1, 2, 3].reduce((accu, el) => accu.concat(el), []); ~~~~~ !!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. - ~~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. + ~~~~~~~~~~~~~~~ +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. +!!! error TS2763: Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. +!!! error TS2763: Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. +!!! error TS2763: Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. const [oops2] = [1, 2, 3].reduce((acc: number[], e) => acc.concat(e), []); \ No newline at end of file From 722917f04ea47bc6bb3f33287d4db8b55a22dd4e Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 3 Jul 2019 09:50:03 -0700 Subject: [PATCH 67/95] Remove TODO --- src/compiler/program.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index d96a4dc68ab..664e2d0319d 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -520,7 +520,6 @@ namespace ts { result += diag.messageText; indent++; if (diag.next) { - // TODO: Should be possible to optimise the common, non-tree case for (const kid of diag.next) { result += flattenDiagnosticMessageText(kid, newLine, indent); } From 0bea4bd3c91b81e8bd62827828565f6b2a117f25 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 3 Jul 2019 15:58:21 -0700 Subject: [PATCH 68/95] Widen object literal this types (#32240) --- src/compiler/checker.ts | 4 +- .../reference/noImplicitThisBigThis.types | 24 +++++----- .../objectLiteralThisWidenedOnUse.errors.txt | 22 +++++++++ .../objectLiteralThisWidenedOnUse.js | 27 +++++++++++ .../objectLiteralThisWidenedOnUse.symbols | 39 +++++++++++++++ .../objectLiteralThisWidenedOnUse.types | 47 +++++++++++++++++++ .../compiler/objectLiteralThisWidenedOnUse.ts | 14 ++++++ 7 files changed, 163 insertions(+), 14 deletions(-) create mode 100644 tests/baselines/reference/objectLiteralThisWidenedOnUse.errors.txt create mode 100644 tests/baselines/reference/objectLiteralThisWidenedOnUse.js create mode 100644 tests/baselines/reference/objectLiteralThisWidenedOnUse.symbols create mode 100644 tests/baselines/reference/objectLiteralThisWidenedOnUse.types create mode 100644 tests/cases/compiler/objectLiteralThisWidenedOnUse.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 72f1b9a01a6..497788b6d72 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -18288,7 +18288,7 @@ namespace ts { // There was no contextual ThisType for the containing object literal, so the contextual type // for 'this' is the non-null form of the contextual type for the containing object literal or // the type of the object literal itself. - return contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral); + return getWidenedType(contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral)); } // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. @@ -18305,7 +18305,7 @@ namespace ts { } } - return checkExpressionCached(expression); + return getWidenedType(checkExpressionCached(expression)); } } } diff --git a/tests/baselines/reference/noImplicitThisBigThis.types b/tests/baselines/reference/noImplicitThisBigThis.types index 4e1731aebc7..f6812655a67 100644 --- a/tests/baselines/reference/noImplicitThisBigThis.types +++ b/tests/baselines/reference/noImplicitThisBigThis.types @@ -11,21 +11,21 @@ function createObj() { >func1 : () => { func1(): any; func2(): any; func3(): any; } return this; ->this : { func1(): { func1(): any; func2(): any; func3(): any; }; func2(): { func1(): any; func2(): any; func3(): any; }; func3(): { func1(): any; func2(): any; func3(): any; }; } +>this : { func1(): any; func2(): any; func3(): any; } }, func2() { >func2 : () => { func1(): any; func2(): any; func3(): any; } return this; ->this : { func1(): { func1(): any; func2(): any; func3(): any; }; func2(): { func1(): any; func2(): any; func3(): any; }; func3(): { func1(): any; func2(): any; func3(): any; }; } +>this : { func1(): any; func2(): any; func3(): any; } }, func3() { >func3 : () => { func1(): any; func2(): any; func3(): any; } return this; ->this : { func1(): { func1(): any; func2(): any; func3(): any; }; func2(): { func1(): any; func2(): any; func3(): any; }; func3(): { func1(): any; func2(): any; func3(): any; }; } +>this : { func1(): any; func2(): any; func3(): any; } } }; } @@ -40,63 +40,63 @@ function createObjNoCrash() { >func1 : () => { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } return this; ->this : { func1(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func2(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func3(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func4(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func5(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func6(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func7(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func8(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func9(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; } +>this : { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } }, func2() { >func2 : () => { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } return this; ->this : { func1(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func2(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func3(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func4(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func5(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func6(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func7(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func8(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func9(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; } +>this : { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } }, func3() { >func3 : () => { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } return this; ->this : { func1(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func2(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func3(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func4(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func5(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func6(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func7(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func8(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func9(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; } +>this : { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } }, func4() { >func4 : () => { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } return this; ->this : { func1(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func2(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func3(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func4(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func5(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func6(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func7(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func8(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func9(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; } +>this : { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } }, func5() { >func5 : () => { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } return this; ->this : { func1(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func2(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func3(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func4(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func5(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func6(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func7(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func8(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func9(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; } +>this : { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } }, func6() { >func6 : () => { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } return this; ->this : { func1(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func2(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func3(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func4(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func5(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func6(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func7(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func8(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func9(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; } +>this : { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } }, func7() { >func7 : () => { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } return this; ->this : { func1(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func2(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func3(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func4(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func5(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func6(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func7(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func8(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func9(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; } +>this : { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } }, func8() { >func8 : () => { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } return this; ->this : { func1(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func2(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func3(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func4(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func5(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func6(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func7(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func8(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func9(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; } +>this : { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } }, func9() { >func9 : () => { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } return this; ->this : { func1(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func2(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func3(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func4(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func5(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func6(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func7(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func8(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; func9(): { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; }; } +>this : { func1(): any; func2(): any; func3(): any; func4(): any; func5(): any; func6(): any; func7(): any; func8(): any; func9(): any; } } }; } diff --git a/tests/baselines/reference/objectLiteralThisWidenedOnUse.errors.txt b/tests/baselines/reference/objectLiteralThisWidenedOnUse.errors.txt new file mode 100644 index 00000000000..72971321db7 --- /dev/null +++ b/tests/baselines/reference/objectLiteralThisWidenedOnUse.errors.txt @@ -0,0 +1,22 @@ +tests/cases/compiler/objectLiteralThisWidenedOnUse.ts(8,21): error TS2345: Argument of type '{ prop1: number; prop2: number; prop3: number; test(): void; accept_foo(foo: Foo): boolean; }' is not assignable to parameter of type 'Foo'. + Property 'bar' is missing in type '{ prop1: number; prop2: number; prop3: number; test(): void; accept_foo(foo: Foo): boolean; }' but required in type 'Foo'. + + +==== tests/cases/compiler/objectLiteralThisWidenedOnUse.ts (1 errors) ==== + interface Foo { bar: boolean; } + + var GlobalIns = { + prop1: 1, + prop2: 2, + prop3: 3, + test () { + this.accept_foo(this); + ~~~~ +!!! error TS2345: Argument of type '{ prop1: number; prop2: number; prop3: number; test(): void; accept_foo(foo: Foo): boolean; }' is not assignable to parameter of type 'Foo'. +!!! error TS2345: Property 'bar' is missing in type '{ prop1: number; prop2: number; prop3: number; test(): void; accept_foo(foo: Foo): boolean; }' but required in type 'Foo'. +!!! related TS2728 tests/cases/compiler/objectLiteralThisWidenedOnUse.ts:1:17: 'bar' is declared here. + }, + accept_foo (foo: Foo): boolean { + return !!foo && !!foo.bar; + } + }; \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralThisWidenedOnUse.js b/tests/baselines/reference/objectLiteralThisWidenedOnUse.js new file mode 100644 index 00000000000..5dddfd6f3d1 --- /dev/null +++ b/tests/baselines/reference/objectLiteralThisWidenedOnUse.js @@ -0,0 +1,27 @@ +//// [objectLiteralThisWidenedOnUse.ts] +interface Foo { bar: boolean; } + +var GlobalIns = { + prop1: 1, + prop2: 2, + prop3: 3, + test () { + this.accept_foo(this); + }, + accept_foo (foo: Foo): boolean { + return !!foo && !!foo.bar; + } +}; + +//// [objectLiteralThisWidenedOnUse.js] +var GlobalIns = { + prop1: 1, + prop2: 2, + prop3: 3, + test: function () { + this.accept_foo(this); + }, + accept_foo: function (foo) { + return !!foo && !!foo.bar; + } +}; diff --git a/tests/baselines/reference/objectLiteralThisWidenedOnUse.symbols b/tests/baselines/reference/objectLiteralThisWidenedOnUse.symbols new file mode 100644 index 00000000000..def5fdf16e1 --- /dev/null +++ b/tests/baselines/reference/objectLiteralThisWidenedOnUse.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/objectLiteralThisWidenedOnUse.ts === +interface Foo { bar: boolean; } +>Foo : Symbol(Foo, Decl(objectLiteralThisWidenedOnUse.ts, 0, 0)) +>bar : Symbol(Foo.bar, Decl(objectLiteralThisWidenedOnUse.ts, 0, 15)) + +var GlobalIns = { +>GlobalIns : Symbol(GlobalIns, Decl(objectLiteralThisWidenedOnUse.ts, 2, 3)) + + prop1: 1, +>prop1 : Symbol(prop1, Decl(objectLiteralThisWidenedOnUse.ts, 2, 17)) + + prop2: 2, +>prop2 : Symbol(prop2, Decl(objectLiteralThisWidenedOnUse.ts, 3, 11)) + + prop3: 3, +>prop3 : Symbol(prop3, Decl(objectLiteralThisWidenedOnUse.ts, 4, 11)) + + test () { +>test : Symbol(test, Decl(objectLiteralThisWidenedOnUse.ts, 5, 11)) + + this.accept_foo(this); +>this.accept_foo : Symbol(accept_foo, Decl(objectLiteralThisWidenedOnUse.ts, 8, 4)) +>this : Symbol(GlobalIns, Decl(objectLiteralThisWidenedOnUse.ts, 2, 15)) +>accept_foo : Symbol(accept_foo, Decl(objectLiteralThisWidenedOnUse.ts, 8, 4)) +>this : Symbol(GlobalIns, Decl(objectLiteralThisWidenedOnUse.ts, 2, 15)) + + }, + accept_foo (foo: Foo): boolean { +>accept_foo : Symbol(accept_foo, Decl(objectLiteralThisWidenedOnUse.ts, 8, 4)) +>foo : Symbol(foo, Decl(objectLiteralThisWidenedOnUse.ts, 9, 14)) +>Foo : Symbol(Foo, Decl(objectLiteralThisWidenedOnUse.ts, 0, 0)) + + return !!foo && !!foo.bar; +>foo : Symbol(foo, Decl(objectLiteralThisWidenedOnUse.ts, 9, 14)) +>foo.bar : Symbol(Foo.bar, Decl(objectLiteralThisWidenedOnUse.ts, 0, 15)) +>foo : Symbol(foo, Decl(objectLiteralThisWidenedOnUse.ts, 9, 14)) +>bar : Symbol(Foo.bar, Decl(objectLiteralThisWidenedOnUse.ts, 0, 15)) + } +}; diff --git a/tests/baselines/reference/objectLiteralThisWidenedOnUse.types b/tests/baselines/reference/objectLiteralThisWidenedOnUse.types new file mode 100644 index 00000000000..d13e2bcaa60 --- /dev/null +++ b/tests/baselines/reference/objectLiteralThisWidenedOnUse.types @@ -0,0 +1,47 @@ +=== tests/cases/compiler/objectLiteralThisWidenedOnUse.ts === +interface Foo { bar: boolean; } +>bar : boolean + +var GlobalIns = { +>GlobalIns : { prop1: number; prop2: number; prop3: number; test(): void; accept_foo(foo: Foo): boolean; } +>{ prop1: 1, prop2: 2, prop3: 3, test () { this.accept_foo(this); }, accept_foo (foo: Foo): boolean { return !!foo && !!foo.bar; }} : { prop1: number; prop2: number; prop3: number; test(): void; accept_foo(foo: Foo): boolean; } + + prop1: 1, +>prop1 : number +>1 : 1 + + prop2: 2, +>prop2 : number +>2 : 2 + + prop3: 3, +>prop3 : number +>3 : 3 + + test () { +>test : () => void + + this.accept_foo(this); +>this.accept_foo(this) : boolean +>this.accept_foo : (foo: Foo) => boolean +>this : { prop1: number; prop2: number; prop3: number; test(): void; accept_foo(foo: Foo): boolean; } +>accept_foo : (foo: Foo) => boolean +>this : { prop1: number; prop2: number; prop3: number; test(): void; accept_foo(foo: Foo): boolean; } + + }, + accept_foo (foo: Foo): boolean { +>accept_foo : (foo: Foo) => boolean +>foo : Foo + + return !!foo && !!foo.bar; +>!!foo && !!foo.bar : boolean +>!!foo : boolean +>!foo : boolean +>foo : Foo +>!!foo.bar : boolean +>!foo.bar : boolean +>foo.bar : boolean +>foo : Foo +>bar : boolean + } +}; diff --git a/tests/cases/compiler/objectLiteralThisWidenedOnUse.ts b/tests/cases/compiler/objectLiteralThisWidenedOnUse.ts new file mode 100644 index 00000000000..7d2088720a5 --- /dev/null +++ b/tests/cases/compiler/objectLiteralThisWidenedOnUse.ts @@ -0,0 +1,14 @@ +// @noImplicitThis: true +interface Foo { bar: boolean; } + +var GlobalIns = { + prop1: 1, + prop2: 2, + prop3: 3, + test () { + this.accept_foo(this); + }, + accept_foo (foo: Foo): boolean { + return !!foo && !!foo.bar; + } +}; \ No newline at end of file From e8bf9584aa74aabfecb51a02edb13e3657508274 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 3 Jul 2019 21:55:59 -0700 Subject: [PATCH 69/95] Improve type checking and inference for Generators and Async Generators (#30790) * Improve typing for Generators and Async Generators * Add TReturn and TNext to Iterator, IterableIterator, etc. * Update ts internal Iterator to be assignable from global Iterator * Make 'done' optional in IteratorYieldResult * Revert Iterable and IterableIterator to simpler versions plus other fixes * Add additional inference tests * Added additional tests * PR cleanup and minor async iteration type fix * Updated diagnostics message and added non-strict tests * Fix expected arity of Iterator/AsyncIterator --- src/compiler/builderState.ts | 4 +- src/compiler/checker.ts | 1206 ++++++++++++----- src/compiler/commandLineParser.ts | 5 +- src/compiler/core.ts | 29 +- src/compiler/diagnosticMessages.json | 35 +- src/compiler/sourcemap.ts | 3 +- src/compiler/types.ts | 18 +- src/compiler/utilities.ts | 8 +- src/harness/sourceMapRecorder.ts | 6 +- src/harness/vfs.ts | 4 +- src/lib/es2015.generator.d.ts | 10 +- src/lib/es2015.iterable.d.ts | 22 +- src/lib/es2018.asyncgenerator.d.ts | 59 + src/lib/es2018.asynciterable.d.ts | 9 +- src/lib/es2018.d.ts | 1 + src/lib/libs.json | 1 + src/server/editorServices.ts | 15 +- src/testRunner/parallel/host.ts | 4 +- .../unittests/config/commandLineParsing.ts | 6 +- src/testRunner/unittests/config/showConfig.ts | 4 +- src/testRunner/unittests/shimMap.ts | 7 +- src/testRunner/unittests/tsserver/helpers.ts | 7 +- src/tsconfig-base.json | 2 +- .../reference/FunctionDeclaration11_es6.types | 2 +- .../reference/FunctionDeclaration13_es6.types | 2 +- .../reference/FunctionDeclaration1_es6.types | 2 +- .../reference/FunctionDeclaration6_es6.types | 2 +- .../reference/FunctionDeclaration7_es6.types | 4 +- .../reference/FunctionDeclaration9_es6.types | 10 +- .../reference/FunctionExpression1_es6.types | 4 +- .../reference/FunctionExpression2_es6.types | 6 +- .../FunctionPropertyAssignments1_es6.types | 6 +- .../FunctionPropertyAssignments2_es6.types | 6 +- .../FunctionPropertyAssignments3_es6.types | 6 +- .../FunctionPropertyAssignments5_es6.types | 6 +- .../FunctionPropertyAssignments6_es6.types | 6 +- .../MemberFunctionDeclaration1_es6.types | 2 +- .../MemberFunctionDeclaration2_es6.types | 2 +- .../MemberFunctionDeclaration3_es6.types | 2 +- .../MemberFunctionDeclaration4_es6.types | 2 +- .../MemberFunctionDeclaration7_es6.types | 2 +- .../reference/YieldExpression10_es6.types | 6 +- .../reference/YieldExpression11_es6.types | 2 +- .../reference/YieldExpression13_es6.types | 2 +- .../reference/YieldExpression16_es6.types | 4 +- .../reference/YieldExpression19_es6.types | 8 +- .../reference/YieldExpression3_es6.types | 2 +- .../reference/YieldExpression4_es6.types | 2 +- .../reference/YieldExpression5_es6.types | 2 +- .../reference/YieldExpression7_es6.types | 4 +- .../reference/YieldExpression8_es6.types | 8 +- .../reference/YieldExpression9_es6.types | 4 +- .../reference/YieldStarExpression3_es6.types | 2 +- .../reference/YieldStarExpression4_es6.types | 2 +- .../reference/api/tsserverlibrary.d.ts | 2 +- tests/baselines/reference/api/typescript.d.ts | 2 +- .../reference/asyncImportNestedYield.types | 2 +- .../reference/asyncMethodWithSuper_es6.types | 8 +- .../reference/awaitInNonAsyncFunction.types | 2 +- ...ckScopedBindingsInDownlevelGenerator.types | 2 +- .../capturedParametersInInitializers1.types | 10 +- .../reference/castOfYield.errors.txt | 4 +- .../baselines/reference/controlFlowIIFE.types | 6 +- ....asyncGenerators.classMethods.es2015.types | 28 +- ....asyncGenerators.classMethods.es2018.types | 28 +- ...ter.asyncGenerators.classMethods.es5.types | 28 +- ...nerators.functionDeclarations.es2015.types | 24 +- ...nerators.functionDeclarations.es2018.types | 24 +- ...cGenerators.functionDeclarations.es5.types | 24 +- ...enerators.functionExpressions.es2015.types | 38 +- ...enerators.functionExpressions.es2018.types | 38 +- ...ncGenerators.functionExpressions.es5.types | 38 +- ...nerators.objectLiteralMethods.es2015.types | 52 +- ...nerators.objectLiteralMethods.es2018.types | 52 +- ...cGenerators.objectLiteralMethods.es5.types | 52 +- .../reference/emitter.forAwait.es2015.types | 6 +- .../reference/emitter.forAwait.es2017.types | 6 +- .../reference/emitter.forAwait.es2018.types | 6 +- .../reference/emitter.forAwait.es5.types | 6 +- ...ionsForbiddenInParameterInitializers.types | 2 +- tests/baselines/reference/for-of29.errors.txt | 6 +- tests/baselines/reference/for-of29.types | 8 +- tests/baselines/reference/for-of30.errors.txt | 18 +- tests/baselines/reference/for-of30.js | 4 +- tests/baselines/reference/for-of30.symbols | 4 +- tests/baselines/reference/for-of30.types | 4 +- tests/baselines/reference/for-of31.errors.txt | 33 - tests/baselines/reference/for-of31.js | 2 +- tests/baselines/reference/for-of31.symbols | 2 +- tests/baselines/reference/for-of31.types | 2 +- tests/baselines/reference/for-of34.errors.txt | 2 +- tests/baselines/reference/for-of34.js | 2 +- tests/baselines/reference/for-of34.symbols | 2 +- tests/baselines/reference/for-of34.types | 2 +- tests/baselines/reference/for-of35.errors.txt | 2 +- tests/baselines/reference/for-of35.js | 2 +- tests/baselines/reference/for-of35.symbols | 2 +- tests/baselines/reference/for-of35.types | 2 +- .../generatorAssignability.errors.txt | 106 ++ .../reference/generatorAssignability.symbols | 157 +++ .../reference/generatorAssignability.types | 177 +++ .../reference/generatorES6InAMDModule.types | 2 +- .../baselines/reference/generatorES6_1.types | 2 +- .../baselines/reference/generatorES6_2.types | 2 +- .../baselines/reference/generatorES6_3.types | 4 +- .../baselines/reference/generatorES6_4.types | 6 +- .../baselines/reference/generatorES6_5.types | 2 +- .../baselines/reference/generatorES6_6.types | 2 +- .../generatorExplicitReturnType.errors.txt | 41 + .../reference/generatorExplicitReturnType.js | 44 + .../generatorExplicitReturnType.symbols | 48 + .../generatorExplicitReturnType.types | 58 + .../reference/generatorImplicitAny.js | 5 + .../reference/generatorImplicitAny.symbols | 4 + .../reference/generatorImplicitAny.types | 4 + .../generatorNoImplicitReturns.types | 2 +- .../generatorReturnExpressionIsChecked.types | 2 +- .../reference/generatorReturnTypeInference.js | 236 ++++ .../generatorReturnTypeInference.symbols | 258 ++++ .../generatorReturnTypeInference.types | 308 +++++ ...torReturnTypeInferenceNonStrict.errors.txt | 156 +++ .../generatorReturnTypeInferenceNonStrict.js | 240 ++++ ...eratorReturnTypeInferenceNonStrict.symbols | 260 ++++ ...eneratorReturnTypeInferenceNonStrict.types | 310 +++++ .../reference/generatorTypeCheck1.types | 2 +- .../reference/generatorTypeCheck13.types | 2 +- .../reference/generatorTypeCheck14.types | 2 +- .../reference/generatorTypeCheck15.types | 2 +- .../reference/generatorTypeCheck16.types | 2 +- .../reference/generatorTypeCheck17.types | 4 +- .../reference/generatorTypeCheck18.types | 4 +- .../reference/generatorTypeCheck19.types | 2 +- .../reference/generatorTypeCheck20.types | 2 +- .../reference/generatorTypeCheck21.types | 2 +- .../reference/generatorTypeCheck22.types | 2 +- .../reference/generatorTypeCheck23.types | 2 +- .../reference/generatorTypeCheck24.types | 2 +- .../reference/generatorTypeCheck25.errors.txt | 36 +- .../reference/generatorTypeCheck25.types | 2 +- .../reference/generatorTypeCheck26.types | 2 +- .../reference/generatorTypeCheck27.types | 6 +- .../reference/generatorTypeCheck28.types | 6 +- .../reference/generatorTypeCheck29.types | 8 +- .../reference/generatorTypeCheck30.types | 8 +- .../reference/generatorTypeCheck31.errors.txt | 8 +- .../reference/generatorTypeCheck31.types | 8 +- .../reference/generatorTypeCheck33.types | 4 +- .../reference/generatorTypeCheck34.types | 4 +- .../reference/generatorTypeCheck35.types | 2 +- .../reference/generatorTypeCheck36.types | 2 +- .../reference/generatorTypeCheck37.types | 2 +- .../reference/generatorTypeCheck38.types | 2 +- .../reference/generatorTypeCheck39.types | 2 +- .../reference/generatorTypeCheck40.types | 2 +- .../reference/generatorTypeCheck41.types | 2 +- .../reference/generatorTypeCheck42.types | 2 +- .../reference/generatorTypeCheck43.types | 8 +- .../reference/generatorTypeCheck44.types | 2 +- .../reference/generatorTypeCheck45.types | 8 +- .../reference/generatorTypeCheck46.types | 8 +- .../reference/generatorTypeCheck47.errors.txt | 7 - .../reference/generatorTypeCheck47.types | 2 +- .../reference/generatorTypeCheck48.errors.txt | 8 +- .../reference/generatorTypeCheck48.types | 4 +- .../reference/generatorTypeCheck49.types | 2 +- .../reference/generatorTypeCheck50.types | 2 +- .../reference/generatorTypeCheck51.errors.txt | 11 - .../reference/generatorTypeCheck51.types | 4 +- .../reference/generatorTypeCheck52.types | 2 +- .../reference/generatorTypeCheck53.types | 2 +- .../reference/generatorTypeCheck54.types | 2 +- .../reference/generatorTypeCheck55.types | 2 +- .../reference/generatorTypeCheck56.types | 4 +- .../reference/generatorTypeCheck57.types | 2 +- .../reference/generatorTypeCheck58.types | 2 +- .../reference/generatorTypeCheck59.types | 2 +- .../reference/generatorTypeCheck6.errors.txt | 4 +- .../reference/generatorTypeCheck60.types | 2 +- .../reference/generatorTypeCheck61.types | 2 +- .../reference/generatorTypeCheck62.types | 10 +- .../reference/generatorTypeCheck63.errors.txt | 41 +- .../reference/generatorTypeCheck63.types | 16 +- .../reference/generatorTypeCheck7.errors.txt | 4 +- .../reference/generatorTypeCheck8.errors.txt | 20 +- ...portCallExpressionReturnPromiseOfAny.types | 2 +- ...rtHelpersNoHelpersForAsyncGenerators.types | 2 +- .../iteratorSpreadInArray9.errors.txt | 32 - .../reference/iteratorSpreadInCall12.js | 8 +- .../reference/iteratorSpreadInCall12.symbols | 14 +- .../reference/iteratorSpreadInCall12.types | 22 +- .../reference/iteratorSpreadInCall5.js | 8 +- .../reference/iteratorSpreadInCall5.symbols | 14 +- .../reference/iteratorSpreadInCall5.types | 14 +- .../iteratorSpreadInCall6.errors.txt | 6 +- .../reference/iteratorSpreadInCall6.js | 8 +- .../reference/iteratorSpreadInCall6.symbols | 14 +- .../reference/iteratorSpreadInCall6.types | 14 +- .../iteratorSpreadInCall7.errors.txt | 6 +- .../reference/iteratorSpreadInCall7.js | 8 +- .../reference/iteratorSpreadInCall7.symbols | 14 +- .../reference/iteratorSpreadInCall7.types | 14 +- .../iteratorSpreadInCall8.errors.txt | 6 +- .../reference/iteratorSpreadInCall8.js | 8 +- .../reference/iteratorSpreadInCall8.symbols | 14 +- .../reference/iteratorSpreadInCall8.types | 14 +- .../iteratorSpreadInCall9.errors.txt | 6 +- .../reference/iteratorSpreadInCall9.js | 8 +- .../reference/iteratorSpreadInCall9.symbols | 14 +- .../reference/iteratorSpreadInCall9.types | 18 +- .../reference/labeledStatementWithLabel.types | 2 +- .../labeledStatementWithLabel_es2015.types | 2 +- .../labeledStatementWithLabel_strict.types | 2 +- ...eLibrary_NoErrorDuplicateLibOptions1.types | 4 +- ...eLibrary_NoErrorDuplicateLibOptions2.types | 4 +- ...dularizeLibrary_TargetES5UsingES6Lib.types | 4 +- ...Library_UsingES5LibAndES6FeatureLibs.types | 2 +- ....asyncGenerators.classMethods.es2018.types | 42 +- ...nerators.functionDeclarations.es2018.types | 44 +- ...enerators.functionExpressions.es2018.types | 72 +- ...nerators.objectLiteralMethods.es2018.types | 116 +- .../reference/parser.forAwait.es2018.types | 8 +- .../restParameterInDownlevelGenerator.types | 2 +- .../strictGeneratorTypes/tsconfig.json | 5 + ...MapValidationVarInDownLevelGenerator.types | 2 +- ...romGeneratorMakesRequiredParams.errors.txt | 4 +- .../templateStringInYieldKeyword.types | 2 +- ...eStringWithEmbeddedYieldKeyword.errors.txt | 4 +- ...ateStringWithEmbeddedYieldKeywordES6.types | 2 +- .../types.asyncGenerators.es2018.1.types | 138 +- .../types.asyncGenerators.es2018.2.errors.txt | 153 ++- .../types.asyncGenerators.es2018.2.types | 96 +- .../reference/types.forAwait.es2018.1.types | 2 +- .../types.forAwait.es2018.3.errors.txt | 4 +- tests/baselines/reference/uniqueSymbols.types | 32 +- .../reference/uniqueSymbolsDeclarations.js | 20 +- .../reference/uniqueSymbolsDeclarations.types | 32 +- .../reference/yieldExpression1.types | 6 +- .../yieldExpressionInControlFlow.types | 4 +- .../reference/yieldExpressionInFlowLoop.types | 2 +- .../yieldExpressionInnerCommentEmit.types | 2 +- .../es6/for-ofStatements/for-of30.ts | 4 +- .../es6/for-ofStatements/for-of31.ts | 2 +- .../es6/for-ofStatements/for-of34.ts | 2 +- .../es6/for-ofStatements/for-of35.ts | 2 +- .../es6/spread/iteratorSpreadInCall12.ts | 4 +- .../es6/spread/iteratorSpreadInCall5.ts | 4 +- .../es6/spread/iteratorSpreadInCall6.ts | 4 +- .../es6/spread/iteratorSpreadInCall7.ts | 4 +- .../es6/spread/iteratorSpreadInCall8.ts | 4 +- .../es6/spread/iteratorSpreadInCall9.ts | 4 +- .../generators/generatorAssignability.ts | 73 + .../generators/generatorExplicitReturnType.ts | 28 + .../generators/generatorImplicitAny.ts | 6 + .../generatorReturnTypeInference.ts | 137 ++ .../generatorReturnTypeInferenceNonStrict.ts | 139 ++ 255 files changed, 4914 insertions(+), 1536 deletions(-) create mode 100644 src/lib/es2018.asyncgenerator.d.ts delete mode 100644 tests/baselines/reference/for-of31.errors.txt create mode 100644 tests/baselines/reference/generatorAssignability.errors.txt create mode 100644 tests/baselines/reference/generatorAssignability.symbols create mode 100644 tests/baselines/reference/generatorAssignability.types create mode 100644 tests/baselines/reference/generatorExplicitReturnType.errors.txt create mode 100644 tests/baselines/reference/generatorExplicitReturnType.js create mode 100644 tests/baselines/reference/generatorExplicitReturnType.symbols create mode 100644 tests/baselines/reference/generatorExplicitReturnType.types create mode 100644 tests/baselines/reference/generatorImplicitAny.js create mode 100644 tests/baselines/reference/generatorImplicitAny.symbols create mode 100644 tests/baselines/reference/generatorImplicitAny.types create mode 100644 tests/baselines/reference/generatorReturnTypeInference.js create mode 100644 tests/baselines/reference/generatorReturnTypeInference.symbols create mode 100644 tests/baselines/reference/generatorReturnTypeInference.types create mode 100644 tests/baselines/reference/generatorReturnTypeInferenceNonStrict.errors.txt create mode 100644 tests/baselines/reference/generatorReturnTypeInferenceNonStrict.js create mode 100644 tests/baselines/reference/generatorReturnTypeInferenceNonStrict.symbols create mode 100644 tests/baselines/reference/generatorReturnTypeInferenceNonStrict.types delete mode 100644 tests/baselines/reference/generatorTypeCheck47.errors.txt delete mode 100644 tests/baselines/reference/generatorTypeCheck51.errors.txt delete mode 100644 tests/baselines/reference/iteratorSpreadInArray9.errors.txt create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/strictGeneratorTypes/tsconfig.json create mode 100644 tests/cases/conformance/generators/generatorAssignability.ts create mode 100644 tests/cases/conformance/generators/generatorExplicitReturnType.ts create mode 100644 tests/cases/conformance/generators/generatorImplicitAny.ts create mode 100644 tests/cases/conformance/generators/generatorReturnTypeInference.ts create mode 100644 tests/cases/conformance/generators/generatorReturnTypeInferenceNonStrict.ts diff --git a/src/compiler/builderState.ts b/src/compiler/builderState.ts index 58b189d9e81..953334321c2 100644 --- a/src/compiler/builderState.ts +++ b/src/compiler/builderState.ts @@ -427,8 +427,8 @@ namespace ts.BuilderState { const references = state.referencedMap.get(path); if (references) { const iterator = references.keys(); - for (let { value, done } = iterator.next(); !done; { value, done } = iterator.next()) { - queue.push(value as Path); + for (let iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) { + queue.push(iterResult.value as Path); } } } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 497788b6d72..40b86ad679a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7,6 +7,56 @@ namespace ts { let nextMergeId = 1; let nextFlowId = 1; + const enum IterationUse { + AllowsSyncIterablesFlag = 1 << 0, + AllowsAsyncIterablesFlag = 1 << 1, + AllowsStringInputFlag = 1 << 2, + ForOfFlag = 1 << 3, + YieldStarFlag = 1 << 4, + SpreadFlag = 1 << 5, + DestructuringFlag = 1 << 6, + + // Spread, Destructuring, Array element assignment + Element = AllowsSyncIterablesFlag, + Spread = AllowsSyncIterablesFlag | SpreadFlag, + Destructuring = AllowsSyncIterablesFlag | DestructuringFlag, + + ForOf = AllowsSyncIterablesFlag | AllowsStringInputFlag | ForOfFlag, + ForAwaitOf = AllowsSyncIterablesFlag | AllowsAsyncIterablesFlag | AllowsStringInputFlag | ForOfFlag, + + YieldStar = AllowsSyncIterablesFlag | YieldStarFlag, + AsyncYieldStar = AllowsSyncIterablesFlag | AllowsAsyncIterablesFlag | YieldStarFlag, + + GeneratorReturnType = AllowsSyncIterablesFlag, + AsyncGeneratorReturnType = AllowsAsyncIterablesFlag, + + } + + const enum IterationTypeKind { + Yield, + Return, + Next, + } + + interface IterationTypesResolver { + iterableCacheKey: "iterationTypesOfAsyncIterable" | "iterationTypesOfIterable"; + iteratorCacheKey: "iterationTypesOfAsyncIterator" | "iterationTypesOfIterator"; + iteratorSymbolName: "asyncIterator" | "iterator"; + getGlobalIteratorType: (reportErrors: boolean) => Type; + getGlobalIterableType: (reportErrors: boolean) => Type; + getGlobalIterableIteratorType: (reportErrors: boolean) => Type; + getGlobalGeneratorType: (reportErrors: boolean) => Type; + resolveIterationType: (type: Type, errorNode: Node | undefined) => Type | undefined; + mustHaveANextMethodDiagnostic: DiagnosticMessage; + mustBeAMethodDiagnostic: DiagnosticMessage; + mustHaveAValueDiagnostic: DiagnosticMessage; + } + + const enum WideningKind { + Normal, + GeneratorYield + } + export function getNodeId(node: Node): number { if (!node.id) { node.id = nextNodeId; @@ -481,6 +531,44 @@ namespace ts { const enumNumberIndexInfo = createIndexInfo(stringType, /*isReadonly*/ true); + const iterationTypesCache = createMap(); // cache for common IterationTypes instances + const noIterationTypes: IterationTypes = { + get yieldType(): Type { throw new Error("Not supported"); }, + get returnType(): Type { throw new Error("Not supported"); }, + get nextType(): Type { throw new Error("Not supported"); }, + }; + const anyIterationTypes = createIterationTypes(anyType, anyType, anyType); + const anyIterationTypesExceptNext = createIterationTypes(anyType, anyType, unknownType); + const defaultIterationTypes = createIterationTypes(neverType, anyType, undefinedType); // default iteration types for `Iterator`. + + const asyncIterationTypesResolver: IterationTypesResolver = { + iterableCacheKey: "iterationTypesOfAsyncIterable", + iteratorCacheKey: "iterationTypesOfAsyncIterator", + iteratorSymbolName: "asyncIterator", + getGlobalIteratorType: getGlobalAsyncIteratorType, + getGlobalIterableType: getGlobalAsyncIterableType, + getGlobalIterableIteratorType: getGlobalAsyncIterableIteratorType, + getGlobalGeneratorType: getGlobalAsyncGeneratorType, + resolveIterationType: getAwaitedType, + mustHaveANextMethodDiagnostic: Diagnostics.An_async_iterator_must_have_a_next_method, + mustBeAMethodDiagnostic: Diagnostics.The_0_property_of_an_async_iterator_must_be_a_method, + mustHaveAValueDiagnostic: Diagnostics.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property, + }; + + const syncIterationTypesResolver: IterationTypesResolver = { + iterableCacheKey: "iterationTypesOfIterable", + iteratorCacheKey: "iterationTypesOfIterator", + iteratorSymbolName: "iterator", + getGlobalIteratorType, + getGlobalIterableType, + getGlobalIterableIteratorType, + getGlobalGeneratorType, + resolveIterationType: (type, _errorNode) => type, + mustHaveANextMethodDiagnostic: Diagnostics.An_iterator_must_have_a_next_method, + mustBeAMethodDiagnostic: Diagnostics.The_0_property_of_an_iterator_must_be_a_method, + mustHaveAValueDiagnostic: Diagnostics.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property, + }; + interface DuplicateInfoForSymbol { readonly firstFileLocations: Node[]; readonly secondFileLocations: Node[]; @@ -533,9 +621,13 @@ namespace ts { let deferredGlobalIterableType: GenericType; let deferredGlobalIteratorType: GenericType; let deferredGlobalIterableIteratorType: GenericType; + let deferredGlobalGeneratorType: GenericType; + let deferredGlobalIteratorYieldResultType: GenericType; + let deferredGlobalIteratorReturnResultType: GenericType; let deferredGlobalAsyncIterableType: GenericType; let deferredGlobalAsyncIteratorType: GenericType; let deferredGlobalAsyncIterableIteratorType: GenericType; + let deferredGlobalAsyncGeneratorType: GenericType; let deferredGlobalTemplateStringsArrayType: ObjectType; let deferredGlobalImportMetaType: ObjectType; let deferredGlobalExtractSymbol: Symbol; @@ -5108,7 +5200,7 @@ namespace ts { // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - const elementType = checkIteratedTypeOrElementType(parentType, pattern, /*allowStringInput*/ false, /*allowAsyncIterables*/ false); + const elementType = checkIteratedTypeOrElementType(IterationUse.Destructuring, parentType, undefinedType, pattern); const index = pattern.elements.indexOf(declaration); if (declaration.dotDotDotToken) { // If the parent is a tuple type, the rest element has a tuple type of the @@ -9340,25 +9432,41 @@ namespace ts { } function getGlobalAsyncIteratorType(reportErrors: boolean) { - return deferredGlobalAsyncIteratorType || (deferredGlobalAsyncIteratorType = getGlobalType("AsyncIterator" as __String, /*arity*/ 1, reportErrors)) || emptyGenericType; + return deferredGlobalAsyncIteratorType || (deferredGlobalAsyncIteratorType = getGlobalType("AsyncIterator" as __String, /*arity*/ 3, reportErrors)) || emptyGenericType; } function getGlobalAsyncIterableIteratorType(reportErrors: boolean) { return deferredGlobalAsyncIterableIteratorType || (deferredGlobalAsyncIterableIteratorType = getGlobalType("AsyncIterableIterator" as __String, /*arity*/ 1, reportErrors)) || emptyGenericType; } + function getGlobalAsyncGeneratorType(reportErrors: boolean) { + return deferredGlobalAsyncGeneratorType || (deferredGlobalAsyncGeneratorType = getGlobalType("AsyncGenerator" as __String, /*arity*/ 3, reportErrors)) || emptyGenericType; + } + function getGlobalIterableType(reportErrors: boolean) { return deferredGlobalIterableType || (deferredGlobalIterableType = getGlobalType("Iterable" as __String, /*arity*/ 1, reportErrors)) || emptyGenericType; } function getGlobalIteratorType(reportErrors: boolean) { - return deferredGlobalIteratorType || (deferredGlobalIteratorType = getGlobalType("Iterator" as __String, /*arity*/ 1, reportErrors)) || emptyGenericType; + return deferredGlobalIteratorType || (deferredGlobalIteratorType = getGlobalType("Iterator" as __String, /*arity*/ 3, reportErrors)) || emptyGenericType; } function getGlobalIterableIteratorType(reportErrors: boolean) { return deferredGlobalIterableIteratorType || (deferredGlobalIterableIteratorType = getGlobalType("IterableIterator" as __String, /*arity*/ 1, reportErrors)) || emptyGenericType; } + function getGlobalGeneratorType(reportErrors: boolean) { + return deferredGlobalGeneratorType || (deferredGlobalGeneratorType = getGlobalType("Generator" as __String, /*arity*/ 3, reportErrors)) || emptyGenericType; + } + + function getGlobalIteratorYieldResultType(reportErrors: boolean) { + return deferredGlobalIteratorYieldResultType || (deferredGlobalIteratorYieldResultType = getGlobalType("IteratorYieldResult" as __String, /*arity*/ 1, reportErrors)) || emptyGenericType; + } + + function getGlobalIteratorReturnResultType(reportErrors: boolean) { + return deferredGlobalIteratorReturnResultType || (deferredGlobalIteratorReturnResultType = getGlobalType("IteratorReturnResult" as __String, /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalTypeOrUndefined(name: __String, arity = 0): ObjectType | undefined { const symbol = getGlobalSymbol(name, SymbolFlags.Type, /*diagnostic*/ undefined); return symbol && getTypeOfGlobalSymbol(symbol, arity); @@ -9387,20 +9495,22 @@ namespace ts { return createTypeFromGenericGlobalType(getGlobalTypedPropertyDescriptorType(), [propertyType]); } - function createAsyncIterableType(iteratedType: Type): Type { - return createTypeFromGenericGlobalType(getGlobalAsyncIterableType(/*reportErrors*/ true), [iteratedType]); - } - - function createAsyncIterableIteratorType(iteratedType: Type): Type { - return createTypeFromGenericGlobalType(getGlobalAsyncIterableIteratorType(/*reportErrors*/ true), [iteratedType]); + function createAsyncGeneratorType(yieldType: Type, returnType: Type, nextType: Type) { + const globalAsyncGeneratorType = getGlobalAsyncGeneratorType(/*reportErrors*/ true); + if (globalAsyncGeneratorType !== emptyGenericType) { + yieldType = getAwaitedType(yieldType) || unknownType; + returnType = getAwaitedType(returnType) || unknownType; + nextType = getAwaitedType(nextType) || unknownType; + } + return createTypeFromGenericGlobalType(globalAsyncGeneratorType, [yieldType, returnType, nextType]); } function createIterableType(iteratedType: Type): Type { return createTypeFromGenericGlobalType(getGlobalIterableType(/*reportErrors*/ true), [iteratedType]); } - function createIterableIteratorType(iteratedType: Type): Type { - return createTypeFromGenericGlobalType(getGlobalIterableIteratorType(/*reportErrors*/ true), [iteratedType]); + function createGeneratorType(yieldType: Type, returnType: Type, nextType: Type) { + return createTypeFromGenericGlobalType(getGlobalGeneratorType(/*reportErrors*/ true), [yieldType, returnType, nextType]); } function createArrayType(elementType: Type, readonly?: boolean): ObjectType { @@ -14528,6 +14638,25 @@ namespace ts { return type; } + function getWidenedLiteralLikeTypeForContextualReturnTypeIfNeeded(type: Type | undefined, contextualSignatureReturnType: Type | undefined, isAsync: boolean) { + if (type && isUnitType(type)) { + const contextualType = !contextualSignatureReturnType ? undefined : + isAsync ? getPromisedTypeOfPromise(contextualSignatureReturnType) : + contextualSignatureReturnType; + type = getWidenedLiteralLikeTypeForContextualType(type, contextualType); + } + return type; + } + + function getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(type: Type | undefined, contextualSignatureReturnType: Type | undefined, kind: IterationTypeKind, isAsyncGenerator: boolean) { + if (type && isUnitType(type)) { + const contextualType = !contextualSignatureReturnType ? undefined : + getIterationTypeOfGeneratorFunctionReturnType(kind, contextualSignatureReturnType, isAsyncGenerator); + type = getWidenedLiteralLikeTypeForContextualType(type, contextualType); + } + return type; + } + /** * Check if a Type was written as a tuple type literal. * Prefer using isTupleLikeType() unless the use of `elementTypes` is required. @@ -14884,7 +15013,7 @@ namespace ts { return errorReported; } - function reportImplicitAny(declaration: Declaration, type: Type) { + function reportImplicitAny(declaration: Declaration, type: Type, wideningKind?: WideningKind) { const typeAsString = typeToString(getWidenedType(type)); if (isInJSFile(declaration) && !isCheckJsEnabledForFile(getSourceFileOfNode(declaration), compilerOptions)) { // Only report implicit any errors/suggestions in TS and ts-check JS files @@ -14930,10 +15059,17 @@ namespace ts { case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: if (noImplicitAny && !(declaration as NamedDeclaration).name) { - error(declaration, Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); + if (wideningKind === WideningKind.GeneratorYield) { + error(declaration, Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); + } + else { + error(declaration, Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); + } return; } - diagnostic = noImplicitAny ? Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type : Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage; + diagnostic = !noImplicitAny ? Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage : + wideningKind === WideningKind.GeneratorYield ? Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : + Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; case SyntaxKind.MappedType: if (noImplicitAny) { @@ -14946,11 +15082,11 @@ namespace ts { errorOrSuggestion(noImplicitAny, declaration, diagnostic, declarationNameToString(getNameOfDeclaration(declaration)), typeAsString); } - function reportErrorsFromWidening(declaration: Declaration, type: Type) { + function reportErrorsFromWidening(declaration: Declaration, type: Type, wideningKind?: WideningKind) { if (produceDiagnostics && noImplicitAny && getObjectFlags(type) & ObjectFlags.ContainsWideningType) { // Report implicit any error within type if possible, otherwise report error on declaration if (!reportWideningErrorsInType(type)) { - reportImplicitAny(declaration, type); + reportImplicitAny(declaration, type, wideningKind); } } } @@ -15159,7 +15295,7 @@ namespace ts { return getTypeFromInference(inference) || unknownType; } - function* getUnmatchedProperties(source: Type, target: Type, requireOptionalProperties: boolean, matchDiscriminantProperties: boolean) { + function* getUnmatchedProperties(source: Type, target: Type, requireOptionalProperties: boolean, matchDiscriminantProperties: boolean): IterableIterator { const properties = target.flags & TypeFlags.Union ? getPossiblePropertiesOfUnionType(target as UnionType) : getPropertiesOfType(target); for (const targetProp of properties) { if (requireOptionalProperties || !(targetProp.flags & SymbolFlags.Optional || getCheckFlags(targetProp) & CheckFlags.Partial)) { @@ -15181,7 +15317,8 @@ namespace ts { } function getUnmatchedProperty(source: Type, target: Type, requireOptionalProperties: boolean, matchDiscriminantProperties: boolean): Symbol | undefined { - return getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties).next().value; + const result = getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties).next(); + if (!result.done) return result.value; } function tupleTypesDefinitelyUnrelated(source: TupleTypeReference, target: TupleTypeReference) { @@ -16160,12 +16297,12 @@ namespace ts { function getTypeOfDestructuredArrayElement(type: Type, index: number) { return everyType(type, isTupleLikeType) && getTupleElementType(type, index) || - checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || + checkIteratedTypeOrElementType(IterationUse.Destructuring, type, undefinedType, /*errorNode*/ undefined) || errorType; } function getTypeOfDestructuredSpreadExpression(type: Type) { - return createArrayType(checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || errorType); + return createArrayType(checkIteratedTypeOrElementType(IterationUse.Destructuring, type, undefinedType, /*errorNode*/ undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node: BinaryExpression): Type { @@ -18442,7 +18579,7 @@ namespace ts { if (contextualReturnType) { return node.asteriskToken ? contextualReturnType - : getIteratedTypeOfGenerator(contextualReturnType, (functionFlags & FunctionFlags.Async) !== 0); + : getIterationTypeOfGeneratorFunctionReturnType(IterationTypeKind.Yield, contextualReturnType, (functionFlags & FunctionFlags.Async) !== 0); } } @@ -18675,7 +18812,7 @@ namespace ts { function getContextualTypeForElementExpression(arrayContextualType: Type | undefined, index: number): Type | undefined { return arrayContextualType && ( getTypeOfPropertyOfContextualType(arrayContextualType, "" + index as __String) - || getIteratedTypeOrElementType(arrayContextualType, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterables*/ false, /*checkAssignability*/ false)); + || getIteratedTypeOrElementType(IterationUse.Element, arrayContextualType, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false)); } // In a contextually typed conditional expression, the true/false expressions are contextually typed by the same type. @@ -18873,6 +19010,10 @@ namespace ts { case SyntaxKind.AwaitExpression: return getContextualTypeForAwaitOperand(parent); case SyntaxKind.CallExpression: + if ((parent).expression.kind === SyntaxKind.ImportKeyword) { + return stringType; + } + /* falls through */ case SyntaxKind.NewExpression: return getContextualTypeForArgument(parent, node); case SyntaxKind.TypeAssertionExpression: @@ -19140,7 +19281,7 @@ namespace ts { } const arrayOrIterableType = checkExpression(node.expression, checkMode); - return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false, /*allowAsyncIterables*/ false); + return checkIteratedTypeOrElementType(IterationUse.Spread, arrayOrIterableType, undefinedType, node.expression); } function hasDefaultValue(node: BindingElement | Expression): boolean { @@ -19173,7 +19314,7 @@ namespace ts { // if there is no index type / iterated type. const restArrayType = checkExpression((e).expression, checkMode, forceTuple); const restElementType = getIndexTypeOfType(restArrayType, IndexKind.Number) || - getIteratedTypeOrElementType(restArrayType, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterables*/ false, /*checkAssignability*/ false); + getIteratedTypeOrElementType(IterationUse.Destructuring, restArrayType, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false); if (restElementType) { elementTypes.push(restElementType); } @@ -22937,106 +23078,128 @@ namespace ts { } const functionFlags = getFunctionFlags(func); - let type: Type; - if (func.body.kind !== SyntaxKind.Block) { - type = checkExpressionCached(func.body, checkMode && checkMode & ~CheckMode.SkipGenericFunctions); - if (functionFlags & FunctionFlags.Async) { + const isAsync = (functionFlags & FunctionFlags.Async) !== 0; + const isGenerator = (functionFlags & FunctionFlags.Generator) !== 0; + + let returnType: Type | undefined; + let yieldType: Type | undefined; + let nextType: Type | undefined; + let fallbackReturnType: Type = voidType; + if (func.body.kind !== SyntaxKind.Block) { // Async or normal arrow function + returnType = checkExpressionCached(func.body, checkMode && checkMode & ~CheckMode.SkipGenericFunctions); + if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any // Promise/A+ compatible implementation will always assimilate any foreign promise, so the // return type of the body should be unwrapped to its awaited type, which we will wrap in // the native Promise type later in this function. - type = checkAwaitedType(type, /*errorNode*/ func, Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); + returnType = checkAwaitedType(returnType, /*errorNode*/ func, Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } } - else { - let types = checkAndAggregateReturnExpressionTypes(func, checkMode); - if (functionFlags & FunctionFlags.Generator) { // Generator or AsyncGenerator function - types = concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), types); - if (!types || types.length === 0) { - const iterableIteratorAny = functionFlags & FunctionFlags.Async - ? createAsyncIterableIteratorType(anyType) // AsyncGenerator function - : createIterableIteratorType(anyType); // Generator function - if (noImplicitAny) { - error(func.asteriskToken, - Diagnostics.Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type, typeToString(iterableIteratorAny)); - } - return iterableIteratorAny; - } + else if (isGenerator) { // Generator or AsyncGenerator function + const returnTypes = checkAndAggregateReturnExpressionTypes(func, checkMode); + if (!returnTypes) { + fallbackReturnType = neverType; } - else { - if (!types) { - // For an async function, the return type will not be never, but rather a Promise for never. - return functionFlags & FunctionFlags.Async - ? createPromiseReturnType(func, neverType) // Async function - : neverType; // Normal function - } - if (types.length === 0) { - // For an async function, the return type will not be void, but rather a Promise for void. - return functionFlags & FunctionFlags.Async - ? createPromiseReturnType(func, voidType) // Async function - : voidType; // Normal function - } + else if (returnTypes.length > 0) { + returnType = getUnionType(returnTypes, UnionReduction.Subtype); + } + const { yieldTypes, nextTypes } = checkAndAggregateYieldOperandTypes(func, checkMode); + yieldType = some(yieldTypes) ? getUnionType(yieldTypes, UnionReduction.Subtype) : undefined; + nextType = some(nextTypes) ? getIntersectionType(nextTypes) : undefined; + } + else { // Async or normal function + const types = checkAndAggregateReturnExpressionTypes(func, checkMode); + if (!types) { + // For an async function, the return type will not be never, but rather a Promise for never. + return functionFlags & FunctionFlags.Async + ? createPromiseReturnType(func, neverType) // Async function + : neverType; // Normal function + } + if (types.length === 0) { + // For an async function, the return type will not be void, but rather a Promise for void. + return functionFlags & FunctionFlags.Async + ? createPromiseReturnType(func, voidType) // Async function + : voidType; // Normal function } // Return a union of the return expression types. - type = getUnionType(types, UnionReduction.Subtype); + returnType = getUnionType(types, UnionReduction.Subtype); } - const contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); - if (!contextualSignature) { - reportErrorsFromWidening(func, type); - } - - if (isUnitType(type)) { - let contextualType = !contextualSignature ? undefined : - contextualSignature === getSignatureFromDeclaration(func) ? type : - getReturnTypeOfSignature(contextualSignature); - if (contextualType) { - switch (functionFlags & FunctionFlags.AsyncGenerator) { - case FunctionFlags.AsyncGenerator: - contextualType = getIteratedTypeOfGenerator(contextualType, /*isAsyncGenerator*/ true); - break; - case FunctionFlags.Generator: - contextualType = getIteratedTypeOfGenerator(contextualType, /*isAsyncGenerator*/ false); - break; - case FunctionFlags.Async: - contextualType = getPromisedTypeOfPromise(contextualType); - break; + if (returnType || yieldType || nextType) { + const contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); + if (!contextualSignature) { + if (yieldType) reportErrorsFromWidening(func, yieldType, WideningKind.GeneratorYield); + if (returnType) reportErrorsFromWidening(func, returnType); + if (nextType) reportErrorsFromWidening(func, nextType); + } + if (returnType && isUnitType(returnType) || + yieldType && isUnitType(yieldType) || + nextType && isUnitType(nextType)) { + const contextualType = !contextualSignature ? undefined : + contextualSignature === getSignatureFromDeclaration(func) ? isGenerator ? undefined : returnType : + getReturnTypeOfSignature(contextualSignature); + if (isGenerator) { + yieldType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(yieldType, contextualType, IterationTypeKind.Yield, isAsync); + returnType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(returnType, contextualType, IterationTypeKind.Return, isAsync); + nextType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(nextType, contextualType, IterationTypeKind.Next, isAsync); + } + else { + returnType = getWidenedLiteralLikeTypeForContextualReturnTypeIfNeeded(returnType, contextualType, isAsync); } } - type = getWidenedLiteralLikeTypeForContextualType(type, contextualType); + + if (yieldType) yieldType = getWidenedType(yieldType); + if (returnType) returnType = getWidenedType(returnType); + if (nextType) nextType = getWidenedType(nextType); } - const widenedType = getWidenedType(type); - switch (functionFlags & FunctionFlags.AsyncGenerator) { - case FunctionFlags.AsyncGenerator: - return createAsyncIterableIteratorType(widenedType); - case FunctionFlags.Generator: - return createIterableIteratorType(widenedType); - case FunctionFlags.Async: - // From within an async function you can return either a non-promise value or a promise. Any - // Promise/A+ compatible implementation will always assimilate any foreign promise, so the - // return type of the body is awaited type of the body, wrapped in a native Promise type. - return createPromiseType(widenedType); - default: - return widenedType; + if (isGenerator) { + return createGeneratorReturnType(yieldType || neverType, returnType || fallbackReturnType, nextType || unknownType, isAsync); + } + else { + // From within an async function you can return either a non-promise value or a promise. Any + // Promise/A+ compatible implementation will always assimilate any foreign promise, so the + // return type of the body is awaited type of the body, wrapped in a native Promise type. + return isAsync + ? createPromiseType(returnType || fallbackReturnType) + : returnType || fallbackReturnType; } } - function checkAndAggregateYieldOperandTypes(func: FunctionLikeDeclaration, checkMode: CheckMode | undefined): Type[] { - const aggregatedTypes: Type[] = []; + function createGeneratorReturnType(yieldType: Type, returnType: Type, nextType: Type, isAsyncGenerator: boolean) { + return isAsyncGenerator + ? createAsyncGeneratorType(yieldType, returnType, nextType) + : createGeneratorType(yieldType, returnType, nextType); + } + + function checkAndAggregateYieldOperandTypes(func: FunctionLikeDeclaration, checkMode: CheckMode | undefined) { + const yieldTypes: Type[] = []; + const nextTypes: Type[] = []; const isAsync = (getFunctionFlags(func) & FunctionFlags.Async) !== 0; forEachYieldExpression(func.body, yieldExpression => { - pushIfUnique(aggregatedTypes, getYieldedTypeOfYieldExpression(yieldExpression, isAsync, checkMode)); + const yieldExpressionType = yieldExpression.expression ? checkExpression(yieldExpression.expression, checkMode) : undefinedWideningType; + pushIfUnique(yieldTypes, getYieldedTypeOfYieldExpression(yieldExpression, yieldExpressionType, anyType, isAsync)); + let nextType: Type | undefined; + if (yieldExpression.asteriskToken) { + const iterationTypes = getIterationTypesOfIterable( + yieldExpressionType, + isAsync ? IterationUse.AsyncYieldStar : IterationUse.YieldStar, + yieldExpression.expression); + nextType = iterationTypes && iterationTypes.nextType; + } + else { + nextType = getContextualType(yieldExpression); + } + if (nextType) pushIfUnique(nextTypes, nextType); }); - return aggregatedTypes; + return { yieldTypes, nextTypes }; } - function getYieldedTypeOfYieldExpression(node: YieldExpression, isAsync: boolean, checkMode?: CheckMode): Type | undefined { + function getYieldedTypeOfYieldExpression(node: YieldExpression, expressionType: Type, sentType: Type, isAsync: boolean): Type | undefined { const errorNode = node.expression || node; - const expressionType = node.expression ? checkExpression(node.expression, checkMode) : undefinedWideningType; // A `yield*` expression effectively yields everything that its operand yields - const yieldedType = node.asteriskToken ? checkIteratedTypeOrElementType(expressionType, errorNode, /*allowStringInput*/ false, isAsync) : expressionType; + const yieldedType = node.asteriskToken ? checkIteratedTypeOrElementType(isAsync ? IterationUse.AsyncYieldStar : IterationUse.YieldStar, expressionType, sentType, errorNode) : expressionType; return !isAsync ? yieldedType : getAwaitedType(yieldedType, errorNode, node.asteriskToken ? Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member : Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); @@ -23182,8 +23345,11 @@ namespace ts { return; } + const functionFlags = getFunctionFlags(func); + const type = returnType && getReturnOrPromisedType(returnType, functionFlags); + // Functions with with an explicitly specified 'void' or 'any' return type don't need any return expressions. - if (returnType && maybeTypeOfKind(returnType, TypeFlags.Any | TypeFlags.Void)) { + if (type && maybeTypeOfKind(type, TypeFlags.Any | TypeFlags.Void)) { return; } @@ -23195,20 +23361,20 @@ namespace ts { const hasExplicitReturn = func.flags & NodeFlags.HasExplicitReturn; - if (returnType && returnType.flags & TypeFlags.Never) { + if (type && type.flags & TypeFlags.Never) { error(getEffectiveReturnTypeNode(func), Diagnostics.A_function_returning_never_cannot_have_a_reachable_end_point); } - else if (returnType && !hasExplicitReturn) { + else if (type && !hasExplicitReturn) { // minimal check: function has syntactic return type annotation and no explicit return statements in the body // this function does not conform to the specification. // NOTE: having returnType !== undefined is a precondition for entering this branch so func.type will always be present error(getEffectiveReturnTypeNode(func), Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value); } - else if (returnType && strictNullChecks && !isTypeAssignableTo(undefinedType, returnType)) { + else if (type && strictNullChecks && !isTypeAssignableTo(undefinedType, type)) { error(getEffectiveReturnTypeNode(func), Diagnostics.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined); } else if (compilerOptions.noImplicitReturns) { - if (!returnType) { + if (!type) { // If return type annotation is omitted check if function has any explicit return statements. // If it does not have any - its inferred return type is void - don't do any checks. // Otherwise get inferred return type from function body and report error only if it is not void / anytype @@ -23298,22 +23464,20 @@ namespace ts { } } - function getReturnOrPromisedType(node: FunctionLikeDeclaration | MethodSignature, functionFlags: FunctionFlags) { - const type = getReturnTypeFromAnnotation(node); - return type && ((functionFlags & FunctionFlags.AsyncGenerator) === FunctionFlags.Async) ? - getAwaitedType(type) || errorType : type; + function getReturnOrPromisedType(type: Type | undefined, functionFlags: FunctionFlags) { + const isGenerator = !!(functionFlags & FunctionFlags.Generator); + const isAsync = !!(functionFlags & FunctionFlags.Async); + return type && isGenerator ? getIterationTypeOfGeneratorFunctionReturnType(IterationTypeKind.Return, type, isAsync) || errorType : + type && isAsync ? getAwaitedType(type) || errorType : + type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node: ArrowFunction | FunctionExpression | MethodDeclaration) { Debug.assert(node.kind !== SyntaxKind.MethodDeclaration || isObjectLiteralMethod(node)); const functionFlags = getFunctionFlags(node); - const returnOrPromisedType = getReturnOrPromisedType(node, functionFlags); - - if ((functionFlags & FunctionFlags.Generator) === 0) { // Async function or normal function - // return is not necessary in the body of generators - checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); - } + const returnType = getReturnTypeFromAnnotation(node); + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); if (node.body) { if (!getEffectiveReturnTypeNode(node)) { @@ -23335,6 +23499,7 @@ namespace ts { // check assignability of the awaited type of the expression body against the promised type of // its return type annotation. const exprType = checkExpression(node.body); + const returnOrPromisedType = getReturnOrPromisedType(returnType, functionFlags); if (returnOrPromisedType) { if ((functionFlags & FunctionFlags.AsyncGenerator) === FunctionFlags.Async) { // Async function const awaitedType = checkAwaitedType(exprType, node.body, Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); @@ -23737,7 +23902,7 @@ namespace ts { // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - const elementType = checkIteratedTypeOrElementType(sourceType, node, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || errorType; + const elementType = checkIteratedTypeOrElementType(IterationUse.Destructuring, sourceType, undefinedType, node) || errorType; for (let i = 0; i < elements.length; i++) { checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, checkMode); } @@ -24245,33 +24410,44 @@ namespace ts { return anyType; } + const isAsync = (functionFlags & FunctionFlags.Async) !== 0; if (node.asteriskToken) { // Async generator functions prior to ESNext require the __await, __asyncDelegator, // and __asyncValues helpers - if ((functionFlags & FunctionFlags.AsyncGenerator) === FunctionFlags.AsyncGenerator && - languageVersion < ScriptTarget.ESNext) { + if (isAsync && languageVersion < ScriptTarget.ESNext) { checkExternalEmitHelpers(node, ExternalEmitHelpers.AsyncDelegatorIncludes); } // Generator functions prior to ES2015 require the __values helper - if ((functionFlags & FunctionFlags.AsyncGenerator) === FunctionFlags.Generator && - languageVersion < ScriptTarget.ES2015 && compilerOptions.downlevelIteration) { + if (!isAsync && languageVersion < ScriptTarget.ES2015 && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, ExternalEmitHelpers.Values); } } - const isAsync = (functionFlags & FunctionFlags.Async) !== 0; - const yieldedType = getYieldedTypeOfYieldExpression(node, isAsync)!; // TODO: GH#18217 // There is no point in doing an assignability check if the function // has no explicit return type because the return type is directly computed // from the yield expressions. const returnType = getReturnTypeFromAnnotation(func); - if (returnType) { - const signatureElementType = getIteratedTypeOfGenerator(returnType, isAsync) || anyType; - checkTypeAssignableToAndOptionallyElaborate(yieldedType, signatureElementType, node.expression || node, node.expression); + const iterationTypes = returnType && getIterationTypesOfGeneratorFunctionReturnType(returnType, isAsync); + const signatureYieldType = iterationTypes && iterationTypes.yieldType || anyType; + const signatureNextType = iterationTypes && iterationTypes.nextType || anyType; + const resolvedSignatureNextType = isAsync ? getAwaitedType(signatureNextType) || anyType : signatureNextType; + const yieldExpressionType = node.expression ? checkExpression(node.expression) : undefinedWideningType; + const yieldedType = getYieldedTypeOfYieldExpression(node, yieldExpressionType, resolvedSignatureNextType, isAsync); + if (returnType && yieldedType) { + checkTypeAssignableToAndOptionallyElaborate(yieldedType, signatureYieldType, node.expression || node, node.expression); + } + + if (node.asteriskToken) { + const use = isAsync ? IterationUse.AsyncYieldStar : IterationUse.YieldStar; + return getIterationTypeOfIterable(use, IterationTypeKind.Return, yieldExpressionType, node.expression) + || anyType; + } + else if (returnType) { + return getIterationTypeOfGeneratorFunctionReturnType(IterationTypeKind.Next, returnType, isAsync) + || anyType; } - // Both yield and yield* expressions have type 'any' return anyType; } @@ -24989,18 +25165,17 @@ namespace ts { error(returnTypeNode, Diagnostics.A_generator_cannot_have_a_void_type_annotation); } else { - const generatorElementType = getIteratedTypeOfGenerator(returnType, (functionFlags & FunctionFlags.Async) !== 0) || anyType; - const iterableIteratorInstantiation = functionFlags & FunctionFlags.Async - ? createAsyncIterableIteratorType(generatorElementType) // AsyncGenerator function - : createIterableIteratorType(generatorElementType); // Generator function - - // Naively, one could check that IterableIterator is assignable to the return type annotation. + // Naively, one could check that Generator is assignable to the return type annotation. // However, that would not catch the error in the following case. // // interface BadGenerator extends Iterable, Iterator { } // function* g(): BadGenerator { } // Iterable and Iterator have different types! // - checkTypeAssignableTo(iterableIteratorInstantiation, returnType, returnTypeNode); + const generatorYieldType = getIterationTypeOfGeneratorFunctionReturnType(IterationTypeKind.Yield, returnType, (functionFlags & FunctionFlags.Async) !== 0) || anyType; + const generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(IterationTypeKind.Return, returnType, (functionFlags & FunctionFlags.Async) !== 0) || generatorYieldType; + const generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(IterationTypeKind.Next, returnType, (functionFlags & FunctionFlags.Async) !== 0) || unknownType; + const generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags & FunctionFlags.Async)); + checkTypeAssignableTo(generatorInstantiation, returnType, returnTypeNode); } } else if ((functionFlags & FunctionFlags.AsyncGenerator) === FunctionFlags.Async) { @@ -25891,9 +26066,9 @@ namespace ts { } } - function getAwaitedTypeOfPromise(type: Type, errorNode?: Node, diagnosticMessage?: DiagnosticMessage): Type | undefined { + function getAwaitedTypeOfPromise(type: Type, errorNode?: Node, diagnosticMessage?: DiagnosticMessage, arg0?: string | number): Type | undefined { const promisedType = getPromisedTypeOfPromise(type, errorNode); - return promisedType && getAwaitedType(promisedType, errorNode, diagnosticMessage); + return promisedType && getAwaitedType(promisedType, errorNode, diagnosticMessage, arg0); } /** @@ -25961,11 +26136,11 @@ namespace ts { * Promise-like type; otherwise, it is the type of the expression. This is used to reflect * The runtime behavior of the `await` keyword. */ - function checkAwaitedType(type: Type, errorNode: Node, diagnosticMessage: DiagnosticMessage): Type { - return getAwaitedType(type, errorNode, diagnosticMessage) || errorType; + function checkAwaitedType(type: Type, errorNode: Node, diagnosticMessage: DiagnosticMessage, arg0?: string | number): Type { + return getAwaitedType(type, errorNode, diagnosticMessage, arg0) || errorType; } - function getAwaitedType(type: Type, errorNode?: Node, diagnosticMessage?: DiagnosticMessage): Type | undefined { + function getAwaitedType(type: Type, errorNode?: Node, diagnosticMessage?: DiagnosticMessage, arg0?: string | number): Type | undefined { const typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; @@ -25978,7 +26153,7 @@ namespace ts { if (type.flags & TypeFlags.Union) { let types: Type[] | undefined; for (const constituentType of (type).types) { - types = append(types, getAwaitedType(constituentType, errorNode, diagnosticMessage)); + types = append(types, getAwaitedType(constituentType, errorNode, diagnosticMessage, arg0)); } if (!types) { @@ -26032,7 +26207,7 @@ namespace ts { // Keep track of the type we're about to unwrap to avoid bad recursive promise types. // See the comments above for more information. awaitedTypeStack.push(type.id); - const awaitedType = getAwaitedType(promisedType, errorNode, diagnosticMessage); + const awaitedType = getAwaitedType(promisedType, errorNode, diagnosticMessage, arg0); awaitedTypeStack.pop(); if (!awaitedType) { @@ -26061,7 +26236,7 @@ namespace ts { if (thenFunction && getSignaturesOfType(thenFunction, SignatureKind.Call).length > 0) { if (errorNode) { if (!diagnosticMessage) return Debug.fail(); - error(errorNode, diagnosticMessage); + error(errorNode, diagnosticMessage, arg0); } return undefined; } @@ -26545,11 +26720,7 @@ namespace ts { const body = node.kind === SyntaxKind.MethodSignature ? undefined : node.body; checkSourceElement(body); - - if ((functionFlags & FunctionFlags.Generator) === 0) { // Async function or normal function - const returnOrPromisedType = getReturnOrPromisedType(node, functionFlags); - checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); - } + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !getEffectiveReturnTypeNode(node)) { // Report an implicit any error if there is no body, no explicit return type, and node is not a private method @@ -27151,7 +27322,7 @@ namespace ts { // check the binding pattern with empty elements if (needCheckWidenedType) { if (isArrayBindingPattern(node.name)) { - checkIteratedTypeOrElementType(widenedType, node, /* allowStringInput */ false, /* allowAsyncIterables */ false); + checkIteratedTypeOrElementType(IterationUse.Destructuring, widenedType, undefinedType, node); } else if (strictNullChecks) { checkNonNullNonVoidType(widenedType, node); @@ -27449,15 +27620,16 @@ namespace ts { function checkRightHandSideOfForOf(rhsExpression: Expression, awaitModifier: AwaitKeywordToken | undefined): Type { const expressionType = checkNonNullExpression(rhsExpression); - return checkIteratedTypeOrElementType(expressionType, rhsExpression, /*allowStringInput*/ true, awaitModifier !== undefined); + const use = awaitModifier ? IterationUse.ForAwaitOf : IterationUse.ForOf; + return checkIteratedTypeOrElementType(use, expressionType, undefinedType, rhsExpression); } - function checkIteratedTypeOrElementType(inputType: Type, errorNode: Node | undefined, allowStringInput: boolean, allowAsyncIterables: boolean): Type { + function checkIteratedTypeOrElementType(use: IterationUse, inputType: Type, sentType: Type, errorNode: Node | undefined): Type { if (isTypeAny(inputType)) { return inputType; } - return getIteratedTypeOrElementType(inputType, errorNode, allowStringInput, allowAsyncIterables, /*checkAssignability*/ true) || anyType; + return getIteratedTypeOrElementType(use, inputType, sentType, errorNode, /*checkAssignability*/ true) || anyType; } /** @@ -27465,7 +27637,8 @@ namespace ts { * we want to get the iterated type of an iterable for ES2015 or later, or the iterated type * of a iterable (if defined globally) or element type of an array like for ES2015 or earlier. */ - function getIteratedTypeOrElementType(inputType: Type, errorNode: Node | undefined, allowStringInput: boolean, allowAsyncIterables: boolean, checkAssignability: boolean): Type | undefined { + function getIteratedTypeOrElementType(use: IterationUse, inputType: Type, sentType: Type, errorNode: Node | undefined, checkAssignability: boolean): Type | undefined { + const allowAsyncIterables = (use & IterationUse.AllowsAsyncIterablesFlag) !== 0; if (inputType === neverType) { reportTypeNotIterableError(errorNode!, inputType, allowAsyncIterables); // TODO: GH#18217 return undefined; @@ -27479,9 +27652,22 @@ namespace ts { // downlevelIteration is requested. if (uplevelIteration || downlevelIteration || allowAsyncIterables) { // We only report errors for an invalid iterable type in ES2015 or higher. - const iteratedType = getIteratedTypeOfIterable(inputType, uplevelIteration ? errorNode : undefined, allowAsyncIterables, /*allowSyncIterables*/ true, checkAssignability); - if (iteratedType || uplevelIteration) { - return iteratedType; + const iterationTypes = getIterationTypesOfIterable(inputType, use, uplevelIteration ? errorNode : undefined); + if (checkAssignability) { + if (iterationTypes) { + const diagnostic = + use & IterationUse.ForOfFlag ? Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0 : + use & IterationUse.SpreadFlag ? Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0 : + use & IterationUse.DestructuringFlag ? Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0 : + use & IterationUse.YieldStarFlag ? Diagnostics.Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0 : + undefined; + if (diagnostic) { + checkTypeAssignableTo(sentType, iterationTypes.nextType, errorNode, diagnostic); + } + } + } + if (iterationTypes || uplevelIteration) { + return iterationTypes && iterationTypes.yieldType; } } @@ -27492,7 +27678,7 @@ namespace ts { // If strings are permitted, remove any string-like constituents from the array type. // This allows us to find other non-string element types from an array unioned with // a string. - if (allowStringInput) { + if (use & IterationUse.AllowsStringInputFlag) { if (arrayType.flags & TypeFlags.Union) { // After we remove all types that are StringLike, we will know if there was a string constituent // based on whether the result of filter is a new array. @@ -27530,16 +27716,16 @@ namespace ts { // want to say that number is not an array type. But if the input was just // number and string input is allowed, we want to say that number is not an // array type or a string type. - const isIterable = !!getIteratedTypeOfIterable(inputType, /* errorNode */ undefined, allowAsyncIterables, /*allowSyncIterables*/ true, checkAssignability); - const diagnostic = !allowStringInput || hasStringConstituent + const yieldType = getIterationTypeOfIterable(use, IterationTypeKind.Yield, inputType, /*errorNode*/ undefined); + const diagnostic = !(use & IterationUse.AllowsStringInputFlag) || hasStringConstituent ? downlevelIteration ? Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator - : isIterable + : yieldType ? Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators : Diagnostics.Type_0_is_not_an_array_type : downlevelIteration ? Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator - : isIterable + : yieldType ? Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators : Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; error(errorNode, diagnostic, typeToString(arrayType)); @@ -27561,33 +27747,82 @@ namespace ts { } /** - * We want to treat type as an iterable, and get the type it is an iterable of. The iterable - * must have the following structure (annotated with the names of the variables below): + * Gets the requested "iteration type" from an `Iterable`-like or `AsyncIterable`-like type. + */ + function getIterationTypeOfIterable(use: IterationUse, typeKind: IterationTypeKind, inputType: Type, errorNode: Node | undefined): Type | undefined { + if (isTypeAny(inputType)) { + return undefined; + } + + const iterationTypes = getIterationTypesOfIterable(inputType, use, errorNode); + return iterationTypes && iterationTypes[getIterationTypesKeyFromIterationTypeKind(typeKind)]; + } + + function createIterationTypes(yieldType: Type = neverType, returnType: Type = neverType, nextType: Type = unknownType): IterationTypes { + // `yieldType` and `returnType` are defaulted to `neverType` they each will be combined + // via `getUnionType` when merging iteration types. `nextType` is defined as `unknownType` + // as it is combined via `getIntersectionType` when merging iteration types. + + // Use the cache only for intrinsic types to keep it small as they are likely to be + // more frequently created (i.e. `Iterator`). Iteration types + // are also cached on the type they are requested for, so we shouldn't need to maintain + // the cache for less-frequently used types. + if (yieldType.flags & TypeFlags.Intrinsic && + returnType.flags & (TypeFlags.Any | TypeFlags.Never | TypeFlags.Unknown | TypeFlags.Void | TypeFlags.Undefined) && + nextType.flags & (TypeFlags.Any | TypeFlags.Never | TypeFlags.Unknown | TypeFlags.Void | TypeFlags.Undefined)) { + const id = getTypeListId([yieldType, returnType, nextType]); + let iterationTypes = iterationTypesCache.get(id); + if (!iterationTypes) { + iterationTypes = { yieldType, returnType, nextType }; + iterationTypesCache.set(id, iterationTypes); + } + return iterationTypes; + } + return { yieldType, returnType, nextType }; + } + + /** + * Combines multiple `IterationTypes` records. * - * { // iterable - * [Symbol.iterator]: { // iteratorMethod - * (): Iterator - * } - * } + * If `array` is empty or all elements are missing or are references to `noIterationTypes`, + * then `noIterationTypes` is returned. Otherwise, an `IterationTypes` record is returned + * for the combined iteration types. + */ + function combineIterationTypes(array: (IterationTypes | undefined)[]) { + let yieldTypes: Type[] | undefined; + let returnTypes: Type[] | undefined; + let nextTypes: Type[] | undefined; + for (const iterationTypes of array) { + if (iterationTypes === undefined || iterationTypes === noIterationTypes) { + continue; + } + if (iterationTypes === anyIterationTypes) { + return anyIterationTypes; + } + yieldTypes = append(yieldTypes, iterationTypes.yieldType); + returnTypes = append(returnTypes, iterationTypes.returnType); + nextTypes = append(nextTypes, iterationTypes.nextType); + } + if (yieldTypes || returnTypes || nextTypes) { + return createIterationTypes( + yieldTypes && getUnionType(yieldTypes), + returnTypes && getUnionType(returnTypes), + nextTypes && getIntersectionType(nextTypes)); + } + return noIterationTypes; + } + + /** + * Gets the *yield*, *return*, and *next* types from an `Iterable`-like or `AsyncIterable`-like type. * - * For an async iterable, we expect the following structure: - * - * { // iterable - * [Symbol.asyncIterator]: { // iteratorMethod - * (): AsyncIterator - * } - * } - * - * T is the type we are after. At every level that involves analyzing return types - * of signatures, we union the return types of all the signatures. + * At every level that involves analyzing return types of signatures, we union the return types of all the signatures. * * Another thing to note is that at any step of this process, we could run into a dead end, * meaning either the property is missing, or we run into the anyType. If either of these things - * happens, we return undefined to signal that we could not find the iterated type. If a property - * is missing, and the previous step did not result in 'any', then we also give an error if the + * happens, we return `undefined` to signal that we could not find the iteration type. If a property + * is missing, and the previous step did not result in `any`, then we also give an error if the * caller requested it. Then the caller can decide what to do in the case where there is no iterated - * type. This is different from returning anyType, because that would signify that we have matched the - * whole pattern and that T (above) is 'any'. + * type. * * For a **for-of** statement, `yield*` (in a normal generator), spread, array * destructuring, or normal generator we will only ever look for a `[Symbol.iterator]()` @@ -27598,78 +27833,197 @@ namespace ts { * For a **for-await-of** statement or a `yield*` in an async generator we will look for * the `[Symbol.asyncIterator]()` method first, and then the `[Symbol.iterator]()` method. */ - function getIteratedTypeOfIterable(type: Type, errorNode: Node | undefined, allowAsyncIterables: boolean, allowSyncIterables: boolean, checkAssignability: boolean): Type | undefined { + function getIterationTypesOfIterable(type: Type, use: IterationUse, errorNode: Node | undefined) { if (isTypeAny(type)) { - return undefined; + return anyIterationTypes; } - return mapType(type, getIteratedType); - - function getIteratedType(type: Type) { - const typeAsIterable = type; - if (allowAsyncIterables) { - if (typeAsIterable.iteratedTypeOfAsyncIterable) { - return typeAsIterable.iteratedTypeOfAsyncIterable; + if (!(type.flags & TypeFlags.Union)) { + const iterationTypes = getIterationTypesOfIterableWorker(type, use, errorNode); + if (iterationTypes === noIterationTypes) { + if (errorNode) { + reportTypeNotIterableError(errorNode, type, !!(use & IterationUse.AllowsAsyncIterablesFlag)); } - - // As an optimization, if the type is an instantiation of the global `AsyncIterable` - // or the global `AsyncIterableIterator` then just grab its type argument. - if (isReferenceToType(type, getGlobalAsyncIterableType(/*reportErrors*/ false)) || - isReferenceToType(type, getGlobalAsyncIterableIteratorType(/*reportErrors*/ false))) { - return typeAsIterable.iteratedTypeOfAsyncIterable = (type).typeArguments![0]; - } - } - - if (allowSyncIterables) { - if (typeAsIterable.iteratedTypeOfIterable) { - return allowAsyncIterables - ? typeAsIterable.iteratedTypeOfAsyncIterable = getAwaitedType(typeAsIterable.iteratedTypeOfIterable) - : typeAsIterable.iteratedTypeOfIterable; - } - - // As an optimization, if the type is an instantiation of the global `Iterable` or - // `IterableIterator` then just grab its type argument. - if (isReferenceToType(type, getGlobalIterableType(/*reportErrors*/ false)) || - isReferenceToType(type, getGlobalIterableIteratorType(/*reportErrors*/ false))) { - return allowAsyncIterables - ? typeAsIterable.iteratedTypeOfAsyncIterable = getAwaitedType((type).typeArguments![0]) - : typeAsIterable.iteratedTypeOfIterable = (type).typeArguments![0]; - } - } - - const asyncMethodType = allowAsyncIterables && getTypeOfPropertyOfType(type, getPropertyNameForKnownSymbolName("asyncIterator")); - const methodType = asyncMethodType || (allowSyncIterables ? getTypeOfPropertyOfType(type, getPropertyNameForKnownSymbolName("iterator")) : undefined); - if (isTypeAny(methodType)) { return undefined; } + return iterationTypes; + } - const signatures = methodType ? getSignaturesOfType(methodType, SignatureKind.Call) : undefined; - if (!some(signatures)) { + const cacheKey = use & IterationUse.AllowsAsyncIterablesFlag ? "iterationTypesOfAsyncIterable" : "iterationTypesOfIterable"; + const cachedTypes = (type as IterableOrIteratorType)[cacheKey]; + if (cachedTypes) return cachedTypes === noIterationTypes ? undefined : cachedTypes; + + let allIterationTypes: IterationTypes[] | undefined; + for (const constituent of (type as UnionType).types) { + const iterationTypes = getIterationTypesOfIterableWorker(constituent, use, errorNode); + if (iterationTypes === noIterationTypes) { if (errorNode) { - // only report on the first error - reportTypeNotIterableError(errorNode, type, allowAsyncIterables); + reportTypeNotIterableError(errorNode, type, !!(use & IterationUse.AllowsAsyncIterablesFlag)); errorNode = undefined; } - return undefined; } - - const returnType = getUnionType(map(signatures, getReturnTypeOfSignature), UnionReduction.Subtype); - const iteratedType = getIteratedTypeOfIterator(returnType, errorNode, /*isAsyncIterator*/ !!asyncMethodType); - if (checkAssignability && errorNode && iteratedType) { - // If `checkAssignability` was specified, we were called from - // `checkIteratedTypeOrElementType`. As such, we need to validate that - // the type passed in is actually an Iterable. - checkTypeAssignableTo(type, asyncMethodType - ? createAsyncIterableType(iteratedType) - : createIterableType(iteratedType), errorNode); - } - - if (iteratedType) { - return allowAsyncIterables - ? typeAsIterable.iteratedTypeOfAsyncIterable = asyncMethodType ? iteratedType : getAwaitedType(iteratedType) - : typeAsIterable.iteratedTypeOfIterable = iteratedType; + else { + allIterationTypes = append(allIterationTypes, iterationTypes); } } + + const iterationTypes = allIterationTypes ? combineIterationTypes(allIterationTypes) : noIterationTypes; + (type as IterableOrIteratorType)[cacheKey] = iterationTypes; + return iterationTypes === noIterationTypes ? undefined : iterationTypes; + } + + function getAsyncFromSyncIterationTypes(iterationTypes: IterationTypes, errorNode: Node | undefined) { + if (iterationTypes === noIterationTypes) return noIterationTypes; + if (iterationTypes === anyIterationTypes) return anyIterationTypes; + const { yieldType, returnType, nextType } = iterationTypes; + return createIterationTypes( + getAwaitedType(yieldType, errorNode) || anyType, + getAwaitedType(returnType, errorNode) || anyType, + nextType); + } + + /** + * Gets the *yield*, *return*, and *next* types from a non-union type. + * + * If we are unable to find the *yield*, *return*, and *next* types, `noIterationTypes` is + * returned to indicate to the caller that it should report an error. Otherwise, an + * `IterationTypes` record is returned. + * + * NOTE: You probably don't want to call this directly and should be calling + * `getIterationTypesOfIterable` instead. + */ + function getIterationTypesOfIterableWorker(type: Type, use: IterationUse, errorNode: Node | undefined) { + if (isTypeAny(type)) { + return anyIterationTypes; + } + + if (use & IterationUse.AllowsAsyncIterablesFlag) { + const iterationTypes = + getIterationTypesOfIterableCached(type, asyncIterationTypesResolver) || + getIterationTypesOfIterableFast(type, asyncIterationTypesResolver); + if (iterationTypes) { + return iterationTypes; + } + } + + if (use & IterationUse.AllowsSyncIterablesFlag) { + const iterationTypes = + getIterationTypesOfIterableCached(type, syncIterationTypesResolver) || + getIterationTypesOfIterableFast(type, syncIterationTypesResolver); + if (iterationTypes) { + if (use & IterationUse.AllowsAsyncIterablesFlag) { + // for a sync iterable in an async context, only use the cached types if they are valid. + if (iterationTypes !== noIterationTypes) { + return (type as IterableOrIteratorType).iterationTypesOfAsyncIterable = getAsyncFromSyncIterationTypes(iterationTypes, errorNode); + } + } + else { + return iterationTypes; + } + } + } + + if (use & IterationUse.AllowsAsyncIterablesFlag) { + const iterationTypes = getIterationTypesOfIterableSlow(type, asyncIterationTypesResolver, errorNode); + if (iterationTypes !== noIterationTypes) { + return iterationTypes; + } + } + + if (use & IterationUse.AllowsSyncIterablesFlag) { + const iterationTypes = getIterationTypesOfIterableSlow(type, syncIterationTypesResolver, errorNode); + if (iterationTypes !== noIterationTypes) { + if (use & IterationUse.AllowsAsyncIterablesFlag) { + return (type as IterableOrIteratorType).iterationTypesOfAsyncIterable = iterationTypes + ? getAsyncFromSyncIterationTypes(iterationTypes, errorNode) + : noIterationTypes; + } + else { + return iterationTypes; + } + } + } + + return noIterationTypes; + } + + /** + * Gets the *yield*, *return*, and *next* types of an `Iterable`-like or + * `AsyncIterable`-like type from the cache. + * + * NOTE: You probably don't want to call this directly and should be calling + * `getIterationTypesOfIterable` instead. + */ + function getIterationTypesOfIterableCached(type: Type, resolver: IterationTypesResolver) { + return (type as IterableOrIteratorType)[resolver.iterableCacheKey]; + } + + /** + * Gets the *yield*, *return*, and *next* types of an `Iterable`-like or `AsyncIterable`-like + * type from from common heuristics. + * + * If we previously analyzed this type and found no iteration types, `noIterationTypes` is + * returned. If we found iteration types, an `IterationTypes` record is returned. + * Otherwise, we return `undefined` to indicate to the caller it should perform a more + * exhaustive analysis. + * + * NOTE: You probably don't want to call this directly and should be calling + * `getIterationTypesOfIterable` instead. + */ + function getIterationTypesOfIterableFast(type: Type, resolver: IterationTypesResolver) { + // As an optimization, if the type is an instantiation of one of the following global types, then + // just grab its related type argument: + // - `Iterable` or `AsyncIterable` + // - `IterableIterator` or `AsyncIterableIterator` + let globalType: Type; + if (isReferenceToType(type, globalType = resolver.getGlobalIterableType(/*reportErrors*/ false)) || + isReferenceToType(type, globalType = resolver.getGlobalIterableIteratorType(/*reportErrors*/ false))) { + const [yieldType] = (type as GenericType).typeArguments!; + // The "return" and "next" types of `Iterable` and `IterableIterator` are defined by the + // iteration types of their `[Symbol.iterator]()` method. The same is true for their async cousins. + // While we define these as `any` and `undefined` in our libs by default, a custom lib *could* use + // different definitions. + const globalIterationTypes = + getIterationTypesOfIterableCached(globalType, resolver) || + getIterationTypesOfIterableSlow(globalType, resolver, /*errorNode*/ undefined); + const { returnType, nextType } = globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes; + return (type as IterableOrIteratorType)[resolver.iterableCacheKey] = createIterationTypes(yieldType, returnType, nextType); + } + + // As an optimization, if the type is an instantiation of the following global type, then + // just grab its related type arguments: + // - `Generator` or `AsyncGenerator` + if (isReferenceToType(type, resolver.getGlobalGeneratorType(/*reportErrors*/ false))) { + const [yieldType, returnType, nextType] = (type as GenericType).typeArguments!; + return (type as IterableOrIteratorType)[resolver.iterableCacheKey] = createIterationTypes(yieldType, returnType, nextType); + } + } + + /** + * Gets the *yield*, *return*, and *next* types of an `Iterable`-like or `AsyncIterable`-like + * type from its members. + * + * If we successfully found the *yield*, *return*, and *next* types, an `IterationTypes` + * record is returned. Otherwise, `noIterationTypes` is returned. + * + * NOTE: You probably don't want to call this directly and should be calling + * `getIterationTypesOfIterable` instead. + */ + function getIterationTypesOfIterableSlow(type: Type, resolver: IterationTypesResolver, errorNode: Node | undefined) { + const method = getPropertyOfType(type, getPropertyNameForKnownSymbolName(resolver.iteratorSymbolName)); + const methodType = method && !(method.flags & SymbolFlags.Optional) ? getTypeOfSymbol(method) : undefined; + if (isTypeAny(methodType)) { + return (type as IterableOrIteratorType)[resolver.iterableCacheKey] = anyIterationTypes; + } + + const signatures = methodType ? getSignaturesOfType(methodType, SignatureKind.Call) : undefined; + if (!some(signatures)) { + return (type as IterableOrIteratorType)[resolver.iterableCacheKey] = noIterationTypes; + } + + const iteratorType = getUnionType(map(signatures, getReturnTypeOfSignature), UnionReduction.Subtype); + const iterationTypes = getIterationTypesOfIterator(iteratorType, resolver, errorNode) || noIterationTypes; + return (type as IterableOrIteratorType)[resolver.iterableCacheKey] = iterationTypes; } function reportTypeNotIterableError(errorNode: Node, type: Type, allowAsyncIterables: boolean): void { @@ -27679,104 +28033,257 @@ namespace ts { } /** - * This function has very similar logic as getIteratedTypeOfIterable, except that it operates on - * Iterators instead of Iterables. Here is the structure: + * Gets the *yield*, *return*, and *next* types from an `Iterator`-like or `AsyncIterator`-like type. * - * { // iterator - * next: { // nextMethod - * (): { // nextResult - * value: T // nextValue - * } - * } - * } - * - * For an async iterator, we expect the following structure: - * - * { // iterator - * next: { // nextMethod - * (): PromiseLike<{ // nextResult - * value: T // nextValue - * }> - * } - * } + * If we successfully found the *yield*, *return*, and *next* types, an `IterationTypes` + * record is returned. Otherwise, `undefined` is returned. */ - function getIteratedTypeOfIterator(type: Type, errorNode: Node | undefined, isAsyncIterator: boolean): Type | undefined { + function getIterationTypesOfIterator(type: Type, resolver: IterationTypesResolver, errorNode: Node | undefined) { if (isTypeAny(type)) { - return undefined; + return anyIterationTypes; } - const typeAsIterator = type; - if (isAsyncIterator ? typeAsIterator.iteratedTypeOfAsyncIterator : typeAsIterator.iteratedTypeOfIterator) { - return isAsyncIterator ? typeAsIterator.iteratedTypeOfAsyncIterator : typeAsIterator.iteratedTypeOfIterator; - } - - // As an optimization, if the type is an instantiation of the global `Iterator` (for - // a non-async iterator) or the global `AsyncIterator` (for an async-iterator) then - // just grab its type argument. - const getIteratorType = isAsyncIterator ? getGlobalAsyncIteratorType : getGlobalIteratorType; - if (isReferenceToType(type, getIteratorType(/*reportErrors*/ false))) { - return isAsyncIterator - ? typeAsIterator.iteratedTypeOfAsyncIterator = (type).typeArguments![0] - : typeAsIterator.iteratedTypeOfIterator = (type).typeArguments![0]; - } - - // Both async and non-async iterators must have a `next` method. - const nextMethod = getTypeOfPropertyOfType(type, "next" as __String); - if (isTypeAny(nextMethod)) { - return undefined; - } - - const nextMethodSignatures = nextMethod ? getSignaturesOfType(nextMethod, SignatureKind.Call) : emptyArray; - if (nextMethodSignatures.length === 0) { - if (errorNode) { - error(errorNode, isAsyncIterator - ? Diagnostics.An_async_iterator_must_have_a_next_method - : Diagnostics.An_iterator_must_have_a_next_method); - } - return undefined; - } - - let nextResult: Type | undefined = getUnionType(map(nextMethodSignatures, getReturnTypeOfSignature), UnionReduction.Subtype); - if (isTypeAny(nextResult)) { - return undefined; - } - - // For an async iterator, we must get the awaited type of the return type. - if (isAsyncIterator) { - nextResult = getAwaitedTypeOfPromise(nextResult, errorNode, Diagnostics.The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property); - if (isTypeAny(nextResult)) { - return undefined; - } - } - - const nextValue = nextResult && getTypeOfPropertyOfType(nextResult, "value" as __String); - if (!nextValue) { - if (errorNode) { - error(errorNode, isAsyncIterator - ? Diagnostics.The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property - : Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); - } - return undefined; - } - - return isAsyncIterator - ? typeAsIterator.iteratedTypeOfAsyncIterator = nextValue - : typeAsIterator.iteratedTypeOfIterator = nextValue; + const iterationTypes = + getIterationTypesOfIteratorCached(type, resolver) || + getIterationTypesOfIteratorFast(type, resolver) || + getIterationTypesOfIteratorSlow(type, resolver, errorNode); + return iterationTypes === noIterationTypes ? undefined : iterationTypes; } /** - * A generator may have a return type of `Iterator`, `Iterable`, or - * `IterableIterator`. An async generator may have a return type of `AsyncIterator`, - * `AsyncIterable`, or `AsyncIterableIterator`. This function can be used to extract - * the iterated type from this return type for contextual typing and verifying signatures. + * Gets the iteration types of an `Iterator`-like or `AsyncIterator`-like type from the + * cache. + * + * NOTE: You probably don't want to call this directly and should be calling + * `getIterationTypesOfIterator` instead. */ - function getIteratedTypeOfGenerator(returnType: Type, isAsyncGenerator: boolean): Type | undefined { + function getIterationTypesOfIteratorCached(type: Type, resolver: IterationTypesResolver) { + return (type as IterableOrIteratorType)[resolver.iteratorCacheKey]; + } + + /** + * Gets the iteration types of an `Iterator`-like or `AsyncIterator`-like type from the + * cache or from common heuristics. + * + * If we previously analyzed this type and found no iteration types, `noIterationTypes` is + * returned. If we found iteration types, an `IterationTypes` record is returned. + * Otherwise, we return `undefined` to indicate to the caller it should perform a more + * exhaustive analysis. + * + * NOTE: You probably don't want to call this directly and should be calling + * `getIterationTypesOfIterator` instead. + */ + function getIterationTypesOfIteratorFast(type: Type, resolver: IterationTypesResolver) { + // As an optimization, if the type is an instantiation of one of the following global types, + // then just grab its related type argument: + // - `IterableIterator` or `AsyncIterableIterator` + // - `Iterator` or `AsyncIterator` + // - `Generator` or `AsyncGenerator` + const globalType = resolver.getGlobalIterableIteratorType(/*reportErrors*/ false); + if (isReferenceToType(type, globalType)) { + const [yieldType] = (type as GenericType).typeArguments!; + // The "return" and "next" types of `IterableIterator` and `AsyncIterableIterator` are defined by the + // iteration types of their `next`, `return`, and `throw` methods. While we define these as `any` + // and `undefined` in our libs by default, a custom lib *could* use different definitions. + const globalIterationTypes = + getIterationTypesOfIteratorCached(globalType, resolver) || + getIterationTypesOfIteratorSlow(globalType, resolver, /*errorNode*/ undefined); + const { returnType, nextType } = globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes; + return (type as IterableOrIteratorType)[resolver.iteratorCacheKey] = createIterationTypes(yieldType, returnType, nextType); + } + if (isReferenceToType(type, resolver.getGlobalIteratorType(/*reportErrors*/ false)) || + isReferenceToType(type, resolver.getGlobalGeneratorType(/*reportErrors*/ false))) { + const [yieldType, returnType, nextType] = (type as GenericType).typeArguments!; + return (type as IterableOrIteratorType)[resolver.iteratorCacheKey] = createIterationTypes(yieldType, returnType, nextType); + } + } + + function isIteratorResult(type: Type, kind: IterationTypeKind.Yield | IterationTypeKind.Return) { + // From https://tc39.github.io/ecma262/#sec-iteratorresult-interface: + // > [done] is the result status of an iterator `next` method call. If the end of the iterator was reached `done` is `true`. + // > If the end was not reached `done` is `false` and a value is available. + // > If a `done` property (either own or inherited) does not exist, it is consider to have the value `false`. + const doneType = getTypeOfPropertyOfType(type, "done" as __String) || falseType; + return isTypeAssignableTo(kind === IterationTypeKind.Yield ? falseType : trueType, doneType); + } + + function isYieldIteratorResult(type: Type) { + return isIteratorResult(type, IterationTypeKind.Yield); + } + + function isReturnIteratorResult(type: Type) { + return isIteratorResult(type, IterationTypeKind.Return); + } + + /** + * Gets the *yield* and *return* types of an `IteratorResult`-like type. + * + * If we are unable to determine a *yield* or a *return* type, `noIterationTypes` is + * returned to indicate to the caller that it should handle the error. Otherwise, an + * `IterationTypes` record is returned. + */ + function getIterationTypesOfIteratorResult(type: Type) { + if (isTypeAny(type)) { + return anyIterationTypes; + } + + const cachedTypes = (type as IterableOrIteratorType).iterationTypesOfIteratorResult; + if (cachedTypes) { + return cachedTypes; + } + + // As an optimization, if the type is an instantiation of one of the global `IteratorYieldResult` + // or `IteratorReturnResult` types, then just grab its type argument. + if (isReferenceToType(type, getGlobalIteratorYieldResultType(/*reportErrors*/ false))) { + const yieldType = (type as GenericType).typeArguments![0]; + return (type as IterableOrIteratorType).iterationTypesOfIteratorResult = createIterationTypes(yieldType, /*returnType*/ undefined, /*nextType*/ undefined); + } + if (isReferenceToType(type, getGlobalIteratorReturnResultType(/*reportErrors*/ false))) { + const returnType = (type as GenericType).typeArguments![0]; + return (type as IterableOrIteratorType).iterationTypesOfIteratorResult = createIterationTypes(/*yieldType*/ undefined, returnType, /*nextType*/ undefined); + } + + // Choose any constituents that can produce the requested iteration type. + const yieldIteratorResult = filterType(type, isYieldIteratorResult); + const yieldType = yieldIteratorResult !== neverType ? getTypeOfPropertyOfType(yieldIteratorResult, "value" as __String) : undefined; + + const returnIteratorResult = filterType(type, isReturnIteratorResult); + const returnType = returnIteratorResult !== neverType ? getTypeOfPropertyOfType(returnIteratorResult, "value" as __String) : undefined; + + if (!yieldType && !returnType) { + return (type as IterableOrIteratorType).iterationTypesOfIteratorResult = noIterationTypes; + } + + // From https://tc39.github.io/ecma262/#sec-iteratorresult-interface + // > ... If the iterator does not have a return value, `value` is `undefined`. In that case, the + // > `value` property may be absent from the conforming object if it does not inherit an explicit + // > `value` property. + return (type as IterableOrIteratorType).iterationTypesOfIteratorResult = createIterationTypes(yieldType, returnType || voidType, /*nextType*/ undefined); + } + + /** + * Gets the *yield*, *return*, and *next* types of a the `next()`, `return()`, or + * `throw()` method of an `Iterator`-like or `AsyncIterator`-like type. + * + * If we successfully found the *yield*, *return*, and *next* types, an `IterationTypes` + * record is returned. Otherwise, we return `undefined`. + */ + function getIterationTypesOfMethod(type: Type, resolver: IterationTypesResolver, methodName: "next" | "return" | "throw", errorNode: Node | undefined): IterationTypes | undefined { + const method = getPropertyOfType(type, methodName as __String); + + // Ignore 'return' or 'throw' if they are missing. + if (!method && methodName !== "next") { + return undefined; + } + + const methodType = method && !(methodName === "next" && (method.flags & SymbolFlags.Optional)) + ? methodName === "next" ? getTypeOfSymbol(method) : getTypeWithFacts(getTypeOfSymbol(method), TypeFacts.NEUndefinedOrNull) + : undefined; + + if (isTypeAny(methodType)) { + // `return()` and `throw()` don't provide a *next* type. + return methodName === "next" ? anyIterationTypes : anyIterationTypesExceptNext; + } + + // Both async and non-async iterators *must* have a `next` method. + const methodSignatures = methodType ? getSignaturesOfType(methodType, SignatureKind.Call) : emptyArray; + if (methodSignatures.length === 0) { + if (errorNode) { + const diagnostic = methodName === "next" + ? resolver.mustHaveANextMethodDiagnostic + : resolver.mustBeAMethodDiagnostic; + error(errorNode, diagnostic, methodName); + } + return methodName === "next" ? anyIterationTypes : undefined; + } + + // Extract the first parameter and return type of each signature. + let methodParameterTypes: Type[] | undefined; + let methodReturnTypes: Type[] | undefined; + for (const signature of methodSignatures) { + if (methodName !== "throw" && some(signature.parameters)) { + methodParameterTypes = append(methodParameterTypes, getTypeAtPosition(signature, 0)); + } + methodReturnTypes = append(methodReturnTypes, getReturnTypeOfSignature(signature)); + } + + // Resolve the *next* or *return* type from the first parameter of a `next()` or + // `return()` method, respectively. + let returnTypes: Type[] | undefined; + let nextType: Type | undefined; + if (methodName !== "throw") { + const methodParameterType = methodParameterTypes ? getUnionType(methodParameterTypes) : unknownType; + const resolvedMethodParameterType = resolver.resolveIterationType(methodParameterType, errorNode) || anyType; + if (methodName === "next") { + nextType = resolvedMethodParameterType; + } + else if (methodName === "return") { + returnTypes = append(returnTypes, resolvedMethodParameterType); + } + } + + // Resolve the *yield* and *return* types from the return type of the method (i.e. `IteratorResult`) + let yieldType: Type; + const methodReturnType = methodReturnTypes ? getUnionType(methodReturnTypes, UnionReduction.Subtype) : neverType; + const resolvedMethodReturnType = resolver.resolveIterationType(methodReturnType, errorNode) || anyType; + const iterationTypes = getIterationTypesOfIteratorResult(resolvedMethodReturnType); + if (iterationTypes === noIterationTypes) { + if (errorNode) { + error(errorNode, resolver.mustHaveAValueDiagnostic, methodName); + } + yieldType = anyType; + returnTypes = append(returnTypes, anyType); + } + else { + yieldType = iterationTypes.yieldType; + returnTypes = append(returnTypes, iterationTypes.returnType); + } + + return createIterationTypes(yieldType, getUnionType(returnTypes), nextType); + } + + /** + * Gets the *yield*, *return*, and *next* types of an `Iterator`-like or `AsyncIterator`-like + * type from its members. + * + * If we successfully found the *yield*, *return*, and *next* types, an `IterationTypes` + * record is returned. Otherwise, `noIterationTypes` is returned. + * + * NOTE: You probably don't want to call this directly and should be calling + * `getIterationTypesOfIterator` instead. + */ + function getIterationTypesOfIteratorSlow(type: Type, resolver: IterationTypesResolver, errorNode: Node | undefined) { + const iterationTypes = combineIterationTypes([ + getIterationTypesOfMethod(type, resolver, "next", errorNode), + getIterationTypesOfMethod(type, resolver, "return", errorNode), + getIterationTypesOfMethod(type, resolver, "throw", errorNode), + ]); + return (type as IterableOrIteratorType)[resolver.iteratorCacheKey] = iterationTypes; + } + + /** + * Gets the requested "iteration type" from a type that is either `Iterable`-like, `Iterator`-like, + * `IterableIterator`-like, or `Generator`-like (for a non-async generator); or `AsyncIterable`-like, + * `AsyncIterator`-like, `AsyncIterableIterator`-like, or `AsyncGenerator`-like (for an async generator). + */ + function getIterationTypeOfGeneratorFunctionReturnType(kind: IterationTypeKind, returnType: Type, isAsyncGenerator: boolean): Type | undefined { if (isTypeAny(returnType)) { return undefined; } - return getIteratedTypeOfIterable(returnType, /*errorNode*/ undefined, /*allowAsyncIterables*/ isAsyncGenerator, /*allowSyncIterables*/ !isAsyncGenerator, /*checkAssignability*/ false) - || getIteratedTypeOfIterator(returnType, /*errorNode*/ undefined, isAsyncGenerator); + const iterationTypes = getIterationTypesOfGeneratorFunctionReturnType(returnType, isAsyncGenerator); + return iterationTypes && iterationTypes[getIterationTypesKeyFromIterationTypeKind(kind)]; + } + + function getIterationTypesOfGeneratorFunctionReturnType(type: Type, isAsyncGenerator: boolean) { + if (isTypeAny(type)) { + return anyIterationTypes; + } + + const use = isAsyncGenerator ? IterationUse.AsyncGeneratorReturnType : IterationUse.GeneratorReturnType; + const resolver = isAsyncGenerator ? asyncIterationTypesResolver : syncIterationTypesResolver; + return getIterationTypesOfIterable(type, use, /*errorNode*/ undefined) || + getIterationTypesOfIterator(type, resolver, /*errorNode*/ undefined); } function checkBreakOrContinueStatement(node: BreakOrContinueStatement) { @@ -27786,10 +28293,16 @@ namespace ts { // TODO: Check that target label is valid } + function unwrapReturnType(returnType: Type, functionFlags: FunctionFlags) { + const isGenerator = !!(functionFlags & FunctionFlags.Generator); + const isAsync = !!(functionFlags & FunctionFlags.Async); + return isGenerator ? getIterationTypeOfGeneratorFunctionReturnType(IterationTypeKind.Return, returnType, isAsync) || errorType : + isAsync ? getPromisedTypeOfPromise(returnType) || errorType : + returnType; + } + function isUnwrappedReturnTypeVoidOrAny(func: SignatureDeclaration, returnType: Type): boolean { - const unwrappedReturnType = (getFunctionFlags(func) & FunctionFlags.AsyncGenerator) === FunctionFlags.Async - ? getPromisedTypeOfPromise(returnType) // Async function - : returnType; // AsyncGenerator function, Generator function, or normal function + const unwrappedReturnType = unwrapReturnType(returnType, getFunctionFlags(func)); return !!unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, TypeFlags.Void | TypeFlags.AnyOrUnknown); } @@ -27808,17 +28321,9 @@ namespace ts { const signature = getSignatureFromDeclaration(func); const returnType = getReturnTypeOfSignature(signature); const functionFlags = getFunctionFlags(func); - const isGenerator = functionFlags & FunctionFlags.Generator; if (strictNullChecks || node.expression || returnType.flags & TypeFlags.Never) { const exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (isGenerator) { // AsyncGenerator function or Generator function - // A generator does not need its return expressions checked against its return type. - // Instead, the yield expressions are checked against the element type. - // TODO: Check return types of generators when return type tracking is added - // for generators. - return; - } - else if (func.kind === SyntaxKind.SetAccessor) { + if (func.kind === SyntaxKind.SetAccessor) { if (node.expression) { error(node, Diagnostics.Setters_cannot_return_a_value); } @@ -27829,22 +28334,19 @@ namespace ts { } } else if (getReturnTypeFromAnnotation(func)) { - if (functionFlags & FunctionFlags.Async) { // Async function - const promisedType = getPromisedTypeOfPromise(returnType); - const awaitedType = checkAwaitedType(exprType, node, Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); - if (promisedType) { - // If the function has a return type, but promisedType is - // undefined, an error will be reported in checkAsyncFunctionReturnType - // so we don't need to report one here. - checkTypeAssignableToAndOptionallyElaborate(awaitedType, promisedType, node, node.expression); - } - } - else { - checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression); + const unwrappedReturnType = unwrapReturnType(returnType, functionFlags); + const unwrappedExprType = functionFlags & FunctionFlags.Async + ? checkAwaitedType(exprType, node, Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) + : exprType; + if (unwrappedReturnType) { + // If the function has a return type, but promisedType is + // undefined, an error will be reported in checkAsyncFunctionReturnType + // so we don't need to report one here. + checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, node, node.expression); } } } - else if (func.kind !== SyntaxKind.Constructor && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) { + else if (func.kind !== SyntaxKind.Constructor && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, Diagnostics.Not_all_code_paths_return_a_value); } @@ -30325,7 +30827,7 @@ namespace ts { const node = cast(expr.parent, isArrayLiteralExpression); // [{ property1: p1, property2 }] = elems; const typeOfArrayLiteral = getTypeOfAssignmentPattern(node) || errorType; - const elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral, expr.parent, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || errorType; + const elementType = checkIteratedTypeOrElementType(IterationUse.Destructuring, typeOfArrayLiteral, undefinedType, expr.parent) || errorType; return checkArrayLiteralDestructuringElementAssignment(node, typeOfArrayLiteral, node.elements.indexOf(expr), elementType); } @@ -32791,4 +33293,12 @@ namespace ts { export const LibraryManagedAttributes = "LibraryManagedAttributes" as __String; // tslint:enable variable-name } + + function getIterationTypesKeyFromIterationTypeKind(typeKind: IterationTypeKind) { + switch (typeKind) { + case IterationTypeKind.Yield: return "yieldType"; + case IterationTypeKind.Return: return "returnType"; + case IterationTypeKind.Next: return "nextType"; + } + } } diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 4747b89f08c..2c4c867fb67 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -40,6 +40,7 @@ namespace ts { ["es2017.string", "lib.es2017.string.d.ts"], ["es2017.intl", "lib.es2017.intl.d.ts"], ["es2017.typedarrays", "lib.es2017.typedarrays.d.ts"], + ["es2018.asyncgenerator", "lib.es2018.asyncgenerator.d.ts"], ["es2018.asynciterable", "lib.es2018.asynciterable.d.ts"], ["es2018.intl", "lib.es2018.intl.d.ts"], ["es2018.promise", "lib.es2018.promise.d.ts"], @@ -1899,7 +1900,9 @@ namespace ts { case "object": return {}; default: - return option.type.keys().next().value; + const iterResult = option.type.keys().next(); + if (!iterResult.done) return iterResult.value; + return Debug.fail("Expected 'option.type' to have entries."); } } diff --git a/src/compiler/core.ts b/src/compiler/core.ts index f1511b79c12..545e5d7bdda 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -24,7 +24,6 @@ namespace ts { " __sortedArrayBrand": any; } - /** ES6 Map interface, only read methods included. */ export interface ReadonlyMap { get(key: string): T | undefined; @@ -45,7 +44,7 @@ namespace ts { /** ES6 Iterator type. */ export interface Iterator { - next(): { value: T, done: false } | { value: never, done: true }; + next(): { value: T, done?: false } | { value: never, done: true }; } /** Array that is only intended to be pushed to, never read. */ @@ -297,12 +296,13 @@ namespace ts { forEach(action: (value: T, key: string) => void): void { const iterator = this.entries(); while (true) { - const { value: entry, done } = iterator.next(); - if (done) { + const iterResult = iterator.next(); + if (iterResult.done) { break; } - action(entry[1], entry[0]); + const [key, value] = iterResult.value; + action(value, key); } } }; @@ -346,11 +346,11 @@ namespace ts { export function firstDefinedIterator(iter: Iterator, callback: (element: T) => U | undefined): U | undefined { while (true) { - const { value, done } = iter.next(); - if (done) { + const iterResult = iter.next(); + if (iterResult.done) { return undefined; } - const result = callback(value); + const result = callback(iterResult.value); if (result !== undefined) { return result; } @@ -375,7 +375,7 @@ namespace ts { return { value: undefined as never, done: true }; } i++; - return { value: [arrayA[i - 1], arrayB[i - 1]], done: false }; + return { value: [arrayA[i - 1], arrayB[i - 1]] as [T, U], done: false }; } }; } @@ -567,7 +567,7 @@ namespace ts { return { next() { const iterRes = iter.next(); - return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false }; + return iterRes.done ? iterRes as { done: true, value: never } : { value: mapFn(iterRes.value), done: false }; } }; } @@ -678,7 +678,7 @@ namespace ts { } const iterRes = iter.next(); if (iterRes.done) { - return iterRes; + return iterRes as { done: true, value: never }; } currentIter = getIterator(iterRes.value); } @@ -753,7 +753,7 @@ namespace ts { while (true) { const res = iter.next(); if (res.done) { - return res; + return res as { done: true, value: never }; } const value = mapFn(res.value); if (value !== undefined) { @@ -1078,6 +1078,7 @@ namespace ts { * @param value The value to append to the array. If `value` is `undefined`, nothing is * appended. */ + export function append[number] | undefined>(to: TArray, value: TValue): [undefined, undefined] extends [TArray, TValue] ? TArray : NonNullable[number][]; export function append(to: T[], value: T | undefined): T[]; export function append(to: T[] | undefined, value: T): T[]; export function append(to: T[] | undefined, value: T | undefined): T[] | undefined; @@ -1402,8 +1403,8 @@ namespace ts { export function arrayFrom(iterator: Iterator | IterableIterator): T[]; export function arrayFrom(iterator: Iterator | IterableIterator, map?: (t: T) => U): (T | U)[] { const result: (T | U)[] = []; - for (let { value, done } = iterator.next(); !done; { value, done } = iterator.next()) { - result.push(map ? map(value) : value); + for (let iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) { + result.push(map ? map(iterResult.value) : iterResult.value); } return result; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 7d178f1d478..c404851af3e 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1764,7 +1764,7 @@ "category": "Error", "code": 2489 }, - "The type returned by the 'next()' method of an iterator must have a 'value' property.": { + "The type returned by the '{0}()' method of an iterator must have a 'value' property.": { "category": "Error", "code": 2490 }, @@ -1992,7 +1992,7 @@ "category": "Error", "code": 2546 }, - "The type returned by the 'next()' method of an async iterator must be a promise for a type with a 'value' property.": { + "The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property.": { "category": "Error", "code": 2547 }, @@ -2653,6 +2653,30 @@ "category": "Error", "code": 2762 }, + "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'.": { + "category": "Error", + "code": 2763 + }, + "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'.": { + "category": "Error", + "code": 2764 + }, + "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'.": { + "category": "Error", + "code": 2765 + }, + "Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'.": { + "category": "Error", + "code": 2766 + }, + "The '{0}' property of an iterator must be a method.": { + "category": "Error", + "code": 2767 + }, + "The '{0}' property of an async iterator must be a method.": { + "category": "Error", + "code": 2768 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", @@ -4214,7 +4238,7 @@ "category": "Error", "code": 7024 }, - "Generator implicitly has type '{0}' because it does not yield any values. Consider supplying a return type.": { + "Generator implicitly has yield type '{0}' because it does not yield any values. Consider supplying a return type annotation.": { "category": "Error", "code": 7025 }, @@ -4336,6 +4360,11 @@ "category": "Error", "code": 7054 }, + "'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type.": { + "category": "Error", + "code": 7055 + }, + "You cannot rename this element.": { "category": "Error", "code": 8000 diff --git a/src/compiler/sourcemap.ts b/src/compiler/sourcemap.ts index b33536bab2a..c17e47724e4 100644 --- a/src/compiler/sourcemap.ts +++ b/src/compiler/sourcemap.ts @@ -148,7 +148,8 @@ namespace ts { const sourceIndexToNewSourceIndexMap: number[] = []; let nameIndexToNewNameIndexMap: number[] | undefined; const mappingIterator = decodeMappings(map.mappings); - for (let { value: raw, done } = mappingIterator.next(); !done; { value: raw, done } = mappingIterator.next()) { + for (let iterResult = mappingIterator.next(); !iterResult.done; iterResult = mappingIterator.next()) { + const raw = iterResult.value; if (end && ( raw.generatedLine > end.line || (raw.generatedLine === end.line && raw.generatedCharacter > end.character))) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 91a4a5570ef..a31e707f984 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4273,13 +4273,23 @@ namespace ts { regularType: ResolvedType; // Regular version of fresh type } + /* @internal */ + export interface IterationTypes { + readonly yieldType: Type; + readonly returnType: Type; + readonly nextType: Type; + } + // Just a place to cache element types of iterables and iterators /* @internal */ export interface IterableOrIteratorType extends ObjectType, UnionType { - iteratedTypeOfIterable?: Type; - iteratedTypeOfIterator?: Type; - iteratedTypeOfAsyncIterable?: Type; - iteratedTypeOfAsyncIterator?: Type; + iterationTypesOfGeneratorReturnType?: IterationTypes; + iterationTypesOfAsyncGeneratorReturnType?: IterationTypes; + iterationTypesOfIterable?: IterationTypes; + iterationTypesOfIterator?: IterationTypes; + iterationTypesOfAsyncIterable?: IterationTypes; + iterationTypesOfAsyncIterator?: IterationTypes; + iterationTypesOfIteratorResult?: IterationTypes; } /* @internal */ diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 8b20ecda204..e9b23bdedf0 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -150,8 +150,8 @@ namespace ts { export function forEachEntry(map: ReadonlyMap, callback: (value: T, key: string) => U | undefined): U | undefined; export function forEachEntry(map: ReadonlyUnderscoreEscapedMap | ReadonlyMap, callback: (value: T, key: (string & __String)) => U | undefined): U | undefined { const iterator = map.entries(); - for (let { value: pair, done } = iterator.next(); !done; { value: pair, done } = iterator.next()) { - const [key, value] = pair; + for (let iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) { + const [key, value] = iterResult.value; const result = callback(value, key as (string & __String)); if (result) { return result; @@ -165,8 +165,8 @@ namespace ts { export function forEachKey(map: ReadonlyMap<{}>, callback: (key: string) => T | undefined): T | undefined; export function forEachKey(map: ReadonlyUnderscoreEscapedMap<{}> | ReadonlyMap<{}>, callback: (key: string & __String) => T | undefined): T | undefined { const iterator = map.keys(); - for (let { value: key, done } = iterator.next(); !done; { value: key, done } = iterator.next()) { - const result = callback(key as string & __String); + for (let iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) { + const result = callback(iterResult.value as string & __String); if (result) { return result; } diff --git a/src/harness/sourceMapRecorder.ts b/src/harness/sourceMapRecorder.ts index 893b17ff106..829e047eade 100644 --- a/src/harness/sourceMapRecorder.ts +++ b/src/harness/sourceMapRecorder.ts @@ -301,7 +301,8 @@ namespace Harness.SourceMapRecorder { SourceMapSpanWriter.initializeSourceMapSpanWriter(sourceMapRecorder, sourceMapData.sourceMap, currentFile); const mapper = ts.decodeMappings(sourceMapData.sourceMap.mappings); - for (let { value: decodedSourceMapping, done } = mapper.next(); !done; { value: decodedSourceMapping, done } = mapper.next()) { + for (let iterResult = mapper.next(); !iterResult.done; iterResult = mapper.next()) { + const decodedSourceMapping = iterResult.value; const currentSourceFile = ts.isSourceMapping(decodedSourceMapping) ? program.getSourceFile(sourceMapData.inputSourceFileNames[decodedSourceMapping.sourceIndex]) : undefined; @@ -335,7 +336,8 @@ namespace Harness.SourceMapRecorder { SourceMapSpanWriter.initializeSourceMapSpanWriter(sourceMapRecorder, sourceMap, currentFile); const mapper = ts.decodeMappings(sourceMap.mappings); - for (let { value: decodedSourceMapping, done } = mapper.next(); !done; { value: decodedSourceMapping, done } = mapper.next()) { + for (let iterResult = mapper.next(); !iterResult.done; iterResult = mapper.next()) { + const decodedSourceMapping = iterResult.value; const currentSourceFile = ts.isSourceMapping(decodedSourceMapping) ? getFile(sourceFileAbsolutePaths[decodedSourceMapping.sourceIndex]) : undefined; diff --git a/src/harness/vfs.ts b/src/harness/vfs.ts index ee9519f254c..b20c04937f8 100644 --- a/src/harness/vfs.ts +++ b/src/harness/vfs.ts @@ -683,7 +683,7 @@ namespace vfs { if (isDirectory(node)) throw createIOError("EISDIR"); if (!isFile(node)) throw createIOError("EBADF"); - node.buffer = Buffer.isBuffer(data) ? data.slice() : ts.sys.bufferFrom!("" + data, encoding || "utf8"); + node.buffer = Buffer.isBuffer(data) ? data.slice() : ts.sys.bufferFrom!("" + data, encoding || "utf8") as Buffer; node.size = node.buffer.byteLength; node.mtimeMs = time; node.ctimeMs = time; @@ -1204,7 +1204,7 @@ namespace vfs { } }, readFileSync(path: string): Buffer { - return ts.sys.bufferFrom!(host.readFile(path)!, "utf8"); // TODO: GH#18217 + return ts.sys.bufferFrom!(host.readFile(path)!, "utf8") as Buffer; // TODO: GH#18217 } }; } diff --git a/src/lib/es2015.generator.d.ts b/src/lib/es2015.generator.d.ts index 92bb8dca868..7c6929173a0 100644 --- a/src/lib/es2015.generator.d.ts +++ b/src/lib/es2015.generator.d.ts @@ -1,4 +1,12 @@ -interface Generator extends Iterator { } +/// + +interface Generator extends Iterator { + // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. + next(...args: [] | [TNext]): IteratorResult; + return(value: TReturn): IteratorResult; + throw(e: any): IteratorResult; + [Symbol.iterator](): Generator; +} interface GeneratorFunction { /** diff --git a/src/lib/es2015.iterable.d.ts b/src/lib/es2015.iterable.d.ts index faba45bc518..937f99d3409 100644 --- a/src/lib/es2015.iterable.d.ts +++ b/src/lib/es2015.iterable.d.ts @@ -8,15 +8,23 @@ interface SymbolConstructor { readonly iterator: symbol; } -interface IteratorResult { - done: boolean; - value: T; +interface IteratorYieldResult { + done?: false; + value: TYield; } -interface Iterator { - next(value?: any): IteratorResult; - return?(value?: any): IteratorResult; - throw?(e?: any): IteratorResult; +interface IteratorReturnResult { + done: true; + value: TReturn; +} + +type IteratorResult = IteratorYieldResult | IteratorReturnResult; + +interface Iterator { + // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. + next(...args: [] | [TNext]): IteratorResult; + return?(value?: TReturn): IteratorResult; + throw?(e?: any): IteratorResult; } interface Iterable { diff --git a/src/lib/es2018.asyncgenerator.d.ts b/src/lib/es2018.asyncgenerator.d.ts new file mode 100644 index 00000000000..76275c92575 --- /dev/null +++ b/src/lib/es2018.asyncgenerator.d.ts @@ -0,0 +1,59 @@ +/// + +interface AsyncGenerator extends AsyncIterator { + // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. + next(...args: [] | [TNext | PromiseLike]): Promise>; + return(value: TReturn | PromiseLike): Promise>; + throw(e: any): Promise>; + [Symbol.asyncIterator](): AsyncGenerator; +} + +interface AsyncGeneratorFunction { + /** + * Creates a new AsyncGenerator object. + * @param args A list of arguments the function accepts. + */ + new (...args: any[]): AsyncGenerator; + /** + * Creates a new AsyncGenerator object. + * @param args A list of arguments the function accepts. + */ + (...args: any[]): AsyncGenerator; + /** + * The length of the arguments. + */ + readonly length: number; + /** + * Returns the name of the function. + */ + readonly name: string; + /** + * A reference to the prototype. + */ + readonly prototype: AsyncGenerator; +} + +interface AsyncGeneratorFunctionConstructor { + /** + * Creates a new AsyncGenerator function. + * @param args A list of arguments the function accepts. + */ + new (...args: string[]): AsyncGeneratorFunction; + /** + * Creates a new AsyncGenerator function. + * @param args A list of arguments the function accepts. + */ + (...args: string[]): AsyncGeneratorFunction; + /** + * The length of the arguments. + */ + readonly length: number; + /** + * Returns the name of the function. + */ + readonly name: string; + /** + * A reference to the prototype. + */ + readonly prototype: AsyncGeneratorFunction; +} diff --git a/src/lib/es2018.asynciterable.d.ts b/src/lib/es2018.asynciterable.d.ts index 11093af623d..d5d83f31893 100644 --- a/src/lib/es2018.asynciterable.d.ts +++ b/src/lib/es2018.asynciterable.d.ts @@ -9,10 +9,11 @@ interface SymbolConstructor { readonly asyncIterator: symbol; } -interface AsyncIterator { - next(value?: any): Promise>; - return?(value?: any): Promise>; - throw?(e?: any): Promise>; +interface AsyncIterator { + // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. + next(...args: [] | [TNext | PromiseLike]): Promise>; + return?(value?: TReturn | PromiseLike): Promise>; + throw?(e?: any): Promise>; } interface AsyncIterable { diff --git a/src/lib/es2018.d.ts b/src/lib/es2018.d.ts index 2a20887b3ee..b7670a81c3c 100644 --- a/src/lib/es2018.d.ts +++ b/src/lib/es2018.d.ts @@ -1,4 +1,5 @@ /// +/// /// /// /// diff --git a/src/lib/libs.json b/src/lib/libs.json index ac2f2db5b6b..089689befdd 100644 --- a/src/lib/libs.json +++ b/src/lib/libs.json @@ -31,6 +31,7 @@ "es2017.string", "es2017.intl", "es2017.typedarrays", + "es2018.asyncgenerator", "es2018.asynciterable", "es2018.regexp", "es2018.promise", diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 10a7b667009..81c56bb179b 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -2832,8 +2832,9 @@ namespace ts.server { let assignOrphanScriptInfosToInferredProject = false; if (openFiles) { while (true) { - const { value: file, done } = openFiles.next(); - if (done) break; + const iterResult = openFiles.next(); + if (iterResult.done) break; + const file = iterResult.value; const scriptInfo = this.getScriptInfo(file.fileName); Debug.assert(!scriptInfo || !scriptInfo.isScriptOpen(), "Script should not exist and not be open already"); // Create script infos so we have the new content for all the open files before we do any updates to projects @@ -2850,8 +2851,9 @@ namespace ts.server { if (changedFiles) { while (true) { - const { value: file, done } = changedFiles.next(); - if (done) break; + const iterResult = changedFiles.next(); + if (iterResult.done) break; + const file = iterResult.value; const scriptInfo = this.getScriptInfo(file.fileName)!; Debug.assert(!!scriptInfo); // Make edits to script infos and marks containing project as dirty @@ -2887,8 +2889,9 @@ namespace ts.server { /* @internal */ applyChangesToFile(scriptInfo: ScriptInfo, changes: Iterator) { while (true) { - const { value: change, done } = changes.next(); - if (done) break; + const iterResult = changes.next(); + if (iterResult.done) break; + const change = iterResult.value; scriptInfo.editContent(change.span.start, change.span.start + change.span.length, change.newText); } } diff --git a/src/testRunner/parallel/host.ts b/src/testRunner/parallel/host.ts index ee66fd738b0..50b18e39ac1 100644 --- a/src/testRunner/parallel/host.ts +++ b/src/testRunner/parallel/host.ts @@ -295,8 +295,8 @@ namespace Harness.Parallel.Host { worker.accumulatedOutput += d.toString(); console.log(`[Worker ${i}]`, d.toString()); }; - worker.process.stderr.on("data", appendOutput); - worker.process.stdout.on("data", appendOutput); + worker.process.stderr!.on("data", appendOutput); + worker.process.stdout!.on("data", appendOutput); const killChild = (timeout: TaskTimeout) => { worker.process.kill(); console.error(`Worker exceeded ${timeout.duration}ms timeout ${worker.currentTasks && worker.currentTasks.length ? `while running test '${worker.currentTasks[0].file}'.` : `during test setup.`}`); diff --git a/src/testRunner/unittests/config/commandLineParsing.ts b/src/testRunner/unittests/config/commandLineParsing.ts index 3d1001c7daf..d30c2a741dc 100644 --- a/src/testRunner/unittests/config/commandLineParsing.ts +++ b/src/testRunner/unittests/config/commandLineParsing.ts @@ -57,7 +57,7 @@ namespace ts { assertParseResult(["--lib", "es5,invalidOption", "0.ts"], { errors: [{ - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.string', 'es2020.symbol.wellknown', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint'.", + messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.string', 'es2020.symbol.wellknown', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint'.", category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category, code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, file: undefined, @@ -259,7 +259,7 @@ namespace ts { assertParseResult(["--lib", "es5,", "es7", "0.ts"], { errors: [{ - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.string', 'es2020.symbol.wellknown', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint'.", + messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.string', 'es2020.symbol.wellknown', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint'.", category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category, code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, file: undefined, @@ -278,7 +278,7 @@ namespace ts { assertParseResult(["--lib", "es5, ", "es7", "0.ts"], { errors: [{ - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.string', 'es2020.symbol.wellknown', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint'.", + messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.string', 'es2020.symbol.wellknown', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint'.", category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category, code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, file: undefined, diff --git a/src/testRunner/unittests/config/showConfig.ts b/src/testRunner/unittests/config/showConfig.ts index afe8f878d27..043e8382d23 100644 --- a/src/testRunner/unittests/config/showConfig.ts +++ b/src/testRunner/unittests/config/showConfig.ts @@ -134,7 +134,9 @@ namespace ts { break; } default: { - const val = option.type.keys().next().value; + const iterResult = option.type.keys().next(); + if (iterResult.done) return Debug.fail("Expected 'option.type' to have entries"); + const val = iterResult.value; if (option.isTSConfigOnly) { args = ["-p", "tsconfig.json"]; configObject = { compilerOptions: { [option.name]: val } }; diff --git a/src/testRunner/unittests/shimMap.ts b/src/testRunner/unittests/shimMap.ts index a47a1d18205..c3e94c0840c 100644 --- a/src/testRunner/unittests/shimMap.ts +++ b/src/testRunner/unittests/shimMap.ts @@ -68,12 +68,13 @@ namespace ts { // Use an iterator. const iterator = map.entries(); while (true) { - const { value: tuple, done } = iterator.next(); - if (done) { + const iterResult = iterator.next(); + if (iterResult.done) { break; } - doForEach(tuple[1], tuple[0]); + const [key, value] = iterResult.value; + doForEach(value, key); } } diff --git a/src/testRunner/unittests/tsserver/helpers.ts b/src/testRunner/unittests/tsserver/helpers.ts index 1c2383ab004..63b854e8ce8 100644 --- a/src/testRunner/unittests/tsserver/helpers.ts +++ b/src/testRunner/unittests/tsserver/helpers.ts @@ -438,10 +438,13 @@ namespace ts.projectSystem { export function configuredProjectAt(projectService: server.ProjectService, index: number) { const values = projectService.configuredProjects.values(); while (index > 0) { - values.next(); + const iterResult = values.next(); + if (iterResult.done) return Debug.fail("Expected a result."); index--; } - return values.next().value; + const iterResult = values.next(); + if (iterResult.done) return Debug.fail("Expected a result."); + return iterResult.value; } export function checkProjectActualFiles(project: server.Project, expectedFiles: ReadonlyArray) { diff --git a/src/tsconfig-base.json b/src/tsconfig-base.json index 4d83436a538..c1081ed1826 100644 --- a/src/tsconfig-base.json +++ b/src/tsconfig-base.json @@ -1,7 +1,7 @@ { "compilerOptions": { "pretty": true, - "lib": ["es2015.iterable", "es5"], + "lib": ["es2015.iterable", "es2015.generator", "es5"], "target": "es5", "rootDir": ".", diff --git a/tests/baselines/reference/FunctionDeclaration11_es6.types b/tests/baselines/reference/FunctionDeclaration11_es6.types index 0a312c2661c..c5053de9781 100644 --- a/tests/baselines/reference/FunctionDeclaration11_es6.types +++ b/tests/baselines/reference/FunctionDeclaration11_es6.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts === function * yield() { ->yield : () => IterableIterator +>yield : () => Generator } diff --git a/tests/baselines/reference/FunctionDeclaration13_es6.types b/tests/baselines/reference/FunctionDeclaration13_es6.types index b6f6aafd658..011472ef73d 100644 --- a/tests/baselines/reference/FunctionDeclaration13_es6.types +++ b/tests/baselines/reference/FunctionDeclaration13_es6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts === function * foo() { ->foo : () => IterableIterator +>foo : () => Generator // Legal to use 'yield' in a type context. var v: yield; diff --git a/tests/baselines/reference/FunctionDeclaration1_es6.types b/tests/baselines/reference/FunctionDeclaration1_es6.types index 548b1eb98d6..025cbe051c6 100644 --- a/tests/baselines/reference/FunctionDeclaration1_es6.types +++ b/tests/baselines/reference/FunctionDeclaration1_es6.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts === function * foo() { ->foo : () => IterableIterator +>foo : () => Generator } diff --git a/tests/baselines/reference/FunctionDeclaration6_es6.types b/tests/baselines/reference/FunctionDeclaration6_es6.types index 4cfb710a781..e567b033ec6 100644 --- a/tests/baselines/reference/FunctionDeclaration6_es6.types +++ b/tests/baselines/reference/FunctionDeclaration6_es6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts === function*foo(a = yield) { ->foo : (a?: any) => IterableIterator +>foo : (a?: any) => Generator >a : any >yield : any } diff --git a/tests/baselines/reference/FunctionDeclaration7_es6.types b/tests/baselines/reference/FunctionDeclaration7_es6.types index d9635231e4a..05df09ef780 100644 --- a/tests/baselines/reference/FunctionDeclaration7_es6.types +++ b/tests/baselines/reference/FunctionDeclaration7_es6.types @@ -1,10 +1,10 @@ === tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts === function*bar() { ->bar : () => IterableIterator +>bar : () => Generator // 'yield' here is an identifier, and not a yield expression. function*foo(a = yield) { ->foo : (a?: any) => IterableIterator +>foo : (a?: any) => Generator >a : any >yield : any } diff --git a/tests/baselines/reference/FunctionDeclaration9_es6.types b/tests/baselines/reference/FunctionDeclaration9_es6.types index 2b915b82a67..0c854f623f4 100644 --- a/tests/baselines/reference/FunctionDeclaration9_es6.types +++ b/tests/baselines/reference/FunctionDeclaration9_es6.types @@ -1,11 +1,11 @@ === tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts === function * foo() { ->foo : () => IterableIterator +>foo : () => Generator var v = { [yield]: foo } ->v : { [x: number]: () => IterableIterator; } ->{ [yield]: foo } : { [x: number]: () => IterableIterator; } ->[yield] : () => IterableIterator +>v : { [x: number]: () => Generator; } +>{ [yield]: foo } : { [x: number]: () => Generator; } +>[yield] : () => Generator >yield : any ->foo : () => IterableIterator +>foo : () => Generator } diff --git a/tests/baselines/reference/FunctionExpression1_es6.types b/tests/baselines/reference/FunctionExpression1_es6.types index 1bba41f11f2..1c56baf396a 100644 --- a/tests/baselines/reference/FunctionExpression1_es6.types +++ b/tests/baselines/reference/FunctionExpression1_es6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts === var v = function * () { } ->v : () => IterableIterator ->function * () { } : () => IterableIterator +>v : () => Generator +>function * () { } : () => Generator diff --git a/tests/baselines/reference/FunctionExpression2_es6.types b/tests/baselines/reference/FunctionExpression2_es6.types index 7a421dd1abf..8945268bf71 100644 --- a/tests/baselines/reference/FunctionExpression2_es6.types +++ b/tests/baselines/reference/FunctionExpression2_es6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts === var v = function * foo() { } ->v : () => IterableIterator ->function * foo() { } : () => IterableIterator ->foo : () => IterableIterator +>v : () => Generator +>function * foo() { } : () => Generator +>foo : () => Generator diff --git a/tests/baselines/reference/FunctionPropertyAssignments1_es6.types b/tests/baselines/reference/FunctionPropertyAssignments1_es6.types index 90b8615003e..8fa1b035830 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments1_es6.types +++ b/tests/baselines/reference/FunctionPropertyAssignments1_es6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts === var v = { *foo() { } } ->v : { foo(): IterableIterator; } ->{ *foo() { } } : { foo(): IterableIterator; } ->foo : () => IterableIterator +>v : { foo(): Generator; } +>{ *foo() { } } : { foo(): Generator; } +>foo : () => Generator diff --git a/tests/baselines/reference/FunctionPropertyAssignments2_es6.types b/tests/baselines/reference/FunctionPropertyAssignments2_es6.types index 6b9a2da9408..9ad073be7e9 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments2_es6.types +++ b/tests/baselines/reference/FunctionPropertyAssignments2_es6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments2_es6.ts === var v = { *() { } } ->v : { (Missing)(): IterableIterator; } ->{ *() { } } : { (Missing)(): IterableIterator; } -> : () => IterableIterator +>v : { (Missing)(): Generator; } +>{ *() { } } : { (Missing)(): Generator; } +> : () => Generator diff --git a/tests/baselines/reference/FunctionPropertyAssignments3_es6.types b/tests/baselines/reference/FunctionPropertyAssignments3_es6.types index 9222f6e142d..b49b766f1eb 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments3_es6.types +++ b/tests/baselines/reference/FunctionPropertyAssignments3_es6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments3_es6.ts === var v = { *{ } } ->v : { (Missing)(): IterableIterator; } ->{ *{ } } : { (Missing)(): IterableIterator; } -> : () => IterableIterator +>v : { (Missing)(): Generator; } +>{ *{ } } : { (Missing)(): Generator; } +> : () => Generator diff --git a/tests/baselines/reference/FunctionPropertyAssignments5_es6.types b/tests/baselines/reference/FunctionPropertyAssignments5_es6.types index 9430360e9da..18b2a7f33e5 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments5_es6.types +++ b/tests/baselines/reference/FunctionPropertyAssignments5_es6.types @@ -1,8 +1,8 @@ === tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts === var v = { *[foo()]() { } } ->v : { [x: number]: () => IterableIterator; } ->{ *[foo()]() { } } : { [x: number]: () => IterableIterator; } ->[foo()] : () => IterableIterator +>v : { [x: number]: () => Generator; } +>{ *[foo()]() { } } : { [x: number]: () => Generator; } +>[foo()] : () => Generator >foo() : any >foo : any diff --git a/tests/baselines/reference/FunctionPropertyAssignments6_es6.types b/tests/baselines/reference/FunctionPropertyAssignments6_es6.types index 832acbd8840..a7982dc2ca4 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments6_es6.types +++ b/tests/baselines/reference/FunctionPropertyAssignments6_es6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments6_es6.ts === var v = { *() { } } ->v : { (Missing)(): IterableIterator; } ->{ *() { } } : { (Missing)(): IterableIterator; } -> : () => IterableIterator +>v : { (Missing)(): Generator; } +>{ *() { } } : { (Missing)(): Generator; } +> : () => Generator diff --git a/tests/baselines/reference/MemberFunctionDeclaration1_es6.types b/tests/baselines/reference/MemberFunctionDeclaration1_es6.types index 89eec59bb1c..d002439563b 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration1_es6.types +++ b/tests/baselines/reference/MemberFunctionDeclaration1_es6.types @@ -3,5 +3,5 @@ class C { >C : C *foo() { } ->foo : () => IterableIterator +>foo : () => Generator } diff --git a/tests/baselines/reference/MemberFunctionDeclaration2_es6.types b/tests/baselines/reference/MemberFunctionDeclaration2_es6.types index bfc83ccfd27..761fd3c8bb8 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration2_es6.types +++ b/tests/baselines/reference/MemberFunctionDeclaration2_es6.types @@ -3,5 +3,5 @@ class C { >C : C public * foo() { } ->foo : () => IterableIterator +>foo : () => Generator } diff --git a/tests/baselines/reference/MemberFunctionDeclaration3_es6.types b/tests/baselines/reference/MemberFunctionDeclaration3_es6.types index e855cfa730d..97ecf7236b0 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration3_es6.types +++ b/tests/baselines/reference/MemberFunctionDeclaration3_es6.types @@ -3,6 +3,6 @@ class C { >C : C *[foo]() { } ->[foo] : () => IterableIterator +>[foo] : () => Generator >foo : any } diff --git a/tests/baselines/reference/MemberFunctionDeclaration4_es6.types b/tests/baselines/reference/MemberFunctionDeclaration4_es6.types index 7717c30a449..48b1bc1f591 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration4_es6.types +++ b/tests/baselines/reference/MemberFunctionDeclaration4_es6.types @@ -3,5 +3,5 @@ class C { >C : C *() { } -> : () => IterableIterator +> : () => Generator } diff --git a/tests/baselines/reference/MemberFunctionDeclaration7_es6.types b/tests/baselines/reference/MemberFunctionDeclaration7_es6.types index 8269f672372..1ee2ffc1433 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration7_es6.types +++ b/tests/baselines/reference/MemberFunctionDeclaration7_es6.types @@ -3,5 +3,5 @@ class C { >C : C *foo() { } ->foo : () => IterableIterator +>foo : () => Generator } diff --git a/tests/baselines/reference/YieldExpression10_es6.types b/tests/baselines/reference/YieldExpression10_es6.types index 966baa031ed..4f9f400a616 100644 --- a/tests/baselines/reference/YieldExpression10_es6.types +++ b/tests/baselines/reference/YieldExpression10_es6.types @@ -1,8 +1,8 @@ === tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts === var v = { * foo() { ->v : { foo(): IterableIterator; } ->{ * foo() { yield(foo); }} : { foo(): IterableIterator; } ->foo : () => IterableIterator +>v : { foo(): Generator; } +>{ * foo() { yield(foo); }} : { foo(): Generator; } +>foo : () => Generator yield(foo); >yield(foo) : any diff --git a/tests/baselines/reference/YieldExpression11_es6.types b/tests/baselines/reference/YieldExpression11_es6.types index 01257e4f95f..0ddc8ba936c 100644 --- a/tests/baselines/reference/YieldExpression11_es6.types +++ b/tests/baselines/reference/YieldExpression11_es6.types @@ -3,7 +3,7 @@ class C { >C : C *foo() { ->foo : () => IterableIterator +>foo : () => Generator yield(foo); >yield(foo) : any diff --git a/tests/baselines/reference/YieldExpression13_es6.types b/tests/baselines/reference/YieldExpression13_es6.types index 011ac1e09e8..5859828b8fe 100644 --- a/tests/baselines/reference/YieldExpression13_es6.types +++ b/tests/baselines/reference/YieldExpression13_es6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts === function* foo() { yield } ->foo : () => IterableIterator +>foo : () => Generator >yield : any diff --git a/tests/baselines/reference/YieldExpression16_es6.types b/tests/baselines/reference/YieldExpression16_es6.types index 661d60a5b58..67b956a3cfc 100644 --- a/tests/baselines/reference/YieldExpression16_es6.types +++ b/tests/baselines/reference/YieldExpression16_es6.types @@ -1,12 +1,12 @@ === tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts === function* foo() { ->foo : () => IterableIterator +>foo : () => Generator function bar() { >bar : () => void yield foo; >yield foo : any ->foo : () => IterableIterator +>foo : () => Generator } } diff --git a/tests/baselines/reference/YieldExpression19_es6.types b/tests/baselines/reference/YieldExpression19_es6.types index f57b175d53c..cab1da911c5 100644 --- a/tests/baselines/reference/YieldExpression19_es6.types +++ b/tests/baselines/reference/YieldExpression19_es6.types @@ -1,17 +1,17 @@ === tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts === function*foo() { ->foo : () => IterableIterator +>foo : () => Generator function bar() { >bar : () => void function* quux() { ->quux : () => IterableIterator<() => IterableIterator> +>quux : () => Generator<() => Generator, void, unknown> yield(foo); >yield(foo) : any ->(foo) : () => IterableIterator ->foo : () => IterableIterator +>(foo) : () => Generator +>foo : () => Generator } } } diff --git a/tests/baselines/reference/YieldExpression3_es6.types b/tests/baselines/reference/YieldExpression3_es6.types index 9e2f810d911..31ea178bc5a 100644 --- a/tests/baselines/reference/YieldExpression3_es6.types +++ b/tests/baselines/reference/YieldExpression3_es6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts === function* foo() { ->foo : () => IterableIterator +>foo : () => Generator yield >yield : any diff --git a/tests/baselines/reference/YieldExpression4_es6.types b/tests/baselines/reference/YieldExpression4_es6.types index 929bef38edd..c52f9222070 100644 --- a/tests/baselines/reference/YieldExpression4_es6.types +++ b/tests/baselines/reference/YieldExpression4_es6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts === function* foo() { ->foo : () => IterableIterator +>foo : () => Generator yield; >yield : any diff --git a/tests/baselines/reference/YieldExpression5_es6.types b/tests/baselines/reference/YieldExpression5_es6.types index 77a003d0922..6ff16d8cd8d 100644 --- a/tests/baselines/reference/YieldExpression5_es6.types +++ b/tests/baselines/reference/YieldExpression5_es6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/YieldExpression5_es6.ts === function* foo() { ->foo : () => IterableIterator +>foo : () => Generator yield* >yield* : any diff --git a/tests/baselines/reference/YieldExpression7_es6.types b/tests/baselines/reference/YieldExpression7_es6.types index 44dcc196c3b..8ebaa07ef60 100644 --- a/tests/baselines/reference/YieldExpression7_es6.types +++ b/tests/baselines/reference/YieldExpression7_es6.types @@ -1,8 +1,8 @@ === tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts === function* foo() { ->foo : () => IterableIterator +>foo : () => Generator yield foo >yield foo : any ->foo : () => IterableIterator +>foo : () => Generator } diff --git a/tests/baselines/reference/YieldExpression8_es6.types b/tests/baselines/reference/YieldExpression8_es6.types index 67343e3fbfc..66935c18cc5 100644 --- a/tests/baselines/reference/YieldExpression8_es6.types +++ b/tests/baselines/reference/YieldExpression8_es6.types @@ -2,13 +2,13 @@ yield(foo); >yield(foo) : any >yield : any ->foo : () => IterableIterator +>foo : () => Generator function* foo() { ->foo : () => IterableIterator +>foo : () => Generator yield(foo); >yield(foo) : any ->(foo) : () => IterableIterator ->foo : () => IterableIterator +>(foo) : () => Generator +>foo : () => Generator } diff --git a/tests/baselines/reference/YieldExpression9_es6.types b/tests/baselines/reference/YieldExpression9_es6.types index 109dc270583..e277bc711c5 100644 --- a/tests/baselines/reference/YieldExpression9_es6.types +++ b/tests/baselines/reference/YieldExpression9_es6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts === var v = function*() { ->v : () => IterableIterator ->function*() { yield(foo);} : () => IterableIterator +>v : () => Generator +>function*() { yield(foo);} : () => Generator yield(foo); >yield(foo) : any diff --git a/tests/baselines/reference/YieldStarExpression3_es6.types b/tests/baselines/reference/YieldStarExpression3_es6.types index 5bc03855b19..46d71934225 100644 --- a/tests/baselines/reference/YieldStarExpression3_es6.types +++ b/tests/baselines/reference/YieldStarExpression3_es6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/YieldStarExpression3_es6.ts === function *g() { ->g : () => IterableIterator +>g : () => Generator yield *; >yield * : any diff --git a/tests/baselines/reference/YieldStarExpression4_es6.types b/tests/baselines/reference/YieldStarExpression4_es6.types index 86b727306d4..5a1ebbe6a6e 100644 --- a/tests/baselines/reference/YieldStarExpression4_es6.types +++ b/tests/baselines/reference/YieldStarExpression4_es6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/YieldStarExpression4_es6.ts === function *g() { ->g : () => IterableIterator +>g : () => Generator yield * []; >yield * [] : any diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 479ba22f2a1..dfb9947447f 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -53,7 +53,7 @@ declare namespace ts { interface Iterator { next(): { value: T; - done: false; + done?: false; } | { value: never; done: true; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index c7e0403140f..a0833bf618e 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -53,7 +53,7 @@ declare namespace ts { interface Iterator { next(): { value: T; - done: false; + done?: false; } | { value: never; done: true; diff --git a/tests/baselines/reference/asyncImportNestedYield.types b/tests/baselines/reference/asyncImportNestedYield.types index f7fbfa8f962..59cd72d5465 100644 --- a/tests/baselines/reference/asyncImportNestedYield.types +++ b/tests/baselines/reference/asyncImportNestedYield.types @@ -1,6 +1,6 @@ === tests/cases/compiler/asyncImportNestedYield.ts === async function* foo() { ->foo : () => AsyncIterableIterator +>foo : () => AsyncGenerator import((await import(yield "foo")).default); >import((await import(yield "foo")).default) : Promise diff --git a/tests/baselines/reference/asyncMethodWithSuper_es6.types b/tests/baselines/reference/asyncMethodWithSuper_es6.types index ae78d8bc3ad..5dcc642146a 100644 --- a/tests/baselines/reference/asyncMethodWithSuper_es6.types +++ b/tests/baselines/reference/asyncMethodWithSuper_es6.types @@ -336,7 +336,7 @@ class B extends A { } async * property_access_only_read_only_in_generator() { ->property_access_only_read_only_in_generator : () => AsyncIterableIterator +>property_access_only_read_only_in_generator : () => AsyncGenerator // call with property access super.x(); @@ -372,7 +372,7 @@ class B extends A { } async * property_access_only_write_only_in_generator() { ->property_access_only_write_only_in_generator : () => AsyncIterableIterator +>property_access_only_write_only_in_generator : () => AsyncGenerator const f = () => {}; >f : () => void @@ -420,7 +420,7 @@ class B extends A { } async * element_access_only_read_only_in_generator() { ->element_access_only_read_only_in_generator : () => AsyncIterableIterator +>element_access_only_read_only_in_generator : () => AsyncGenerator // call with element access super["x"](); @@ -456,7 +456,7 @@ class B extends A { } async * element_access_only_write_only_in_generator() { ->element_access_only_write_only_in_generator : () => AsyncIterableIterator +>element_access_only_write_only_in_generator : () => AsyncGenerator const f = () => {}; >f : () => void diff --git a/tests/baselines/reference/awaitInNonAsyncFunction.types b/tests/baselines/reference/awaitInNonAsyncFunction.types index 78b9a6c5a90..1f521948779 100644 --- a/tests/baselines/reference/awaitInNonAsyncFunction.types +++ b/tests/baselines/reference/awaitInNonAsyncFunction.types @@ -57,7 +57,7 @@ const arrowFunc = (p: Promise) => { }; function* generatorFunc(p: Promise) { ->generatorFunc : (p: Promise) => IterableIterator +>generatorFunc : (p: Promise) => Generator >p : Promise for await (const _ of []); diff --git a/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator.types b/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator.types index cf93e7c2f4d..5f9692654ba 100644 --- a/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator.types +++ b/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator.types @@ -1,6 +1,6 @@ === tests/cases/compiler/blockScopedBindingsInDownlevelGenerator.ts === function* a() { ->a : () => IterableIterator +>a : () => Generator for (const i of [1,2,3]) { >i : number diff --git a/tests/baselines/reference/capturedParametersInInitializers1.types b/tests/baselines/reference/capturedParametersInInitializers1.types index 4819298d1af..aa0df80902e 100644 --- a/tests/baselines/reference/capturedParametersInInitializers1.types +++ b/tests/baselines/reference/capturedParametersInInitializers1.types @@ -82,11 +82,11 @@ function foo6(y = () => (() => z)(), z = 1) { // ok - used inside immediately invoked generator function function foo7(y = (function*() {yield z})(), z = 1) { ->foo7 : (y?: IterableIterator, z?: number) => void ->y : IterableIterator ->(function*() {yield z})() : IterableIterator ->(function*() {yield z}) : () => IterableIterator ->function*() {yield z} : () => IterableIterator +>foo7 : (y?: Generator, z?: number) => void +>y : Generator +>(function*() {yield z})() : Generator +>(function*() {yield z}) : () => Generator +>function*() {yield z} : () => Generator >yield z : any >z : number >z : number diff --git a/tests/baselines/reference/castOfYield.errors.txt b/tests/baselines/reference/castOfYield.errors.txt index 0d40a4dcd98..90725000c90 100644 --- a/tests/baselines/reference/castOfYield.errors.txt +++ b/tests/baselines/reference/castOfYield.errors.txt @@ -1,8 +1,8 @@ -error TS2318: Cannot find global type 'IterableIterator'. +error TS2318: Cannot find global type 'Generator'. tests/cases/compiler/castOfYield.ts(4,14): error TS1109: Expression expected. -!!! error TS2318: Cannot find global type 'IterableIterator'. +!!! error TS2318: Cannot find global type 'Generator'. ==== tests/cases/compiler/castOfYield.ts (1 errors) ==== function* f() { (yield 0); diff --git a/tests/baselines/reference/controlFlowIIFE.types b/tests/baselines/reference/controlFlowIIFE.types index 2116cfaa2ae..64207b27061 100644 --- a/tests/baselines/reference/controlFlowIIFE.types +++ b/tests/baselines/reference/controlFlowIIFE.types @@ -181,9 +181,9 @@ function f5() { >v : number (function*() { ->(function*() { yield 1; v = 1; })() : IterableIterator ->(function*() { yield 1; v = 1; }) : () => IterableIterator ->function*() { yield 1; v = 1; } : () => IterableIterator +>(function*() { yield 1; v = 1; })() : Generator +>(function*() { yield 1; v = 1; }) : () => Generator +>function*() { yield 1; v = 1; } : () => Generator yield 1; >yield 1 : any diff --git a/tests/baselines/reference/emitter.asyncGenerators.classMethods.es2015.types b/tests/baselines/reference/emitter.asyncGenerators.classMethods.es2015.types index c6d6fb6758d..54013c11fce 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.classMethods.es2015.types +++ b/tests/baselines/reference/emitter.asyncGenerators.classMethods.es2015.types @@ -3,7 +3,7 @@ class C1 { >C1 : C1 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator } } === tests/cases/conformance/emitter/es2015/asyncGenerators/C2.ts === @@ -11,7 +11,7 @@ class C2 { >C2 : C2 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield; >x : any @@ -23,7 +23,7 @@ class C3 { >C3 : C3 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield 1; >x : any @@ -36,7 +36,7 @@ class C4 { >C4 : C4 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield* [1]; >x : any @@ -50,14 +50,14 @@ class C5 { >C5 : C5 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield* (async function*() { yield 1; })(); ->x : any ->yield* (async function*() { yield 1; })() : any ->(async function*() { yield 1; })() : AsyncIterableIterator ->(async function*() { yield 1; }) : () => AsyncIterableIterator ->async function*() { yield 1; } : () => AsyncIterableIterator +>x : void +>yield* (async function*() { yield 1; })() : void +>(async function*() { yield 1; })() : AsyncGenerator +>(async function*() { yield 1; }) : () => AsyncGenerator +>async function*() { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 } @@ -67,7 +67,7 @@ class C6 { >C6 : C6 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = await 1; >x : 1 @@ -80,7 +80,7 @@ class C7 { >C7 : C7 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator return 1; >1 : 1 @@ -94,7 +94,7 @@ class C8 { >g : () => void } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator this.g(); >this.g() : void @@ -115,7 +115,7 @@ class C9 extends B9 { >B9 : B9 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator super.g(); >super.g() : void diff --git a/tests/baselines/reference/emitter.asyncGenerators.classMethods.es2018.types b/tests/baselines/reference/emitter.asyncGenerators.classMethods.es2018.types index 17fefc54e81..7c439f49b7f 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.classMethods.es2018.types +++ b/tests/baselines/reference/emitter.asyncGenerators.classMethods.es2018.types @@ -3,7 +3,7 @@ class C1 { >C1 : C1 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator } } === tests/cases/conformance/emitter/es2018/asyncGenerators/C2.ts === @@ -11,7 +11,7 @@ class C2 { >C2 : C2 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield; >x : any @@ -23,7 +23,7 @@ class C3 { >C3 : C3 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield 1; >x : any @@ -36,7 +36,7 @@ class C4 { >C4 : C4 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield* [1]; >x : any @@ -50,14 +50,14 @@ class C5 { >C5 : C5 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield* (async function*() { yield 1; })(); ->x : any ->yield* (async function*() { yield 1; })() : any ->(async function*() { yield 1; })() : AsyncIterableIterator ->(async function*() { yield 1; }) : () => AsyncIterableIterator ->async function*() { yield 1; } : () => AsyncIterableIterator +>x : void +>yield* (async function*() { yield 1; })() : void +>(async function*() { yield 1; })() : AsyncGenerator +>(async function*() { yield 1; }) : () => AsyncGenerator +>async function*() { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 } @@ -67,7 +67,7 @@ class C6 { >C6 : C6 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = await 1; >x : 1 @@ -80,7 +80,7 @@ class C7 { >C7 : C7 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator return 1; >1 : 1 @@ -94,7 +94,7 @@ class C8 { >g : () => void } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator this.g(); >this.g() : void @@ -115,7 +115,7 @@ class C9 extends B9 { >B9 : B9 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator super.g(); >super.g() : void diff --git a/tests/baselines/reference/emitter.asyncGenerators.classMethods.es5.types b/tests/baselines/reference/emitter.asyncGenerators.classMethods.es5.types index 5d636d2400c..bb62ad37038 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.classMethods.es5.types +++ b/tests/baselines/reference/emitter.asyncGenerators.classMethods.es5.types @@ -3,7 +3,7 @@ class C1 { >C1 : C1 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator } } === tests/cases/conformance/emitter/es5/asyncGenerators/C2.ts === @@ -11,7 +11,7 @@ class C2 { >C2 : C2 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield; >x : any @@ -23,7 +23,7 @@ class C3 { >C3 : C3 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield 1; >x : any @@ -36,7 +36,7 @@ class C4 { >C4 : C4 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield* [1]; >x : any @@ -50,14 +50,14 @@ class C5 { >C5 : C5 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield* (async function*() { yield 1; })(); ->x : any ->yield* (async function*() { yield 1; })() : any ->(async function*() { yield 1; })() : AsyncIterableIterator ->(async function*() { yield 1; }) : () => AsyncIterableIterator ->async function*() { yield 1; } : () => AsyncIterableIterator +>x : void +>yield* (async function*() { yield 1; })() : void +>(async function*() { yield 1; })() : AsyncGenerator +>(async function*() { yield 1; }) : () => AsyncGenerator +>async function*() { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 } @@ -67,7 +67,7 @@ class C6 { >C6 : C6 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = await 1; >x : 1 @@ -80,7 +80,7 @@ class C7 { >C7 : C7 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator return 1; >1 : 1 @@ -94,7 +94,7 @@ class C8 { >g : () => void } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator this.g(); >this.g() : void @@ -115,7 +115,7 @@ class C9 extends B9 { >B9 : B9 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator super.g(); >super.g() : void diff --git a/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es2015.types b/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es2015.types index 15ff1298b21..3dd1afd236d 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es2015.types +++ b/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es2015.types @@ -1,10 +1,10 @@ === tests/cases/conformance/emitter/es2015/asyncGenerators/F1.ts === async function * f1() { ->f1 : () => AsyncIterableIterator +>f1 : () => AsyncGenerator } === tests/cases/conformance/emitter/es2015/asyncGenerators/F2.ts === async function * f2() { ->f2 : () => AsyncIterableIterator +>f2 : () => AsyncGenerator const x = yield; >x : any @@ -12,7 +12,7 @@ async function * f2() { } === tests/cases/conformance/emitter/es2015/asyncGenerators/F3.ts === async function * f3() { ->f3 : () => AsyncIterableIterator +>f3 : () => AsyncGenerator const x = yield 1; >x : any @@ -21,7 +21,7 @@ async function * f3() { } === tests/cases/conformance/emitter/es2015/asyncGenerators/F4.ts === async function * f4() { ->f4 : () => AsyncIterableIterator +>f4 : () => AsyncGenerator const x = yield* [1]; >x : any @@ -31,20 +31,20 @@ async function * f4() { } === tests/cases/conformance/emitter/es2015/asyncGenerators/F5.ts === async function * f5() { ->f5 : () => AsyncIterableIterator +>f5 : () => AsyncGenerator const x = yield* (async function*() { yield 1; })(); ->x : any ->yield* (async function*() { yield 1; })() : any ->(async function*() { yield 1; })() : AsyncIterableIterator ->(async function*() { yield 1; }) : () => AsyncIterableIterator ->async function*() { yield 1; } : () => AsyncIterableIterator +>x : void +>yield* (async function*() { yield 1; })() : void +>(async function*() { yield 1; })() : AsyncGenerator +>(async function*() { yield 1; }) : () => AsyncGenerator +>async function*() { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 } === tests/cases/conformance/emitter/es2015/asyncGenerators/F6.ts === async function * f6() { ->f6 : () => AsyncIterableIterator +>f6 : () => AsyncGenerator const x = await 1; >x : 1 @@ -53,7 +53,7 @@ async function * f6() { } === tests/cases/conformance/emitter/es2015/asyncGenerators/F7.ts === async function * f7() { ->f7 : () => AsyncIterableIterator +>f7 : () => AsyncGenerator return 1; >1 : 1 diff --git a/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es2018.types b/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es2018.types index 8ffd5534e40..9034f795efd 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es2018.types +++ b/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es2018.types @@ -1,10 +1,10 @@ === tests/cases/conformance/emitter/es2018/asyncGenerators/F1.ts === async function * f1() { ->f1 : () => AsyncIterableIterator +>f1 : () => AsyncGenerator } === tests/cases/conformance/emitter/es2018/asyncGenerators/F2.ts === async function * f2() { ->f2 : () => AsyncIterableIterator +>f2 : () => AsyncGenerator const x = yield; >x : any @@ -12,7 +12,7 @@ async function * f2() { } === tests/cases/conformance/emitter/es2018/asyncGenerators/F3.ts === async function * f3() { ->f3 : () => AsyncIterableIterator +>f3 : () => AsyncGenerator const x = yield 1; >x : any @@ -21,7 +21,7 @@ async function * f3() { } === tests/cases/conformance/emitter/es2018/asyncGenerators/F4.ts === async function * f4() { ->f4 : () => AsyncIterableIterator +>f4 : () => AsyncGenerator const x = yield* [1]; >x : any @@ -31,20 +31,20 @@ async function * f4() { } === tests/cases/conformance/emitter/es2018/asyncGenerators/F5.ts === async function * f5() { ->f5 : () => AsyncIterableIterator +>f5 : () => AsyncGenerator const x = yield* (async function*() { yield 1; })(); ->x : any ->yield* (async function*() { yield 1; })() : any ->(async function*() { yield 1; })() : AsyncIterableIterator ->(async function*() { yield 1; }) : () => AsyncIterableIterator ->async function*() { yield 1; } : () => AsyncIterableIterator +>x : void +>yield* (async function*() { yield 1; })() : void +>(async function*() { yield 1; })() : AsyncGenerator +>(async function*() { yield 1; }) : () => AsyncGenerator +>async function*() { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 } === tests/cases/conformance/emitter/es2018/asyncGenerators/F6.ts === async function * f6() { ->f6 : () => AsyncIterableIterator +>f6 : () => AsyncGenerator const x = await 1; >x : 1 @@ -53,7 +53,7 @@ async function * f6() { } === tests/cases/conformance/emitter/es2018/asyncGenerators/F7.ts === async function * f7() { ->f7 : () => AsyncIterableIterator +>f7 : () => AsyncGenerator return 1; >1 : 1 diff --git a/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es5.types b/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es5.types index 6220f5efd1e..9771364486f 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es5.types +++ b/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es5.types @@ -1,10 +1,10 @@ === tests/cases/conformance/emitter/es5/asyncGenerators/F1.ts === async function * f1() { ->f1 : () => AsyncIterableIterator +>f1 : () => AsyncGenerator } === tests/cases/conformance/emitter/es5/asyncGenerators/F2.ts === async function * f2() { ->f2 : () => AsyncIterableIterator +>f2 : () => AsyncGenerator const x = yield; >x : any @@ -12,7 +12,7 @@ async function * f2() { } === tests/cases/conformance/emitter/es5/asyncGenerators/F3.ts === async function * f3() { ->f3 : () => AsyncIterableIterator +>f3 : () => AsyncGenerator const x = yield 1; >x : any @@ -21,7 +21,7 @@ async function * f3() { } === tests/cases/conformance/emitter/es5/asyncGenerators/F4.ts === async function * f4() { ->f4 : () => AsyncIterableIterator +>f4 : () => AsyncGenerator const x = yield* [1]; >x : any @@ -31,20 +31,20 @@ async function * f4() { } === tests/cases/conformance/emitter/es5/asyncGenerators/F5.ts === async function * f5() { ->f5 : () => AsyncIterableIterator +>f5 : () => AsyncGenerator const x = yield* (async function*() { yield 1; })(); ->x : any ->yield* (async function*() { yield 1; })() : any ->(async function*() { yield 1; })() : AsyncIterableIterator ->(async function*() { yield 1; }) : () => AsyncIterableIterator ->async function*() { yield 1; } : () => AsyncIterableIterator +>x : void +>yield* (async function*() { yield 1; })() : void +>(async function*() { yield 1; })() : AsyncGenerator +>(async function*() { yield 1; }) : () => AsyncGenerator +>async function*() { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 } === tests/cases/conformance/emitter/es5/asyncGenerators/F6.ts === async function * f6() { ->f6 : () => AsyncIterableIterator +>f6 : () => AsyncGenerator const x = await 1; >x : 1 @@ -53,7 +53,7 @@ async function * f6() { } === tests/cases/conformance/emitter/es5/asyncGenerators/F7.ts === async function * f7() { ->f7 : () => AsyncIterableIterator +>f7 : () => AsyncGenerator return 1; >1 : 1 diff --git a/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es2015.types b/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es2015.types index 1db2126b7ed..ee48f52f77a 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es2015.types +++ b/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es2015.types @@ -1,12 +1,12 @@ === tests/cases/conformance/emitter/es2015/asyncGenerators/F1.ts === const f1 = async function * () { ->f1 : () => AsyncIterableIterator ->async function * () {} : () => AsyncIterableIterator +>f1 : () => AsyncGenerator +>async function * () {} : () => AsyncGenerator } === tests/cases/conformance/emitter/es2015/asyncGenerators/F2.ts === const f2 = async function * () { ->f2 : () => AsyncIterableIterator ->async function * () { const x = yield;} : () => AsyncIterableIterator +>f2 : () => AsyncGenerator +>async function * () { const x = yield;} : () => AsyncGenerator const x = yield; >x : any @@ -14,8 +14,8 @@ const f2 = async function * () { } === tests/cases/conformance/emitter/es2015/asyncGenerators/F3.ts === const f3 = async function * () { ->f3 : () => AsyncIterableIterator ->async function * () { const x = yield 1;} : () => AsyncIterableIterator +>f3 : () => AsyncGenerator +>async function * () { const x = yield 1;} : () => AsyncGenerator const x = yield 1; >x : any @@ -24,8 +24,8 @@ const f3 = async function * () { } === tests/cases/conformance/emitter/es2015/asyncGenerators/F4.ts === const f4 = async function * () { ->f4 : () => AsyncIterableIterator ->async function * () { const x = yield* [1];} : () => AsyncIterableIterator +>f4 : () => AsyncGenerator +>async function * () { const x = yield* [1];} : () => AsyncGenerator const x = yield* [1]; >x : any @@ -35,22 +35,22 @@ const f4 = async function * () { } === tests/cases/conformance/emitter/es2015/asyncGenerators/F5.ts === const f5 = async function * () { ->f5 : () => AsyncIterableIterator ->async function * () { const x = yield* (async function*() { yield 1; })();} : () => AsyncIterableIterator +>f5 : () => AsyncGenerator +>async function * () { const x = yield* (async function*() { yield 1; })();} : () => AsyncGenerator const x = yield* (async function*() { yield 1; })(); ->x : any ->yield* (async function*() { yield 1; })() : any ->(async function*() { yield 1; })() : AsyncIterableIterator ->(async function*() { yield 1; }) : () => AsyncIterableIterator ->async function*() { yield 1; } : () => AsyncIterableIterator +>x : void +>yield* (async function*() { yield 1; })() : void +>(async function*() { yield 1; })() : AsyncGenerator +>(async function*() { yield 1; }) : () => AsyncGenerator +>async function*() { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 } === tests/cases/conformance/emitter/es2015/asyncGenerators/F6.ts === const f6 = async function * () { ->f6 : () => AsyncIterableIterator ->async function * () { const x = await 1;} : () => AsyncIterableIterator +>f6 : () => AsyncGenerator +>async function * () { const x = await 1;} : () => AsyncGenerator const x = await 1; >x : 1 @@ -59,8 +59,8 @@ const f6 = async function * () { } === tests/cases/conformance/emitter/es2015/asyncGenerators/F7.ts === const f7 = async function * () { ->f7 : () => AsyncIterableIterator ->async function * () { return 1;} : () => AsyncIterableIterator +>f7 : () => AsyncGenerator +>async function * () { return 1;} : () => AsyncGenerator return 1; >1 : 1 diff --git a/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es2018.types b/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es2018.types index 07ee0579bed..8f09c423ecd 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es2018.types +++ b/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es2018.types @@ -1,12 +1,12 @@ === tests/cases/conformance/emitter/es2018/asyncGenerators/F1.ts === const f1 = async function * () { ->f1 : () => AsyncIterableIterator ->async function * () {} : () => AsyncIterableIterator +>f1 : () => AsyncGenerator +>async function * () {} : () => AsyncGenerator } === tests/cases/conformance/emitter/es2018/asyncGenerators/F2.ts === const f2 = async function * () { ->f2 : () => AsyncIterableIterator ->async function * () { const x = yield;} : () => AsyncIterableIterator +>f2 : () => AsyncGenerator +>async function * () { const x = yield;} : () => AsyncGenerator const x = yield; >x : any @@ -14,8 +14,8 @@ const f2 = async function * () { } === tests/cases/conformance/emitter/es2018/asyncGenerators/F3.ts === const f3 = async function * () { ->f3 : () => AsyncIterableIterator ->async function * () { const x = yield 1;} : () => AsyncIterableIterator +>f3 : () => AsyncGenerator +>async function * () { const x = yield 1;} : () => AsyncGenerator const x = yield 1; >x : any @@ -24,8 +24,8 @@ const f3 = async function * () { } === tests/cases/conformance/emitter/es2018/asyncGenerators/F4.ts === const f4 = async function * () { ->f4 : () => AsyncIterableIterator ->async function * () { const x = yield* [1];} : () => AsyncIterableIterator +>f4 : () => AsyncGenerator +>async function * () { const x = yield* [1];} : () => AsyncGenerator const x = yield* [1]; >x : any @@ -35,22 +35,22 @@ const f4 = async function * () { } === tests/cases/conformance/emitter/es2018/asyncGenerators/F5.ts === const f5 = async function * () { ->f5 : () => AsyncIterableIterator ->async function * () { const x = yield* (async function*() { yield 1; })();} : () => AsyncIterableIterator +>f5 : () => AsyncGenerator +>async function * () { const x = yield* (async function*() { yield 1; })();} : () => AsyncGenerator const x = yield* (async function*() { yield 1; })(); ->x : any ->yield* (async function*() { yield 1; })() : any ->(async function*() { yield 1; })() : AsyncIterableIterator ->(async function*() { yield 1; }) : () => AsyncIterableIterator ->async function*() { yield 1; } : () => AsyncIterableIterator +>x : void +>yield* (async function*() { yield 1; })() : void +>(async function*() { yield 1; })() : AsyncGenerator +>(async function*() { yield 1; }) : () => AsyncGenerator +>async function*() { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 } === tests/cases/conformance/emitter/es2018/asyncGenerators/F6.ts === const f6 = async function * () { ->f6 : () => AsyncIterableIterator ->async function * () { const x = await 1;} : () => AsyncIterableIterator +>f6 : () => AsyncGenerator +>async function * () { const x = await 1;} : () => AsyncGenerator const x = await 1; >x : 1 @@ -59,8 +59,8 @@ const f6 = async function * () { } === tests/cases/conformance/emitter/es2018/asyncGenerators/F7.ts === const f7 = async function * () { ->f7 : () => AsyncIterableIterator ->async function * () { return 1;} : () => AsyncIterableIterator +>f7 : () => AsyncGenerator +>async function * () { return 1;} : () => AsyncGenerator return 1; >1 : 1 diff --git a/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es5.types b/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es5.types index e9da600bdbf..b92f49da91f 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es5.types +++ b/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es5.types @@ -1,12 +1,12 @@ === tests/cases/conformance/emitter/es5/asyncGenerators/F1.ts === const f1 = async function * () { ->f1 : () => AsyncIterableIterator ->async function * () {} : () => AsyncIterableIterator +>f1 : () => AsyncGenerator +>async function * () {} : () => AsyncGenerator } === tests/cases/conformance/emitter/es5/asyncGenerators/F2.ts === const f2 = async function * () { ->f2 : () => AsyncIterableIterator ->async function * () { const x = yield;} : () => AsyncIterableIterator +>f2 : () => AsyncGenerator +>async function * () { const x = yield;} : () => AsyncGenerator const x = yield; >x : any @@ -14,8 +14,8 @@ const f2 = async function * () { } === tests/cases/conformance/emitter/es5/asyncGenerators/F3.ts === const f3 = async function * () { ->f3 : () => AsyncIterableIterator ->async function * () { const x = yield 1;} : () => AsyncIterableIterator +>f3 : () => AsyncGenerator +>async function * () { const x = yield 1;} : () => AsyncGenerator const x = yield 1; >x : any @@ -24,8 +24,8 @@ const f3 = async function * () { } === tests/cases/conformance/emitter/es5/asyncGenerators/F4.ts === const f4 = async function * () { ->f4 : () => AsyncIterableIterator ->async function * () { const x = yield* [1];} : () => AsyncIterableIterator +>f4 : () => AsyncGenerator +>async function * () { const x = yield* [1];} : () => AsyncGenerator const x = yield* [1]; >x : any @@ -35,22 +35,22 @@ const f4 = async function * () { } === tests/cases/conformance/emitter/es5/asyncGenerators/F5.ts === const f5 = async function * () { ->f5 : () => AsyncIterableIterator ->async function * () { const x = yield* (async function*() { yield 1; })();} : () => AsyncIterableIterator +>f5 : () => AsyncGenerator +>async function * () { const x = yield* (async function*() { yield 1; })();} : () => AsyncGenerator const x = yield* (async function*() { yield 1; })(); ->x : any ->yield* (async function*() { yield 1; })() : any ->(async function*() { yield 1; })() : AsyncIterableIterator ->(async function*() { yield 1; }) : () => AsyncIterableIterator ->async function*() { yield 1; } : () => AsyncIterableIterator +>x : void +>yield* (async function*() { yield 1; })() : void +>(async function*() { yield 1; })() : AsyncGenerator +>(async function*() { yield 1; }) : () => AsyncGenerator +>async function*() { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 } === tests/cases/conformance/emitter/es5/asyncGenerators/F6.ts === const f6 = async function * () { ->f6 : () => AsyncIterableIterator ->async function * () { const x = await 1;} : () => AsyncIterableIterator +>f6 : () => AsyncGenerator +>async function * () { const x = await 1;} : () => AsyncGenerator const x = await 1; >x : 1 @@ -59,8 +59,8 @@ const f6 = async function * () { } === tests/cases/conformance/emitter/es5/asyncGenerators/F7.ts === const f7 = async function * () { ->f7 : () => AsyncIterableIterator ->async function * () { return 1;} : () => AsyncIterableIterator +>f7 : () => AsyncGenerator +>async function * () { return 1;} : () => AsyncGenerator return 1; >1 : 1 diff --git a/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es2015.types b/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es2015.types index 9e47fc9d989..5d9d79da634 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es2015.types +++ b/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es2015.types @@ -1,19 +1,19 @@ === tests/cases/conformance/emitter/es2015/asyncGenerators/O1.ts === const o1 = { ->o1 : { f(): AsyncIterableIterator; } ->{ async * f() { }} : { f(): AsyncIterableIterator; } +>o1 : { f(): AsyncGenerator; } +>{ async * f() { }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator } } === tests/cases/conformance/emitter/es2015/asyncGenerators/O2.ts === const o2 = { ->o2 : { f(): AsyncIterableIterator; } ->{ async * f() { const x = yield; }} : { f(): AsyncIterableIterator; } +>o2 : { f(): AsyncGenerator; } +>{ async * f() { const x = yield; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield; >x : any @@ -22,11 +22,11 @@ const o2 = { } === tests/cases/conformance/emitter/es2015/asyncGenerators/O3.ts === const o3 = { ->o3 : { f(): AsyncIterableIterator; } ->{ async * f() { const x = yield 1; }} : { f(): AsyncIterableIterator; } +>o3 : { f(): AsyncGenerator; } +>{ async * f() { const x = yield 1; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield 1; >x : any @@ -36,11 +36,11 @@ const o3 = { } === tests/cases/conformance/emitter/es2015/asyncGenerators/O4.ts === const o4 = { ->o4 : { f(): AsyncIterableIterator; } ->{ async * f() { const x = yield* [1]; }} : { f(): AsyncIterableIterator; } +>o4 : { f(): AsyncGenerator; } +>{ async * f() { const x = yield* [1]; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield* [1]; >x : any @@ -51,29 +51,29 @@ const o4 = { } === tests/cases/conformance/emitter/es2015/asyncGenerators/O5.ts === const o5 = { ->o5 : { f(): AsyncIterableIterator; } ->{ async * f() { const x = yield* (async function*() { yield 1; })(); }} : { f(): AsyncIterableIterator; } +>o5 : { f(): AsyncGenerator; } +>{ async * f() { const x = yield* (async function*() { yield 1; })(); }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield* (async function*() { yield 1; })(); ->x : any ->yield* (async function*() { yield 1; })() : any ->(async function*() { yield 1; })() : AsyncIterableIterator ->(async function*() { yield 1; }) : () => AsyncIterableIterator ->async function*() { yield 1; } : () => AsyncIterableIterator +>x : void +>yield* (async function*() { yield 1; })() : void +>(async function*() { yield 1; })() : AsyncGenerator +>(async function*() { yield 1; }) : () => AsyncGenerator +>async function*() { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 } } === tests/cases/conformance/emitter/es2015/asyncGenerators/O6.ts === const o6 = { ->o6 : { f(): AsyncIterableIterator; } ->{ async * f() { const x = await 1; }} : { f(): AsyncIterableIterator; } +>o6 : { f(): AsyncGenerator; } +>{ async * f() { const x = await 1; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = await 1; >x : 1 @@ -83,11 +83,11 @@ const o6 = { } === tests/cases/conformance/emitter/es2015/asyncGenerators/O7.ts === const o7 = { ->o7 : { f(): AsyncIterableIterator; } ->{ async * f() { return 1; }} : { f(): AsyncIterableIterator; } +>o7 : { f(): AsyncGenerator; } +>{ async * f() { return 1; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator return 1; >1 : 1 diff --git a/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es2018.types b/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es2018.types index 4b33425a7a4..5b0b63b66e4 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es2018.types +++ b/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es2018.types @@ -1,19 +1,19 @@ === tests/cases/conformance/emitter/es2018/asyncGenerators/O1.ts === const o1 = { ->o1 : { f(): AsyncIterableIterator; } ->{ async * f() { }} : { f(): AsyncIterableIterator; } +>o1 : { f(): AsyncGenerator; } +>{ async * f() { }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator } } === tests/cases/conformance/emitter/es2018/asyncGenerators/O2.ts === const o2 = { ->o2 : { f(): AsyncIterableIterator; } ->{ async * f() { const x = yield; }} : { f(): AsyncIterableIterator; } +>o2 : { f(): AsyncGenerator; } +>{ async * f() { const x = yield; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield; >x : any @@ -22,11 +22,11 @@ const o2 = { } === tests/cases/conformance/emitter/es2018/asyncGenerators/O3.ts === const o3 = { ->o3 : { f(): AsyncIterableIterator; } ->{ async * f() { const x = yield 1; }} : { f(): AsyncIterableIterator; } +>o3 : { f(): AsyncGenerator; } +>{ async * f() { const x = yield 1; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield 1; >x : any @@ -36,11 +36,11 @@ const o3 = { } === tests/cases/conformance/emitter/es2018/asyncGenerators/O4.ts === const o4 = { ->o4 : { f(): AsyncIterableIterator; } ->{ async * f() { const x = yield* [1]; }} : { f(): AsyncIterableIterator; } +>o4 : { f(): AsyncGenerator; } +>{ async * f() { const x = yield* [1]; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield* [1]; >x : any @@ -51,29 +51,29 @@ const o4 = { } === tests/cases/conformance/emitter/es2018/asyncGenerators/O5.ts === const o5 = { ->o5 : { f(): AsyncIterableIterator; } ->{ async * f() { const x = yield* (async function*() { yield 1; })(); }} : { f(): AsyncIterableIterator; } +>o5 : { f(): AsyncGenerator; } +>{ async * f() { const x = yield* (async function*() { yield 1; })(); }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield* (async function*() { yield 1; })(); ->x : any ->yield* (async function*() { yield 1; })() : any ->(async function*() { yield 1; })() : AsyncIterableIterator ->(async function*() { yield 1; }) : () => AsyncIterableIterator ->async function*() { yield 1; } : () => AsyncIterableIterator +>x : void +>yield* (async function*() { yield 1; })() : void +>(async function*() { yield 1; })() : AsyncGenerator +>(async function*() { yield 1; }) : () => AsyncGenerator +>async function*() { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 } } === tests/cases/conformance/emitter/es2018/asyncGenerators/O6.ts === const o6 = { ->o6 : { f(): AsyncIterableIterator; } ->{ async * f() { const x = await 1; }} : { f(): AsyncIterableIterator; } +>o6 : { f(): AsyncGenerator; } +>{ async * f() { const x = await 1; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = await 1; >x : 1 @@ -83,11 +83,11 @@ const o6 = { } === tests/cases/conformance/emitter/es2018/asyncGenerators/O7.ts === const o7 = { ->o7 : { f(): AsyncIterableIterator; } ->{ async * f() { return 1; }} : { f(): AsyncIterableIterator; } +>o7 : { f(): AsyncGenerator; } +>{ async * f() { return 1; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator return 1; >1 : 1 diff --git a/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es5.types b/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es5.types index 39000760508..b4ab8ea8480 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es5.types +++ b/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es5.types @@ -1,19 +1,19 @@ === tests/cases/conformance/emitter/es5/asyncGenerators/O1.ts === const o1 = { ->o1 : { f(): AsyncIterableIterator; } ->{ async * f() { }} : { f(): AsyncIterableIterator; } +>o1 : { f(): AsyncGenerator; } +>{ async * f() { }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator } } === tests/cases/conformance/emitter/es5/asyncGenerators/O2.ts === const o2 = { ->o2 : { f(): AsyncIterableIterator; } ->{ async * f() { const x = yield; }} : { f(): AsyncIterableIterator; } +>o2 : { f(): AsyncGenerator; } +>{ async * f() { const x = yield; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield; >x : any @@ -22,11 +22,11 @@ const o2 = { } === tests/cases/conformance/emitter/es5/asyncGenerators/O3.ts === const o3 = { ->o3 : { f(): AsyncIterableIterator; } ->{ async * f() { const x = yield 1; }} : { f(): AsyncIterableIterator; } +>o3 : { f(): AsyncGenerator; } +>{ async * f() { const x = yield 1; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield 1; >x : any @@ -36,11 +36,11 @@ const o3 = { } === tests/cases/conformance/emitter/es5/asyncGenerators/O4.ts === const o4 = { ->o4 : { f(): AsyncIterableIterator; } ->{ async * f() { const x = yield* [1]; }} : { f(): AsyncIterableIterator; } +>o4 : { f(): AsyncGenerator; } +>{ async * f() { const x = yield* [1]; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield* [1]; >x : any @@ -51,29 +51,29 @@ const o4 = { } === tests/cases/conformance/emitter/es5/asyncGenerators/O5.ts === const o5 = { ->o5 : { f(): AsyncIterableIterator; } ->{ async * f() { const x = yield* (async function*() { yield 1; })(); }} : { f(): AsyncIterableIterator; } +>o5 : { f(): AsyncGenerator; } +>{ async * f() { const x = yield* (async function*() { yield 1; })(); }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = yield* (async function*() { yield 1; })(); ->x : any ->yield* (async function*() { yield 1; })() : any ->(async function*() { yield 1; })() : AsyncIterableIterator ->(async function*() { yield 1; }) : () => AsyncIterableIterator ->async function*() { yield 1; } : () => AsyncIterableIterator +>x : void +>yield* (async function*() { yield 1; })() : void +>(async function*() { yield 1; })() : AsyncGenerator +>(async function*() { yield 1; }) : () => AsyncGenerator +>async function*() { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 } } === tests/cases/conformance/emitter/es5/asyncGenerators/O6.ts === const o6 = { ->o6 : { f(): AsyncIterableIterator; } ->{ async * f() { const x = await 1; }} : { f(): AsyncIterableIterator; } +>o6 : { f(): AsyncGenerator; } +>{ async * f() { const x = await 1; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = await 1; >x : 1 @@ -83,11 +83,11 @@ const o6 = { } === tests/cases/conformance/emitter/es5/asyncGenerators/O7.ts === const o7 = { ->o7 : { f(): AsyncIterableIterator; } ->{ async * f() { return 1; }} : { f(): AsyncIterableIterator; } +>o7 : { f(): AsyncGenerator; } +>{ async * f() { return 1; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator return 1; >1 : 1 diff --git a/tests/baselines/reference/emitter.forAwait.es2015.types b/tests/baselines/reference/emitter.forAwait.es2015.types index e7d1c77f346..3c345386c37 100644 --- a/tests/baselines/reference/emitter.forAwait.es2015.types +++ b/tests/baselines/reference/emitter.forAwait.es2015.types @@ -25,7 +25,7 @@ async function f2() { } === tests/cases/conformance/emitter/es2015/forAwait/file3.ts === async function* f3() { ->f3 : () => AsyncIterableIterator +>f3 : () => AsyncGenerator let y: any; >y : any @@ -37,7 +37,7 @@ async function* f3() { } === tests/cases/conformance/emitter/es2015/forAwait/file4.ts === async function* f4() { ->f4 : () => AsyncIterableIterator +>f4 : () => AsyncGenerator let x: any, y: any; >x : any @@ -68,7 +68,7 @@ async function f5() { === tests/cases/conformance/emitter/es2015/forAwait/file6.ts === // https://github.com/Microsoft/TypeScript/issues/21363 async function* f6() { ->f6 : () => AsyncIterableIterator +>f6 : () => AsyncGenerator let y: any; >y : any diff --git a/tests/baselines/reference/emitter.forAwait.es2017.types b/tests/baselines/reference/emitter.forAwait.es2017.types index f1dffdd280a..19642ddd677 100644 --- a/tests/baselines/reference/emitter.forAwait.es2017.types +++ b/tests/baselines/reference/emitter.forAwait.es2017.types @@ -25,7 +25,7 @@ async function f2() { } === tests/cases/conformance/emitter/es2017/forAwait/file3.ts === async function* f3() { ->f3 : () => AsyncIterableIterator +>f3 : () => AsyncGenerator let y: any; >y : any @@ -37,7 +37,7 @@ async function* f3() { } === tests/cases/conformance/emitter/es2017/forAwait/file4.ts === async function* f4() { ->f4 : () => AsyncIterableIterator +>f4 : () => AsyncGenerator let x: any, y: any; >x : any @@ -68,7 +68,7 @@ async function f5() { === tests/cases/conformance/emitter/es2017/forAwait/file6.ts === // https://github.com/Microsoft/TypeScript/issues/21363 async function* f6() { ->f6 : () => AsyncIterableIterator +>f6 : () => AsyncGenerator let y: any; >y : any diff --git a/tests/baselines/reference/emitter.forAwait.es2018.types b/tests/baselines/reference/emitter.forAwait.es2018.types index c9954de364d..a9b3a94dead 100644 --- a/tests/baselines/reference/emitter.forAwait.es2018.types +++ b/tests/baselines/reference/emitter.forAwait.es2018.types @@ -25,7 +25,7 @@ async function f2() { } === tests/cases/conformance/emitter/es2018/forAwait/file3.ts === async function* f3() { ->f3 : () => AsyncIterableIterator +>f3 : () => AsyncGenerator let y: any; >y : any @@ -37,7 +37,7 @@ async function* f3() { } === tests/cases/conformance/emitter/es2018/forAwait/file4.ts === async function* f4() { ->f4 : () => AsyncIterableIterator +>f4 : () => AsyncGenerator let x: any, y: any; >x : any @@ -68,7 +68,7 @@ async function f5() { === tests/cases/conformance/emitter/es2018/forAwait/file6.ts === // https://github.com/Microsoft/TypeScript/issues/21363 async function* f6() { ->f6 : () => AsyncIterableIterator +>f6 : () => AsyncGenerator let y: any; >y : any diff --git a/tests/baselines/reference/emitter.forAwait.es5.types b/tests/baselines/reference/emitter.forAwait.es5.types index fe0a49a9016..1452be304b6 100644 --- a/tests/baselines/reference/emitter.forAwait.es5.types +++ b/tests/baselines/reference/emitter.forAwait.es5.types @@ -25,7 +25,7 @@ async function f2() { } === tests/cases/conformance/emitter/es5/forAwait/file3.ts === async function* f3() { ->f3 : () => AsyncIterableIterator +>f3 : () => AsyncGenerator let y: any; >y : any @@ -37,7 +37,7 @@ async function* f3() { } === tests/cases/conformance/emitter/es5/forAwait/file4.ts === async function* f4() { ->f4 : () => AsyncIterableIterator +>f4 : () => AsyncGenerator let x: any, y: any; >x : any @@ -68,7 +68,7 @@ async function f5() { === tests/cases/conformance/emitter/es5/forAwait/file6.ts === // https://github.com/Microsoft/TypeScript/issues/21363 async function* f6() { ->f6 : () => AsyncIterableIterator +>f6 : () => AsyncGenerator let y: any; >y : any diff --git a/tests/baselines/reference/expressionsForbiddenInParameterInitializers.types b/tests/baselines/reference/expressionsForbiddenInParameterInitializers.types index 6142c1066fa..f70d546fce2 100644 --- a/tests/baselines/reference/expressionsForbiddenInParameterInitializers.types +++ b/tests/baselines/reference/expressionsForbiddenInParameterInitializers.types @@ -8,7 +8,7 @@ export async function foo({ foo = await import("./bar") }) { } export function* foo2({ foo = yield "a" }) { ->foo2 : ({ foo }: { foo?: any; }) => IterableIterator +>foo2 : ({ foo }: { foo?: any; }) => Generator >foo : any >yield "a" : any >"a" : "a" diff --git a/tests/baselines/reference/for-of29.errors.txt b/tests/baselines/reference/for-of29.errors.txt index 748fcf49050..0f1bead3f13 100644 --- a/tests/baselines/reference/for-of29.errors.txt +++ b/tests/baselines/reference/for-of29.errors.txt @@ -1,5 +1,4 @@ -tests/cases/conformance/es6/for-ofStatements/for-of29.ts(5,15): error TS2322: Type '{ [Symbol.iterator]?(): Iterator; }' is not assignable to type 'Iterable'. - Property '[Symbol.iterator]' is optional in type '{ [Symbol.iterator]?(): Iterator; }' but required in type 'Iterable'. +tests/cases/conformance/es6/for-ofStatements/for-of29.ts(5,15): error TS2488: Type '{ [Symbol.iterator]?(): Iterator; }' must have a '[Symbol.iterator]()' method that returns an iterator. ==== tests/cases/conformance/es6/for-ofStatements/for-of29.ts (1 errors) ==== @@ -9,6 +8,5 @@ tests/cases/conformance/es6/for-ofStatements/for-of29.ts(5,15): error TS2322: Ty for (var v of iterableWithOptionalIterator) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ [Symbol.iterator]?(): Iterator; }' is not assignable to type 'Iterable'. -!!! error TS2322: Property '[Symbol.iterator]' is optional in type '{ [Symbol.iterator]?(): Iterator; }' but required in type 'Iterable'. +!!! error TS2488: Type '{ [Symbol.iterator]?(): Iterator; }' must have a '[Symbol.iterator]()' method that returns an iterator. \ No newline at end of file diff --git a/tests/baselines/reference/for-of29.types b/tests/baselines/reference/for-of29.types index 51c82012893..2f246b56860 100644 --- a/tests/baselines/reference/for-of29.types +++ b/tests/baselines/reference/for-of29.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/for-ofStatements/for-of29.ts === var iterableWithOptionalIterator: { ->iterableWithOptionalIterator : { [Symbol.iterator]?(): Iterator; } +>iterableWithOptionalIterator : { [Symbol.iterator]?(): Iterator; } [Symbol.iterator]?(): Iterator ->[Symbol.iterator] : () => Iterator +>[Symbol.iterator] : () => Iterator >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -11,6 +11,6 @@ var iterableWithOptionalIterator: { }; for (var v of iterableWithOptionalIterator) { } ->v : string ->iterableWithOptionalIterator : { [Symbol.iterator]?(): Iterator; } +>v : any +>iterableWithOptionalIterator : { [Symbol.iterator]?(): Iterator; } diff --git a/tests/baselines/reference/for-of30.errors.txt b/tests/baselines/reference/for-of30.errors.txt index b0091c90b57..5d9f5d4d1b6 100644 --- a/tests/baselines/reference/for-of30.errors.txt +++ b/tests/baselines/reference/for-of30.errors.txt @@ -1,9 +1,4 @@ -tests/cases/conformance/es6/for-ofStatements/for-of30.ts(16,15): error TS2322: Type 'StringIterator' is not assignable to type 'Iterable'. - Types of property '[Symbol.iterator]' are incompatible. - Type '() => StringIterator' is not assignable to type '() => Iterator'. - Type 'StringIterator' is not assignable to type 'Iterator'. - Types of property 'return' are incompatible. - Type 'number' is not assignable to type '(value?: any) => IteratorResult'. +tests/cases/conformance/es6/for-ofStatements/for-of30.ts(16,15): error TS2767: The 'return' property of an iterator must be a method. ==== tests/cases/conformance/es6/for-ofStatements/for-of30.ts (1 errors) ==== @@ -14,9 +9,9 @@ tests/cases/conformance/es6/for-ofStatements/for-of30.ts(16,15): error TS2322: T value: "" } } - + return = 0; - + [Symbol.iterator]() { return this; } @@ -24,9 +19,4 @@ tests/cases/conformance/es6/for-ofStatements/for-of30.ts(16,15): error TS2322: T for (var v of new StringIterator) { } ~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterable'. -!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible. -!!! error TS2322: Type '() => StringIterator' is not assignable to type '() => Iterator'. -!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator'. -!!! error TS2322: Types of property 'return' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type '(value?: any) => IteratorResult'. \ No newline at end of file +!!! error TS2767: The 'return' property of an iterator must be a method. \ No newline at end of file diff --git a/tests/baselines/reference/for-of30.js b/tests/baselines/reference/for-of30.js index 935944db640..49d3fa8f46c 100644 --- a/tests/baselines/reference/for-of30.js +++ b/tests/baselines/reference/for-of30.js @@ -6,9 +6,9 @@ class StringIterator { value: "" } } - + return = 0; - + [Symbol.iterator]() { return this; } diff --git a/tests/baselines/reference/for-of30.symbols b/tests/baselines/reference/for-of30.symbols index 779d8aa2b21..f6fd0224ad7 100644 --- a/tests/baselines/reference/for-of30.symbols +++ b/tests/baselines/reference/for-of30.symbols @@ -13,10 +13,10 @@ class StringIterator { >value : Symbol(value, Decl(for-of30.ts, 3, 24)) } } - + return = 0; >return : Symbol(StringIterator.return, Decl(for-of30.ts, 6, 5)) - + [Symbol.iterator]() { >[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of30.ts, 8, 15)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of30.types b/tests/baselines/reference/for-of30.types index bd369223d7f..d415360dc6f 100644 --- a/tests/baselines/reference/for-of30.types +++ b/tests/baselines/reference/for-of30.types @@ -17,11 +17,11 @@ class StringIterator { >"" : "" } } - + return = 0; >return : number >0 : 0 - + [Symbol.iterator]() { >[Symbol.iterator] : () => this >Symbol.iterator : symbol diff --git a/tests/baselines/reference/for-of31.errors.txt b/tests/baselines/reference/for-of31.errors.txt deleted file mode 100644 index 2b1a7052918..00000000000 --- a/tests/baselines/reference/for-of31.errors.txt +++ /dev/null @@ -1,33 +0,0 @@ -tests/cases/conformance/es6/for-ofStatements/for-of31.ts(14,15): error TS2322: Type 'StringIterator' is not assignable to type 'Iterable'. - Types of property '[Symbol.iterator]' are incompatible. - Type '() => StringIterator' is not assignable to type '() => Iterator'. - Type 'StringIterator' is not assignable to type 'Iterator'. - Types of property 'next' are incompatible. - Type '() => { value: string; }' is not assignable to type '(value?: any) => IteratorResult'. - Property 'done' is missing in type '{ value: string; }' but required in type 'IteratorResult'. - - -==== tests/cases/conformance/es6/for-ofStatements/for-of31.ts (1 errors) ==== - class StringIterator { - next() { - return { - // no done property - value: "" - } - } - - [Symbol.iterator]() { - return this; - } - } - - for (var v of new StringIterator) { } - ~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterable'. -!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible. -!!! error TS2322: Type '() => StringIterator' is not assignable to type '() => Iterator'. -!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator'. -!!! error TS2322: Types of property 'next' are incompatible. -!!! error TS2322: Type '() => { value: string; }' is not assignable to type '(value?: any) => IteratorResult'. -!!! error TS2322: Property 'done' is missing in type '{ value: string; }' but required in type 'IteratorResult'. -!!! related TS2728 /.ts/lib.es2015.iterable.d.ts:32:5: 'done' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/for-of31.js b/tests/baselines/reference/for-of31.js index 84e24bed5a9..10bc33416c9 100644 --- a/tests/baselines/reference/for-of31.js +++ b/tests/baselines/reference/for-of31.js @@ -6,7 +6,7 @@ class StringIterator { value: "" } } - + [Symbol.iterator]() { return this; } diff --git a/tests/baselines/reference/for-of31.symbols b/tests/baselines/reference/for-of31.symbols index 41b7d0a85d6..37b4f27aaa8 100644 --- a/tests/baselines/reference/for-of31.symbols +++ b/tests/baselines/reference/for-of31.symbols @@ -11,7 +11,7 @@ class StringIterator { >value : Symbol(value, Decl(for-of31.ts, 2, 16)) } } - + [Symbol.iterator]() { >[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of31.ts, 6, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of31.types b/tests/baselines/reference/for-of31.types index 843ce928c44..330c39578f3 100644 --- a/tests/baselines/reference/for-of31.types +++ b/tests/baselines/reference/for-of31.types @@ -14,7 +14,7 @@ class StringIterator { >"" : "" } } - + [Symbol.iterator]() { >[Symbol.iterator] : () => this >Symbol.iterator : symbol diff --git a/tests/baselines/reference/for-of34.errors.txt b/tests/baselines/reference/for-of34.errors.txt index 2d53ecb0a20..ecab8c91e1f 100644 --- a/tests/baselines/reference/for-of34.errors.txt +++ b/tests/baselines/reference/for-of34.errors.txt @@ -9,7 +9,7 @@ tests/cases/conformance/es6/for-ofStatements/for-of34.ts(11,10): error TS7022: ' !!! error TS7023: 'next' 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. return v; } - + [Symbol.iterator]() { return this; } diff --git a/tests/baselines/reference/for-of34.js b/tests/baselines/reference/for-of34.js index 2d9af61d1a3..3cfb390890d 100644 --- a/tests/baselines/reference/for-of34.js +++ b/tests/baselines/reference/for-of34.js @@ -3,7 +3,7 @@ class StringIterator { next() { return v; } - + [Symbol.iterator]() { return this; } diff --git a/tests/baselines/reference/for-of34.symbols b/tests/baselines/reference/for-of34.symbols index 0b1e1252753..3ebe5624f9e 100644 --- a/tests/baselines/reference/for-of34.symbols +++ b/tests/baselines/reference/for-of34.symbols @@ -8,7 +8,7 @@ class StringIterator { return v; >v : Symbol(v, Decl(for-of34.ts, 10, 8)) } - + [Symbol.iterator]() { >[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of34.ts, 3, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of34.types b/tests/baselines/reference/for-of34.types index 5a4287e7843..3cb11706a13 100644 --- a/tests/baselines/reference/for-of34.types +++ b/tests/baselines/reference/for-of34.types @@ -8,7 +8,7 @@ class StringIterator { return v; >v : any } - + [Symbol.iterator]() { >[Symbol.iterator] : () => this >Symbol.iterator : symbol diff --git a/tests/baselines/reference/for-of35.errors.txt b/tests/baselines/reference/for-of35.errors.txt index 6f14a24fb96..fe4cc69cdaf 100644 --- a/tests/baselines/reference/for-of35.errors.txt +++ b/tests/baselines/reference/for-of35.errors.txt @@ -12,7 +12,7 @@ tests/cases/conformance/es6/for-ofStatements/for-of35.ts(14,10): error TS7022: ' value: v } } - + [Symbol.iterator]() { return this; } diff --git a/tests/baselines/reference/for-of35.js b/tests/baselines/reference/for-of35.js index a73f873d7ce..769138664da 100644 --- a/tests/baselines/reference/for-of35.js +++ b/tests/baselines/reference/for-of35.js @@ -6,7 +6,7 @@ class StringIterator { value: v } } - + [Symbol.iterator]() { return this; } diff --git a/tests/baselines/reference/for-of35.symbols b/tests/baselines/reference/for-of35.symbols index 4f21e538cad..d2c9de2bd17 100644 --- a/tests/baselines/reference/for-of35.symbols +++ b/tests/baselines/reference/for-of35.symbols @@ -14,7 +14,7 @@ class StringIterator { >v : Symbol(v, Decl(for-of35.ts, 13, 8)) } } - + [Symbol.iterator]() { >[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of35.ts, 6, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of35.types b/tests/baselines/reference/for-of35.types index 0c80a6633b2..66d1106073e 100644 --- a/tests/baselines/reference/for-of35.types +++ b/tests/baselines/reference/for-of35.types @@ -17,7 +17,7 @@ class StringIterator { >v : any } } - + [Symbol.iterator]() { >[Symbol.iterator] : () => this >Symbol.iterator : symbol diff --git a/tests/baselines/reference/generatorAssignability.errors.txt b/tests/baselines/reference/generatorAssignability.errors.txt new file mode 100644 index 00000000000..83e53f4a3fb --- /dev/null +++ b/tests/baselines/reference/generatorAssignability.errors.txt @@ -0,0 +1,106 @@ +tests/cases/conformance/generators/generatorAssignability.ts(10,5): error TS2764: Cannot iterate value because the 'next' method of its iterator expects type 'string', but array spread will always send 'undefined'. +tests/cases/conformance/generators/generatorAssignability.ts(14,5): error TS2765: Cannot iterate value because the 'next' method of its iterator expects type 'string', but array destructuring will always send 'undefined'. +tests/cases/conformance/generators/generatorAssignability.ts(18,5): error TS2765: Cannot iterate value because the 'next' method of its iterator expects type 'string', but array destructuring will always send 'undefined'. +tests/cases/conformance/generators/generatorAssignability.ts(22,1): error TS2765: Cannot iterate value because the 'next' method of its iterator expects type 'string', but array destructuring will always send 'undefined'. +tests/cases/conformance/generators/generatorAssignability.ts(26,1): error TS2765: Cannot iterate value because the 'next' method of its iterator expects type 'string', but array destructuring will always send 'undefined'. +tests/cases/conformance/generators/generatorAssignability.ts(30,11): error TS2763: Cannot iterate value because the 'next' method of its iterator expects type 'string', but for-of will always send 'undefined'. +tests/cases/conformance/generators/generatorAssignability.ts(35,21): error TS2763: Cannot iterate value because the 'next' method of its iterator expects type 'string', but for-of will always send 'undefined'. +tests/cases/conformance/generators/generatorAssignability.ts(39,21): error TS2763: Cannot iterate value because the 'next' method of its iterator expects type 'string', but for-of will always send 'undefined'. +tests/cases/conformance/generators/generatorAssignability.ts(45,12): error TS2766: Cannot delegate iteration to value because the 'next' method of its iterator expects type 'string', but the containing generator will always send 'boolean'. +tests/cases/conformance/generators/generatorAssignability.ts(51,12): error TS2766: Cannot delegate iteration to value because the 'next' method of its iterator expects type 'string', but the containing generator will always send 'boolean'. +tests/cases/conformance/generators/generatorAssignability.ts(55,12): error TS2766: Cannot delegate iteration to value because the 'next' method of its iterator expects type 'string', but the containing generator will always send 'boolean'. + + +==== tests/cases/conformance/generators/generatorAssignability.ts (11 errors) ==== + declare let _: any; + declare const g1: Generator; + declare const g2: Generator; + declare const g3: Generator; + declare const g4: AsyncGenerator; + declare const g5: AsyncGenerator; + declare const g6: AsyncGenerator; + + // spread iterable + [...g1]; // error + ~~ +!!! error TS2764: Cannot iterate value because the 'next' method of its iterator expects type 'string', but array spread will always send 'undefined'. + [...g2]; // ok + + // binding pattern over iterable + let [x1] = g1; // error + ~~~~ +!!! error TS2765: Cannot iterate value because the 'next' method of its iterator expects type 'string', but array destructuring will always send 'undefined'. + let [x2] = g2; // ok + + // binding rest pattern over iterable + let [...y1] = g1; // error + ~~~~~~~ +!!! error TS2765: Cannot iterate value because the 'next' method of its iterator expects type 'string', but array destructuring will always send 'undefined'. + let [...y2] = g2; // ok + + // assignment pattern over iterable + [_] = g1; // error + ~~~ +!!! error TS2765: Cannot iterate value because the 'next' method of its iterator expects type 'string', but array destructuring will always send 'undefined'. + [_] = g2; // ok + + // assignment rest pattern over iterable + [..._] = g1; // error + ~~~~~~ +!!! error TS2765: Cannot iterate value because the 'next' method of its iterator expects type 'string', but array destructuring will always send 'undefined'. + [..._] = g2; // ok + + // for-of over iterable + for (_ of g1); // error + ~~ +!!! error TS2763: Cannot iterate value because the 'next' method of its iterator expects type 'string', but for-of will always send 'undefined'. + for (_ of g2); // ok + + async function asyncfn() { + // for-await-of over iterable + for await (_ of g1); // error + ~~ +!!! error TS2763: Cannot iterate value because the 'next' method of its iterator expects type 'string', but for-of will always send 'undefined'. + for await (_ of g2); // ok + + // for-await-of over asynciterable + for await (_ of g4); // error + ~~ +!!! error TS2763: Cannot iterate value because the 'next' method of its iterator expects type 'string', but for-of will always send 'undefined'. + for await (_ of g5); // ok + } + + function* f1(): Generator { + // yield* over iterable + yield* g1; // error + ~~ +!!! error TS2766: Cannot delegate iteration to value because the 'next' method of its iterator expects type 'string', but the containing generator will always send 'boolean'. + yield* g3; // ok + } + + async function* f2(): AsyncGenerator { + // yield* over iterable + yield* g1; // error + ~~ +!!! error TS2766: Cannot delegate iteration to value because the 'next' method of its iterator expects type 'string', but the containing generator will always send 'boolean'. + yield* g3; // ok + + // yield* over asynciterable + yield* g4; // error + ~~ +!!! error TS2766: Cannot delegate iteration to value because the 'next' method of its iterator expects type 'string', but the containing generator will always send 'boolean'. + yield* g6; // ok + } + + async function f3() { + const syncGenerator = function*() { + yield 1; + yield 2; + }; + + const o = {[Symbol.asyncIterator]: syncGenerator}; + + for await (const x of o) { + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/generatorAssignability.symbols b/tests/baselines/reference/generatorAssignability.symbols new file mode 100644 index 00000000000..8773011c677 --- /dev/null +++ b/tests/baselines/reference/generatorAssignability.symbols @@ -0,0 +1,157 @@ +=== tests/cases/conformance/generators/generatorAssignability.ts === +declare let _: any; +>_ : Symbol(_, Decl(generatorAssignability.ts, 0, 11)) + +declare const g1: Generator; +>g1 : Symbol(g1, Decl(generatorAssignability.ts, 1, 13)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) + +declare const g2: Generator; +>g2 : Symbol(g2, Decl(generatorAssignability.ts, 2, 13)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) + +declare const g3: Generator; +>g3 : Symbol(g3, Decl(generatorAssignability.ts, 3, 13)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) + +declare const g4: AsyncGenerator; +>g4 : Symbol(g4, Decl(generatorAssignability.ts, 4, 13)) +>AsyncGenerator : Symbol(AsyncGenerator, Decl(lib.es2018.asyncgenerator.d.ts, --, --)) + +declare const g5: AsyncGenerator; +>g5 : Symbol(g5, Decl(generatorAssignability.ts, 5, 13)) +>AsyncGenerator : Symbol(AsyncGenerator, Decl(lib.es2018.asyncgenerator.d.ts, --, --)) + +declare const g6: AsyncGenerator; +>g6 : Symbol(g6, Decl(generatorAssignability.ts, 6, 13)) +>AsyncGenerator : Symbol(AsyncGenerator, Decl(lib.es2018.asyncgenerator.d.ts, --, --)) + +// spread iterable +[...g1]; // error +>g1 : Symbol(g1, Decl(generatorAssignability.ts, 1, 13)) + +[...g2]; // ok +>g2 : Symbol(g2, Decl(generatorAssignability.ts, 2, 13)) + +// binding pattern over iterable +let [x1] = g1; // error +>x1 : Symbol(x1, Decl(generatorAssignability.ts, 13, 5)) +>g1 : Symbol(g1, Decl(generatorAssignability.ts, 1, 13)) + +let [x2] = g2; // ok +>x2 : Symbol(x2, Decl(generatorAssignability.ts, 14, 5)) +>g2 : Symbol(g2, Decl(generatorAssignability.ts, 2, 13)) + +// binding rest pattern over iterable +let [...y1] = g1; // error +>y1 : Symbol(y1, Decl(generatorAssignability.ts, 17, 5)) +>g1 : Symbol(g1, Decl(generatorAssignability.ts, 1, 13)) + +let [...y2] = g2; // ok +>y2 : Symbol(y2, Decl(generatorAssignability.ts, 18, 5)) +>g2 : Symbol(g2, Decl(generatorAssignability.ts, 2, 13)) + +// assignment pattern over iterable +[_] = g1; // error +>_ : Symbol(_, Decl(generatorAssignability.ts, 0, 11)) +>g1 : Symbol(g1, Decl(generatorAssignability.ts, 1, 13)) + +[_] = g2; // ok +>_ : Symbol(_, Decl(generatorAssignability.ts, 0, 11)) +>g2 : Symbol(g2, Decl(generatorAssignability.ts, 2, 13)) + +// assignment rest pattern over iterable +[..._] = g1; // error +>_ : Symbol(_, Decl(generatorAssignability.ts, 0, 11)) +>g1 : Symbol(g1, Decl(generatorAssignability.ts, 1, 13)) + +[..._] = g2; // ok +>_ : Symbol(_, Decl(generatorAssignability.ts, 0, 11)) +>g2 : Symbol(g2, Decl(generatorAssignability.ts, 2, 13)) + +// for-of over iterable +for (_ of g1); // error +>_ : Symbol(_, Decl(generatorAssignability.ts, 0, 11)) +>g1 : Symbol(g1, Decl(generatorAssignability.ts, 1, 13)) + +for (_ of g2); // ok +>_ : Symbol(_, Decl(generatorAssignability.ts, 0, 11)) +>g2 : Symbol(g2, Decl(generatorAssignability.ts, 2, 13)) + +async function asyncfn() { +>asyncfn : Symbol(asyncfn, Decl(generatorAssignability.ts, 30, 14)) + + // for-await-of over iterable + for await (_ of g1); // error +>_ : Symbol(_, Decl(generatorAssignability.ts, 0, 11)) +>g1 : Symbol(g1, Decl(generatorAssignability.ts, 1, 13)) + + for await (_ of g2); // ok +>_ : Symbol(_, Decl(generatorAssignability.ts, 0, 11)) +>g2 : Symbol(g2, Decl(generatorAssignability.ts, 2, 13)) + + // for-await-of over asynciterable + for await (_ of g4); // error +>_ : Symbol(_, Decl(generatorAssignability.ts, 0, 11)) +>g4 : Symbol(g4, Decl(generatorAssignability.ts, 4, 13)) + + for await (_ of g5); // ok +>_ : Symbol(_, Decl(generatorAssignability.ts, 0, 11)) +>g5 : Symbol(g5, Decl(generatorAssignability.ts, 5, 13)) +} + +function* f1(): Generator { +>f1 : Symbol(f1, Decl(generatorAssignability.ts, 40, 1)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) + + // yield* over iterable + yield* g1; // error +>g1 : Symbol(g1, Decl(generatorAssignability.ts, 1, 13)) + + yield* g3; // ok +>g3 : Symbol(g3, Decl(generatorAssignability.ts, 3, 13)) +} + +async function* f2(): AsyncGenerator { +>f2 : Symbol(f2, Decl(generatorAssignability.ts, 46, 1)) +>AsyncGenerator : Symbol(AsyncGenerator, Decl(lib.es2018.asyncgenerator.d.ts, --, --)) + + // yield* over iterable + yield* g1; // error +>g1 : Symbol(g1, Decl(generatorAssignability.ts, 1, 13)) + + yield* g3; // ok +>g3 : Symbol(g3, Decl(generatorAssignability.ts, 3, 13)) + + // yield* over asynciterable + yield* g4; // error +>g4 : Symbol(g4, Decl(generatorAssignability.ts, 4, 13)) + + yield* g6; // ok +>g6 : Symbol(g6, Decl(generatorAssignability.ts, 6, 13)) +} + +async function f3() { +>f3 : Symbol(f3, Decl(generatorAssignability.ts, 56, 1)) + + const syncGenerator = function*() { +>syncGenerator : Symbol(syncGenerator, Decl(generatorAssignability.ts, 59, 9)) + + yield 1; + yield 2; + }; + + const o = {[Symbol.asyncIterator]: syncGenerator}; +>o : Symbol(o, Decl(generatorAssignability.ts, 64, 9)) +>[Symbol.asyncIterator] : Symbol([Symbol.asyncIterator], Decl(generatorAssignability.ts, 64, 15)) +>Symbol.asyncIterator : Symbol(SymbolConstructor.asyncIterator, Decl(lib.es2018.asynciterable.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) +>asyncIterator : Symbol(SymbolConstructor.asyncIterator, Decl(lib.es2018.asynciterable.d.ts, --, --)) +>syncGenerator : Symbol(syncGenerator, Decl(generatorAssignability.ts, 59, 9)) + + for await (const x of o) { +>x : Symbol(x, Decl(generatorAssignability.ts, 66, 20)) +>o : Symbol(o, Decl(generatorAssignability.ts, 64, 9)) + } +} + diff --git a/tests/baselines/reference/generatorAssignability.types b/tests/baselines/reference/generatorAssignability.types new file mode 100644 index 00000000000..c498104aeba --- /dev/null +++ b/tests/baselines/reference/generatorAssignability.types @@ -0,0 +1,177 @@ +=== tests/cases/conformance/generators/generatorAssignability.ts === +declare let _: any; +>_ : any + +declare const g1: Generator; +>g1 : Generator + +declare const g2: Generator; +>g2 : Generator + +declare const g3: Generator; +>g3 : Generator + +declare const g4: AsyncGenerator; +>g4 : AsyncGenerator + +declare const g5: AsyncGenerator; +>g5 : AsyncGenerator + +declare const g6: AsyncGenerator; +>g6 : AsyncGenerator + +// spread iterable +[...g1]; // error +>[...g1] : number[] +>...g1 : number +>g1 : Generator + +[...g2]; // ok +>[...g2] : number[] +>...g2 : number +>g2 : Generator + +// binding pattern over iterable +let [x1] = g1; // error +>x1 : number +>g1 : Generator + +let [x2] = g2; // ok +>x2 : number +>g2 : Generator + +// binding rest pattern over iterable +let [...y1] = g1; // error +>y1 : number[] +>g1 : Generator + +let [...y2] = g2; // ok +>y2 : number[] +>g2 : Generator + +// assignment pattern over iterable +[_] = g1; // error +>[_] = g1 : Generator +>[_] : [any] +>_ : any +>g1 : Generator + +[_] = g2; // ok +>[_] = g2 : Generator +>[_] : [any] +>_ : any +>g2 : Generator + +// assignment rest pattern over iterable +[..._] = g1; // error +>[..._] = g1 : Generator +>[..._] : any[] +>..._ : any +>_ : any +>g1 : Generator + +[..._] = g2; // ok +>[..._] = g2 : Generator +>[..._] : any[] +>..._ : any +>_ : any +>g2 : Generator + +// for-of over iterable +for (_ of g1); // error +>_ : any +>g1 : Generator + +for (_ of g2); // ok +>_ : any +>g2 : Generator + +async function asyncfn() { +>asyncfn : () => Promise + + // for-await-of over iterable + for await (_ of g1); // error +>_ : any +>g1 : Generator + + for await (_ of g2); // ok +>_ : any +>g2 : Generator + + // for-await-of over asynciterable + for await (_ of g4); // error +>_ : any +>g4 : AsyncGenerator + + for await (_ of g5); // ok +>_ : any +>g5 : AsyncGenerator +} + +function* f1(): Generator { +>f1 : () => Generator + + // yield* over iterable + yield* g1; // error +>yield* g1 : void +>g1 : Generator + + yield* g3; // ok +>yield* g3 : void +>g3 : Generator +} + +async function* f2(): AsyncGenerator { +>f2 : () => AsyncGenerator + + // yield* over iterable + yield* g1; // error +>yield* g1 : void +>g1 : Generator + + yield* g3; // ok +>yield* g3 : void +>g3 : Generator + + // yield* over asynciterable + yield* g4; // error +>yield* g4 : void +>g4 : AsyncGenerator + + yield* g6; // ok +>yield* g6 : void +>g6 : AsyncGenerator +} + +async function f3() { +>f3 : () => Promise + + const syncGenerator = function*() { +>syncGenerator : () => Generator<1 | 2, void, unknown> +>function*() { yield 1; yield 2; } : () => Generator<1 | 2, void, unknown> + + yield 1; +>yield 1 : any +>1 : 1 + + yield 2; +>yield 2 : any +>2 : 2 + + }; + + const o = {[Symbol.asyncIterator]: syncGenerator}; +>o : { [Symbol.asyncIterator]: () => Generator<1 | 2, void, unknown>; } +>{[Symbol.asyncIterator]: syncGenerator} : { [Symbol.asyncIterator]: () => Generator<1 | 2, void, unknown>; } +>[Symbol.asyncIterator] : () => Generator<1 | 2, void, unknown> +>Symbol.asyncIterator : symbol +>Symbol : SymbolConstructor +>asyncIterator : symbol +>syncGenerator : () => Generator<1 | 2, void, unknown> + + for await (const x of o) { +>x : 1 | 2 +>o : { [Symbol.asyncIterator]: () => Generator<1 | 2, void, unknown>; } + } +} + diff --git a/tests/baselines/reference/generatorES6InAMDModule.types b/tests/baselines/reference/generatorES6InAMDModule.types index 9a12a72f005..a1b06edc346 100644 --- a/tests/baselines/reference/generatorES6InAMDModule.types +++ b/tests/baselines/reference/generatorES6InAMDModule.types @@ -1,6 +1,6 @@ === tests/cases/compiler/generatorES6InAMDModule.ts === export function* foo() { ->foo : () => IterableIterator +>foo : () => Generator yield >yield : any diff --git a/tests/baselines/reference/generatorES6_1.types b/tests/baselines/reference/generatorES6_1.types index 13ac7c05844..e1046c8548e 100644 --- a/tests/baselines/reference/generatorES6_1.types +++ b/tests/baselines/reference/generatorES6_1.types @@ -1,6 +1,6 @@ === tests/cases/compiler/generatorES6_1.ts === function* foo() { ->foo : () => IterableIterator +>foo : () => Generator yield >yield : any diff --git a/tests/baselines/reference/generatorES6_2.types b/tests/baselines/reference/generatorES6_2.types index a95a0008d4f..61fc7db71a7 100644 --- a/tests/baselines/reference/generatorES6_2.types +++ b/tests/baselines/reference/generatorES6_2.types @@ -3,7 +3,7 @@ class C { >C : C public * foo() { ->foo : () => IterableIterator +>foo : () => Generator yield 1 >yield 1 : any diff --git a/tests/baselines/reference/generatorES6_3.types b/tests/baselines/reference/generatorES6_3.types index e237cbd3510..2b72e711322 100644 --- a/tests/baselines/reference/generatorES6_3.types +++ b/tests/baselines/reference/generatorES6_3.types @@ -1,7 +1,7 @@ === tests/cases/compiler/generatorES6_3.ts === var v = function*() { ->v : () => IterableIterator ->function*() { yield 0} : () => IterableIterator +>v : () => Generator +>function*() { yield 0} : () => Generator yield 0 >yield 0 : any diff --git a/tests/baselines/reference/generatorES6_4.types b/tests/baselines/reference/generatorES6_4.types index fa19d8f3ae2..31945d0d3e6 100644 --- a/tests/baselines/reference/generatorES6_4.types +++ b/tests/baselines/reference/generatorES6_4.types @@ -1,10 +1,10 @@ === tests/cases/compiler/generatorES6_4.ts === var v = { ->v : { foo(): IterableIterator; } ->{ *foo() { yield 0 }} : { foo(): IterableIterator; } +>v : { foo(): Generator; } +>{ *foo() { yield 0 }} : { foo(): Generator; } *foo() { ->foo : () => IterableIterator +>foo : () => Generator yield 0 >yield 0 : any diff --git a/tests/baselines/reference/generatorES6_5.types b/tests/baselines/reference/generatorES6_5.types index 12396f69e24..6ff6105b498 100644 --- a/tests/baselines/reference/generatorES6_5.types +++ b/tests/baselines/reference/generatorES6_5.types @@ -1,6 +1,6 @@ === tests/cases/compiler/generatorES6_5.ts === function* foo() { ->foo : () => IterableIterator +>foo : () => Generator yield a ? b : c; >yield a ? b : c : any diff --git a/tests/baselines/reference/generatorES6_6.types b/tests/baselines/reference/generatorES6_6.types index 7306b6ed99a..05e0bcc7f88 100644 --- a/tests/baselines/reference/generatorES6_6.types +++ b/tests/baselines/reference/generatorES6_6.types @@ -3,7 +3,7 @@ class C { >C : C *[Symbol.iterator]() { ->[Symbol.iterator] : () => IterableIterator +>[Symbol.iterator] : () => Generator >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/generatorExplicitReturnType.errors.txt b/tests/baselines/reference/generatorExplicitReturnType.errors.txt new file mode 100644 index 00000000000..4841e62bba7 --- /dev/null +++ b/tests/baselines/reference/generatorExplicitReturnType.errors.txt @@ -0,0 +1,41 @@ +tests/cases/conformance/generators/generatorExplicitReturnType.ts(2,5): error TS2322: Type 'undefined' is not assignable to type 'number'. +tests/cases/conformance/generators/generatorExplicitReturnType.ts(3,11): error TS2322: Type '"a"' is not assignable to type 'number'. +tests/cases/conformance/generators/generatorExplicitReturnType.ts(4,11): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/generators/generatorExplicitReturnType.ts(5,5): error TS2322: Type '10' is not assignable to type 'boolean'. +tests/cases/conformance/generators/generatorExplicitReturnType.ts(16,11): error TS2322: Type 'symbol' is not assignable to type 'number'. + + +==== tests/cases/conformance/generators/generatorExplicitReturnType.ts (5 errors) ==== + function* g1(): Generator { + yield; // error + ~~~~~ +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. + yield "a"; // error + ~~~ +!!! error TS2322: Type '"a"' is not assignable to type 'number'. + const x: number = yield 1; // error + ~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + return 10; // error + ~~~~~~~~~~ +!!! error TS2322: Type '10' is not assignable to type 'boolean'. + } + + function* g2(): Generator { + const x = yield 1; + return true; + } + + declare const generator: Generator; + + function* g3(): Generator { + const x: number = yield* generator; // error + ~ +!!! error TS2322: Type 'symbol' is not assignable to type 'number'. + return true; + } + + function* g4(): Generator { + const x = yield* generator; + return true; + } \ No newline at end of file diff --git a/tests/baselines/reference/generatorExplicitReturnType.js b/tests/baselines/reference/generatorExplicitReturnType.js new file mode 100644 index 00000000000..1669a2905e5 --- /dev/null +++ b/tests/baselines/reference/generatorExplicitReturnType.js @@ -0,0 +1,44 @@ +//// [generatorExplicitReturnType.ts] +function* g1(): Generator { + yield; // error + yield "a"; // error + const x: number = yield 1; // error + return 10; // error +} + +function* g2(): Generator { + const x = yield 1; + return true; +} + +declare const generator: Generator; + +function* g3(): Generator { + const x: number = yield* generator; // error + return true; +} + +function* g4(): Generator { + const x = yield* generator; + return true; +} + +//// [generatorExplicitReturnType.js] +function* g1() { + yield; // error + yield "a"; // error + const x = yield 1; // error + return 10; // error +} +function* g2() { + const x = yield 1; + return true; +} +function* g3() { + const x = yield* generator; // error + return true; +} +function* g4() { + const x = yield* generator; + return true; +} diff --git a/tests/baselines/reference/generatorExplicitReturnType.symbols b/tests/baselines/reference/generatorExplicitReturnType.symbols new file mode 100644 index 00000000000..fb3676a8b78 --- /dev/null +++ b/tests/baselines/reference/generatorExplicitReturnType.symbols @@ -0,0 +1,48 @@ +=== tests/cases/conformance/generators/generatorExplicitReturnType.ts === +function* g1(): Generator { +>g1 : Symbol(g1, Decl(generatorExplicitReturnType.ts, 0, 0)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) + + yield; // error + yield "a"; // error + const x: number = yield 1; // error +>x : Symbol(x, Decl(generatorExplicitReturnType.ts, 3, 9)) + + return 10; // error +} + +function* g2(): Generator { +>g2 : Symbol(g2, Decl(generatorExplicitReturnType.ts, 5, 1)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) + + const x = yield 1; +>x : Symbol(x, Decl(generatorExplicitReturnType.ts, 8, 9)) + + return true; +} + +declare const generator: Generator; +>generator : Symbol(generator, Decl(generatorExplicitReturnType.ts, 12, 13)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) + +function* g3(): Generator { +>g3 : Symbol(g3, Decl(generatorExplicitReturnType.ts, 12, 59)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) + + const x: number = yield* generator; // error +>x : Symbol(x, Decl(generatorExplicitReturnType.ts, 15, 9)) +>generator : Symbol(generator, Decl(generatorExplicitReturnType.ts, 12, 13)) + + return true; +} + +function* g4(): Generator { +>g4 : Symbol(g4, Decl(generatorExplicitReturnType.ts, 17, 1)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) + + const x = yield* generator; +>x : Symbol(x, Decl(generatorExplicitReturnType.ts, 20, 9)) +>generator : Symbol(generator, Decl(generatorExplicitReturnType.ts, 12, 13)) + + return true; +} diff --git a/tests/baselines/reference/generatorExplicitReturnType.types b/tests/baselines/reference/generatorExplicitReturnType.types new file mode 100644 index 00000000000..6e05722d049 --- /dev/null +++ b/tests/baselines/reference/generatorExplicitReturnType.types @@ -0,0 +1,58 @@ +=== tests/cases/conformance/generators/generatorExplicitReturnType.ts === +function* g1(): Generator { +>g1 : () => Generator + + yield; // error +>yield : string + + yield "a"; // error +>yield "a" : string +>"a" : "a" + + const x: number = yield 1; // error +>x : number +>yield 1 : string +>1 : 1 + + return 10; // error +>10 : 10 +} + +function* g2(): Generator { +>g2 : () => Generator + + const x = yield 1; +>x : string +>yield 1 : string +>1 : 1 + + return true; +>true : true +} + +declare const generator: Generator; +>generator : Generator + +function* g3(): Generator { +>g3 : () => Generator + + const x: number = yield* generator; // error +>x : number +>yield* generator : symbol +>generator : Generator + + return true; +>true : true +} + +function* g4(): Generator { +>g4 : () => Generator + + const x = yield* generator; +>x : symbol +>yield* generator : symbol +>generator : Generator + + return true; +>true : true +} diff --git a/tests/baselines/reference/generatorImplicitAny.js b/tests/baselines/reference/generatorImplicitAny.js new file mode 100644 index 00000000000..ee12d8052b8 --- /dev/null +++ b/tests/baselines/reference/generatorImplicitAny.js @@ -0,0 +1,5 @@ +//// [generatorImplicitAny.ts] +function* g() {} + +//// [generatorImplicitAny.js] +function* g() { } diff --git a/tests/baselines/reference/generatorImplicitAny.symbols b/tests/baselines/reference/generatorImplicitAny.symbols new file mode 100644 index 00000000000..3c3929e9ab3 --- /dev/null +++ b/tests/baselines/reference/generatorImplicitAny.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/generators/generatorImplicitAny.ts === +function* g() {} +>g : Symbol(g, Decl(generatorImplicitAny.ts, 0, 0)) + diff --git a/tests/baselines/reference/generatorImplicitAny.types b/tests/baselines/reference/generatorImplicitAny.types new file mode 100644 index 00000000000..a63d19b7fbe --- /dev/null +++ b/tests/baselines/reference/generatorImplicitAny.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/generators/generatorImplicitAny.ts === +function* g() {} +>g : () => Generator + diff --git a/tests/baselines/reference/generatorNoImplicitReturns.types b/tests/baselines/reference/generatorNoImplicitReturns.types index 666ce4db474..f8a2a073487 100644 --- a/tests/baselines/reference/generatorNoImplicitReturns.types +++ b/tests/baselines/reference/generatorNoImplicitReturns.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/yieldExpressions/generatorNoImplicitReturns.ts === function* testGenerator () { ->testGenerator : () => IterableIterator +>testGenerator : () => Generator if (Math.random() > 0.5) { >Math.random() > 0.5 : boolean diff --git a/tests/baselines/reference/generatorReturnExpressionIsChecked.types b/tests/baselines/reference/generatorReturnExpressionIsChecked.types index f77ec0b3729..4abe3721a8e 100644 --- a/tests/baselines/reference/generatorReturnExpressionIsChecked.types +++ b/tests/baselines/reference/generatorReturnExpressionIsChecked.types @@ -1,6 +1,6 @@ === tests/cases/compiler/generatorReturnExpressionIsChecked.ts === function* f(): Iterator { ->f : () => Iterator +>f : () => Iterator return invalid; >invalid : any diff --git a/tests/baselines/reference/generatorReturnTypeInference.js b/tests/baselines/reference/generatorReturnTypeInference.js new file mode 100644 index 00000000000..d3350d52486 --- /dev/null +++ b/tests/baselines/reference/generatorReturnTypeInference.js @@ -0,0 +1,236 @@ +//// [generatorReturnTypeInference.ts] +declare const iterableIterator: IterableIterator; +declare const generator: Generator; +declare const never: never; + +function* g000() { // Generator +} + +// 'yield' iteration type inference +function* g001() { // Generator + yield; +} + +function* g002() { // Generator + yield 1; +} + +function* g003() { // Generator + yield* []; +} + +function* g004() { // Generator + yield* iterableIterator; +} + +function* g005() { // Generator + const x = yield* generator; +} + +function* g006() { // Generator<1 | 2, void, unknown> + yield 1; + yield 2; +} + +function* g007() { // Generator + yield never; +} + +// 'return' iteration type inference +function* g102() { // Generator + return 1; +} + +function* g103() { // Generator + if (Math.random()) return 1; + return 2; +} + +function* g104() { // Generator + return never; +} + +// 'next' iteration type inference +function* g201() { // Generator + let a: string = yield 1; +} + +function* g202() { // Generator<1 | 2, void, never> + let a: string = yield 1; + let b: number = yield 2; +} + +declare function f1(x: string): void; +declare function f1(x: number): void; + +function* g203() { // Generator + const x = f1(yield 1); +} + +declare function f2(x: T): T; + +function* g204() { // Generator + const x = f2(yield 1); +} + +// mixed iteration types inference + +function* g301() { // Generator + yield; + return; +} + +function* g302() { // Generator + yield 1; + return; +} + +function* g303() { // Generator + yield; + return "a"; +} + +function* g304() { // Generator + yield 1; + return "a"; +} + +function* g305() { // Generator<1 | 2, "a" | "b", unknown> + if (Math.random()) yield 1; + yield 2; + if (Math.random()) return "a"; + return "b"; +} + +function* g306() { // Generator + const a: "hi" = yield 1; + return true; +} + +function* g307() { // Generator + const a: T = yield 0; + return a; +} + +function* g308(x: T) { // Generator + const a: T = yield x; + return a; +} + +function* g309(x: T, y: U) { // Generator + const a: V = yield x; + return y; +} + +function* g310() { // Generator + const [a = 1, b = 2] = yield; +} + +function* g311() { // Generator + yield* (function*() { + const y: string = yield; + })(); +} + + +//// [generatorReturnTypeInference.js] +function* g000() { +} +// 'yield' iteration type inference +function* g001() { + yield; +} +function* g002() { + yield 1; +} +function* g003() { + yield* []; +} +function* g004() { + yield* iterableIterator; +} +function* g005() { + const x = yield* generator; +} +function* g006() { + yield 1; + yield 2; +} +function* g007() { + yield never; +} +// 'return' iteration type inference +function* g102() { + return 1; +} +function* g103() { + if (Math.random()) + return 1; + return 2; +} +function* g104() { + return never; +} +// 'next' iteration type inference +function* g201() { + let a = yield 1; +} +function* g202() { + let a = yield 1; + let b = yield 2; +} +function* g203() { + const x = f1(yield 1); +} +function* g204() { + const x = f2(yield 1); +} +// mixed iteration types inference +function* g301() { + yield; + return; +} +function* g302() { + yield 1; + return; +} +function* g303() { + yield; + return "a"; +} +function* g304() { + yield 1; + return "a"; +} +function* g305() { + if (Math.random()) + yield 1; + yield 2; + if (Math.random()) + return "a"; + return "b"; +} +function* g306() { + const a = yield 1; + return true; +} +function* g307() { + const a = yield 0; + return a; +} +function* g308(x) { + const a = yield x; + return a; +} +function* g309(x, y) { + const a = yield x; + return y; +} +function* g310() { + const [a = 1, b = 2] = yield; +} +function* g311() { + yield* (function* () { + const y = yield; + })(); +} diff --git a/tests/baselines/reference/generatorReturnTypeInference.symbols b/tests/baselines/reference/generatorReturnTypeInference.symbols new file mode 100644 index 00000000000..9af5773a118 --- /dev/null +++ b/tests/baselines/reference/generatorReturnTypeInference.symbols @@ -0,0 +1,258 @@ +=== tests/cases/conformance/generators/generatorReturnTypeInference.ts === +declare const iterableIterator: IterableIterator; +>iterableIterator : Symbol(iterableIterator, Decl(generatorReturnTypeInference.ts, 0, 13)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) + +declare const generator: Generator; +>generator : Symbol(generator, Decl(generatorReturnTypeInference.ts, 1, 13)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) + +declare const never: never; +>never : Symbol(never, Decl(generatorReturnTypeInference.ts, 2, 13)) + +function* g000() { // Generator +>g000 : Symbol(g000, Decl(generatorReturnTypeInference.ts, 2, 27)) +} + +// 'yield' iteration type inference +function* g001() { // Generator +>g001 : Symbol(g001, Decl(generatorReturnTypeInference.ts, 5, 1)) + + yield; +} + +function* g002() { // Generator +>g002 : Symbol(g002, Decl(generatorReturnTypeInference.ts, 10, 1)) + + yield 1; +} + +function* g003() { // Generator +>g003 : Symbol(g003, Decl(generatorReturnTypeInference.ts, 14, 1)) + + yield* []; +} + +function* g004() { // Generator +>g004 : Symbol(g004, Decl(generatorReturnTypeInference.ts, 18, 1)) + + yield* iterableIterator; +>iterableIterator : Symbol(iterableIterator, Decl(generatorReturnTypeInference.ts, 0, 13)) +} + +function* g005() { // Generator +>g005 : Symbol(g005, Decl(generatorReturnTypeInference.ts, 22, 1)) + + const x = yield* generator; +>x : Symbol(x, Decl(generatorReturnTypeInference.ts, 25, 9)) +>generator : Symbol(generator, Decl(generatorReturnTypeInference.ts, 1, 13)) +} + +function* g006() { // Generator<1 | 2, void, unknown> +>g006 : Symbol(g006, Decl(generatorReturnTypeInference.ts, 26, 1)) + + yield 1; + yield 2; +} + +function* g007() { // Generator +>g007 : Symbol(g007, Decl(generatorReturnTypeInference.ts, 31, 1)) + + yield never; +>never : Symbol(never, Decl(generatorReturnTypeInference.ts, 2, 13)) +} + +// 'return' iteration type inference +function* g102() { // Generator +>g102 : Symbol(g102, Decl(generatorReturnTypeInference.ts, 35, 1)) + + return 1; +} + +function* g103() { // Generator +>g103 : Symbol(g103, Decl(generatorReturnTypeInference.ts, 40, 1)) + + if (Math.random()) return 1; +>Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) + + return 2; +} + +function* g104() { // Generator +>g104 : Symbol(g104, Decl(generatorReturnTypeInference.ts, 45, 1)) + + return never; +>never : Symbol(never, Decl(generatorReturnTypeInference.ts, 2, 13)) +} + +// 'next' iteration type inference +function* g201() { // Generator +>g201 : Symbol(g201, Decl(generatorReturnTypeInference.ts, 49, 1)) + + let a: string = yield 1; +>a : Symbol(a, Decl(generatorReturnTypeInference.ts, 53, 7)) +} + +function* g202() { // Generator<1 | 2, void, never> +>g202 : Symbol(g202, Decl(generatorReturnTypeInference.ts, 54, 1)) + + let a: string = yield 1; +>a : Symbol(a, Decl(generatorReturnTypeInference.ts, 57, 7)) + + let b: number = yield 2; +>b : Symbol(b, Decl(generatorReturnTypeInference.ts, 58, 7)) +} + +declare function f1(x: string): void; +>f1 : Symbol(f1, Decl(generatorReturnTypeInference.ts, 59, 1), Decl(generatorReturnTypeInference.ts, 61, 37)) +>x : Symbol(x, Decl(generatorReturnTypeInference.ts, 61, 20)) + +declare function f1(x: number): void; +>f1 : Symbol(f1, Decl(generatorReturnTypeInference.ts, 59, 1), Decl(generatorReturnTypeInference.ts, 61, 37)) +>x : Symbol(x, Decl(generatorReturnTypeInference.ts, 62, 20)) + +function* g203() { // Generator +>g203 : Symbol(g203, Decl(generatorReturnTypeInference.ts, 62, 37)) + + const x = f1(yield 1); +>x : Symbol(x, Decl(generatorReturnTypeInference.ts, 65, 6)) +>f1 : Symbol(f1, Decl(generatorReturnTypeInference.ts, 59, 1), Decl(generatorReturnTypeInference.ts, 61, 37)) +} + +declare function f2(x: T): T; +>f2 : Symbol(f2, Decl(generatorReturnTypeInference.ts, 66, 1)) +>T : Symbol(T, Decl(generatorReturnTypeInference.ts, 68, 20)) +>x : Symbol(x, Decl(generatorReturnTypeInference.ts, 68, 23)) +>T : Symbol(T, Decl(generatorReturnTypeInference.ts, 68, 20)) +>T : Symbol(T, Decl(generatorReturnTypeInference.ts, 68, 20)) + +function* g204() { // Generator +>g204 : Symbol(g204, Decl(generatorReturnTypeInference.ts, 68, 32)) + + const x = f2(yield 1); +>x : Symbol(x, Decl(generatorReturnTypeInference.ts, 71, 6)) +>f2 : Symbol(f2, Decl(generatorReturnTypeInference.ts, 66, 1)) +} + +// mixed iteration types inference + +function* g301() { // Generator +>g301 : Symbol(g301, Decl(generatorReturnTypeInference.ts, 72, 1)) + + yield; + return; +} + +function* g302() { // Generator +>g302 : Symbol(g302, Decl(generatorReturnTypeInference.ts, 79, 1)) + + yield 1; + return; +} + +function* g303() { // Generator +>g303 : Symbol(g303, Decl(generatorReturnTypeInference.ts, 84, 1)) + + yield; + return "a"; +} + +function* g304() { // Generator +>g304 : Symbol(g304, Decl(generatorReturnTypeInference.ts, 89, 1)) + + yield 1; + return "a"; +} + +function* g305() { // Generator<1 | 2, "a" | "b", unknown> +>g305 : Symbol(g305, Decl(generatorReturnTypeInference.ts, 94, 1)) + + if (Math.random()) yield 1; +>Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) + + yield 2; + if (Math.random()) return "a"; +>Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) + + return "b"; +} + +function* g306() { // Generator +>g306 : Symbol(g306, Decl(generatorReturnTypeInference.ts, 101, 1)) + + const a: "hi" = yield 1; +>a : Symbol(a, Decl(generatorReturnTypeInference.ts, 104, 9)) + + return true; +} + +function* g307() { // Generator +>g307 : Symbol(g307, Decl(generatorReturnTypeInference.ts, 106, 1)) +>T : Symbol(T, Decl(generatorReturnTypeInference.ts, 108, 15)) + + const a: T = yield 0; +>a : Symbol(a, Decl(generatorReturnTypeInference.ts, 109, 9)) +>T : Symbol(T, Decl(generatorReturnTypeInference.ts, 108, 15)) + + return a; +>a : Symbol(a, Decl(generatorReturnTypeInference.ts, 109, 9)) +} + +function* g308(x: T) { // Generator +>g308 : Symbol(g308, Decl(generatorReturnTypeInference.ts, 111, 1)) +>T : Symbol(T, Decl(generatorReturnTypeInference.ts, 113, 15)) +>x : Symbol(x, Decl(generatorReturnTypeInference.ts, 113, 18)) +>T : Symbol(T, Decl(generatorReturnTypeInference.ts, 113, 15)) + + const a: T = yield x; +>a : Symbol(a, Decl(generatorReturnTypeInference.ts, 114, 9)) +>T : Symbol(T, Decl(generatorReturnTypeInference.ts, 113, 15)) +>x : Symbol(x, Decl(generatorReturnTypeInference.ts, 113, 18)) + + return a; +>a : Symbol(a, Decl(generatorReturnTypeInference.ts, 114, 9)) +} + +function* g309(x: T, y: U) { // Generator +>g309 : Symbol(g309, Decl(generatorReturnTypeInference.ts, 116, 1)) +>T : Symbol(T, Decl(generatorReturnTypeInference.ts, 118, 15)) +>U : Symbol(U, Decl(generatorReturnTypeInference.ts, 118, 17)) +>V : Symbol(V, Decl(generatorReturnTypeInference.ts, 118, 20)) +>x : Symbol(x, Decl(generatorReturnTypeInference.ts, 118, 24)) +>T : Symbol(T, Decl(generatorReturnTypeInference.ts, 118, 15)) +>y : Symbol(y, Decl(generatorReturnTypeInference.ts, 118, 29)) +>U : Symbol(U, Decl(generatorReturnTypeInference.ts, 118, 17)) + + const a: V = yield x; +>a : Symbol(a, Decl(generatorReturnTypeInference.ts, 119, 9)) +>V : Symbol(V, Decl(generatorReturnTypeInference.ts, 118, 20)) +>x : Symbol(x, Decl(generatorReturnTypeInference.ts, 118, 24)) + + return y; +>y : Symbol(y, Decl(generatorReturnTypeInference.ts, 118, 29)) +} + +function* g310() { // Generator +>g310 : Symbol(g310, Decl(generatorReturnTypeInference.ts, 121, 1)) + + const [a = 1, b = 2] = yield; +>a : Symbol(a, Decl(generatorReturnTypeInference.ts, 124, 8)) +>b : Symbol(b, Decl(generatorReturnTypeInference.ts, 124, 14)) +} + +function* g311() { // Generator +>g311 : Symbol(g311, Decl(generatorReturnTypeInference.ts, 125, 1)) + + yield* (function*() { + const y: string = yield; +>y : Symbol(y, Decl(generatorReturnTypeInference.ts, 129, 7)) + + })(); +} + diff --git a/tests/baselines/reference/generatorReturnTypeInference.types b/tests/baselines/reference/generatorReturnTypeInference.types new file mode 100644 index 00000000000..a0942c9b700 --- /dev/null +++ b/tests/baselines/reference/generatorReturnTypeInference.types @@ -0,0 +1,308 @@ +=== tests/cases/conformance/generators/generatorReturnTypeInference.ts === +declare const iterableIterator: IterableIterator; +>iterableIterator : IterableIterator + +declare const generator: Generator; +>generator : Generator + +declare const never: never; +>never : never + +function* g000() { // Generator +>g000 : () => Generator +} + +// 'yield' iteration type inference +function* g001() { // Generator +>g001 : () => Generator + + yield; +>yield : any +} + +function* g002() { // Generator +>g002 : () => Generator + + yield 1; +>yield 1 : any +>1 : 1 +} + +function* g003() { // Generator +>g003 : () => Generator + + yield* []; +>yield* [] : any +>[] : never[] +} + +function* g004() { // Generator +>g004 : () => Generator + + yield* iterableIterator; +>yield* iterableIterator : any +>iterableIterator : IterableIterator +} + +function* g005() { // Generator +>g005 : () => Generator + + const x = yield* generator; +>x : string +>yield* generator : string +>generator : Generator +} + +function* g006() { // Generator<1 | 2, void, unknown> +>g006 : () => Generator<1 | 2, void, unknown> + + yield 1; +>yield 1 : any +>1 : 1 + + yield 2; +>yield 2 : any +>2 : 2 +} + +function* g007() { // Generator +>g007 : () => Generator + + yield never; +>yield never : any +>never : never +} + +// 'return' iteration type inference +function* g102() { // Generator +>g102 : () => Generator + + return 1; +>1 : 1 +} + +function* g103() { // Generator +>g103 : () => Generator + + if (Math.random()) return 1; +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number +>1 : 1 + + return 2; +>2 : 2 +} + +function* g104() { // Generator +>g104 : () => Generator + + return never; +>never : never +} + +// 'next' iteration type inference +function* g201() { // Generator +>g201 : () => Generator + + let a: string = yield 1; +>a : string +>yield 1 : any +>1 : 1 +} + +function* g202() { // Generator<1 | 2, void, never> +>g202 : () => Generator<1 | 2, void, never> + + let a: string = yield 1; +>a : string +>yield 1 : any +>1 : 1 + + let b: number = yield 2; +>b : number +>yield 2 : any +>2 : 2 +} + +declare function f1(x: string): void; +>f1 : { (x: string): void; (x: number): void; } +>x : string + +declare function f1(x: number): void; +>f1 : { (x: string): void; (x: number): void; } +>x : number + +function* g203() { // Generator +>g203 : () => Generator + + const x = f1(yield 1); +>x : void +>f1(yield 1) : void +>f1 : { (x: string): void; (x: number): void; } +>yield 1 : any +>1 : 1 +} + +declare function f2(x: T): T; +>f2 : (x: T) => T +>x : T + +function* g204() { // Generator +>g204 : () => Generator + + const x = f2(yield 1); +>x : any +>f2(yield 1) : any +>f2 : (x: T) => T +>yield 1 : any +>1 : 1 +} + +// mixed iteration types inference + +function* g301() { // Generator +>g301 : () => Generator + + yield; +>yield : any + + return; +} + +function* g302() { // Generator +>g302 : () => Generator + + yield 1; +>yield 1 : any +>1 : 1 + + return; +} + +function* g303() { // Generator +>g303 : () => Generator + + yield; +>yield : any + + return "a"; +>"a" : "a" +} + +function* g304() { // Generator +>g304 : () => Generator + + yield 1; +>yield 1 : any +>1 : 1 + + return "a"; +>"a" : "a" +} + +function* g305() { // Generator<1 | 2, "a" | "b", unknown> +>g305 : () => Generator<1 | 2, "a" | "b", unknown> + + if (Math.random()) yield 1; +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number +>yield 1 : any +>1 : 1 + + yield 2; +>yield 2 : any +>2 : 2 + + if (Math.random()) return "a"; +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number +>"a" : "a" + + return "b"; +>"b" : "b" +} + +function* g306() { // Generator +>g306 : () => Generator + + const a: "hi" = yield 1; +>a : "hi" +>yield 1 : any +>1 : 1 + + return true; +>true : true +} + +function* g307() { // Generator +>g307 : () => Generator + + const a: T = yield 0; +>a : T +>yield 0 : any +>0 : 0 + + return a; +>a : T +} + +function* g308(x: T) { // Generator +>g308 : (x: T) => Generator +>x : T + + const a: T = yield x; +>a : T +>yield x : any +>x : T + + return a; +>a : T +} + +function* g309(x: T, y: U) { // Generator +>g309 : (x: T, y: U) => Generator +>x : T +>y : U + + const a: V = yield x; +>a : V +>yield x : any +>x : T + + return y; +>y : U +} + +function* g310() { // Generator +>g310 : () => Generator + + const [a = 1, b = 2] = yield; +>a : any +>1 : 1 +>b : any +>2 : 2 +>yield : any +} + +function* g311() { // Generator +>g311 : () => Generator + + yield* (function*() { +>yield* (function*() { const y: string = yield; })() : void +>(function*() { const y: string = yield; })() : Generator +>(function*() { const y: string = yield; }) : () => Generator +>function*() { const y: string = yield; } : () => Generator + + const y: string = yield; +>y : string +>yield : any + + })(); +} + diff --git a/tests/baselines/reference/generatorReturnTypeInferenceNonStrict.errors.txt b/tests/baselines/reference/generatorReturnTypeInferenceNonStrict.errors.txt new file mode 100644 index 00000000000..ebab0e585c7 --- /dev/null +++ b/tests/baselines/reference/generatorReturnTypeInferenceNonStrict.errors.txt @@ -0,0 +1,156 @@ +tests/cases/conformance/generators/generatorReturnTypeInferenceNonStrict.ts(9,11): error TS7055: 'g001', which lacks return-type annotation, implicitly has an 'any' yield type. +tests/cases/conformance/generators/generatorReturnTypeInferenceNonStrict.ts(17,11): error TS7055: 'g003', which lacks return-type annotation, implicitly has an 'any' yield type. +tests/cases/conformance/generators/generatorReturnTypeInferenceNonStrict.ts(79,11): error TS7055: 'g301', which lacks return-type annotation, implicitly has an 'any' yield type. +tests/cases/conformance/generators/generatorReturnTypeInferenceNonStrict.ts(89,11): error TS7055: 'g303', which lacks return-type annotation, implicitly has an 'any' yield type. +tests/cases/conformance/generators/generatorReturnTypeInferenceNonStrict.ts(126,11): error TS7055: 'g310', which lacks return-type annotation, implicitly has an 'any' yield type. +tests/cases/conformance/generators/generatorReturnTypeInferenceNonStrict.ts(131,10): error TS7025: Generator implicitly has yield type 'any' because it does not yield any values. Consider supplying a return type annotation. + + +==== tests/cases/conformance/generators/generatorReturnTypeInferenceNonStrict.ts (6 errors) ==== + declare const iterableIterator: IterableIterator; + declare const generator: Generator; + declare const never: never; + + function* g000() { // Generator + } + + // 'yield' iteration type inference + function* g001() { // Generator + ~~~~ +!!! error TS7055: 'g001', which lacks return-type annotation, implicitly has an 'any' yield type. + yield; + } + + function* g002() { // Generator + yield 1; + } + + function* g003() { // Generator + ~~~~ +!!! error TS7055: 'g003', which lacks return-type annotation, implicitly has an 'any' yield type. + // NOTE: In strict mode, `[]` produces the type `never[]`. + // In non-strict mode, `[]` produces the type `undefined[]` which is implicitly any. + yield* []; + } + + function* g004() { // Generator + yield* iterableIterator; + } + + function* g005() { // Generator + const x = yield* generator; + } + + function* g006() { // Generator<1 | 2, void, unknown> + yield 1; + yield 2; + } + + function* g007() { // Generator + yield never; + } + + // 'return' iteration type inference + function* g102() { // Generator + return 1; + } + + function* g103() { // Generator + if (Math.random()) return 1; + return 2; + } + + function* g104() { // Generator + return never; + } + + // 'next' iteration type inference + function* g201() { // Generator + let a: string = yield 1; + } + + function* g202() { // Generator<1 | 2, void, never> + let a: string = yield 1; + let b: number = yield 2; + } + + declare function f1(x: string): void; + declare function f1(x: number): void; + + function* g203() { // Generator + const x = f1(yield 1); + } + + declare function f2(x: T): T; + + function* g204() { // Generator + const x = f2(yield 1); + } + + // mixed iteration types inference + + function* g301() { // Generator + ~~~~ +!!! error TS7055: 'g301', which lacks return-type annotation, implicitly has an 'any' yield type. + yield; + return; + } + + function* g302() { // Generator + yield 1; + return; + } + + function* g303() { // Generator + ~~~~ +!!! error TS7055: 'g303', which lacks return-type annotation, implicitly has an 'any' yield type. + yield; + return "a"; + } + + function* g304() { // Generator + yield 1; + return "a"; + } + + function* g305() { // Generator<1 | 2, "a" | "b", unknown> + if (Math.random()) yield 1; + yield 2; + if (Math.random()) return "a"; + return "b"; + } + + function* g306() { // Generator + const a: "hi" = yield 1; + return true; + } + + function* g307() { // Generator + const a: T = yield 0; + return a; + } + + function* g308(x: T) { // Generator + const a: T = yield x; + return a; + } + + function* g309(x: T, y: U) { // Generator + const a: V = yield x; + return y; + } + + function* g310() { // Generator + ~~~~ +!!! error TS7055: 'g310', which lacks return-type annotation, implicitly has an 'any' yield type. + const [a = 1, b = 2] = yield; + } + + function* g311() { // Generator + yield* (function*() { + ~~~~~~~~ +!!! error TS7025: Generator implicitly has yield type 'any' because it does not yield any values. Consider supplying a return type annotation. + const y: string = yield; + })(); + } + \ No newline at end of file diff --git a/tests/baselines/reference/generatorReturnTypeInferenceNonStrict.js b/tests/baselines/reference/generatorReturnTypeInferenceNonStrict.js new file mode 100644 index 00000000000..272a92d1504 --- /dev/null +++ b/tests/baselines/reference/generatorReturnTypeInferenceNonStrict.js @@ -0,0 +1,240 @@ +//// [generatorReturnTypeInferenceNonStrict.ts] +declare const iterableIterator: IterableIterator; +declare const generator: Generator; +declare const never: never; + +function* g000() { // Generator +} + +// 'yield' iteration type inference +function* g001() { // Generator + yield; +} + +function* g002() { // Generator + yield 1; +} + +function* g003() { // Generator + // NOTE: In strict mode, `[]` produces the type `never[]`. + // In non-strict mode, `[]` produces the type `undefined[]` which is implicitly any. + yield* []; +} + +function* g004() { // Generator + yield* iterableIterator; +} + +function* g005() { // Generator + const x = yield* generator; +} + +function* g006() { // Generator<1 | 2, void, unknown> + yield 1; + yield 2; +} + +function* g007() { // Generator + yield never; +} + +// 'return' iteration type inference +function* g102() { // Generator + return 1; +} + +function* g103() { // Generator + if (Math.random()) return 1; + return 2; +} + +function* g104() { // Generator + return never; +} + +// 'next' iteration type inference +function* g201() { // Generator + let a: string = yield 1; +} + +function* g202() { // Generator<1 | 2, void, never> + let a: string = yield 1; + let b: number = yield 2; +} + +declare function f1(x: string): void; +declare function f1(x: number): void; + +function* g203() { // Generator + const x = f1(yield 1); +} + +declare function f2(x: T): T; + +function* g204() { // Generator + const x = f2(yield 1); +} + +// mixed iteration types inference + +function* g301() { // Generator + yield; + return; +} + +function* g302() { // Generator + yield 1; + return; +} + +function* g303() { // Generator + yield; + return "a"; +} + +function* g304() { // Generator + yield 1; + return "a"; +} + +function* g305() { // Generator<1 | 2, "a" | "b", unknown> + if (Math.random()) yield 1; + yield 2; + if (Math.random()) return "a"; + return "b"; +} + +function* g306() { // Generator + const a: "hi" = yield 1; + return true; +} + +function* g307() { // Generator + const a: T = yield 0; + return a; +} + +function* g308(x: T) { // Generator + const a: T = yield x; + return a; +} + +function* g309(x: T, y: U) { // Generator + const a: V = yield x; + return y; +} + +function* g310() { // Generator + const [a = 1, b = 2] = yield; +} + +function* g311() { // Generator + yield* (function*() { + const y: string = yield; + })(); +} + + +//// [generatorReturnTypeInferenceNonStrict.js] +function* g000() { +} +// 'yield' iteration type inference +function* g001() { + yield; +} +function* g002() { + yield 1; +} +function* g003() { + // NOTE: In strict mode, `[]` produces the type `never[]`. + // In non-strict mode, `[]` produces the type `undefined[]` which is implicitly any. + yield* []; +} +function* g004() { + yield* iterableIterator; +} +function* g005() { + const x = yield* generator; +} +function* g006() { + yield 1; + yield 2; +} +function* g007() { + yield never; +} +// 'return' iteration type inference +function* g102() { + return 1; +} +function* g103() { + if (Math.random()) + return 1; + return 2; +} +function* g104() { + return never; +} +// 'next' iteration type inference +function* g201() { + let a = yield 1; +} +function* g202() { + let a = yield 1; + let b = yield 2; +} +function* g203() { + const x = f1(yield 1); +} +function* g204() { + const x = f2(yield 1); +} +// mixed iteration types inference +function* g301() { + yield; + return; +} +function* g302() { + yield 1; + return; +} +function* g303() { + yield; + return "a"; +} +function* g304() { + yield 1; + return "a"; +} +function* g305() { + if (Math.random()) + yield 1; + yield 2; + if (Math.random()) + return "a"; + return "b"; +} +function* g306() { + const a = yield 1; + return true; +} +function* g307() { + const a = yield 0; + return a; +} +function* g308(x) { + const a = yield x; + return a; +} +function* g309(x, y) { + const a = yield x; + return y; +} +function* g310() { + const [a = 1, b = 2] = yield; +} +function* g311() { + yield* (function* () { + const y = yield; + })(); +} diff --git a/tests/baselines/reference/generatorReturnTypeInferenceNonStrict.symbols b/tests/baselines/reference/generatorReturnTypeInferenceNonStrict.symbols new file mode 100644 index 00000000000..2ff827d66c9 --- /dev/null +++ b/tests/baselines/reference/generatorReturnTypeInferenceNonStrict.symbols @@ -0,0 +1,260 @@ +=== tests/cases/conformance/generators/generatorReturnTypeInferenceNonStrict.ts === +declare const iterableIterator: IterableIterator; +>iterableIterator : Symbol(iterableIterator, Decl(generatorReturnTypeInferenceNonStrict.ts, 0, 13)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) + +declare const generator: Generator; +>generator : Symbol(generator, Decl(generatorReturnTypeInferenceNonStrict.ts, 1, 13)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) + +declare const never: never; +>never : Symbol(never, Decl(generatorReturnTypeInferenceNonStrict.ts, 2, 13)) + +function* g000() { // Generator +>g000 : Symbol(g000, Decl(generatorReturnTypeInferenceNonStrict.ts, 2, 27)) +} + +// 'yield' iteration type inference +function* g001() { // Generator +>g001 : Symbol(g001, Decl(generatorReturnTypeInferenceNonStrict.ts, 5, 1)) + + yield; +} + +function* g002() { // Generator +>g002 : Symbol(g002, Decl(generatorReturnTypeInferenceNonStrict.ts, 10, 1)) + + yield 1; +} + +function* g003() { // Generator +>g003 : Symbol(g003, Decl(generatorReturnTypeInferenceNonStrict.ts, 14, 1)) + + // NOTE: In strict mode, `[]` produces the type `never[]`. + // In non-strict mode, `[]` produces the type `undefined[]` which is implicitly any. + yield* []; +} + +function* g004() { // Generator +>g004 : Symbol(g004, Decl(generatorReturnTypeInferenceNonStrict.ts, 20, 1)) + + yield* iterableIterator; +>iterableIterator : Symbol(iterableIterator, Decl(generatorReturnTypeInferenceNonStrict.ts, 0, 13)) +} + +function* g005() { // Generator +>g005 : Symbol(g005, Decl(generatorReturnTypeInferenceNonStrict.ts, 24, 1)) + + const x = yield* generator; +>x : Symbol(x, Decl(generatorReturnTypeInferenceNonStrict.ts, 27, 9)) +>generator : Symbol(generator, Decl(generatorReturnTypeInferenceNonStrict.ts, 1, 13)) +} + +function* g006() { // Generator<1 | 2, void, unknown> +>g006 : Symbol(g006, Decl(generatorReturnTypeInferenceNonStrict.ts, 28, 1)) + + yield 1; + yield 2; +} + +function* g007() { // Generator +>g007 : Symbol(g007, Decl(generatorReturnTypeInferenceNonStrict.ts, 33, 1)) + + yield never; +>never : Symbol(never, Decl(generatorReturnTypeInferenceNonStrict.ts, 2, 13)) +} + +// 'return' iteration type inference +function* g102() { // Generator +>g102 : Symbol(g102, Decl(generatorReturnTypeInferenceNonStrict.ts, 37, 1)) + + return 1; +} + +function* g103() { // Generator +>g103 : Symbol(g103, Decl(generatorReturnTypeInferenceNonStrict.ts, 42, 1)) + + if (Math.random()) return 1; +>Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) + + return 2; +} + +function* g104() { // Generator +>g104 : Symbol(g104, Decl(generatorReturnTypeInferenceNonStrict.ts, 47, 1)) + + return never; +>never : Symbol(never, Decl(generatorReturnTypeInferenceNonStrict.ts, 2, 13)) +} + +// 'next' iteration type inference +function* g201() { // Generator +>g201 : Symbol(g201, Decl(generatorReturnTypeInferenceNonStrict.ts, 51, 1)) + + let a: string = yield 1; +>a : Symbol(a, Decl(generatorReturnTypeInferenceNonStrict.ts, 55, 7)) +} + +function* g202() { // Generator<1 | 2, void, never> +>g202 : Symbol(g202, Decl(generatorReturnTypeInferenceNonStrict.ts, 56, 1)) + + let a: string = yield 1; +>a : Symbol(a, Decl(generatorReturnTypeInferenceNonStrict.ts, 59, 7)) + + let b: number = yield 2; +>b : Symbol(b, Decl(generatorReturnTypeInferenceNonStrict.ts, 60, 7)) +} + +declare function f1(x: string): void; +>f1 : Symbol(f1, Decl(generatorReturnTypeInferenceNonStrict.ts, 61, 1), Decl(generatorReturnTypeInferenceNonStrict.ts, 63, 37)) +>x : Symbol(x, Decl(generatorReturnTypeInferenceNonStrict.ts, 63, 20)) + +declare function f1(x: number): void; +>f1 : Symbol(f1, Decl(generatorReturnTypeInferenceNonStrict.ts, 61, 1), Decl(generatorReturnTypeInferenceNonStrict.ts, 63, 37)) +>x : Symbol(x, Decl(generatorReturnTypeInferenceNonStrict.ts, 64, 20)) + +function* g203() { // Generator +>g203 : Symbol(g203, Decl(generatorReturnTypeInferenceNonStrict.ts, 64, 37)) + + const x = f1(yield 1); +>x : Symbol(x, Decl(generatorReturnTypeInferenceNonStrict.ts, 67, 6)) +>f1 : Symbol(f1, Decl(generatorReturnTypeInferenceNonStrict.ts, 61, 1), Decl(generatorReturnTypeInferenceNonStrict.ts, 63, 37)) +} + +declare function f2(x: T): T; +>f2 : Symbol(f2, Decl(generatorReturnTypeInferenceNonStrict.ts, 68, 1)) +>T : Symbol(T, Decl(generatorReturnTypeInferenceNonStrict.ts, 70, 20)) +>x : Symbol(x, Decl(generatorReturnTypeInferenceNonStrict.ts, 70, 23)) +>T : Symbol(T, Decl(generatorReturnTypeInferenceNonStrict.ts, 70, 20)) +>T : Symbol(T, Decl(generatorReturnTypeInferenceNonStrict.ts, 70, 20)) + +function* g204() { // Generator +>g204 : Symbol(g204, Decl(generatorReturnTypeInferenceNonStrict.ts, 70, 32)) + + const x = f2(yield 1); +>x : Symbol(x, Decl(generatorReturnTypeInferenceNonStrict.ts, 73, 6)) +>f2 : Symbol(f2, Decl(generatorReturnTypeInferenceNonStrict.ts, 68, 1)) +} + +// mixed iteration types inference + +function* g301() { // Generator +>g301 : Symbol(g301, Decl(generatorReturnTypeInferenceNonStrict.ts, 74, 1)) + + yield; + return; +} + +function* g302() { // Generator +>g302 : Symbol(g302, Decl(generatorReturnTypeInferenceNonStrict.ts, 81, 1)) + + yield 1; + return; +} + +function* g303() { // Generator +>g303 : Symbol(g303, Decl(generatorReturnTypeInferenceNonStrict.ts, 86, 1)) + + yield; + return "a"; +} + +function* g304() { // Generator +>g304 : Symbol(g304, Decl(generatorReturnTypeInferenceNonStrict.ts, 91, 1)) + + yield 1; + return "a"; +} + +function* g305() { // Generator<1 | 2, "a" | "b", unknown> +>g305 : Symbol(g305, Decl(generatorReturnTypeInferenceNonStrict.ts, 96, 1)) + + if (Math.random()) yield 1; +>Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) + + yield 2; + if (Math.random()) return "a"; +>Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) + + return "b"; +} + +function* g306() { // Generator +>g306 : Symbol(g306, Decl(generatorReturnTypeInferenceNonStrict.ts, 103, 1)) + + const a: "hi" = yield 1; +>a : Symbol(a, Decl(generatorReturnTypeInferenceNonStrict.ts, 106, 9)) + + return true; +} + +function* g307() { // Generator +>g307 : Symbol(g307, Decl(generatorReturnTypeInferenceNonStrict.ts, 108, 1)) +>T : Symbol(T, Decl(generatorReturnTypeInferenceNonStrict.ts, 110, 15)) + + const a: T = yield 0; +>a : Symbol(a, Decl(generatorReturnTypeInferenceNonStrict.ts, 111, 9)) +>T : Symbol(T, Decl(generatorReturnTypeInferenceNonStrict.ts, 110, 15)) + + return a; +>a : Symbol(a, Decl(generatorReturnTypeInferenceNonStrict.ts, 111, 9)) +} + +function* g308(x: T) { // Generator +>g308 : Symbol(g308, Decl(generatorReturnTypeInferenceNonStrict.ts, 113, 1)) +>T : Symbol(T, Decl(generatorReturnTypeInferenceNonStrict.ts, 115, 15)) +>x : Symbol(x, Decl(generatorReturnTypeInferenceNonStrict.ts, 115, 18)) +>T : Symbol(T, Decl(generatorReturnTypeInferenceNonStrict.ts, 115, 15)) + + const a: T = yield x; +>a : Symbol(a, Decl(generatorReturnTypeInferenceNonStrict.ts, 116, 9)) +>T : Symbol(T, Decl(generatorReturnTypeInferenceNonStrict.ts, 115, 15)) +>x : Symbol(x, Decl(generatorReturnTypeInferenceNonStrict.ts, 115, 18)) + + return a; +>a : Symbol(a, Decl(generatorReturnTypeInferenceNonStrict.ts, 116, 9)) +} + +function* g309(x: T, y: U) { // Generator +>g309 : Symbol(g309, Decl(generatorReturnTypeInferenceNonStrict.ts, 118, 1)) +>T : Symbol(T, Decl(generatorReturnTypeInferenceNonStrict.ts, 120, 15)) +>U : Symbol(U, Decl(generatorReturnTypeInferenceNonStrict.ts, 120, 17)) +>V : Symbol(V, Decl(generatorReturnTypeInferenceNonStrict.ts, 120, 20)) +>x : Symbol(x, Decl(generatorReturnTypeInferenceNonStrict.ts, 120, 24)) +>T : Symbol(T, Decl(generatorReturnTypeInferenceNonStrict.ts, 120, 15)) +>y : Symbol(y, Decl(generatorReturnTypeInferenceNonStrict.ts, 120, 29)) +>U : Symbol(U, Decl(generatorReturnTypeInferenceNonStrict.ts, 120, 17)) + + const a: V = yield x; +>a : Symbol(a, Decl(generatorReturnTypeInferenceNonStrict.ts, 121, 9)) +>V : Symbol(V, Decl(generatorReturnTypeInferenceNonStrict.ts, 120, 20)) +>x : Symbol(x, Decl(generatorReturnTypeInferenceNonStrict.ts, 120, 24)) + + return y; +>y : Symbol(y, Decl(generatorReturnTypeInferenceNonStrict.ts, 120, 29)) +} + +function* g310() { // Generator +>g310 : Symbol(g310, Decl(generatorReturnTypeInferenceNonStrict.ts, 123, 1)) + + const [a = 1, b = 2] = yield; +>a : Symbol(a, Decl(generatorReturnTypeInferenceNonStrict.ts, 126, 8)) +>b : Symbol(b, Decl(generatorReturnTypeInferenceNonStrict.ts, 126, 14)) +} + +function* g311() { // Generator +>g311 : Symbol(g311, Decl(generatorReturnTypeInferenceNonStrict.ts, 127, 1)) + + yield* (function*() { + const y: string = yield; +>y : Symbol(y, Decl(generatorReturnTypeInferenceNonStrict.ts, 131, 7)) + + })(); +} + diff --git a/tests/baselines/reference/generatorReturnTypeInferenceNonStrict.types b/tests/baselines/reference/generatorReturnTypeInferenceNonStrict.types new file mode 100644 index 00000000000..4d6754d85bf --- /dev/null +++ b/tests/baselines/reference/generatorReturnTypeInferenceNonStrict.types @@ -0,0 +1,310 @@ +=== tests/cases/conformance/generators/generatorReturnTypeInferenceNonStrict.ts === +declare const iterableIterator: IterableIterator; +>iterableIterator : IterableIterator + +declare const generator: Generator; +>generator : Generator + +declare const never: never; +>never : never + +function* g000() { // Generator +>g000 : () => Generator +} + +// 'yield' iteration type inference +function* g001() { // Generator +>g001 : () => Generator + + yield; +>yield : any +} + +function* g002() { // Generator +>g002 : () => Generator + + yield 1; +>yield 1 : any +>1 : 1 +} + +function* g003() { // Generator +>g003 : () => Generator + + // NOTE: In strict mode, `[]` produces the type `never[]`. + // In non-strict mode, `[]` produces the type `undefined[]` which is implicitly any. + yield* []; +>yield* [] : any +>[] : undefined[] +} + +function* g004() { // Generator +>g004 : () => Generator + + yield* iterableIterator; +>yield* iterableIterator : any +>iterableIterator : IterableIterator +} + +function* g005() { // Generator +>g005 : () => Generator + + const x = yield* generator; +>x : string +>yield* generator : string +>generator : Generator +} + +function* g006() { // Generator<1 | 2, void, unknown> +>g006 : () => Generator<1 | 2, void, unknown> + + yield 1; +>yield 1 : any +>1 : 1 + + yield 2; +>yield 2 : any +>2 : 2 +} + +function* g007() { // Generator +>g007 : () => Generator + + yield never; +>yield never : any +>never : never +} + +// 'return' iteration type inference +function* g102() { // Generator +>g102 : () => Generator + + return 1; +>1 : 1 +} + +function* g103() { // Generator +>g103 : () => Generator + + if (Math.random()) return 1; +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number +>1 : 1 + + return 2; +>2 : 2 +} + +function* g104() { // Generator +>g104 : () => Generator + + return never; +>never : never +} + +// 'next' iteration type inference +function* g201() { // Generator +>g201 : () => Generator + + let a: string = yield 1; +>a : string +>yield 1 : any +>1 : 1 +} + +function* g202() { // Generator<1 | 2, void, never> +>g202 : () => Generator<1 | 2, void, never> + + let a: string = yield 1; +>a : string +>yield 1 : any +>1 : 1 + + let b: number = yield 2; +>b : number +>yield 2 : any +>2 : 2 +} + +declare function f1(x: string): void; +>f1 : { (x: string): void; (x: number): void; } +>x : string + +declare function f1(x: number): void; +>f1 : { (x: string): void; (x: number): void; } +>x : number + +function* g203() { // Generator +>g203 : () => Generator + + const x = f1(yield 1); +>x : void +>f1(yield 1) : void +>f1 : { (x: string): void; (x: number): void; } +>yield 1 : any +>1 : 1 +} + +declare function f2(x: T): T; +>f2 : (x: T) => T +>x : T + +function* g204() { // Generator +>g204 : () => Generator + + const x = f2(yield 1); +>x : any +>f2(yield 1) : any +>f2 : (x: T) => T +>yield 1 : any +>1 : 1 +} + +// mixed iteration types inference + +function* g301() { // Generator +>g301 : () => Generator + + yield; +>yield : any + + return; +} + +function* g302() { // Generator +>g302 : () => Generator + + yield 1; +>yield 1 : any +>1 : 1 + + return; +} + +function* g303() { // Generator +>g303 : () => Generator + + yield; +>yield : any + + return "a"; +>"a" : "a" +} + +function* g304() { // Generator +>g304 : () => Generator + + yield 1; +>yield 1 : any +>1 : 1 + + return "a"; +>"a" : "a" +} + +function* g305() { // Generator<1 | 2, "a" | "b", unknown> +>g305 : () => Generator<1 | 2, "a" | "b", unknown> + + if (Math.random()) yield 1; +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number +>yield 1 : any +>1 : 1 + + yield 2; +>yield 2 : any +>2 : 2 + + if (Math.random()) return "a"; +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number +>"a" : "a" + + return "b"; +>"b" : "b" +} + +function* g306() { // Generator +>g306 : () => Generator + + const a: "hi" = yield 1; +>a : "hi" +>yield 1 : any +>1 : 1 + + return true; +>true : true +} + +function* g307() { // Generator +>g307 : () => Generator + + const a: T = yield 0; +>a : T +>yield 0 : any +>0 : 0 + + return a; +>a : T +} + +function* g308(x: T) { // Generator +>g308 : (x: T) => Generator +>x : T + + const a: T = yield x; +>a : T +>yield x : any +>x : T + + return a; +>a : T +} + +function* g309(x: T, y: U) { // Generator +>g309 : (x: T, y: U) => Generator +>x : T +>y : U + + const a: V = yield x; +>a : V +>yield x : any +>x : T + + return y; +>y : U +} + +function* g310() { // Generator +>g310 : () => Generator + + const [a = 1, b = 2] = yield; +>a : any +>1 : 1 +>b : any +>2 : 2 +>yield : any +} + +function* g311() { // Generator +>g311 : () => Generator + + yield* (function*() { +>yield* (function*() { const y: string = yield; })() : void +>(function*() { const y: string = yield; })() : Generator +>(function*() { const y: string = yield; }) : () => Generator +>function*() { const y: string = yield; } : () => Generator + + const y: string = yield; +>y : string +>yield : any + + })(); +} + diff --git a/tests/baselines/reference/generatorTypeCheck1.types b/tests/baselines/reference/generatorTypeCheck1.types index 435da37fa69..72597601a85 100644 --- a/tests/baselines/reference/generatorTypeCheck1.types +++ b/tests/baselines/reference/generatorTypeCheck1.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck1.ts === function* g1(): Iterator { } ->g1 : () => Iterator +>g1 : () => Iterator diff --git a/tests/baselines/reference/generatorTypeCheck13.types b/tests/baselines/reference/generatorTypeCheck13.types index 06e0e5ec380..2d5bdd5827e 100644 --- a/tests/baselines/reference/generatorTypeCheck13.types +++ b/tests/baselines/reference/generatorTypeCheck13.types @@ -3,7 +3,7 @@ function* g(): IterableIterator { >g : () => IterableIterator yield 0; ->yield 0 : any +>yield 0 : undefined >0 : 0 return ""; diff --git a/tests/baselines/reference/generatorTypeCheck14.types b/tests/baselines/reference/generatorTypeCheck14.types index 28401e68567..a4113cb8be2 100644 --- a/tests/baselines/reference/generatorTypeCheck14.types +++ b/tests/baselines/reference/generatorTypeCheck14.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck14.ts === function* g() { ->g : () => IterableIterator<0 | ""> +>g : () => Generator yield 0; >yield 0 : any diff --git a/tests/baselines/reference/generatorTypeCheck15.types b/tests/baselines/reference/generatorTypeCheck15.types index 33537836c12..d8e8ed58805 100644 --- a/tests/baselines/reference/generatorTypeCheck15.types +++ b/tests/baselines/reference/generatorTypeCheck15.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck15.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator return ""; >"" : "" diff --git a/tests/baselines/reference/generatorTypeCheck16.types b/tests/baselines/reference/generatorTypeCheck16.types index a607ad851c1..b8b43fcefc7 100644 --- a/tests/baselines/reference/generatorTypeCheck16.types +++ b/tests/baselines/reference/generatorTypeCheck16.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck16.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator return; } diff --git a/tests/baselines/reference/generatorTypeCheck17.types b/tests/baselines/reference/generatorTypeCheck17.types index 5a1f03055cc..e6631757d0d 100644 --- a/tests/baselines/reference/generatorTypeCheck17.types +++ b/tests/baselines/reference/generatorTypeCheck17.types @@ -12,10 +12,10 @@ function* g(): IterableIterator { >g : () => IterableIterator yield; ->yield : any +>yield : undefined yield new Bar; ->yield new Bar : any +>yield new Bar : undefined >new Bar : Bar >Bar : typeof Bar } diff --git a/tests/baselines/reference/generatorTypeCheck18.types b/tests/baselines/reference/generatorTypeCheck18.types index b1d1da6661e..73a9a0d88c7 100644 --- a/tests/baselines/reference/generatorTypeCheck18.types +++ b/tests/baselines/reference/generatorTypeCheck18.types @@ -11,10 +11,10 @@ function* g(): IterableIterator { >g : () => IterableIterator yield; ->yield : any +>yield : undefined yield new Baz; ->yield new Baz : any +>yield new Baz : undefined >new Baz : Baz >Baz : typeof Baz } diff --git a/tests/baselines/reference/generatorTypeCheck19.types b/tests/baselines/reference/generatorTypeCheck19.types index 73612246efa..f05cae1fd55 100644 --- a/tests/baselines/reference/generatorTypeCheck19.types +++ b/tests/baselines/reference/generatorTypeCheck19.types @@ -12,7 +12,7 @@ function* g(): IterableIterator { >g : () => IterableIterator yield; ->yield : any +>yield : undefined yield * [new Bar]; >yield * [new Bar] : any diff --git a/tests/baselines/reference/generatorTypeCheck20.types b/tests/baselines/reference/generatorTypeCheck20.types index 77b15497db0..a0ab6b14497 100644 --- a/tests/baselines/reference/generatorTypeCheck20.types +++ b/tests/baselines/reference/generatorTypeCheck20.types @@ -11,7 +11,7 @@ function* g(): IterableIterator { >g : () => IterableIterator yield; ->yield : any +>yield : undefined yield * [new Baz]; >yield * [new Baz] : any diff --git a/tests/baselines/reference/generatorTypeCheck21.types b/tests/baselines/reference/generatorTypeCheck21.types index a87d66d5cee..96b0f15cf60 100644 --- a/tests/baselines/reference/generatorTypeCheck21.types +++ b/tests/baselines/reference/generatorTypeCheck21.types @@ -12,7 +12,7 @@ function* g(): IterableIterator { >g : () => IterableIterator yield; ->yield : any +>yield : undefined yield * new Bar; >yield * new Bar : any diff --git a/tests/baselines/reference/generatorTypeCheck22.types b/tests/baselines/reference/generatorTypeCheck22.types index e46e73874e6..3f8f2d3fd9f 100644 --- a/tests/baselines/reference/generatorTypeCheck22.types +++ b/tests/baselines/reference/generatorTypeCheck22.types @@ -13,7 +13,7 @@ class Baz { z: number } >z : number function* g3() { ->g3 : () => IterableIterator +>g3 : () => Generator yield; >yield : any diff --git a/tests/baselines/reference/generatorTypeCheck23.types b/tests/baselines/reference/generatorTypeCheck23.types index 1d5d294503a..a7fa6c880bb 100644 --- a/tests/baselines/reference/generatorTypeCheck23.types +++ b/tests/baselines/reference/generatorTypeCheck23.types @@ -13,7 +13,7 @@ class Baz { z: number } >z : number function* g3() { ->g3 : () => IterableIterator +>g3 : () => Generator yield; >yield : any diff --git a/tests/baselines/reference/generatorTypeCheck24.types b/tests/baselines/reference/generatorTypeCheck24.types index e3c369bfce1..8f8f4d668f1 100644 --- a/tests/baselines/reference/generatorTypeCheck24.types +++ b/tests/baselines/reference/generatorTypeCheck24.types @@ -13,7 +13,7 @@ class Baz { z: number } >z : number function* g3() { ->g3 : () => IterableIterator +>g3 : () => Generator yield; >yield : any diff --git a/tests/baselines/reference/generatorTypeCheck25.errors.txt b/tests/baselines/reference/generatorTypeCheck25.errors.txt index c3c456e805d..365a19dfdd7 100644 --- a/tests/baselines/reference/generatorTypeCheck25.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck25.errors.txt @@ -1,13 +1,15 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck25.ts(4,5): error TS2322: Type '() => IterableIterator' is not assignable to type '() => Iterable'. - Type 'IterableIterator' is not assignable to type 'Iterable'. +tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck25.ts(4,5): error TS2322: Type '() => Generator' is not assignable to type '() => Iterable'. + Type 'Generator' is not assignable to type 'Iterable'. Types of property '[Symbol.iterator]' are incompatible. - Type '() => IterableIterator' is not assignable to type '() => Iterator'. - Type 'IterableIterator' is not assignable to type 'Iterator'. + Type '() => Generator' is not assignable to type '() => Iterator'. + Type 'Generator' is not assignable to type 'Iterator'. Types of property 'next' are incompatible. - Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. - Type 'IteratorResult' is not assignable to type 'IteratorResult'. - Type 'Bar | Baz' is not assignable to type 'Foo'. - Property 'x' is missing in type 'Baz' but required in type 'Foo'. + Type '(...args: [] | [undefined]) => IteratorResult' is not assignable to type '(...args: [] | [undefined]) => IteratorResult'. + Type 'IteratorResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. + Type 'Bar | Baz' is not assignable to type 'Foo'. + Property 'x' is missing in type 'Baz' but required in type 'Foo'. ==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck25.ts (1 errors) ==== @@ -16,16 +18,18 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck25.ts(4,5): error class Baz { z: number } var g3: () => Iterable = function* () { ~~ -!!! error TS2322: Type '() => IterableIterator' is not assignable to type '() => Iterable'. -!!! error TS2322: Type 'IterableIterator' is not assignable to type 'Iterable'. +!!! error TS2322: Type '() => Generator' is not assignable to type '() => Iterable'. +!!! error TS2322: Type 'Generator' is not assignable to type 'Iterable'. !!! error TS2322: Types of property '[Symbol.iterator]' are incompatible. -!!! error TS2322: Type '() => IterableIterator' is not assignable to type '() => Iterator'. -!!! error TS2322: Type 'IterableIterator' is not assignable to type 'Iterator'. +!!! error TS2322: Type '() => Generator' is not assignable to type '() => Iterator'. +!!! error TS2322: Type 'Generator' is not assignable to type 'Iterator'. !!! error TS2322: Types of property 'next' are incompatible. -!!! error TS2322: Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. -!!! error TS2322: Type 'IteratorResult' is not assignable to type 'IteratorResult'. -!!! error TS2322: Type 'Bar | Baz' is not assignable to type 'Foo'. -!!! error TS2322: Property 'x' is missing in type 'Baz' but required in type 'Foo'. +!!! error TS2322: Type '(...args: [] | [undefined]) => IteratorResult' is not assignable to type '(...args: [] | [undefined]) => IteratorResult'. +!!! error TS2322: Type 'IteratorResult' is not assignable to type 'IteratorResult'. +!!! error TS2322: Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. +!!! error TS2322: Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. +!!! error TS2322: Type 'Bar | Baz' is not assignable to type 'Foo'. +!!! error TS2322: Property 'x' is missing in type 'Baz' but required in type 'Foo'. !!! related TS2728 tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck25.ts:1:13: 'x' is declared here. yield; yield new Bar; diff --git a/tests/baselines/reference/generatorTypeCheck25.types b/tests/baselines/reference/generatorTypeCheck25.types index 4707bfe7b6b..d0498c2da16 100644 --- a/tests/baselines/reference/generatorTypeCheck25.types +++ b/tests/baselines/reference/generatorTypeCheck25.types @@ -14,7 +14,7 @@ class Baz { z: number } var g3: () => Iterable = function* () { >g3 : () => Iterable ->function* () { yield; yield new Bar; yield new Baz; yield *[new Bar]; yield *[new Baz];} : () => IterableIterator +>function* () { yield; yield new Bar; yield new Baz; yield *[new Bar]; yield *[new Baz];} : () => Generator yield; >yield : any diff --git a/tests/baselines/reference/generatorTypeCheck26.types b/tests/baselines/reference/generatorTypeCheck26.types index 6ae17c983b8..7ade7bdec91 100644 --- a/tests/baselines/reference/generatorTypeCheck26.types +++ b/tests/baselines/reference/generatorTypeCheck26.types @@ -4,7 +4,7 @@ function* g(): IterableIterator<(x: string) => number> { >x : string yield x => x.length; ->yield x => x.length : any +>yield x => x.length : undefined >x => x.length : (x: string) => number >x : string >x.length : number diff --git a/tests/baselines/reference/generatorTypeCheck27.types b/tests/baselines/reference/generatorTypeCheck27.types index 16632d021a4..58306e1fb4a 100644 --- a/tests/baselines/reference/generatorTypeCheck27.types +++ b/tests/baselines/reference/generatorTypeCheck27.types @@ -4,9 +4,9 @@ function* g(): IterableIterator<(x: string) => number> { >x : string yield * function* () { ->yield * function* () { yield x => x.length; } () : any ->function* () { yield x => x.length; } () : IterableIterator<(x: any) => any> ->function* () { yield x => x.length; } : () => IterableIterator<(x: any) => any> +>yield * function* () { yield x => x.length; } () : void +>function* () { yield x => x.length; } () : Generator<(x: any) => any, void, unknown> +>function* () { yield x => x.length; } : () => Generator<(x: any) => any, void, unknown> yield x => x.length; >yield x => x.length : any diff --git a/tests/baselines/reference/generatorTypeCheck28.types b/tests/baselines/reference/generatorTypeCheck28.types index 7d5bafe28c5..9cd4e5e82ce 100644 --- a/tests/baselines/reference/generatorTypeCheck28.types +++ b/tests/baselines/reference/generatorTypeCheck28.types @@ -4,11 +4,11 @@ function* g(): IterableIterator<(x: string) => number> { >x : string yield * { ->yield * { *[Symbol.iterator]() { yield x => x.length; } } : any ->{ *[Symbol.iterator]() { yield x => x.length; } } : { [Symbol.iterator](): IterableIterator<(x: string) => number>; } +>yield * { *[Symbol.iterator]() { yield x => x.length; } } : void +>{ *[Symbol.iterator]() { yield x => x.length; } } : { [Symbol.iterator](): Generator<(x: string) => number, void, unknown>; } *[Symbol.iterator]() { ->[Symbol.iterator] : () => IterableIterator<(x: string) => number> +>[Symbol.iterator] : () => Generator<(x: string) => number, void, unknown> >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/generatorTypeCheck29.types b/tests/baselines/reference/generatorTypeCheck29.types index 48a32f65e37..0ce49791a22 100644 --- a/tests/baselines/reference/generatorTypeCheck29.types +++ b/tests/baselines/reference/generatorTypeCheck29.types @@ -1,12 +1,12 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck29.ts === function* g2(): Iterator number>> { ->g2 : () => Iterator number>> +>g2 : () => Iterator number>, any, undefined> >x : string yield function* () { ->yield function* () { yield x => x.length; } () : any ->function* () { yield x => x.length; } () : IterableIterator<(x: any) => any> ->function* () { yield x => x.length; } : () => IterableIterator<(x: any) => any> +>yield function* () { yield x => x.length; } () : undefined +>function* () { yield x => x.length; } () : Generator<(x: any) => any, void, unknown> +>function* () { yield x => x.length; } : () => Generator<(x: any) => any, void, unknown> yield x => x.length; >yield x => x.length : any diff --git a/tests/baselines/reference/generatorTypeCheck30.types b/tests/baselines/reference/generatorTypeCheck30.types index 2e4971770f3..094ed3bf337 100644 --- a/tests/baselines/reference/generatorTypeCheck30.types +++ b/tests/baselines/reference/generatorTypeCheck30.types @@ -1,12 +1,12 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck30.ts === function* g2(): Iterator number>> { ->g2 : () => Iterator number>> +>g2 : () => Iterator number>, any, undefined> >x : string yield function* () { ->yield function* () { yield x => x.length; } () : any ->function* () { yield x => x.length; } () : IterableIterator<(x: any) => any> ->function* () { yield x => x.length; } : () => IterableIterator<(x: any) => any> +>yield function* () { yield x => x.length; } () : undefined +>function* () { yield x => x.length; } () : Generator<(x: any) => any, void, unknown> +>function* () { yield x => x.length; } : () => Generator<(x: any) => any, void, unknown> yield x => x.length; >yield x => x.length : any diff --git a/tests/baselines/reference/generatorTypeCheck31.errors.txt b/tests/baselines/reference/generatorTypeCheck31.errors.txt index 437b7470069..0ed5dcbe0e0 100644 --- a/tests/baselines/reference/generatorTypeCheck31.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck31.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck31.ts(2,11): error TS2322: Type 'IterableIterator<(x: any) => any>' is not assignable to type '() => Iterable<(x: string) => number>'. - Type 'IterableIterator<(x: any) => any>' provides no match for the signature '(): Iterable<(x: string) => number>'. +tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck31.ts(2,11): error TS2322: Type 'Generator<(x: any) => any, void, unknown>' is not assignable to type '() => Iterable<(x: string) => number>'. + Type 'Generator<(x: any) => any, void, unknown>' provides no match for the signature '(): Iterable<(x: string) => number>'. ==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck31.ts (1 errors) ==== @@ -10,6 +10,6 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck31.ts(2,11): erro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } () ~~~~~~~~ -!!! error TS2322: Type 'IterableIterator<(x: any) => any>' is not assignable to type '() => Iterable<(x: string) => number>'. -!!! error TS2322: Type 'IterableIterator<(x: any) => any>' provides no match for the signature '(): Iterable<(x: string) => number>'. +!!! error TS2322: Type 'Generator<(x: any) => any, void, unknown>' is not assignable to type '() => Iterable<(x: string) => number>'. +!!! error TS2322: Type 'Generator<(x: any) => any, void, unknown>' provides no match for the signature '(): Iterable<(x: string) => number>'. } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck31.types b/tests/baselines/reference/generatorTypeCheck31.types index 2038b2ee1c2..c15eab96fe9 100644 --- a/tests/baselines/reference/generatorTypeCheck31.types +++ b/tests/baselines/reference/generatorTypeCheck31.types @@ -1,12 +1,12 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck31.ts === function* g2(): Iterator<() => Iterable<(x: string) => number>> { ->g2 : () => Iterator<() => Iterable<(x: string) => number>> +>g2 : () => Iterator<() => Iterable<(x: string) => number>, any, undefined> >x : string yield function* () { ->yield function* () { yield x => x.length; } () : any ->function* () { yield x => x.length; } () : IterableIterator<(x: any) => any> ->function* () { yield x => x.length; } : () => IterableIterator<(x: any) => any> +>yield function* () { yield x => x.length; } () : undefined +>function* () { yield x => x.length; } () : Generator<(x: any) => any, void, unknown> +>function* () { yield x => x.length; } : () => Generator<(x: any) => any, void, unknown> yield x => x.length; >yield x => x.length : any diff --git a/tests/baselines/reference/generatorTypeCheck33.types b/tests/baselines/reference/generatorTypeCheck33.types index d6b29936530..e894b44a4e3 100644 --- a/tests/baselines/reference/generatorTypeCheck33.types +++ b/tests/baselines/reference/generatorTypeCheck33.types @@ -1,13 +1,13 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck33.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator yield 0; >yield 0 : any >0 : 0 function* g2() { ->g2 : () => IterableIterator +>g2 : () => Generator yield ""; >yield "" : any diff --git a/tests/baselines/reference/generatorTypeCheck34.types b/tests/baselines/reference/generatorTypeCheck34.types index f25eefb72f7..5e2e6af134c 100644 --- a/tests/baselines/reference/generatorTypeCheck34.types +++ b/tests/baselines/reference/generatorTypeCheck34.types @@ -1,13 +1,13 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck34.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator yield 0; >yield 0 : any >0 : 0 function* g2() { ->g2 : () => IterableIterator +>g2 : () => Generator return ""; >"" : "" diff --git a/tests/baselines/reference/generatorTypeCheck35.types b/tests/baselines/reference/generatorTypeCheck35.types index 333b653a501..b35139b9c16 100644 --- a/tests/baselines/reference/generatorTypeCheck35.types +++ b/tests/baselines/reference/generatorTypeCheck35.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck35.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator yield 0; >yield 0 : any diff --git a/tests/baselines/reference/generatorTypeCheck36.types b/tests/baselines/reference/generatorTypeCheck36.types index 318a46c25fb..9cebc9a407f 100644 --- a/tests/baselines/reference/generatorTypeCheck36.types +++ b/tests/baselines/reference/generatorTypeCheck36.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck36.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator yield yield 0; >yield yield 0 : any diff --git a/tests/baselines/reference/generatorTypeCheck37.types b/tests/baselines/reference/generatorTypeCheck37.types index aaa790c8094..d9c28b941dd 100644 --- a/tests/baselines/reference/generatorTypeCheck37.types +++ b/tests/baselines/reference/generatorTypeCheck37.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck37.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator return yield yield 0; >yield yield 0 : any diff --git a/tests/baselines/reference/generatorTypeCheck38.types b/tests/baselines/reference/generatorTypeCheck38.types index 15b8528b345..a62587603d4 100644 --- a/tests/baselines/reference/generatorTypeCheck38.types +++ b/tests/baselines/reference/generatorTypeCheck38.types @@ -3,7 +3,7 @@ var yield; >yield : any function* g() { ->g : () => IterableIterator +>g : () => Generator yield 0; >yield 0 : any diff --git a/tests/baselines/reference/generatorTypeCheck39.types b/tests/baselines/reference/generatorTypeCheck39.types index e24fc173566..5ca4062b558 100644 --- a/tests/baselines/reference/generatorTypeCheck39.types +++ b/tests/baselines/reference/generatorTypeCheck39.types @@ -8,7 +8,7 @@ function decorator(x: any) { >y : any } function* g() { ->g : () => IterableIterator +>g : () => Generator @decorator(yield 0) >decorator(yield 0) : (y: any) => void diff --git a/tests/baselines/reference/generatorTypeCheck40.types b/tests/baselines/reference/generatorTypeCheck40.types index cbec14d36d6..4e774158175 100644 --- a/tests/baselines/reference/generatorTypeCheck40.types +++ b/tests/baselines/reference/generatorTypeCheck40.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck40.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator class C extends (yield 0) { } >C : C diff --git a/tests/baselines/reference/generatorTypeCheck41.types b/tests/baselines/reference/generatorTypeCheck41.types index 5f20d017655..d22c875416f 100644 --- a/tests/baselines/reference/generatorTypeCheck41.types +++ b/tests/baselines/reference/generatorTypeCheck41.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck41.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator let x = { >x : { [x: number]: number; } diff --git a/tests/baselines/reference/generatorTypeCheck42.types b/tests/baselines/reference/generatorTypeCheck42.types index 47d948739f1..f3e82ad1a98 100644 --- a/tests/baselines/reference/generatorTypeCheck42.types +++ b/tests/baselines/reference/generatorTypeCheck42.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck42.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator let x = { >x : { [x: number]: () => void; } diff --git a/tests/baselines/reference/generatorTypeCheck43.types b/tests/baselines/reference/generatorTypeCheck43.types index 298c631728e..cdf5cdc81bb 100644 --- a/tests/baselines/reference/generatorTypeCheck43.types +++ b/tests/baselines/reference/generatorTypeCheck43.types @@ -1,13 +1,13 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck43.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator let x = { ->x : { [x: number]: () => IterableIterator; } ->{ *[yield 0]() { } } : { [x: number]: () => IterableIterator; } +>x : { [x: number]: () => Generator; } +>{ *[yield 0]() { } } : { [x: number]: () => Generator; } *[yield 0]() { ->[yield 0] : () => IterableIterator +>[yield 0] : () => Generator >yield 0 : any >0 : 0 diff --git a/tests/baselines/reference/generatorTypeCheck44.types b/tests/baselines/reference/generatorTypeCheck44.types index 38b335f1ab4..53dfd59266e 100644 --- a/tests/baselines/reference/generatorTypeCheck44.types +++ b/tests/baselines/reference/generatorTypeCheck44.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck44.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator let x = { >x : { [x: number]: number; } diff --git a/tests/baselines/reference/generatorTypeCheck45.types b/tests/baselines/reference/generatorTypeCheck45.types index 59ee8efa9f3..cf409241947 100644 --- a/tests/baselines/reference/generatorTypeCheck45.types +++ b/tests/baselines/reference/generatorTypeCheck45.types @@ -1,17 +1,17 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck45.ts === declare function foo(x: T, fun: () => Iterator<(x: T) => U>, fun2: (y: U) => T): T; ->foo : (x: T, fun: () => Iterator<(x: T) => U>, fun2: (y: U) => T) => T +>foo : (x: T, fun: () => Iterator<(x: T) => U, any, undefined>, fun2: (y: U) => T) => T >x : T ->fun : () => Iterator<(x: T) => U> +>fun : () => Iterator<(x: T) => U, any, undefined> >x : T >fun2 : (y: U) => T >y : U foo("", function* () { yield x => x.length }, p => undefined); // T is fixed, should be string >foo("", function* () { yield x => x.length }, p => undefined) : string ->foo : (x: T, fun: () => Iterator<(x: T) => U>, fun2: (y: U) => T) => T +>foo : (x: T, fun: () => Iterator<(x: T) => U, any, undefined>, fun2: (y: U) => T) => T >"" : "" ->function* () { yield x => x.length } : () => IterableIterator<(x: string) => number> +>function* () { yield x => x.length } : () => Generator<(x: string) => number, void, unknown> >yield x => x.length : any >x => x.length : (x: string) => number >x : string diff --git a/tests/baselines/reference/generatorTypeCheck46.types b/tests/baselines/reference/generatorTypeCheck46.types index 81002c761d9..cd565d55911 100644 --- a/tests/baselines/reference/generatorTypeCheck46.types +++ b/tests/baselines/reference/generatorTypeCheck46.types @@ -11,14 +11,14 @@ foo("", function* () { >foo("", function* () { yield* { *[Symbol.iterator]() { yield x => x.length } }}, p => undefined) : string >foo : (x: T, fun: () => Iterable<(x: T) => U>, fun2: (y: U) => T) => T >"" : "" ->function* () { yield* { *[Symbol.iterator]() { yield x => x.length } }} : () => IterableIterator<(x: string) => number> +>function* () { yield* { *[Symbol.iterator]() { yield x => x.length } }} : () => Generator<(x: string) => number, void, unknown> yield* { ->yield* { *[Symbol.iterator]() { yield x => x.length } } : any ->{ *[Symbol.iterator]() { yield x => x.length } } : { [Symbol.iterator](): IterableIterator<(x: string) => number>; } +>yield* { *[Symbol.iterator]() { yield x => x.length } } : void +>{ *[Symbol.iterator]() { yield x => x.length } } : { [Symbol.iterator](): Generator<(x: string) => number, void, unknown>; } *[Symbol.iterator]() { ->[Symbol.iterator] : () => IterableIterator<(x: string) => number> +>[Symbol.iterator] : () => Generator<(x: string) => number, void, unknown> >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/generatorTypeCheck47.errors.txt b/tests/baselines/reference/generatorTypeCheck47.errors.txt deleted file mode 100644 index 993285179bc..00000000000 --- a/tests/baselines/reference/generatorTypeCheck47.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck47.ts(1,9): error TS7025: Generator implicitly has type 'IterableIterator' because it does not yield any values. Consider supplying a return type. - - -==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck47.ts (1 errors) ==== - function* g() { } - ~ -!!! error TS7025: Generator implicitly has type 'IterableIterator' because it does not yield any values. Consider supplying a return type. \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck47.types b/tests/baselines/reference/generatorTypeCheck47.types index d37512af0ac..d5e92f02a87 100644 --- a/tests/baselines/reference/generatorTypeCheck47.types +++ b/tests/baselines/reference/generatorTypeCheck47.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck47.ts === function* g() { } ->g : () => IterableIterator +>g : () => Generator diff --git a/tests/baselines/reference/generatorTypeCheck48.errors.txt b/tests/baselines/reference/generatorTypeCheck48.errors.txt index a3a9706175f..e1c98d4f275 100644 --- a/tests/baselines/reference/generatorTypeCheck48.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck48.errors.txt @@ -1,17 +1,17 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck48.ts(1,11): error TS7010: 'g', which lacks return-type annotation, implicitly has an 'any' return type. -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck48.ts(5,11): error TS7010: 'h', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck48.ts(1,11): error TS7055: 'g', which lacks return-type annotation, implicitly has an 'any' yield type. +tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck48.ts(5,11): error TS7055: 'h', which lacks return-type annotation, implicitly has an 'any' yield type. ==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck48.ts (2 errors) ==== function* g() { ~ -!!! error TS7010: 'g', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7055: 'g', which lacks return-type annotation, implicitly has an 'any' yield type. yield; } function* h() { ~ -!!! error TS7010: 'h', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7055: 'h', which lacks return-type annotation, implicitly has an 'any' yield type. yield undefined; } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck48.types b/tests/baselines/reference/generatorTypeCheck48.types index f07131595cd..23134d50bee 100644 --- a/tests/baselines/reference/generatorTypeCheck48.types +++ b/tests/baselines/reference/generatorTypeCheck48.types @@ -1,13 +1,13 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck48.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator yield; >yield : any } function* h() { ->h : () => IterableIterator +>h : () => Generator yield undefined; >yield undefined : any diff --git a/tests/baselines/reference/generatorTypeCheck49.types b/tests/baselines/reference/generatorTypeCheck49.types index f73978d1a09..985194b7392 100644 --- a/tests/baselines/reference/generatorTypeCheck49.types +++ b/tests/baselines/reference/generatorTypeCheck49.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck49.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator yield 0; >yield 0 : any diff --git a/tests/baselines/reference/generatorTypeCheck50.types b/tests/baselines/reference/generatorTypeCheck50.types index 1b25ea004f8..fa4561d16a1 100644 --- a/tests/baselines/reference/generatorTypeCheck50.types +++ b/tests/baselines/reference/generatorTypeCheck50.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck50.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator yield yield; >yield yield : any diff --git a/tests/baselines/reference/generatorTypeCheck51.errors.txt b/tests/baselines/reference/generatorTypeCheck51.errors.txt deleted file mode 100644 index b717b51803e..00000000000 --- a/tests/baselines/reference/generatorTypeCheck51.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck51.ts(1,9): error TS7025: Generator implicitly has type 'IterableIterator' because it does not yield any values. Consider supplying a return type. - - -==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck51.ts (1 errors) ==== - function* g() { - ~ -!!! error TS7025: Generator implicitly has type 'IterableIterator' because it does not yield any values. Consider supplying a return type. - function* h() { - yield 0; - } - } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck51.types b/tests/baselines/reference/generatorTypeCheck51.types index 1563ee5e7d3..0ef7abf19cd 100644 --- a/tests/baselines/reference/generatorTypeCheck51.types +++ b/tests/baselines/reference/generatorTypeCheck51.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck51.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator function* h() { ->h : () => IterableIterator +>h : () => Generator yield 0; >yield 0 : any diff --git a/tests/baselines/reference/generatorTypeCheck52.types b/tests/baselines/reference/generatorTypeCheck52.types index 97ac442aa0e..30ef8611f69 100644 --- a/tests/baselines/reference/generatorTypeCheck52.types +++ b/tests/baselines/reference/generatorTypeCheck52.types @@ -8,7 +8,7 @@ class Baz { z: number } >z : number function* g() { ->g : () => IterableIterator +>g : () => Generator yield new Foo; >yield new Foo : any diff --git a/tests/baselines/reference/generatorTypeCheck53.types b/tests/baselines/reference/generatorTypeCheck53.types index b91974e9807..47972eec714 100644 --- a/tests/baselines/reference/generatorTypeCheck53.types +++ b/tests/baselines/reference/generatorTypeCheck53.types @@ -8,7 +8,7 @@ class Baz { z: number } >z : number function* g() { ->g : () => IterableIterator +>g : () => Generator yield new Foo; >yield new Foo : any diff --git a/tests/baselines/reference/generatorTypeCheck54.types b/tests/baselines/reference/generatorTypeCheck54.types index 1cdbde67498..6e91f4be51a 100644 --- a/tests/baselines/reference/generatorTypeCheck54.types +++ b/tests/baselines/reference/generatorTypeCheck54.types @@ -8,7 +8,7 @@ class Baz { z: number } >z : number function* g() { ->g : () => IterableIterator +>g : () => Generator yield* [new Foo]; >yield* [new Foo] : any diff --git a/tests/baselines/reference/generatorTypeCheck55.types b/tests/baselines/reference/generatorTypeCheck55.types index c45f1690131..15c3303b438 100644 --- a/tests/baselines/reference/generatorTypeCheck55.types +++ b/tests/baselines/reference/generatorTypeCheck55.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck55.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator var x = class C extends (yield) {}; >x : typeof C diff --git a/tests/baselines/reference/generatorTypeCheck56.types b/tests/baselines/reference/generatorTypeCheck56.types index 718e5d0d792..6f05396a1f1 100644 --- a/tests/baselines/reference/generatorTypeCheck56.types +++ b/tests/baselines/reference/generatorTypeCheck56.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck56.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator var x = class C { >x : typeof C @@ -8,7 +8,7 @@ function* g() { >C : typeof C *[yield 0]() { ->[yield 0] : () => IterableIterator +>[yield 0] : () => Generator >yield 0 : any >0 : 0 diff --git a/tests/baselines/reference/generatorTypeCheck57.types b/tests/baselines/reference/generatorTypeCheck57.types index b852efe62f4..9e660521dfb 100644 --- a/tests/baselines/reference/generatorTypeCheck57.types +++ b/tests/baselines/reference/generatorTypeCheck57.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck57.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator class C { >C : C diff --git a/tests/baselines/reference/generatorTypeCheck58.types b/tests/baselines/reference/generatorTypeCheck58.types index a04691cb4ba..69d1723be96 100644 --- a/tests/baselines/reference/generatorTypeCheck58.types +++ b/tests/baselines/reference/generatorTypeCheck58.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck58.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator class C { >C : C diff --git a/tests/baselines/reference/generatorTypeCheck59.types b/tests/baselines/reference/generatorTypeCheck59.types index 35b9b7e66f1..d04b829fba8 100644 --- a/tests/baselines/reference/generatorTypeCheck59.types +++ b/tests/baselines/reference/generatorTypeCheck59.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck59.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator class C { >C : C diff --git a/tests/baselines/reference/generatorTypeCheck6.errors.txt b/tests/baselines/reference/generatorTypeCheck6.errors.txt index 35f2cc2016d..a9eca26ca4f 100644 --- a/tests/baselines/reference/generatorTypeCheck6.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck6.ts(1,17): error TS2322: Type 'IterableIterator' is not assignable to type 'number'. +tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck6.ts(1,17): error TS2322: Type 'Generator' is not assignable to type 'number'. ==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck6.ts (1 errors) ==== function* g1(): number { } ~~~~~~ -!!! error TS2322: Type 'IterableIterator' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'Generator' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck60.types b/tests/baselines/reference/generatorTypeCheck60.types index 9073f604be6..b10101b6f41 100644 --- a/tests/baselines/reference/generatorTypeCheck60.types +++ b/tests/baselines/reference/generatorTypeCheck60.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck60.ts === function* g() { ->g : () => IterableIterator +>g : () => Generator class C extends (yield) {}; >C : C diff --git a/tests/baselines/reference/generatorTypeCheck61.types b/tests/baselines/reference/generatorTypeCheck61.types index a8093e1bbe1..91874ffa58d 100644 --- a/tests/baselines/reference/generatorTypeCheck61.types +++ b/tests/baselines/reference/generatorTypeCheck61.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck61.ts === function * g() { ->g : () => IterableIterator +>g : () => Generator @(yield 0) >(yield 0) : any diff --git a/tests/baselines/reference/generatorTypeCheck62.types b/tests/baselines/reference/generatorTypeCheck62.types index 90d34fa8513..be5635a07fc 100644 --- a/tests/baselines/reference/generatorTypeCheck62.types +++ b/tests/baselines/reference/generatorTypeCheck62.types @@ -12,7 +12,7 @@ export function strategy(stratName: string, gen: (a: T >a : T return function*(state) { ->function*(state) { for (const next of gen(state)) { if (next) { next.lastStrategyApplied = stratName; } yield next; } } : (state: T) => IterableIterator +>function*(state) { for (const next of gen(state)) { if (next) { next.lastStrategyApplied = stratName; } yield next; } } : (state: T) => Generator >state : T for (const next of gen(state)) { @@ -53,7 +53,7 @@ export const Nothing1: Strategy = strategy("Nothing", function*(state: St >strategy("Nothing", function*(state: State) { return state;}) : (a: State) => IterableIterator >strategy : (stratName: string, gen: (a: T) => IterableIterator) => (a: T) => IterableIterator >"Nothing" : "Nothing" ->function*(state: State) { return state;} : (state: State) => IterableIterator +>function*(state: State) { return state;} : (state: State) => Generator >state : State return state; @@ -66,7 +66,7 @@ export const Nothing2: Strategy = strategy("Nothing", function*(state: St >strategy("Nothing", function*(state: State) { yield state;}) : (a: State) => IterableIterator >strategy : (stratName: string, gen: (a: T) => IterableIterator) => (a: T) => IterableIterator >"Nothing" : "Nothing" ->function*(state: State) { yield state;} : (state: State) => IterableIterator +>function*(state: State) { yield state;} : (state: State) => Generator >state : State yield state; @@ -77,10 +77,10 @@ export const Nothing2: Strategy = strategy("Nothing", function*(state: St export const Nothing3: Strategy = strategy("Nothing", function* (state: State) { >Nothing3 : Strategy ->strategy("Nothing", function* (state: State) { yield ; return state;}) : (a: State) => IterableIterator +>strategy("Nothing", function* (state: State) { yield ; return state;}) : (a: any) => IterableIterator >strategy : (stratName: string, gen: (a: T) => IterableIterator) => (a: T) => IterableIterator >"Nothing" : "Nothing" ->function* (state: State) { yield ; return state;} : (state: State) => IterableIterator +>function* (state: State) { yield ; return state;} : (state: State) => Generator >state : State yield ; diff --git a/tests/baselines/reference/generatorTypeCheck63.errors.txt b/tests/baselines/reference/generatorTypeCheck63.errors.txt index 2a1935fd906..f77488edc4d 100644 --- a/tests/baselines/reference/generatorTypeCheck63.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck63.errors.txt @@ -1,16 +1,14 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts(24,61): error TS2345: Argument of type '(state: State) => IterableIterator' is not assignable to parameter of type '(a: StrategicState) => IterableIterator'. - Type 'IterableIterator' is not assignable to type 'IterableIterator'. - Type 'State | 1' is not assignable to type 'StrategicState'. - Type '1' has no properties in common with type 'StrategicState'. -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts(29,70): error TS7025: Generator implicitly has type 'IterableIterator' because it does not yield any values. Consider supplying a return type. -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts(32,62): error TS2345: Argument of type '(state: State) => IterableIterator' is not assignable to parameter of type '(a: State) => IterableIterator'. - Type 'IterableIterator' is not assignable to type 'IterableIterator'. - Type 'number' is not assignable to type 'State'. -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts(36,62): error TS2345: Argument of type '(state: State) => IterableIterator' is not assignable to parameter of type '(a: StrategicState) => IterableIterator'. - Type 'IterableIterator' is not assignable to type 'IterableIterator'. +tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts(24,61): error TS2345: Argument of type '(state: State) => Generator' is not assignable to parameter of type '(a: State) => IterableIterator'. + Type 'Generator' is not assignable to type 'IterableIterator'. + Types of property 'next' are incompatible. + Type '(...args: [] | [unknown]) => IteratorResult' is not assignable to type '(...args: [] | [undefined]) => IteratorResult'. + Type 'IteratorResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. + Type 'number' is not assignable to type 'State'. -==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts (4 errors) ==== +==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts (1 errors) ==== export interface StrategicState { lastStrategyApplied?: string; } @@ -36,31 +34,26 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts(36,62): err export const Nothing: Strategy = strategy("Nothing", function* (state: State) { ~~~~~~~~ -!!! error TS2345: Argument of type '(state: State) => IterableIterator' is not assignable to parameter of type '(a: StrategicState) => IterableIterator'. -!!! error TS2345: Type 'IterableIterator' is not assignable to type 'IterableIterator'. -!!! error TS2345: Type 'State | 1' is not assignable to type 'StrategicState'. -!!! error TS2345: Type '1' has no properties in common with type 'StrategicState'. +!!! error TS2345: Argument of type '(state: State) => Generator' is not assignable to parameter of type '(a: State) => IterableIterator'. +!!! error TS2345: Type 'Generator' is not assignable to type 'IterableIterator'. +!!! error TS2345: Types of property 'next' are incompatible. +!!! error TS2345: Type '(...args: [] | [unknown]) => IteratorResult' is not assignable to type '(...args: [] | [undefined]) => IteratorResult'. +!!! error TS2345: Type 'IteratorResult' is not assignable to type 'IteratorResult'. +!!! error TS2345: Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. +!!! error TS2345: Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. +!!! error TS2345: Type 'number' is not assignable to type 'State'. yield 1; return state; }); export const Nothing1: Strategy = strategy("Nothing", function* (state: State) { - ~ -!!! error TS7025: Generator implicitly has type 'IterableIterator' because it does not yield any values. Consider supplying a return type. }); export const Nothing2: Strategy = strategy("Nothing", function* (state: State) { - ~~~~~~~~ -!!! error TS2345: Argument of type '(state: State) => IterableIterator' is not assignable to parameter of type '(a: State) => IterableIterator'. -!!! error TS2345: Type 'IterableIterator' is not assignable to type 'IterableIterator'. -!!! error TS2345: Type 'number' is not assignable to type 'State'. return 1; }); export const Nothing3: Strategy = strategy("Nothing", function* (state: State) { - ~~~~~~~~ -!!! error TS2345: Argument of type '(state: State) => IterableIterator' is not assignable to parameter of type '(a: StrategicState) => IterableIterator'. -!!! error TS2345: Type 'IterableIterator' is not assignable to type 'IterableIterator'. yield state; return 1; }); \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck63.types b/tests/baselines/reference/generatorTypeCheck63.types index 67f9717162d..8a1d03dcb16 100644 --- a/tests/baselines/reference/generatorTypeCheck63.types +++ b/tests/baselines/reference/generatorTypeCheck63.types @@ -12,7 +12,7 @@ export function strategy(stratName: string, gen: (a: T >a : T return function*(state) { ->function*(state) { for (const next of gen(state)) { if (next) { next.lastStrategyApplied = stratName; } yield next; } } : (state: T) => IterableIterator +>function*(state) { for (const next of gen(state)) { if (next) { next.lastStrategyApplied = stratName; } yield next; } } : (state: T) => Generator >state : T for (const next of gen(state)) { @@ -53,7 +53,7 @@ export const Nothing: Strategy = strategy("Nothing", function* (state: St >strategy("Nothing", function* (state: State) { yield 1; return state;}) : any >strategy : (stratName: string, gen: (a: T) => IterableIterator) => (a: T) => IterableIterator >"Nothing" : "Nothing" ->function* (state: State) { yield 1; return state;} : (state: State) => IterableIterator +>function* (state: State) { yield 1; return state;} : (state: State) => Generator >state : State yield 1; @@ -67,20 +67,20 @@ export const Nothing: Strategy = strategy("Nothing", function* (state: St export const Nothing1: Strategy = strategy("Nothing", function* (state: State) { >Nothing1 : Strategy ->strategy("Nothing", function* (state: State) {}) : (a: any) => IterableIterator +>strategy("Nothing", function* (state: State) {}) : (a: State) => IterableIterator >strategy : (stratName: string, gen: (a: T) => IterableIterator) => (a: T) => IterableIterator >"Nothing" : "Nothing" ->function* (state: State) {} : (state: State) => IterableIterator +>function* (state: State) {} : (state: State) => Generator >state : State }); export const Nothing2: Strategy = strategy("Nothing", function* (state: State) { >Nothing2 : Strategy ->strategy("Nothing", function* (state: State) { return 1;}) : any +>strategy("Nothing", function* (state: State) { return 1;}) : (a: State) => IterableIterator >strategy : (stratName: string, gen: (a: T) => IterableIterator) => (a: T) => IterableIterator >"Nothing" : "Nothing" ->function* (state: State) { return 1;} : (state: State) => IterableIterator +>function* (state: State) { return 1;} : (state: State) => Generator >state : State return 1; @@ -90,10 +90,10 @@ export const Nothing2: Strategy = strategy("Nothing", function* (state: S export const Nothing3: Strategy = strategy("Nothing", function* (state: State) { >Nothing3 : Strategy ->strategy("Nothing", function* (state: State) { yield state; return 1;}) : any +>strategy("Nothing", function* (state: State) { yield state; return 1;}) : (a: State) => IterableIterator >strategy : (stratName: string, gen: (a: T) => IterableIterator) => (a: T) => IterableIterator >"Nothing" : "Nothing" ->function* (state: State) { yield state; return 1;} : (state: State) => IterableIterator +>function* (state: State) { yield state; return 1;} : (state: State) => Generator >state : State yield state; diff --git a/tests/baselines/reference/generatorTypeCheck7.errors.txt b/tests/baselines/reference/generatorTypeCheck7.errors.txt index 96e226fe827..fb17027bf3b 100644 --- a/tests/baselines/reference/generatorTypeCheck7.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck7.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck7.ts(4,17): error TS2741: Property 'hello' is missing in type 'IterableIterator' but required in type 'WeirdIter'. +tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck7.ts(4,17): error TS2741: Property 'hello' is missing in type 'Generator' but required in type 'WeirdIter'. ==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck7.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck7.ts(4,17): error } function* g1(): WeirdIter { } ~~~~~~~~~ -!!! error TS2741: Property 'hello' is missing in type 'IterableIterator' but required in type 'WeirdIter'. +!!! error TS2741: Property 'hello' is missing in type 'Generator' but required in type 'WeirdIter'. !!! related TS2728 tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck7.ts:2:5: 'hello' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck8.errors.txt b/tests/baselines/reference/generatorTypeCheck8.errors.txt index cedfecda60b..6261d419ddd 100644 --- a/tests/baselines/reference/generatorTypeCheck8.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck8.errors.txt @@ -1,16 +1,20 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck8.ts(2,17): error TS2322: Type 'IterableIterator' is not assignable to type 'BadGenerator'. +tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck8.ts(2,17): error TS2322: Type 'Generator' is not assignable to type 'BadGenerator'. Types of property 'next' are incompatible. - Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. - Type 'IteratorResult' is not assignable to type 'IteratorResult'. - Type 'string' is not assignable to type 'number'. + Type '(...args: [] | [undefined]) => IteratorResult' is not assignable to type '(...args: [] | [undefined]) => IteratorResult'. + Type 'IteratorResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck8.ts (1 errors) ==== interface BadGenerator extends Iterator, Iterable { } function* g3(): BadGenerator { } ~~~~~~~~~~~~ -!!! error TS2322: Type 'IterableIterator' is not assignable to type 'BadGenerator'. +!!! error TS2322: Type 'Generator' is not assignable to type 'BadGenerator'. !!! error TS2322: Types of property 'next' are incompatible. -!!! error TS2322: Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. -!!! error TS2322: Type 'IteratorResult' is not assignable to type 'IteratorResult'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type '(...args: [] | [undefined]) => IteratorResult' is not assignable to type '(...args: [] | [undefined]) => IteratorResult'. +!!! error TS2322: Type 'IteratorResult' is not assignable to type 'IteratorResult'. +!!! error TS2322: Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. +!!! error TS2322: Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.types b/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.types index f932f2c339d..b5f526adc8e 100644 --- a/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.types +++ b/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.types @@ -93,7 +93,7 @@ var p3: Promise = import(j=getSpecifier()); >getSpecifier : () => string function * loadModule(directories: string[]) { ->loadModule : (directories: string[]) => IterableIterator +>loadModule : (directories: string[]) => Generator >directories : string[] for (const directory of directories) { diff --git a/tests/baselines/reference/importHelpersNoHelpersForAsyncGenerators.types b/tests/baselines/reference/importHelpersNoHelpersForAsyncGenerators.types index cb646e5a15e..da4e9fb704d 100644 --- a/tests/baselines/reference/importHelpersNoHelpersForAsyncGenerators.types +++ b/tests/baselines/reference/importHelpersNoHelpersForAsyncGenerators.types @@ -1,6 +1,6 @@ === tests/cases/compiler/main.ts === export async function * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator await 1; >await 1 : 1 diff --git a/tests/baselines/reference/iteratorSpreadInArray9.errors.txt b/tests/baselines/reference/iteratorSpreadInArray9.errors.txt deleted file mode 100644 index b1278354ba2..00000000000 --- a/tests/baselines/reference/iteratorSpreadInArray9.errors.txt +++ /dev/null @@ -1,32 +0,0 @@ -tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts(13,17): error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterable'. - Types of property '[Symbol.iterator]' are incompatible. - Type '() => SymbolIterator' is not assignable to type '() => Iterator'. - Type 'SymbolIterator' is not assignable to type 'Iterator'. - Types of property 'next' are incompatible. - Type '() => { value: symbol; }' is not assignable to type '(value?: any) => IteratorResult'. - Property 'done' is missing in type '{ value: symbol; }' but required in type 'IteratorResult'. - - -==== tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts (1 errors) ==== - class SymbolIterator { - next() { - return { - value: Symbol() - }; - } - - [Symbol.iterator]() { - return this; - } - } - - var array = [...new SymbolIterator]; - ~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterable'. -!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible. -!!! error TS2322: Type '() => SymbolIterator' is not assignable to type '() => Iterator'. -!!! error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterator'. -!!! error TS2322: Types of property 'next' are incompatible. -!!! error TS2322: Type '() => { value: symbol; }' is not assignable to type '(value?: any) => IteratorResult'. -!!! error TS2322: Property 'done' is missing in type '{ value: symbol; }' but required in type 'IteratorResult'. -!!! related TS2728 /.ts/lib.es2015.iterable.d.ts:32:5: 'done' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall12.js b/tests/baselines/reference/iteratorSpreadInCall12.js index ba8149e29d6..10f1a7cf0c7 100644 --- a/tests/baselines/reference/iteratorSpreadInCall12.js +++ b/tests/baselines/reference/iteratorSpreadInCall12.js @@ -16,7 +16,7 @@ class SymbolIterator { } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -29,7 +29,7 @@ class StringIterator { } } -new Foo(...[...new SymbolIterator, ...[...new StringIterator]]); +new Foo(...[...new SymbolIterator, ...[...new _StringIterator]]); //// [iteratorSpreadInCall12.js] class Foo { @@ -46,7 +46,7 @@ class SymbolIterator { return this; } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -57,4 +57,4 @@ class StringIterator { return this; } } -new Foo(...[...new SymbolIterator, ...[...new StringIterator]]); +new Foo(...[...new SymbolIterator, ...[...new _StringIterator]]); diff --git a/tests/baselines/reference/iteratorSpreadInCall12.symbols b/tests/baselines/reference/iteratorSpreadInCall12.symbols index 935f37bef2a..99b4c3a1f32 100644 --- a/tests/baselines/reference/iteratorSpreadInCall12.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall12.symbols @@ -36,11 +36,11 @@ class SymbolIterator { } } -class StringIterator { ->StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall12.ts, 15, 1)) +class _StringIterator { +>_StringIterator : Symbol(_StringIterator, Decl(iteratorSpreadInCall12.ts, 15, 1)) next() { ->next : Symbol(StringIterator.next, Decl(iteratorSpreadInCall12.ts, 17, 22)) +>next : Symbol(_StringIterator.next, Decl(iteratorSpreadInCall12.ts, 17, 23)) return { value: "", @@ -53,18 +53,18 @@ class StringIterator { } [Symbol.iterator]() { ->[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall12.ts, 23, 5)) +>[Symbol.iterator] : Symbol(_StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall12.ts, 23, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) return this; ->this : Symbol(StringIterator, Decl(iteratorSpreadInCall12.ts, 15, 1)) +>this : Symbol(_StringIterator, Decl(iteratorSpreadInCall12.ts, 15, 1)) } } -new Foo(...[...new SymbolIterator, ...[...new StringIterator]]); +new Foo(...[...new SymbolIterator, ...[...new _StringIterator]]); >Foo : Symbol(Foo, Decl(iteratorSpreadInCall12.ts, 0, 0)) >SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall12.ts, 2, 1)) ->StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall12.ts, 15, 1)) +>_StringIterator : Symbol(_StringIterator, Decl(iteratorSpreadInCall12.ts, 15, 1)) diff --git a/tests/baselines/reference/iteratorSpreadInCall12.types b/tests/baselines/reference/iteratorSpreadInCall12.types index 5e3d2f72236..5f0f0a34cce 100644 --- a/tests/baselines/reference/iteratorSpreadInCall12.types +++ b/tests/baselines/reference/iteratorSpreadInCall12.types @@ -38,8 +38,8 @@ class SymbolIterator { } } -class StringIterator { ->StringIterator : StringIterator +class _StringIterator { +>_StringIterator : _StringIterator next() { >next : () => { value: string; done: boolean; } @@ -69,17 +69,17 @@ class StringIterator { } } -new Foo(...[...new SymbolIterator, ...[...new StringIterator]]); ->new Foo(...[...new SymbolIterator, ...[...new StringIterator]]) : Foo +new Foo(...[...new SymbolIterator, ...[...new _StringIterator]]); +>new Foo(...[...new SymbolIterator, ...[...new _StringIterator]]) : Foo >Foo : typeof Foo ->...[...new SymbolIterator, ...[...new StringIterator]] : string | symbol ->[...new SymbolIterator, ...[...new StringIterator]] : (string | symbol)[] +>...[...new SymbolIterator, ...[...new _StringIterator]] : string | symbol +>[...new SymbolIterator, ...[...new _StringIterator]] : (string | symbol)[] >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator >SymbolIterator : typeof SymbolIterator ->...[...new StringIterator] : string ->[...new StringIterator] : string[] ->...new StringIterator : string ->new StringIterator : StringIterator ->StringIterator : typeof StringIterator +>...[...new _StringIterator] : string +>[...new _StringIterator] : string[] +>...new _StringIterator : string +>new _StringIterator : _StringIterator +>_StringIterator : typeof _StringIterator diff --git a/tests/baselines/reference/iteratorSpreadInCall5.js b/tests/baselines/reference/iteratorSpreadInCall5.js index b17054363ed..b6c3a5c2cfd 100644 --- a/tests/baselines/reference/iteratorSpreadInCall5.js +++ b/tests/baselines/reference/iteratorSpreadInCall5.js @@ -13,7 +13,7 @@ class SymbolIterator { } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -26,7 +26,7 @@ class StringIterator { } } -foo(...new SymbolIterator, ...new StringIterator); +foo(...new SymbolIterator, ...new _StringIterator); //// [iteratorSpreadInCall5.js] function foo(...s) { } @@ -41,7 +41,7 @@ class SymbolIterator { return this; } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -52,4 +52,4 @@ class StringIterator { return this; } } -foo(...new SymbolIterator, ...new StringIterator); +foo(...new SymbolIterator, ...new _StringIterator); diff --git a/tests/baselines/reference/iteratorSpreadInCall5.symbols b/tests/baselines/reference/iteratorSpreadInCall5.symbols index f3be9a28557..a4d55eaf8ce 100644 --- a/tests/baselines/reference/iteratorSpreadInCall5.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall5.symbols @@ -31,11 +31,11 @@ class SymbolIterator { } } -class StringIterator { ->StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall5.ts, 12, 1)) +class _StringIterator { +>_StringIterator : Symbol(_StringIterator, Decl(iteratorSpreadInCall5.ts, 12, 1)) next() { ->next : Symbol(StringIterator.next, Decl(iteratorSpreadInCall5.ts, 14, 22)) +>next : Symbol(_StringIterator.next, Decl(iteratorSpreadInCall5.ts, 14, 23)) return { value: "", @@ -48,18 +48,18 @@ class StringIterator { } [Symbol.iterator]() { ->[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall5.ts, 20, 5)) +>[Symbol.iterator] : Symbol(_StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall5.ts, 20, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) return this; ->this : Symbol(StringIterator, Decl(iteratorSpreadInCall5.ts, 12, 1)) +>this : Symbol(_StringIterator, Decl(iteratorSpreadInCall5.ts, 12, 1)) } } -foo(...new SymbolIterator, ...new StringIterator); +foo(...new SymbolIterator, ...new _StringIterator); >foo : Symbol(foo, Decl(iteratorSpreadInCall5.ts, 0, 0)) >SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall5.ts, 0, 43)) ->StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall5.ts, 12, 1)) +>_StringIterator : Symbol(_StringIterator, Decl(iteratorSpreadInCall5.ts, 12, 1)) diff --git a/tests/baselines/reference/iteratorSpreadInCall5.types b/tests/baselines/reference/iteratorSpreadInCall5.types index 5d70581cacb..6120f036645 100644 --- a/tests/baselines/reference/iteratorSpreadInCall5.types +++ b/tests/baselines/reference/iteratorSpreadInCall5.types @@ -35,8 +35,8 @@ class SymbolIterator { } } -class StringIterator { ->StringIterator : StringIterator +class _StringIterator { +>_StringIterator : _StringIterator next() { >next : () => { value: string; done: boolean; } @@ -66,13 +66,13 @@ class StringIterator { } } -foo(...new SymbolIterator, ...new StringIterator); ->foo(...new SymbolIterator, ...new StringIterator) : void +foo(...new SymbolIterator, ...new _StringIterator); +>foo(...new SymbolIterator, ...new _StringIterator) : void >foo : (...s: (string | symbol)[]) => void >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator >SymbolIterator : typeof SymbolIterator ->...new StringIterator : string ->new StringIterator : StringIterator ->StringIterator : typeof StringIterator +>...new _StringIterator : string +>new _StringIterator : _StringIterator +>_StringIterator : typeof _StringIterator diff --git a/tests/baselines/reference/iteratorSpreadInCall6.errors.txt b/tests/baselines/reference/iteratorSpreadInCall6.errors.txt index 2c89c7bb493..9a25e387be8 100644 --- a/tests/baselines/reference/iteratorSpreadInCall6.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInCall6.errors.txt @@ -16,7 +16,7 @@ tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts(28,28): error TS2345 } } - class StringIterator { + class _StringIterator { next() { return { value: "", @@ -29,6 +29,6 @@ tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts(28,28): error TS2345 } } - foo(...new SymbolIterator, ...new StringIterator); - ~~~~~~~~~~~~~~~~~~~~~ + foo(...new SymbolIterator, ...new _StringIterator); + ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number | symbol'. \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall6.js b/tests/baselines/reference/iteratorSpreadInCall6.js index 161f420ce0e..cf24c0cddfe 100644 --- a/tests/baselines/reference/iteratorSpreadInCall6.js +++ b/tests/baselines/reference/iteratorSpreadInCall6.js @@ -13,7 +13,7 @@ class SymbolIterator { } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -26,7 +26,7 @@ class StringIterator { } } -foo(...new SymbolIterator, ...new StringIterator); +foo(...new SymbolIterator, ...new _StringIterator); //// [iteratorSpreadInCall6.js] function foo(...s) { } @@ -41,7 +41,7 @@ class SymbolIterator { return this; } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -52,4 +52,4 @@ class StringIterator { return this; } } -foo(...new SymbolIterator, ...new StringIterator); +foo(...new SymbolIterator, ...new _StringIterator); diff --git a/tests/baselines/reference/iteratorSpreadInCall6.symbols b/tests/baselines/reference/iteratorSpreadInCall6.symbols index 7eff7628534..b6c02dc570e 100644 --- a/tests/baselines/reference/iteratorSpreadInCall6.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall6.symbols @@ -31,11 +31,11 @@ class SymbolIterator { } } -class StringIterator { ->StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall6.ts, 12, 1)) +class _StringIterator { +>_StringIterator : Symbol(_StringIterator, Decl(iteratorSpreadInCall6.ts, 12, 1)) next() { ->next : Symbol(StringIterator.next, Decl(iteratorSpreadInCall6.ts, 14, 22)) +>next : Symbol(_StringIterator.next, Decl(iteratorSpreadInCall6.ts, 14, 23)) return { value: "", @@ -48,18 +48,18 @@ class StringIterator { } [Symbol.iterator]() { ->[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall6.ts, 20, 5)) +>[Symbol.iterator] : Symbol(_StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall6.ts, 20, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) return this; ->this : Symbol(StringIterator, Decl(iteratorSpreadInCall6.ts, 12, 1)) +>this : Symbol(_StringIterator, Decl(iteratorSpreadInCall6.ts, 12, 1)) } } -foo(...new SymbolIterator, ...new StringIterator); +foo(...new SymbolIterator, ...new _StringIterator); >foo : Symbol(foo, Decl(iteratorSpreadInCall6.ts, 0, 0)) >SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall6.ts, 0, 43)) ->StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall6.ts, 12, 1)) +>_StringIterator : Symbol(_StringIterator, Decl(iteratorSpreadInCall6.ts, 12, 1)) diff --git a/tests/baselines/reference/iteratorSpreadInCall6.types b/tests/baselines/reference/iteratorSpreadInCall6.types index 6a040d25e6d..61994603057 100644 --- a/tests/baselines/reference/iteratorSpreadInCall6.types +++ b/tests/baselines/reference/iteratorSpreadInCall6.types @@ -35,8 +35,8 @@ class SymbolIterator { } } -class StringIterator { ->StringIterator : StringIterator +class _StringIterator { +>_StringIterator : _StringIterator next() { >next : () => { value: string; done: boolean; } @@ -66,13 +66,13 @@ class StringIterator { } } -foo(...new SymbolIterator, ...new StringIterator); ->foo(...new SymbolIterator, ...new StringIterator) : void +foo(...new SymbolIterator, ...new _StringIterator); +>foo(...new SymbolIterator, ...new _StringIterator) : void >foo : (...s: (number | symbol)[]) => void >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator >SymbolIterator : typeof SymbolIterator ->...new StringIterator : string ->new StringIterator : StringIterator ->StringIterator : typeof StringIterator +>...new _StringIterator : string +>new _StringIterator : _StringIterator +>_StringIterator : typeof _StringIterator diff --git a/tests/baselines/reference/iteratorSpreadInCall7.errors.txt b/tests/baselines/reference/iteratorSpreadInCall7.errors.txt index 5494d1e7070..2cb302849cc 100644 --- a/tests/baselines/reference/iteratorSpreadInCall7.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInCall7.errors.txt @@ -16,7 +16,7 @@ tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts(28,28): error TS2345 } } - class StringIterator { + class _StringIterator { next() { return { value: "", @@ -29,6 +29,6 @@ tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts(28,28): error TS2345 } } - foo(...new SymbolIterator, ...new StringIterator); - ~~~~~~~~~~~~~~~~~~~~~ + foo(...new SymbolIterator, ...new _StringIterator); + ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'symbol'. \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall7.js b/tests/baselines/reference/iteratorSpreadInCall7.js index e7c354413df..81fceda02a5 100644 --- a/tests/baselines/reference/iteratorSpreadInCall7.js +++ b/tests/baselines/reference/iteratorSpreadInCall7.js @@ -13,7 +13,7 @@ class SymbolIterator { } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -26,7 +26,7 @@ class StringIterator { } } -foo(...new SymbolIterator, ...new StringIterator); +foo(...new SymbolIterator, ...new _StringIterator); //// [iteratorSpreadInCall7.js] function foo(...s) { return s[0]; } @@ -41,7 +41,7 @@ class SymbolIterator { return this; } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -52,4 +52,4 @@ class StringIterator { return this; } } -foo(...new SymbolIterator, ...new StringIterator); +foo(...new SymbolIterator, ...new _StringIterator); diff --git a/tests/baselines/reference/iteratorSpreadInCall7.symbols b/tests/baselines/reference/iteratorSpreadInCall7.symbols index 98c93f98b64..2c8e523dc4a 100644 --- a/tests/baselines/reference/iteratorSpreadInCall7.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall7.symbols @@ -34,11 +34,11 @@ class SymbolIterator { } } -class StringIterator { ->StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall7.ts, 12, 1)) +class _StringIterator { +>_StringIterator : Symbol(_StringIterator, Decl(iteratorSpreadInCall7.ts, 12, 1)) next() { ->next : Symbol(StringIterator.next, Decl(iteratorSpreadInCall7.ts, 14, 22)) +>next : Symbol(_StringIterator.next, Decl(iteratorSpreadInCall7.ts, 14, 23)) return { value: "", @@ -51,18 +51,18 @@ class StringIterator { } [Symbol.iterator]() { ->[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall7.ts, 20, 5)) +>[Symbol.iterator] : Symbol(_StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall7.ts, 20, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) return this; ->this : Symbol(StringIterator, Decl(iteratorSpreadInCall7.ts, 12, 1)) +>this : Symbol(_StringIterator, Decl(iteratorSpreadInCall7.ts, 12, 1)) } } -foo(...new SymbolIterator, ...new StringIterator); +foo(...new SymbolIterator, ...new _StringIterator); >foo : Symbol(foo, Decl(iteratorSpreadInCall7.ts, 0, 0)) >SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall7.ts, 0, 43)) ->StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall7.ts, 12, 1)) +>_StringIterator : Symbol(_StringIterator, Decl(iteratorSpreadInCall7.ts, 12, 1)) diff --git a/tests/baselines/reference/iteratorSpreadInCall7.types b/tests/baselines/reference/iteratorSpreadInCall7.types index 2f6f0ff06db..d8f820ca804 100644 --- a/tests/baselines/reference/iteratorSpreadInCall7.types +++ b/tests/baselines/reference/iteratorSpreadInCall7.types @@ -38,8 +38,8 @@ class SymbolIterator { } } -class StringIterator { ->StringIterator : StringIterator +class _StringIterator { +>_StringIterator : _StringIterator next() { >next : () => { value: string; done: boolean; } @@ -69,13 +69,13 @@ class StringIterator { } } -foo(...new SymbolIterator, ...new StringIterator); ->foo(...new SymbolIterator, ...new StringIterator) : any +foo(...new SymbolIterator, ...new _StringIterator); +>foo(...new SymbolIterator, ...new _StringIterator) : any >foo : (...s: T[]) => T >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator >SymbolIterator : typeof SymbolIterator ->...new StringIterator : string ->new StringIterator : StringIterator ->StringIterator : typeof StringIterator +>...new _StringIterator : string +>new _StringIterator : _StringIterator +>_StringIterator : typeof _StringIterator diff --git a/tests/baselines/reference/iteratorSpreadInCall8.errors.txt b/tests/baselines/reference/iteratorSpreadInCall8.errors.txt index 73dc6d5185e..03a67c4e0e1 100644 --- a/tests/baselines/reference/iteratorSpreadInCall8.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInCall8.errors.txt @@ -19,7 +19,7 @@ tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts(31,32): error TS2345 } } - class StringIterator { + class _StringIterator { next() { return { value: "", @@ -32,6 +32,6 @@ tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts(31,32): error TS2345 } } - new Foo(...new SymbolIterator, ...new StringIterator); - ~~~~~~~~~~~~~~~~~~~~~ + new Foo(...new SymbolIterator, ...new _StringIterator); + ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'symbol'. \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall8.js b/tests/baselines/reference/iteratorSpreadInCall8.js index a591fd363ab..7eb5cca25d2 100644 --- a/tests/baselines/reference/iteratorSpreadInCall8.js +++ b/tests/baselines/reference/iteratorSpreadInCall8.js @@ -16,7 +16,7 @@ class SymbolIterator { } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -29,7 +29,7 @@ class StringIterator { } } -new Foo(...new SymbolIterator, ...new StringIterator); +new Foo(...new SymbolIterator, ...new _StringIterator); //// [iteratorSpreadInCall8.js] class Foo { @@ -46,7 +46,7 @@ class SymbolIterator { return this; } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -57,4 +57,4 @@ class StringIterator { return this; } } -new Foo(...new SymbolIterator, ...new StringIterator); +new Foo(...new SymbolIterator, ...new _StringIterator); diff --git a/tests/baselines/reference/iteratorSpreadInCall8.symbols b/tests/baselines/reference/iteratorSpreadInCall8.symbols index 7c547419d17..51b7542c22b 100644 --- a/tests/baselines/reference/iteratorSpreadInCall8.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall8.symbols @@ -36,11 +36,11 @@ class SymbolIterator { } } -class StringIterator { ->StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall8.ts, 15, 1)) +class _StringIterator { +>_StringIterator : Symbol(_StringIterator, Decl(iteratorSpreadInCall8.ts, 15, 1)) next() { ->next : Symbol(StringIterator.next, Decl(iteratorSpreadInCall8.ts, 17, 22)) +>next : Symbol(_StringIterator.next, Decl(iteratorSpreadInCall8.ts, 17, 23)) return { value: "", @@ -53,18 +53,18 @@ class StringIterator { } [Symbol.iterator]() { ->[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall8.ts, 23, 5)) +>[Symbol.iterator] : Symbol(_StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall8.ts, 23, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) return this; ->this : Symbol(StringIterator, Decl(iteratorSpreadInCall8.ts, 15, 1)) +>this : Symbol(_StringIterator, Decl(iteratorSpreadInCall8.ts, 15, 1)) } } -new Foo(...new SymbolIterator, ...new StringIterator); +new Foo(...new SymbolIterator, ...new _StringIterator); >Foo : Symbol(Foo, Decl(iteratorSpreadInCall8.ts, 0, 0)) >SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall8.ts, 2, 1)) ->StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall8.ts, 15, 1)) +>_StringIterator : Symbol(_StringIterator, Decl(iteratorSpreadInCall8.ts, 15, 1)) diff --git a/tests/baselines/reference/iteratorSpreadInCall8.types b/tests/baselines/reference/iteratorSpreadInCall8.types index 58f3ea70809..c124a5e8dd7 100644 --- a/tests/baselines/reference/iteratorSpreadInCall8.types +++ b/tests/baselines/reference/iteratorSpreadInCall8.types @@ -38,8 +38,8 @@ class SymbolIterator { } } -class StringIterator { ->StringIterator : StringIterator +class _StringIterator { +>_StringIterator : _StringIterator next() { >next : () => { value: string; done: boolean; } @@ -69,13 +69,13 @@ class StringIterator { } } -new Foo(...new SymbolIterator, ...new StringIterator); ->new Foo(...new SymbolIterator, ...new StringIterator) : any +new Foo(...new SymbolIterator, ...new _StringIterator); +>new Foo(...new SymbolIterator, ...new _StringIterator) : any >Foo : typeof Foo >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator >SymbolIterator : typeof SymbolIterator ->...new StringIterator : string ->new StringIterator : StringIterator ->StringIterator : typeof StringIterator +>...new _StringIterator : string +>new _StringIterator : _StringIterator +>_StringIterator : typeof _StringIterator diff --git a/tests/baselines/reference/iteratorSpreadInCall9.errors.txt b/tests/baselines/reference/iteratorSpreadInCall9.errors.txt index 773eb2a9fc8..42fd65c1ce7 100644 --- a/tests/baselines/reference/iteratorSpreadInCall9.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInCall9.errors.txt @@ -19,7 +19,7 @@ tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts(31,32): error TS2345 } } - class StringIterator { + class _StringIterator { next() { return { value: "", @@ -32,7 +32,7 @@ tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts(31,32): error TS2345 } } - new Foo(...new SymbolIterator, ...[...new StringIterator]); - ~~~~~~~~~~~~~~~~~~~~~~~~~~ + new Foo(...new SymbolIterator, ...[...new _StringIterator]); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'symbol'. \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall9.js b/tests/baselines/reference/iteratorSpreadInCall9.js index 3f54728fd88..a29f1ec76d2 100644 --- a/tests/baselines/reference/iteratorSpreadInCall9.js +++ b/tests/baselines/reference/iteratorSpreadInCall9.js @@ -16,7 +16,7 @@ class SymbolIterator { } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -29,7 +29,7 @@ class StringIterator { } } -new Foo(...new SymbolIterator, ...[...new StringIterator]); +new Foo(...new SymbolIterator, ...[...new _StringIterator]); //// [iteratorSpreadInCall9.js] @@ -47,7 +47,7 @@ class SymbolIterator { return this; } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -58,4 +58,4 @@ class StringIterator { return this; } } -new Foo(...new SymbolIterator, ...[...new StringIterator]); +new Foo(...new SymbolIterator, ...[...new _StringIterator]); diff --git a/tests/baselines/reference/iteratorSpreadInCall9.symbols b/tests/baselines/reference/iteratorSpreadInCall9.symbols index 5db65829f13..79e6515e095 100644 --- a/tests/baselines/reference/iteratorSpreadInCall9.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall9.symbols @@ -36,11 +36,11 @@ class SymbolIterator { } } -class StringIterator { ->StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall9.ts, 15, 1)) +class _StringIterator { +>_StringIterator : Symbol(_StringIterator, Decl(iteratorSpreadInCall9.ts, 15, 1)) next() { ->next : Symbol(StringIterator.next, Decl(iteratorSpreadInCall9.ts, 17, 22)) +>next : Symbol(_StringIterator.next, Decl(iteratorSpreadInCall9.ts, 17, 23)) return { value: "", @@ -53,18 +53,18 @@ class StringIterator { } [Symbol.iterator]() { ->[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall9.ts, 23, 5)) +>[Symbol.iterator] : Symbol(_StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall9.ts, 23, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) return this; ->this : Symbol(StringIterator, Decl(iteratorSpreadInCall9.ts, 15, 1)) +>this : Symbol(_StringIterator, Decl(iteratorSpreadInCall9.ts, 15, 1)) } } -new Foo(...new SymbolIterator, ...[...new StringIterator]); +new Foo(...new SymbolIterator, ...[...new _StringIterator]); >Foo : Symbol(Foo, Decl(iteratorSpreadInCall9.ts, 0, 0)) >SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall9.ts, 2, 1)) ->StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall9.ts, 15, 1)) +>_StringIterator : Symbol(_StringIterator, Decl(iteratorSpreadInCall9.ts, 15, 1)) diff --git a/tests/baselines/reference/iteratorSpreadInCall9.types b/tests/baselines/reference/iteratorSpreadInCall9.types index 1118a394bc4..2cc33ea3fdd 100644 --- a/tests/baselines/reference/iteratorSpreadInCall9.types +++ b/tests/baselines/reference/iteratorSpreadInCall9.types @@ -38,8 +38,8 @@ class SymbolIterator { } } -class StringIterator { ->StringIterator : StringIterator +class _StringIterator { +>_StringIterator : _StringIterator next() { >next : () => { value: string; done: boolean; } @@ -69,15 +69,15 @@ class StringIterator { } } -new Foo(...new SymbolIterator, ...[...new StringIterator]); ->new Foo(...new SymbolIterator, ...[...new StringIterator]) : any +new Foo(...new SymbolIterator, ...[...new _StringIterator]); +>new Foo(...new SymbolIterator, ...[...new _StringIterator]) : any >Foo : typeof Foo >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator >SymbolIterator : typeof SymbolIterator ->...[...new StringIterator] : string ->[...new StringIterator] : string[] ->...new StringIterator : string ->new StringIterator : StringIterator ->StringIterator : typeof StringIterator +>...[...new _StringIterator] : string +>[...new _StringIterator] : string[] +>...new _StringIterator : string +>new _StringIterator : _StringIterator +>_StringIterator : typeof _StringIterator diff --git a/tests/baselines/reference/labeledStatementWithLabel.types b/tests/baselines/reference/labeledStatementWithLabel.types index 52ca74ddf19..e5633ab12f3 100644 --- a/tests/baselines/reference/labeledStatementWithLabel.types +++ b/tests/baselines/reference/labeledStatementWithLabel.types @@ -5,7 +5,7 @@ label: function fn() { } label: function* gen() { } >label : any ->gen : () => IterableIterator +>gen : () => Generator label: async function gen1() { } >label : any diff --git a/tests/baselines/reference/labeledStatementWithLabel_es2015.types b/tests/baselines/reference/labeledStatementWithLabel_es2015.types index 570c3c4ad6d..016ab09107c 100644 --- a/tests/baselines/reference/labeledStatementWithLabel_es2015.types +++ b/tests/baselines/reference/labeledStatementWithLabel_es2015.types @@ -5,7 +5,7 @@ label: function fn() { } label: function* gen() { } >label : any ->gen : () => IterableIterator +>gen : () => Generator label: async function gen1() { } >label : any diff --git a/tests/baselines/reference/labeledStatementWithLabel_strict.types b/tests/baselines/reference/labeledStatementWithLabel_strict.types index 9a8a4ef205c..052a8fbe022 100644 --- a/tests/baselines/reference/labeledStatementWithLabel_strict.types +++ b/tests/baselines/reference/labeledStatementWithLabel_strict.types @@ -8,7 +8,7 @@ label: function fn() { } label: function* gen() { } >label : any ->gen : () => IterableIterator +>gen : () => Generator label: async function gen1() { } >label : any diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types index c32e6590156..c9a0476c2ad 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types @@ -51,7 +51,7 @@ Baz.name; // Using ES6 generator function* gen() { ->gen : () => IterableIterator +>gen : () => Generator let i = 0; >i : number @@ -73,7 +73,7 @@ function* gen() { } function* gen2() { ->gen2 : () => IterableIterator +>gen2 : () => Generator let i = 0; >i : number diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types index a8dd60b1f8c..a695213a42c 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types @@ -51,7 +51,7 @@ Baz.name; // Using ES6 generator function* gen() { ->gen : () => IterableIterator +>gen : () => Generator let i = 0; >i : number @@ -73,7 +73,7 @@ function* gen() { } function* gen2() { ->gen2 : () => IterableIterator +>gen2 : () => Generator let i = 0; >i : number diff --git a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types index 222c5ab0c11..3e7c23fde87 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types +++ b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types @@ -51,7 +51,7 @@ Baz.name; // Using ES6 generator function* gen() { ->gen : () => IterableIterator +>gen : () => Generator let i = 0; >i : number @@ -73,7 +73,7 @@ function* gen() { } function* gen2() { ->gen2 : () => IterableIterator +>gen2 : () => Generator let i = 0; >i : number diff --git a/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6FeatureLibs.types b/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6FeatureLibs.types index e9213203637..f18184101cf 100644 --- a/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6FeatureLibs.types +++ b/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6FeatureLibs.types @@ -23,7 +23,7 @@ Reflect.ownKeys({}); >{} : {} function* idGen() { ->idGen : () => IterableIterator +>idGen : () => Generator let i = 10; >i : number diff --git a/tests/baselines/reference/parser.asyncGenerators.classMethods.es2018.types b/tests/baselines/reference/parser.asyncGenerators.classMethods.es2018.types index 9252c2a22c1..68375a7d679 100644 --- a/tests/baselines/reference/parser.asyncGenerators.classMethods.es2018.types +++ b/tests/baselines/reference/parser.asyncGenerators.classMethods.es2018.types @@ -3,7 +3,7 @@ class C1 { >C1 : C1 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator } } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitMethodNameIsOk.ts === @@ -11,7 +11,7 @@ class C2 { >C2 : C2 async * await() { ->await : () => AsyncIterableIterator +>await : () => AsyncGenerator } } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldMethodNameIsOk.ts === @@ -19,7 +19,7 @@ class C3 { >C3 : C3 async * yield() { ->yield : () => AsyncIterableIterator +>yield : () => AsyncGenerator } } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitParameterIsError.ts === @@ -45,7 +45,7 @@ class C6 { >C6 : C6 async * f(a = await 1) { ->f : (a?: number) => AsyncIterableIterator +>f : (a?: number) => AsyncGenerator >a : number >await 1 : 1 >1 : 1 @@ -56,7 +56,7 @@ class C7 { >C7 : C7 async * f(a = yield) { ->f : (a?: any) => AsyncIterableIterator +>f : (a?: any) => AsyncGenerator >a : any >yield : any } @@ -66,10 +66,10 @@ class C8 { >C8 : C8 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator async function * g() { ->g : () => AsyncIterableIterator +>g : () => AsyncGenerator } } } @@ -78,7 +78,7 @@ class C9 { >C9 : C9 async * f() { ->f : () => AsyncIterableIterator<() => void> +>f : () => AsyncGenerator<() => void, void, unknown> function yield() { > : () => any @@ -92,7 +92,7 @@ class C10 { >C10 : C10 async * f() { ->f : () => AsyncIterableIterator<() => void> +>f : () => AsyncGenerator<() => void, void, unknown> const x = function yield() { >x : () => any @@ -108,7 +108,7 @@ class C11 { >C11 : C11 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator function await() { > : () => any @@ -123,7 +123,7 @@ class C12 { >C12 : C12 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = function await() { >x : () => any @@ -140,7 +140,7 @@ class C13 { >C13 : C13 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator yield; >yield : any @@ -151,7 +151,7 @@ class C14 { >C14 : C14 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator yield 1; >yield 1 : any @@ -163,7 +163,7 @@ class C15 { >C15 : C15 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator yield *; >yield * : any @@ -175,7 +175,7 @@ class C16 { >C16 : C16 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator yield * []; >yield * [] : any @@ -187,7 +187,7 @@ class C17 { >C17 : C17 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator await 1; >await 1 : 1 @@ -199,7 +199,7 @@ class C18 { >C18 : C18 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator await; >await : any @@ -212,7 +212,7 @@ class C19 { >C19 : C19 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator let x: await; >x : await @@ -224,7 +224,7 @@ class C20 { >C20 : C20 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator let x: yield; >x : yield @@ -235,7 +235,7 @@ class C21 { >C21 : C21 async * [yield]() { ->[yield] : () => AsyncIterableIterator +>[yield] : () => AsyncGenerator >yield : any } } @@ -244,7 +244,7 @@ class C22 { >C22 : C22 async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = { [yield]: 1 }; >x : { [x: number]: number; } diff --git a/tests/baselines/reference/parser.asyncGenerators.functionDeclarations.es2018.types b/tests/baselines/reference/parser.asyncGenerators.functionDeclarations.es2018.types index 8804529efd2..08190b40112 100644 --- a/tests/baselines/reference/parser.asyncGenerators.functionDeclarations.es2018.types +++ b/tests/baselines/reference/parser.asyncGenerators.functionDeclarations.es2018.types @@ -1,49 +1,49 @@ === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/functionDeclarationIsOk.ts === async function * f1() { ->f1 : () => AsyncIterableIterator +>f1 : () => AsyncGenerator } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitNameIsOk.ts === async function * await() { ->await : () => AsyncIterableIterator +>await : () => AsyncGenerator } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldNameIsOk.ts === async function * yield() { ->yield : () => AsyncIterableIterator +>yield : () => AsyncGenerator } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitParameterIsError.ts === async function * f4(await) { >f4 : () => any ->await : () => AsyncIterableIterator +>await : () => AsyncGenerator } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldParameterIsError.ts === async function * f5(yield) { >f5 : () => any ->yield : () => AsyncIterableIterator +>yield : () => AsyncGenerator } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitInParameterInitializerIsError.ts === async function * f6(a = await 1) { ->f6 : (a?: number) => AsyncIterableIterator +>f6 : (a?: number) => AsyncGenerator >a : number >await 1 : 1 >1 : 1 } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldInParameterInitializerIsError.ts === async function * f7(a = yield) { ->f7 : (a?: any) => AsyncIterableIterator +>f7 : (a?: any) => AsyncGenerator >a : any >yield : any } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/nestedAsyncGeneratorIsOk.ts === async function * f8() { ->f8 : () => AsyncIterableIterator +>f8 : () => AsyncGenerator async function * g() { ->g : () => AsyncIterableIterator +>g : () => AsyncGenerator } } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/nestedFunctionDeclarationNamedYieldIsError.ts === async function * f9() { ->f9 : () => AsyncIterableIterator<() => void> +>f9 : () => AsyncGenerator<() => void, void, unknown> function yield() { > : () => any @@ -53,7 +53,7 @@ async function * f9() { } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/nestedFunctionExpressionNamedYieldIsError.ts === async function * f10() { ->f10 : () => AsyncIterableIterator<() => void> +>f10 : () => AsyncGenerator<() => void, void, unknown> const x = function yield() { >x : () => any @@ -65,7 +65,7 @@ async function * f10() { } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/nestedFunctionDeclarationNamedAwaitIsError.ts === async function * f11() { ->f11 : () => AsyncIterableIterator +>f11 : () => AsyncGenerator function await() { > : () => any @@ -76,7 +76,7 @@ async function * f11() { } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/nestedFunctionExpressionNamedAwaitIsError.ts === async function * f12() { ->f12 : () => AsyncIterableIterator<() => void> +>f12 : () => AsyncGenerator<() => void, void, unknown> const x = function yield() { >x : () => any @@ -88,14 +88,14 @@ async function * f12() { } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldIsOk.ts === async function * f13() { ->f13 : () => AsyncIterableIterator +>f13 : () => AsyncGenerator yield; >yield : any } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldWithValueIsOk.ts === async function * f14() { ->f14 : () => AsyncIterableIterator +>f14 : () => AsyncGenerator yield 1; >yield 1 : any @@ -103,7 +103,7 @@ async function * f14() { } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldStarMissingValueIsError.ts === async function * f15() { ->f15 : () => AsyncIterableIterator +>f15 : () => AsyncGenerator yield *; >yield * : any @@ -111,7 +111,7 @@ async function * f15() { } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldStarWithValueIsOk.ts === async function * f16() { ->f16 : () => AsyncIterableIterator +>f16 : () => AsyncGenerator yield * []; >yield * [] : any @@ -119,7 +119,7 @@ async function * f16() { } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitWithValueIsOk.ts === async function * f17() { ->f17 : () => AsyncIterableIterator +>f17 : () => AsyncGenerator await 1; >await 1 : 1 @@ -127,7 +127,7 @@ async function * f17() { } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitMissingValueIsError.ts === async function * f18() { ->f18 : () => AsyncIterableIterator +>f18 : () => AsyncGenerator await; >await : any @@ -136,7 +136,7 @@ async function * f18() { === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitAsTypeIsOk.ts === interface await {} async function * f19() { ->f19 : () => AsyncIterableIterator +>f19 : () => AsyncGenerator let x: await; >x : await @@ -144,14 +144,14 @@ async function * f19() { === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldAsTypeIsOk.ts === interface yield {} async function * f20() { ->f20 : () => AsyncIterableIterator +>f20 : () => AsyncGenerator let x: yield; >x : yield } === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldInNestedComputedPropertyIsOk.ts === async function * f21() { ->f21 : () => AsyncIterableIterator +>f21 : () => AsyncGenerator const x = { [yield]: 1 }; >x : { [x: number]: number; } diff --git a/tests/baselines/reference/parser.asyncGenerators.functionExpressions.es2018.types b/tests/baselines/reference/parser.asyncGenerators.functionExpressions.es2018.types index 277b79a3a39..0af07dc220f 100644 --- a/tests/baselines/reference/parser.asyncGenerators.functionExpressions.es2018.types +++ b/tests/baselines/reference/parser.asyncGenerators.functionExpressions.es2018.types @@ -1,8 +1,8 @@ === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/functionExpressionIsOk.ts === const f1 = async function * f() { ->f1 : () => AsyncIterableIterator ->async function * f() {} : () => AsyncIterableIterator ->f : () => AsyncIterableIterator +>f1 : () => AsyncGenerator +>async function * f() {} : () => AsyncGenerator +>f : () => AsyncGenerator }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitNameIsError.ts === @@ -37,8 +37,8 @@ const f5 = async function * (yield) { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitInParameterInitializerIsError.ts === const f6 = async function * (a = await 1) { ->f6 : (a?: number) => AsyncIterableIterator ->async function * (a = await 1) {} : (a?: number) => AsyncIterableIterator +>f6 : (a?: number) => AsyncGenerator +>async function * (a = await 1) {} : (a?: number) => AsyncGenerator >a : number >await 1 : 1 >1 : 1 @@ -46,25 +46,25 @@ const f6 = async function * (a = await 1) { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldInParameterInitializerIsError.ts === const f7 = async function * (a = yield) { ->f7 : (a?: any) => AsyncIterableIterator ->async function * (a = yield) {} : (a?: any) => AsyncIterableIterator +>f7 : (a?: any) => AsyncGenerator +>async function * (a = yield) {} : (a?: any) => AsyncGenerator >a : any >yield : any }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/nestedAsyncGeneratorIsOk.ts === const f8 = async function * () { ->f8 : () => AsyncIterableIterator ->async function * () { async function * g() { }} : () => AsyncIterableIterator +>f8 : () => AsyncGenerator +>async function * () { async function * g() { }} : () => AsyncGenerator async function * g() { ->g : () => AsyncIterableIterator +>g : () => AsyncGenerator } }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/nestedFunctionDeclarationNamedYieldIsError.ts === const f9 = async function * () { ->f9 : () => AsyncIterableIterator<() => void> ->async function * () { function yield() { }} : () => AsyncIterableIterator<() => void> +>f9 : () => AsyncGenerator<() => void, void, unknown> +>async function * () { function yield() { }} : () => AsyncGenerator<() => void, void, unknown> function yield() { > : () => any @@ -74,8 +74,8 @@ const f9 = async function * () { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/nestedFunctionExpressionNamedYieldIsError.ts === const f10 = async function * () { ->f10 : () => AsyncIterableIterator<() => void> ->async function * () { const x = function yield() { };} : () => AsyncIterableIterator<() => void> +>f10 : () => AsyncGenerator<() => void, void, unknown> +>async function * () { const x = function yield() { };} : () => AsyncGenerator<() => void, void, unknown> const x = function yield() { >x : () => any @@ -87,8 +87,8 @@ const f10 = async function * () { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/nestedFunctionDeclarationNamedAwaitIsError.ts === const f11 = async function * () { ->f11 : () => AsyncIterableIterator ->async function * () { function await() { }} : () => AsyncIterableIterator +>f11 : () => AsyncGenerator +>async function * () { function await() { }} : () => AsyncGenerator function await() { > : () => any @@ -99,8 +99,8 @@ const f11 = async function * () { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/nestedFunctionExpressionNamedAwaitIsError.ts === const f12 = async function * () { ->f12 : () => AsyncIterableIterator ->async function * () { const x = function await() { };} : () => AsyncIterableIterator +>f12 : () => AsyncGenerator +>async function * () { const x = function await() { };} : () => AsyncGenerator const x = function await() { >x : () => any @@ -113,8 +113,8 @@ const f12 = async function * () { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldIsOk.ts === const f13 = async function * () { ->f13 : () => AsyncIterableIterator ->async function * () { yield;} : () => AsyncIterableIterator +>f13 : () => AsyncGenerator +>async function * () { yield;} : () => AsyncGenerator yield; >yield : any @@ -122,8 +122,8 @@ const f13 = async function * () { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldWithValueIsOk.ts === const f14 = async function * () { ->f14 : () => AsyncIterableIterator ->async function * () { yield 1;} : () => AsyncIterableIterator +>f14 : () => AsyncGenerator +>async function * () { yield 1;} : () => AsyncGenerator yield 1; >yield 1 : any @@ -132,8 +132,8 @@ const f14 = async function * () { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldStarMissingValueIsError.ts === const f15 = async function * () { ->f15 : () => AsyncIterableIterator ->async function * () { yield *;} : () => AsyncIterableIterator +>f15 : () => AsyncGenerator +>async function * () { yield *;} : () => AsyncGenerator yield *; >yield * : any @@ -142,8 +142,8 @@ const f15 = async function * () { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldStarWithValueIsOk.ts === const f16 = async function * () { ->f16 : () => AsyncIterableIterator ->async function * () { yield * [];} : () => AsyncIterableIterator +>f16 : () => AsyncGenerator +>async function * () { yield * [];} : () => AsyncGenerator yield * []; >yield * [] : any @@ -152,8 +152,8 @@ const f16 = async function * () { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitWithValueIsOk.ts === const f17 = async function * () { ->f17 : () => AsyncIterableIterator ->async function * () { await 1;} : () => AsyncIterableIterator +>f17 : () => AsyncGenerator +>async function * () { await 1;} : () => AsyncGenerator await 1; >await 1 : 1 @@ -162,8 +162,8 @@ const f17 = async function * () { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitMissingValueIsError.ts === const f18 = async function * () { ->f18 : () => AsyncIterableIterator ->async function * () { await;} : () => AsyncIterableIterator +>f18 : () => AsyncGenerator +>async function * () { await;} : () => AsyncGenerator await; >await : any @@ -173,8 +173,8 @@ const f18 = async function * () { === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitAsTypeIsOk.ts === interface await {} const f19 = async function * () { ->f19 : () => AsyncIterableIterator ->async function * () { let x: await;} : () => AsyncIterableIterator +>f19 : () => AsyncGenerator +>async function * () { let x: await;} : () => AsyncGenerator let x: await; >x : await @@ -183,8 +183,8 @@ const f19 = async function * () { === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldAsTypeIsOk.ts === interface yield {} const f20 = async function * () { ->f20 : () => AsyncIterableIterator ->async function * () { let x: yield;} : () => AsyncIterableIterator +>f20 : () => AsyncGenerator +>async function * () { let x: yield;} : () => AsyncGenerator let x: yield; >x : yield @@ -192,8 +192,8 @@ const f20 = async function * () { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldInNestedComputedPropertyIsOk.ts === const f21 = async function *() { ->f21 : () => AsyncIterableIterator ->async function *() { const x = { [yield]: 1 };} : () => AsyncIterableIterator +>f21 : () => AsyncGenerator +>async function *() { const x = { [yield]: 1 };} : () => AsyncGenerator const x = { [yield]: 1 }; >x : { [x: number]: number; } diff --git a/tests/baselines/reference/parser.asyncGenerators.objectLiteralMethods.es2018.types b/tests/baselines/reference/parser.asyncGenerators.objectLiteralMethods.es2018.types index 655ecb3e6a0..5a6ea2a19fb 100644 --- a/tests/baselines/reference/parser.asyncGenerators.objectLiteralMethods.es2018.types +++ b/tests/baselines/reference/parser.asyncGenerators.objectLiteralMethods.es2018.types @@ -1,28 +1,28 @@ === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/methodIsOk.ts === const o1 = { ->o1 : { f(): AsyncIterableIterator; } ->{ async * f() { }} : { f(): AsyncIterableIterator; } +>o1 : { f(): AsyncGenerator; } +>{ async * f() { }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator } }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitMethodNameIsOk.ts === const o2 = { ->o2 : { await(): AsyncIterableIterator; } ->{ async * await() { }} : { await(): AsyncIterableIterator; } +>o2 : { await(): AsyncGenerator; } +>{ async * await() { }} : { await(): AsyncGenerator; } async * await() { ->await : () => AsyncIterableIterator +>await : () => AsyncGenerator } }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldMethodNameIsOk.ts === const o3 = { ->o3 : { yield(): AsyncIterableIterator; } ->{ async * yield() { }} : { yield(): AsyncIterableIterator; } +>o3 : { yield(): AsyncGenerator; } +>{ async * yield() { }} : { yield(): AsyncGenerator; } async * yield() { ->yield : () => AsyncIterableIterator +>yield : () => AsyncGenerator } }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitParameterIsError.ts === @@ -47,11 +47,11 @@ const o5 = { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitInParameterInitializerIsError.ts === const o6 = { ->o6 : { f(a?: number): AsyncIterableIterator; } ->{ async * f(a = await 1) { }} : { f(a?: number): AsyncIterableIterator; } +>o6 : { f(a?: number): AsyncGenerator; } +>{ async * f(a = await 1) { }} : { f(a?: number): AsyncGenerator; } async * f(a = await 1) { ->f : (a?: number) => AsyncIterableIterator +>f : (a?: number) => AsyncGenerator >a : number >await 1 : 1 >1 : 1 @@ -59,35 +59,35 @@ const o6 = { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldInParameterInitializerIsError.ts === const o7 = { ->o7 : { f(a?: any): AsyncIterableIterator; } ->{ async * f(a = yield) { }} : { f(a?: any): AsyncIterableIterator; } +>o7 : { f(a?: any): AsyncGenerator; } +>{ async * f(a = yield) { }} : { f(a?: any): AsyncGenerator; } async * f(a = yield) { ->f : (a?: any) => AsyncIterableIterator +>f : (a?: any) => AsyncGenerator >a : any >yield : any } }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/nestedAsyncGeneratorIsOk.ts === const o8 = { ->o8 : { f(): AsyncIterableIterator; } ->{ async * f() { async function * g() { } }} : { f(): AsyncIterableIterator; } +>o8 : { f(): AsyncGenerator; } +>{ async * f() { async function * g() { } }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator async function * g() { ->g : () => AsyncIterableIterator +>g : () => AsyncGenerator } } }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/nestedFunctionDeclarationNamedYieldIsError.ts === const o9 = { ->o9 : { f(): AsyncIterableIterator<() => void>; } ->{ async * f() { function yield() { } }} : { f(): AsyncIterableIterator<() => void>; } +>o9 : { f(): AsyncGenerator<() => void, void, unknown>; } +>{ async * f() { function yield() { } }} : { f(): AsyncGenerator<() => void, void, unknown>; } async * f() { ->f : () => AsyncIterableIterator<() => void> +>f : () => AsyncGenerator<() => void, void, unknown> function yield() { > : () => any @@ -98,11 +98,11 @@ const o9 = { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/nestedFunctionExpressionNamedYieldIsError.ts === const o10 = { ->o10 : { f(): AsyncIterableIterator<() => void>; } ->{ async * f() { const x = function yield() { }; }} : { f(): AsyncIterableIterator<() => void>; } +>o10 : { f(): AsyncGenerator<() => void, void, unknown>; } +>{ async * f() { const x = function yield() { }; }} : { f(): AsyncGenerator<() => void, void, unknown>; } async * f() { ->f : () => AsyncIterableIterator<() => void> +>f : () => AsyncGenerator<() => void, void, unknown> const x = function yield() { >x : () => any @@ -115,11 +115,11 @@ const o10 = { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/nestedFunctionDeclarationNamedAwaitIsError.ts === const o11 = { ->o11 : { f(): AsyncIterableIterator; } ->{ async * f() { function await() { } }} : { f(): AsyncIterableIterator; } +>o11 : { f(): AsyncGenerator; } +>{ async * f() { function await() { } }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator function await() { > : () => any @@ -131,11 +131,11 @@ const o11 = { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/nestedFunctionExpressionNamedAwaitIsError.ts === const o12 = { ->o12 : { f(): AsyncIterableIterator; } ->{ async * f() { const x = function await() { }; }} : { f(): AsyncIterableIterator; } +>o12 : { f(): AsyncGenerator; } +>{ async * f() { const x = function await() { }; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = function await() { >x : () => any @@ -149,11 +149,11 @@ const o12 = { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldIsOk.ts === const o13 = { ->o13 : { f(): AsyncIterableIterator; } ->{ async * f() { yield; }} : { f(): AsyncIterableIterator; } +>o13 : { f(): AsyncGenerator; } +>{ async * f() { yield; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator yield; >yield : any @@ -161,11 +161,11 @@ const o13 = { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldWithValueIsOk.ts === const o14 = { ->o14 : { f(): AsyncIterableIterator; } ->{ async * f() { yield 1; }} : { f(): AsyncIterableIterator; } +>o14 : { f(): AsyncGenerator; } +>{ async * f() { yield 1; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator yield 1; >yield 1 : any @@ -174,11 +174,11 @@ const o14 = { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldStarMissingValueIsError.ts === const o15 = { ->o15 : { f(): AsyncIterableIterator; } ->{ async * f() { yield *; }} : { f(): AsyncIterableIterator; } +>o15 : { f(): AsyncGenerator; } +>{ async * f() { yield *; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator yield *; >yield * : any @@ -187,11 +187,11 @@ const o15 = { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldStarWithValueIsOk.ts === const o16 = { ->o16 : { f(): AsyncIterableIterator; } ->{ async * f() { yield * []; }} : { f(): AsyncIterableIterator; } +>o16 : { f(): AsyncGenerator; } +>{ async * f() { yield * []; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator yield * []; >yield * [] : any @@ -200,11 +200,11 @@ const o16 = { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitWithValueIsOk.ts === const o17 = { ->o17 : { f(): AsyncIterableIterator; } ->{ async * f() { await 1; }} : { f(): AsyncIterableIterator; } +>o17 : { f(): AsyncGenerator; } +>{ async * f() { await 1; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator await 1; >await 1 : 1 @@ -213,11 +213,11 @@ const o17 = { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitMissingValueIsError.ts === const o18 = { ->o18 : { f(): AsyncIterableIterator; } ->{ async * f() { await; }} : { f(): AsyncIterableIterator; } +>o18 : { f(): AsyncGenerator; } +>{ async * f() { await; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator await; >await : any @@ -227,11 +227,11 @@ const o18 = { === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/awaitAsTypeIsOk.ts === interface await {} const o19 = { ->o19 : { f(): AsyncIterableIterator; } ->{ async * f() { let x: await; }} : { f(): AsyncIterableIterator; } +>o19 : { f(): AsyncGenerator; } +>{ async * f() { let x: await; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator let x: await; >x : await @@ -240,11 +240,11 @@ const o19 = { === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldAsTypeIsOk.ts === interface yield {} const o20 = { ->o20 : { f(): AsyncIterableIterator; } ->{ async * f() { let x: yield; }} : { f(): AsyncIterableIterator; } +>o20 : { f(): AsyncGenerator; } +>{ async * f() { let x: yield; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator let x: yield; >x : yield @@ -252,11 +252,11 @@ const o20 = { }; === tests/cases/conformance/parser/ecmascript2018/asyncGenerators/yieldInNestedComputedPropertyIsOk.ts === const o21 = { ->o21 : { f(): AsyncIterableIterator; } ->{ async * f() { const x = { [yield]: 1 }; }} : { f(): AsyncIterableIterator; } +>o21 : { f(): AsyncGenerator; } +>{ async * f() { const x = { [yield]: 1 }; }} : { f(): AsyncGenerator; } async * f() { ->f : () => AsyncIterableIterator +>f : () => AsyncGenerator const x = { [yield]: 1 }; >x : { [x: number]: number; } diff --git a/tests/baselines/reference/parser.forAwait.es2018.types b/tests/baselines/reference/parser.forAwait.es2018.types index 672d063883d..ea677dd9739 100644 --- a/tests/baselines/reference/parser.forAwait.es2018.types +++ b/tests/baselines/reference/parser.forAwait.es2018.types @@ -70,7 +70,7 @@ async function f8() { } === tests/cases/conformance/parser/ecmascript2018/forAwait/inAsyncGeneratorWithDeclIsOk.ts === async function* f9() { ->f9 : () => AsyncIterableIterator +>f9 : () => AsyncGenerator let y: any; >y : any @@ -82,7 +82,7 @@ async function* f9() { } === tests/cases/conformance/parser/ecmascript2018/forAwait/inAsyncGeneratorWithExpressionIsOk.ts === async function* f10() { ->f10 : () => AsyncIterableIterator +>f10 : () => AsyncGenerator let x: any, y: any; >x : any @@ -95,7 +95,7 @@ async function* f10() { } === tests/cases/conformance/parser/ecmascript2018/forAwait/inGeneratorWithDeclIsError.ts === function* f11() { ->f11 : () => IterableIterator +>f11 : () => Generator let y: any; >y : any @@ -107,7 +107,7 @@ function* f11() { } === tests/cases/conformance/parser/ecmascript2018/forAwait/inGeneratorWithExprIsError.ts === function* f12() { ->f12 : () => IterableIterator +>f12 : () => Generator let x: any, y: any; >x : any diff --git a/tests/baselines/reference/restParameterInDownlevelGenerator.types b/tests/baselines/reference/restParameterInDownlevelGenerator.types index e0b85e1a0ff..0345af14c23 100644 --- a/tests/baselines/reference/restParameterInDownlevelGenerator.types +++ b/tests/baselines/reference/restParameterInDownlevelGenerator.types @@ -1,7 +1,7 @@ === tests/cases/conformance/generators/restParameterInDownlevelGenerator.ts === // https://github.com/Microsoft/TypeScript/issues/30653 function * mergeStringLists(...strings: string[]) { ->mergeStringLists : (...strings: string[]) => IterableIterator +>mergeStringLists : (...strings: string[]) => Generator >strings : string[] for (var str of strings); diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictGeneratorTypes/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictGeneratorTypes/tsconfig.json new file mode 100644 index 00000000000..91f667ef739 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictGeneratorTypes/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "strictGeneratorTypes": true + } +} diff --git a/tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator.types b/tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator.types index cac2f03d8e4..0323d78394d 100644 --- a/tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator.types +++ b/tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator.types @@ -1,6 +1,6 @@ === tests/cases/compiler/sourceMapValidationVarInDownLevelGenerator.ts === function * f() { ->f : () => IterableIterator +>f : () => Generator var x = 1, y; >x : number diff --git a/tests/baselines/reference/spreadOfParamsFromGeneratorMakesRequiredParams.errors.txt b/tests/baselines/reference/spreadOfParamsFromGeneratorMakesRequiredParams.errors.txt index 393e21edb6c..1b1f93ffc3f 100644 --- a/tests/baselines/reference/spreadOfParamsFromGeneratorMakesRequiredParams.errors.txt +++ b/tests/baselines/reference/spreadOfParamsFromGeneratorMakesRequiredParams.errors.txt @@ -1,8 +1,8 @@ -error TS2318: Cannot find global type 'IterableIterator'. +error TS2318: Cannot find global type 'Generator'. tests/cases/compiler/spreadOfParamsFromGeneratorMakesRequiredParams.ts(6,1): error TS2554: Expected 2 arguments, but got 1. -!!! error TS2318: Cannot find global type 'IterableIterator'. +!!! error TS2318: Cannot find global type 'Generator'. ==== tests/cases/compiler/spreadOfParamsFromGeneratorMakesRequiredParams.ts (1 errors) ==== declare function call any>( fn: Fn, diff --git a/tests/baselines/reference/templateStringInYieldKeyword.types b/tests/baselines/reference/templateStringInYieldKeyword.types index 3eff79cf796..71cce7b74eb 100644 --- a/tests/baselines/reference/templateStringInYieldKeyword.types +++ b/tests/baselines/reference/templateStringInYieldKeyword.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts === function* gen() { ->gen : () => IterableIterator +>gen : () => Generator // Once this is supported, the inner expression does not need to be parenthesized. var x = yield `abc${ x }def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt b/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt index ce0d781d824..a9699306373 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt @@ -1,8 +1,8 @@ -error TS2318: Cannot find global type 'IterableIterator'. +error TS2318: Cannot find global type 'Generator'. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,15): error TS1005: '(' expected. -!!! error TS2318: Cannot find global type 'IterableIterator'. +!!! error TS2318: Cannot find global type 'Generator'. ==== tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts (1 errors) ==== function* gen { ~ diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types index dfd4e522def..a4226bc3f44 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts === function* gen() { ->gen : () => IterableIterator +>gen : () => Generator // Once this is supported, yield *must* be parenthesized. var x = `abc${ yield 10 }def`; diff --git a/tests/baselines/reference/types.asyncGenerators.es2018.1.types b/tests/baselines/reference/types.asyncGenerators.es2018.1.types index 0f3b7753313..ad35f2a796f 100644 --- a/tests/baselines/reference/types.asyncGenerators.es2018.1.types +++ b/tests/baselines/reference/types.asyncGenerators.es2018.1.types @@ -1,22 +1,22 @@ === tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.1.ts === async function * inferReturnType1() { ->inferReturnType1 : () => AsyncIterableIterator +>inferReturnType1 : () => AsyncGenerator } async function * inferReturnType2() { ->inferReturnType2 : () => AsyncIterableIterator +>inferReturnType2 : () => AsyncGenerator yield; >yield : any } async function * inferReturnType3() { ->inferReturnType3 : () => AsyncIterableIterator +>inferReturnType3 : () => AsyncGenerator yield 1; >yield 1 : any >1 : 1 } async function * inferReturnType4() { ->inferReturnType4 : () => AsyncIterableIterator +>inferReturnType4 : () => AsyncGenerator yield Promise.resolve(1); >yield Promise.resolve(1) : any @@ -27,7 +27,7 @@ async function * inferReturnType4() { >1 : 1 } async function * inferReturnType5() { ->inferReturnType5 : () => AsyncIterableIterator +>inferReturnType5 : () => AsyncGenerator yield 1; >yield 1 : any @@ -42,7 +42,7 @@ async function * inferReturnType5() { >2 : 2 } async function * inferReturnType6() { ->inferReturnType6 : () => AsyncIterableIterator +>inferReturnType6 : () => AsyncGenerator yield* [1, 2]; >yield* [1, 2] : any @@ -51,7 +51,7 @@ async function * inferReturnType6() { >2 : 2 } async function * inferReturnType7() { ->inferReturnType7 : () => AsyncIterableIterator +>inferReturnType7 : () => AsyncGenerator yield* [Promise.resolve(1)]; >yield* [Promise.resolve(1)] : any @@ -63,19 +63,19 @@ async function * inferReturnType7() { >1 : 1 } async function * inferReturnType8() { ->inferReturnType8 : () => AsyncIterableIterator +>inferReturnType8 : () => AsyncGenerator yield* (async function * () { yield 1; })(); ->yield* (async function * () { yield 1; })() : any ->(async function * () { yield 1; })() : AsyncIterableIterator ->(async function * () { yield 1; }) : () => AsyncIterableIterator ->async function * () { yield 1; } : () => AsyncIterableIterator +>yield* (async function * () { yield 1; })() : void +>(async function * () { yield 1; })() : AsyncGenerator +>(async function * () { yield 1; }) : () => AsyncGenerator +>async function * () { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 } const assignability1: () => AsyncIterableIterator = async function * () { >assignability1 : () => AsyncIterableIterator ->async function * () { yield 1;} : () => AsyncIterableIterator +>async function * () { yield 1;} : () => AsyncGenerator yield 1; >yield 1 : any @@ -84,7 +84,7 @@ const assignability1: () => AsyncIterableIterator = async function * () }; const assignability2: () => AsyncIterableIterator = async function * () { >assignability2 : () => AsyncIterableIterator ->async function * () { yield Promise.resolve(1);} : () => AsyncIterableIterator +>async function * () { yield Promise.resolve(1);} : () => AsyncGenerator yield Promise.resolve(1); >yield Promise.resolve(1) : any @@ -97,7 +97,7 @@ const assignability2: () => AsyncIterableIterator = async function * () }; const assignability3: () => AsyncIterableIterator = async function * () { >assignability3 : () => AsyncIterableIterator ->async function * () { yield* [1, 2];} : () => AsyncIterableIterator +>async function * () { yield* [1, 2];} : () => AsyncGenerator yield* [1, 2]; >yield* [1, 2] : any @@ -108,7 +108,7 @@ const assignability3: () => AsyncIterableIterator = async function * () }; const assignability4: () => AsyncIterableIterator = async function * () { >assignability4 : () => AsyncIterableIterator ->async function * () { yield* [Promise.resolve(1)];} : () => AsyncIterableIterator +>async function * () { yield* [Promise.resolve(1)];} : () => AsyncGenerator yield* [Promise.resolve(1)]; >yield* [Promise.resolve(1)] : any @@ -122,20 +122,20 @@ const assignability4: () => AsyncIterableIterator = async function * () }; const assignability5: () => AsyncIterableIterator = async function * () { >assignability5 : () => AsyncIterableIterator ->async function * () { yield* (async function * () { yield 1; })();} : () => AsyncIterableIterator +>async function * () { yield* (async function * () { yield 1; })();} : () => AsyncGenerator yield* (async function * () { yield 1; })(); ->yield* (async function * () { yield 1; })() : any ->(async function * () { yield 1; })() : AsyncIterableIterator ->(async function * () { yield 1; }) : () => AsyncIterableIterator ->async function * () { yield 1; } : () => AsyncIterableIterator +>yield* (async function * () { yield 1; })() : void +>(async function * () { yield 1; })() : AsyncGenerator +>(async function * () { yield 1; }) : () => AsyncGenerator +>async function * () { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 }; const assignability6: () => AsyncIterable = async function * () { >assignability6 : () => AsyncIterable ->async function * () { yield 1;} : () => AsyncIterableIterator +>async function * () { yield 1;} : () => AsyncGenerator yield 1; >yield 1 : any @@ -144,7 +144,7 @@ const assignability6: () => AsyncIterable = async function * () { }; const assignability7: () => AsyncIterable = async function * () { >assignability7 : () => AsyncIterable ->async function * () { yield Promise.resolve(1);} : () => AsyncIterableIterator +>async function * () { yield Promise.resolve(1);} : () => AsyncGenerator yield Promise.resolve(1); >yield Promise.resolve(1) : any @@ -157,7 +157,7 @@ const assignability7: () => AsyncIterable = async function * () { }; const assignability8: () => AsyncIterable = async function * () { >assignability8 : () => AsyncIterable ->async function * () { yield* [1, 2];} : () => AsyncIterableIterator +>async function * () { yield* [1, 2];} : () => AsyncGenerator yield* [1, 2]; >yield* [1, 2] : any @@ -168,7 +168,7 @@ const assignability8: () => AsyncIterable = async function * () { }; const assignability9: () => AsyncIterable = async function * () { >assignability9 : () => AsyncIterable ->async function * () { yield* [Promise.resolve(1)];} : () => AsyncIterableIterator +>async function * () { yield* [Promise.resolve(1)];} : () => AsyncGenerator yield* [Promise.resolve(1)]; >yield* [Promise.resolve(1)] : any @@ -182,20 +182,20 @@ const assignability9: () => AsyncIterable = async function * () { }; const assignability10: () => AsyncIterable = async function * () { >assignability10 : () => AsyncIterable ->async function * () { yield* (async function * () { yield 1; })();} : () => AsyncIterableIterator +>async function * () { yield* (async function * () { yield 1; })();} : () => AsyncGenerator yield* (async function * () { yield 1; })(); ->yield* (async function * () { yield 1; })() : any ->(async function * () { yield 1; })() : AsyncIterableIterator ->(async function * () { yield 1; }) : () => AsyncIterableIterator ->async function * () { yield 1; } : () => AsyncIterableIterator +>yield* (async function * () { yield 1; })() : void +>(async function * () { yield 1; })() : AsyncGenerator +>(async function * () { yield 1; }) : () => AsyncGenerator +>async function * () { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 }; const assignability11: () => AsyncIterator = async function * () { ->assignability11 : () => AsyncIterator ->async function * () { yield 1;} : () => AsyncIterableIterator +>assignability11 : () => AsyncIterator +>async function * () { yield 1;} : () => AsyncGenerator yield 1; >yield 1 : any @@ -203,8 +203,8 @@ const assignability11: () => AsyncIterator = async function * () { }; const assignability12: () => AsyncIterator = async function * () { ->assignability12 : () => AsyncIterator ->async function * () { yield Promise.resolve(1);} : () => AsyncIterableIterator +>assignability12 : () => AsyncIterator +>async function * () { yield Promise.resolve(1);} : () => AsyncGenerator yield Promise.resolve(1); >yield Promise.resolve(1) : any @@ -216,8 +216,8 @@ const assignability12: () => AsyncIterator = async function * () { }; const assignability13: () => AsyncIterator = async function * () { ->assignability13 : () => AsyncIterator ->async function * () { yield* [1, 2];} : () => AsyncIterableIterator +>assignability13 : () => AsyncIterator +>async function * () { yield* [1, 2];} : () => AsyncGenerator yield* [1, 2]; >yield* [1, 2] : any @@ -227,8 +227,8 @@ const assignability13: () => AsyncIterator = async function * () { }; const assignability14: () => AsyncIterator = async function * () { ->assignability14 : () => AsyncIterator ->async function * () { yield* [Promise.resolve(1)];} : () => AsyncIterableIterator +>assignability14 : () => AsyncIterator +>async function * () { yield* [Promise.resolve(1)];} : () => AsyncGenerator yield* [Promise.resolve(1)]; >yield* [Promise.resolve(1)] : any @@ -241,14 +241,14 @@ const assignability14: () => AsyncIterator = async function * () { }; const assignability15: () => AsyncIterator = async function * () { ->assignability15 : () => AsyncIterator ->async function * () { yield* (async function * () { yield 1; })();} : () => AsyncIterableIterator +>assignability15 : () => AsyncIterator +>async function * () { yield* (async function * () { yield 1; })();} : () => AsyncGenerator yield* (async function * () { yield 1; })(); ->yield* (async function * () { yield 1; })() : any ->(async function * () { yield 1; })() : AsyncIterableIterator ->(async function * () { yield 1; }) : () => AsyncIterableIterator ->async function * () { yield 1; } : () => AsyncIterableIterator +>yield* (async function * () { yield 1; })() : void +>(async function * () { yield 1; })() : AsyncGenerator +>(async function * () { yield 1; }) : () => AsyncGenerator +>async function * () { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 @@ -257,14 +257,14 @@ async function * explicitReturnType1(): AsyncIterableIterator { >explicitReturnType1 : () => AsyncIterableIterator yield 1; ->yield 1 : any +>yield 1 : undefined >1 : 1 } async function * explicitReturnType2(): AsyncIterableIterator { >explicitReturnType2 : () => AsyncIterableIterator yield Promise.resolve(1); ->yield Promise.resolve(1) : any +>yield Promise.resolve(1) : undefined >Promise.resolve(1) : Promise >Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor @@ -296,10 +296,10 @@ async function * explicitReturnType5(): AsyncIterableIterator { >explicitReturnType5 : () => AsyncIterableIterator yield* (async function * () { yield 1; })(); ->yield* (async function * () { yield 1; })() : any ->(async function * () { yield 1; })() : AsyncIterableIterator ->(async function * () { yield 1; }) : () => AsyncIterableIterator ->async function * () { yield 1; } : () => AsyncIterableIterator +>yield* (async function * () { yield 1; })() : void +>(async function * () { yield 1; })() : AsyncGenerator +>(async function * () { yield 1; }) : () => AsyncGenerator +>async function * () { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 } @@ -307,14 +307,14 @@ async function * explicitReturnType6(): AsyncIterable { >explicitReturnType6 : () => AsyncIterable yield 1; ->yield 1 : any +>yield 1 : undefined >1 : 1 } async function * explicitReturnType7(): AsyncIterable { >explicitReturnType7 : () => AsyncIterable yield Promise.resolve(1); ->yield Promise.resolve(1) : any +>yield Promise.resolve(1) : undefined >Promise.resolve(1) : Promise >Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor @@ -346,25 +346,25 @@ async function * explicitReturnType10(): AsyncIterable { >explicitReturnType10 : () => AsyncIterable yield* (async function * () { yield 1; })(); ->yield* (async function * () { yield 1; })() : any ->(async function * () { yield 1; })() : AsyncIterableIterator ->(async function * () { yield 1; }) : () => AsyncIterableIterator ->async function * () { yield 1; } : () => AsyncIterableIterator +>yield* (async function * () { yield 1; })() : void +>(async function * () { yield 1; })() : AsyncGenerator +>(async function * () { yield 1; }) : () => AsyncGenerator +>async function * () { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 } async function * explicitReturnType11(): AsyncIterator { ->explicitReturnType11 : () => AsyncIterator +>explicitReturnType11 : () => AsyncIterator yield 1; ->yield 1 : any +>yield 1 : undefined >1 : 1 } async function * explicitReturnType12(): AsyncIterator { ->explicitReturnType12 : () => AsyncIterator +>explicitReturnType12 : () => AsyncIterator yield Promise.resolve(1); ->yield Promise.resolve(1) : any +>yield Promise.resolve(1) : undefined >Promise.resolve(1) : Promise >Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor @@ -372,7 +372,7 @@ async function * explicitReturnType12(): AsyncIterator { >1 : 1 } async function * explicitReturnType13(): AsyncIterator { ->explicitReturnType13 : () => AsyncIterator +>explicitReturnType13 : () => AsyncIterator yield* [1, 2]; >yield* [1, 2] : any @@ -381,7 +381,7 @@ async function * explicitReturnType13(): AsyncIterator { >2 : 2 } async function * explicitReturnType14(): AsyncIterator { ->explicitReturnType14 : () => AsyncIterator +>explicitReturnType14 : () => AsyncIterator yield* [Promise.resolve(1)]; >yield* [Promise.resolve(1)] : any @@ -393,13 +393,13 @@ async function * explicitReturnType14(): AsyncIterator { >1 : 1 } async function * explicitReturnType15(): AsyncIterator { ->explicitReturnType15 : () => AsyncIterator +>explicitReturnType15 : () => AsyncIterator yield* (async function * () { yield 1; })(); ->yield* (async function * () { yield 1; })() : any ->(async function * () { yield 1; })() : AsyncIterableIterator ->(async function * () { yield 1; }) : () => AsyncIterableIterator ->async function * () { yield 1; } : () => AsyncIterableIterator +>yield* (async function * () { yield 1; })() : void +>(async function * () { yield 1; })() : AsyncGenerator +>(async function * () { yield 1; }) : () => AsyncGenerator +>async function * () { yield 1; } : () => AsyncGenerator >yield 1 : any >1 : 1 } @@ -411,7 +411,7 @@ async function * explicitReturnType16(): {} { >1 : 1 } async function * awaitedType1() { ->awaitedType1 : () => AsyncIterableIterator +>awaitedType1 : () => AsyncGenerator const x = await 1; >x : 1 @@ -419,7 +419,7 @@ async function * awaitedType1() { >1 : 1 } async function * awaitedType2() { ->awaitedType2 : () => AsyncIterableIterator +>awaitedType2 : () => AsyncGenerator const x = await Promise.resolve(1); >x : number diff --git a/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt b/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt index 471cf39bed2..c8c4ed39ed7 100644 --- a/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt +++ b/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt @@ -1,32 +1,45 @@ tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(2,12): error TS2504: Type '{}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(8,12): error TS2504: Type 'Promise' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. -tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(10,7): error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterableIterator'. - Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterableIterator'. - Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(13,7): error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterableIterator'. - Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterableIterator'. -tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(16,7): error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterableIterator'. - Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterableIterator'. -tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(19,7): error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterable'. - Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterable'. +tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(10,7): error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterableIterator'. + Type 'AsyncGenerator' is not assignable to type 'AsyncIterableIterator'. + Types of property 'next' are incompatible. + Type '(...args: [] | [unknown]) => Promise>' is not assignable to type '(...args: [] | [PromiseLike]) => Promise>'. + Type 'Promise>' is not assignable to type 'Promise>'. + Type 'IteratorResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(13,7): error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterableIterator'. + Type 'AsyncGenerator' is not assignable to type 'AsyncIterableIterator'. + Types of property 'next' are incompatible. + Type '(...args: [] | [PromiseLike]) => Promise>' is not assignable to type '(...args: [] | [PromiseLike]) => Promise>'. + Type 'Promise>' is not assignable to type 'Promise>'. +tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(16,7): error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterableIterator'. + Type 'AsyncGenerator' is not assignable to type 'AsyncIterableIterator'. +tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(19,7): error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterable'. + Type 'AsyncGenerator' is not assignable to type 'AsyncIterable'. Types of property '[Symbol.asyncIterator]' are incompatible. - Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterator'. - Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterator'. + Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterator'. + Type 'AsyncGenerator' is not assignable to type 'AsyncIterator'. Types of property 'next' are incompatible. - Type '(value?: any) => Promise>' is not assignable to type '(value?: any) => Promise>'. - Type 'Promise>' is not assignable to type 'Promise>'. - Type 'IteratorResult' is not assignable to type 'IteratorResult'. - Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(22,7): error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterable'. - Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterable'. -tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(25,7): error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterable'. - Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterable'. -tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(28,7): error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterator'. - Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterator'. -tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(31,7): error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterator'. - Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterator'. -tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(34,7): error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterator'. - Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterator'. + Type '(...args: [] | [unknown]) => Promise>' is not assignable to type '(...args: [] | [PromiseLike]) => Promise>'. + Type 'Promise>' is not assignable to type 'Promise>'. +tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(22,7): error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterable'. + Type 'AsyncGenerator' is not assignable to type 'AsyncIterable'. + Types of property '[Symbol.asyncIterator]' are incompatible. + Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterator'. + Type 'AsyncGenerator' is not assignable to type 'AsyncIterator'. + Types of property 'next' are incompatible. + Type '(...args: [] | [PromiseLike]) => Promise>' is not assignable to type '(...args: [] | [PromiseLike]) => Promise>'. + Type 'Promise>' is not assignable to type 'Promise>'. +tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(25,7): error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterable'. + Type 'AsyncGenerator' is not assignable to type 'AsyncIterable'. +tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(28,7): error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterator'. + Type 'AsyncGenerator' is not assignable to type 'AsyncIterator'. +tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(31,7): error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterator'. + Type 'AsyncGenerator' is not assignable to type 'AsyncIterator'. +tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(34,7): error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterator'. + Type 'AsyncGenerator' is not assignable to type 'AsyncIterator'. tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(38,11): error TS2322: Type '"a"' is not assignable to type 'number'. tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(41,12): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(44,12): error TS2322: Type 'string' is not assignable to type 'number'. @@ -36,12 +49,13 @@ tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts( tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(56,11): error TS2322: Type '"a"' is not assignable to type 'number'. tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(59,12): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(62,12): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(64,42): error TS2741: Property '[Symbol.iterator]' is missing in type 'AsyncIterableIterator' but required in type 'IterableIterator'. -tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(67,42): error TS2741: Property '[Symbol.iterator]' is missing in type 'AsyncIterableIterator' but required in type 'Iterable'. -tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(70,42): error TS2322: Type 'AsyncIterableIterator' is not assignable to type 'Iterator'. +tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(64,42): error TS2741: Property '[Symbol.iterator]' is missing in type 'AsyncGenerator' but required in type 'IterableIterator'. +tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(67,42): error TS2741: Property '[Symbol.iterator]' is missing in type 'AsyncGenerator' but required in type 'Iterable'. +tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(70,42): error TS2322: Type 'AsyncGenerator' is not assignable to type 'Iterator'. Types of property 'next' are incompatible. - Type '(value?: any) => Promise>' is not assignable to type '(value?: any) => IteratorResult'. - Type 'Promise>' is missing the following properties from type 'IteratorResult': done, value + Type '(...args: [] | [PromiseLike]) => Promise>' is not assignable to type '(...args: [] | [undefined]) => IteratorResult'. + Type 'Promise>' is not assignable to type 'IteratorResult'. + Property 'value' is missing in type 'Promise>' but required in type 'IteratorYieldResult'. tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(74,12): error TS2504: Type '{}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. @@ -61,65 +75,78 @@ tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts( } const assignability1: () => AsyncIterableIterator = async function * () { ~~~~~~~~~~~~~~ -!!! error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterableIterator'. -!!! error TS2322: Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterableIterator'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterableIterator'. +!!! error TS2322: Type 'AsyncGenerator' is not assignable to type 'AsyncIterableIterator'. +!!! error TS2322: Types of property 'next' are incompatible. +!!! error TS2322: Type '(...args: [] | [unknown]) => Promise>' is not assignable to type '(...args: [] | [PromiseLike]) => Promise>'. +!!! error TS2322: Type 'Promise>' is not assignable to type 'Promise>'. +!!! error TS2322: Type 'IteratorResult' is not assignable to type 'IteratorResult'. +!!! error TS2322: Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. +!!! error TS2322: Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. yield "a"; }; const assignability2: () => AsyncIterableIterator = async function * () { ~~~~~~~~~~~~~~ -!!! error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterableIterator'. -!!! error TS2322: Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterableIterator'. +!!! error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterableIterator'. +!!! error TS2322: Type 'AsyncGenerator' is not assignable to type 'AsyncIterableIterator'. +!!! error TS2322: Types of property 'next' are incompatible. +!!! error TS2322: Type '(...args: [] | [PromiseLike]) => Promise>' is not assignable to type '(...args: [] | [PromiseLike]) => Promise>'. +!!! error TS2322: Type 'Promise>' is not assignable to type 'Promise>'. yield* ["a", "b"]; }; const assignability3: () => AsyncIterableIterator = async function * () { ~~~~~~~~~~~~~~ -!!! error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterableIterator'. -!!! error TS2322: Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterableIterator'. +!!! error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterableIterator'. +!!! error TS2322: Type 'AsyncGenerator' is not assignable to type 'AsyncIterableIterator'. yield* (async function * () { yield "a"; })(); }; const assignability4: () => AsyncIterable = async function * () { ~~~~~~~~~~~~~~ -!!! error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterable'. -!!! error TS2322: Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterable'. +!!! error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterable'. +!!! error TS2322: Type 'AsyncGenerator' is not assignable to type 'AsyncIterable'. !!! error TS2322: Types of property '[Symbol.asyncIterator]' are incompatible. -!!! error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterator'. -!!! error TS2322: Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterator'. +!!! error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterator'. +!!! error TS2322: Type 'AsyncGenerator' is not assignable to type 'AsyncIterator'. !!! error TS2322: Types of property 'next' are incompatible. -!!! error TS2322: Type '(value?: any) => Promise>' is not assignable to type '(value?: any) => Promise>'. -!!! error TS2322: Type 'Promise>' is not assignable to type 'Promise>'. -!!! error TS2322: Type 'IteratorResult' is not assignable to type 'IteratorResult'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(...args: [] | [unknown]) => Promise>' is not assignable to type '(...args: [] | [PromiseLike]) => Promise>'. +!!! error TS2322: Type 'Promise>' is not assignable to type 'Promise>'. yield "a"; }; const assignability5: () => AsyncIterable = async function * () { ~~~~~~~~~~~~~~ -!!! error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterable'. -!!! error TS2322: Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterable'. +!!! error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterable'. +!!! error TS2322: Type 'AsyncGenerator' is not assignable to type 'AsyncIterable'. +!!! error TS2322: Types of property '[Symbol.asyncIterator]' are incompatible. +!!! error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterator'. +!!! error TS2322: Type 'AsyncGenerator' is not assignable to type 'AsyncIterator'. +!!! error TS2322: Types of property 'next' are incompatible. +!!! error TS2322: Type '(...args: [] | [PromiseLike]) => Promise>' is not assignable to type '(...args: [] | [PromiseLike]) => Promise>'. +!!! error TS2322: Type 'Promise>' is not assignable to type 'Promise>'. yield* ["a", "b"]; }; const assignability6: () => AsyncIterable = async function * () { ~~~~~~~~~~~~~~ -!!! error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterable'. -!!! error TS2322: Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterable'. +!!! error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterable'. +!!! error TS2322: Type 'AsyncGenerator' is not assignable to type 'AsyncIterable'. yield* (async function * () { yield "a"; })(); }; const assignability7: () => AsyncIterator = async function * () { ~~~~~~~~~~~~~~ -!!! error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterator'. -!!! error TS2322: Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterator'. +!!! error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterator'. +!!! error TS2322: Type 'AsyncGenerator' is not assignable to type 'AsyncIterator'. yield "a"; }; const assignability8: () => AsyncIterator = async function * () { ~~~~~~~~~~~~~~ -!!! error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterator'. -!!! error TS2322: Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterator'. +!!! error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterator'. +!!! error TS2322: Type 'AsyncGenerator' is not assignable to type 'AsyncIterator'. yield* ["a", "b"]; }; const assignability9: () => AsyncIterator = async function * () { ~~~~~~~~~~~~~~ -!!! error TS2322: Type '() => AsyncIterableIterator' is not assignable to type '() => AsyncIterator'. -!!! error TS2322: Type 'AsyncIterableIterator' is not assignable to type 'AsyncIterator'. +!!! error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterator'. +!!! error TS2322: Type 'AsyncGenerator' is not assignable to type 'AsyncIterator'. yield* (async function * () { yield "a"; })(); }; async function * explicitReturnType1(): AsyncIterableIterator { @@ -169,22 +196,24 @@ tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts( } async function * explicitReturnType10(): IterableIterator { ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2741: Property '[Symbol.iterator]' is missing in type 'AsyncIterableIterator' but required in type 'IterableIterator'. -!!! related TS2728 /.ts/lib.es2015.iterable.d.ts:47:5: '[Symbol.iterator]' is declared here. +!!! error TS2741: Property '[Symbol.iterator]' is missing in type 'AsyncGenerator' but required in type 'IterableIterator'. +!!! related TS2728 /.ts/lib.es2015.iterable.d.ts:55:5: '[Symbol.iterator]' is declared here. yield 1; } async function * explicitReturnType11(): Iterable { ~~~~~~~~~~~~~~~~ -!!! error TS2741: Property '[Symbol.iterator]' is missing in type 'AsyncIterableIterator' but required in type 'Iterable'. -!!! related TS2728 /.ts/lib.es2015.iterable.d.ts:43:5: '[Symbol.iterator]' is declared here. +!!! error TS2741: Property '[Symbol.iterator]' is missing in type 'AsyncGenerator' but required in type 'Iterable'. +!!! related TS2728 /.ts/lib.es2015.iterable.d.ts:51:5: '[Symbol.iterator]' is declared here. yield 1; } async function * explicitReturnType12(): Iterator { ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'AsyncIterableIterator' is not assignable to type 'Iterator'. +!!! error TS2322: Type 'AsyncGenerator' is not assignable to type 'Iterator'. !!! error TS2322: Types of property 'next' are incompatible. -!!! error TS2322: Type '(value?: any) => Promise>' is not assignable to type '(value?: any) => IteratorResult'. -!!! error TS2322: Type 'Promise>' is missing the following properties from type 'IteratorResult': done, value +!!! error TS2322: Type '(...args: [] | [PromiseLike]) => Promise>' is not assignable to type '(...args: [] | [undefined]) => IteratorResult'. +!!! error TS2322: Type 'Promise>' is not assignable to type 'IteratorResult'. +!!! error TS2322: Property 'value' is missing in type 'Promise>' but required in type 'IteratorYieldResult'. +!!! related TS2728 /.ts/lib.es2015.iterable.d.ts:33:5: 'value' is declared here. yield 1; } async function * yieldStar() { diff --git a/tests/baselines/reference/types.asyncGenerators.es2018.2.types b/tests/baselines/reference/types.asyncGenerators.es2018.2.types index 6bcc95297a9..23bf7225eb9 100644 --- a/tests/baselines/reference/types.asyncGenerators.es2018.2.types +++ b/tests/baselines/reference/types.asyncGenerators.es2018.2.types @@ -1,6 +1,6 @@ === tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts === async function * inferReturnType1() { ->inferReturnType1 : () => AsyncIterableIterator +>inferReturnType1 : () => AsyncGenerator yield* {}; >yield* {} : any @@ -15,7 +15,7 @@ async function * inferReturnType2() { >inferReturnType2 : () => any } async function * inferReturnType3() { ->inferReturnType3 : () => AsyncIterableIterator +>inferReturnType3 : () => AsyncGenerator yield* Promise.resolve([1, 2]); >yield* Promise.resolve([1, 2]) : any @@ -29,7 +29,7 @@ async function * inferReturnType3() { } const assignability1: () => AsyncIterableIterator = async function * () { >assignability1 : () => AsyncIterableIterator ->async function * () { yield "a";} : () => AsyncIterableIterator +>async function * () { yield "a";} : () => AsyncGenerator yield "a"; >yield "a" : any @@ -38,7 +38,7 @@ const assignability1: () => AsyncIterableIterator = async function * () }; const assignability2: () => AsyncIterableIterator = async function * () { >assignability2 : () => AsyncIterableIterator ->async function * () { yield* ["a", "b"];} : () => AsyncIterableIterator +>async function * () { yield* ["a", "b"];} : () => AsyncGenerator yield* ["a", "b"]; >yield* ["a", "b"] : any @@ -49,20 +49,20 @@ const assignability2: () => AsyncIterableIterator = async function * () }; const assignability3: () => AsyncIterableIterator = async function * () { >assignability3 : () => AsyncIterableIterator ->async function * () { yield* (async function * () { yield "a"; })();} : () => AsyncIterableIterator +>async function * () { yield* (async function * () { yield "a"; })();} : () => AsyncGenerator yield* (async function * () { yield "a"; })(); ->yield* (async function * () { yield "a"; })() : any ->(async function * () { yield "a"; })() : AsyncIterableIterator ->(async function * () { yield "a"; }) : () => AsyncIterableIterator ->async function * () { yield "a"; } : () => AsyncIterableIterator +>yield* (async function * () { yield "a"; })() : void +>(async function * () { yield "a"; })() : AsyncGenerator +>(async function * () { yield "a"; }) : () => AsyncGenerator +>async function * () { yield "a"; } : () => AsyncGenerator >yield "a" : any >"a" : "a" }; const assignability4: () => AsyncIterable = async function * () { >assignability4 : () => AsyncIterable ->async function * () { yield "a";} : () => AsyncIterableIterator +>async function * () { yield "a";} : () => AsyncGenerator yield "a"; >yield "a" : any @@ -71,7 +71,7 @@ const assignability4: () => AsyncIterable = async function * () { }; const assignability5: () => AsyncIterable = async function * () { >assignability5 : () => AsyncIterable ->async function * () { yield* ["a", "b"];} : () => AsyncIterableIterator +>async function * () { yield* ["a", "b"];} : () => AsyncGenerator yield* ["a", "b"]; >yield* ["a", "b"] : any @@ -82,20 +82,20 @@ const assignability5: () => AsyncIterable = async function * () { }; const assignability6: () => AsyncIterable = async function * () { >assignability6 : () => AsyncIterable ->async function * () { yield* (async function * () { yield "a"; })();} : () => AsyncIterableIterator +>async function * () { yield* (async function * () { yield "a"; })();} : () => AsyncGenerator yield* (async function * () { yield "a"; })(); ->yield* (async function * () { yield "a"; })() : any ->(async function * () { yield "a"; })() : AsyncIterableIterator ->(async function * () { yield "a"; }) : () => AsyncIterableIterator ->async function * () { yield "a"; } : () => AsyncIterableIterator +>yield* (async function * () { yield "a"; })() : void +>(async function * () { yield "a"; })() : AsyncGenerator +>(async function * () { yield "a"; }) : () => AsyncGenerator +>async function * () { yield "a"; } : () => AsyncGenerator >yield "a" : any >"a" : "a" }; const assignability7: () => AsyncIterator = async function * () { ->assignability7 : () => AsyncIterator ->async function * () { yield "a";} : () => AsyncIterableIterator +>assignability7 : () => AsyncIterator +>async function * () { yield "a";} : () => AsyncGenerator yield "a"; >yield "a" : any @@ -103,8 +103,8 @@ const assignability7: () => AsyncIterator = async function * () { }; const assignability8: () => AsyncIterator = async function * () { ->assignability8 : () => AsyncIterator ->async function * () { yield* ["a", "b"];} : () => AsyncIterableIterator +>assignability8 : () => AsyncIterator +>async function * () { yield* ["a", "b"];} : () => AsyncGenerator yield* ["a", "b"]; >yield* ["a", "b"] : any @@ -114,14 +114,14 @@ const assignability8: () => AsyncIterator = async function * () { }; const assignability9: () => AsyncIterator = async function * () { ->assignability9 : () => AsyncIterator ->async function * () { yield* (async function * () { yield "a"; })();} : () => AsyncIterableIterator +>assignability9 : () => AsyncIterator +>async function * () { yield* (async function * () { yield "a"; })();} : () => AsyncGenerator yield* (async function * () { yield "a"; })(); ->yield* (async function * () { yield "a"; })() : any ->(async function * () { yield "a"; })() : AsyncIterableIterator ->(async function * () { yield "a"; }) : () => AsyncIterableIterator ->async function * () { yield "a"; } : () => AsyncIterableIterator +>yield* (async function * () { yield "a"; })() : void +>(async function * () { yield "a"; })() : AsyncGenerator +>(async function * () { yield "a"; }) : () => AsyncGenerator +>async function * () { yield "a"; } : () => AsyncGenerator >yield "a" : any >"a" : "a" @@ -130,7 +130,7 @@ async function * explicitReturnType1(): AsyncIterableIterator { >explicitReturnType1 : () => AsyncIterableIterator yield "a"; ->yield "a" : any +>yield "a" : undefined >"a" : "a" } async function * explicitReturnType2(): AsyncIterableIterator { @@ -146,10 +146,10 @@ async function * explicitReturnType3(): AsyncIterableIterator { >explicitReturnType3 : () => AsyncIterableIterator yield* (async function * () { yield "a"; })(); ->yield* (async function * () { yield "a"; })() : any ->(async function * () { yield "a"; })() : AsyncIterableIterator ->(async function * () { yield "a"; }) : () => AsyncIterableIterator ->async function * () { yield "a"; } : () => AsyncIterableIterator +>yield* (async function * () { yield "a"; })() : void +>(async function * () { yield "a"; })() : AsyncGenerator +>(async function * () { yield "a"; }) : () => AsyncGenerator +>async function * () { yield "a"; } : () => AsyncGenerator >yield "a" : any >"a" : "a" } @@ -157,7 +157,7 @@ async function * explicitReturnType4(): AsyncIterable { >explicitReturnType4 : () => AsyncIterable yield "a"; ->yield "a" : any +>yield "a" : undefined >"a" : "a" } async function * explicitReturnType5(): AsyncIterable { @@ -173,22 +173,22 @@ async function * explicitReturnType6(): AsyncIterable { >explicitReturnType6 : () => AsyncIterable yield* (async function * () { yield "a"; })(); ->yield* (async function * () { yield "a"; })() : any ->(async function * () { yield "a"; })() : AsyncIterableIterator ->(async function * () { yield "a"; }) : () => AsyncIterableIterator ->async function * () { yield "a"; } : () => AsyncIterableIterator +>yield* (async function * () { yield "a"; })() : void +>(async function * () { yield "a"; })() : AsyncGenerator +>(async function * () { yield "a"; }) : () => AsyncGenerator +>async function * () { yield "a"; } : () => AsyncGenerator >yield "a" : any >"a" : "a" } async function * explicitReturnType7(): AsyncIterator { ->explicitReturnType7 : () => AsyncIterator +>explicitReturnType7 : () => AsyncIterator yield "a"; ->yield "a" : any +>yield "a" : undefined >"a" : "a" } async function * explicitReturnType8(): AsyncIterator { ->explicitReturnType8 : () => AsyncIterator +>explicitReturnType8 : () => AsyncIterator yield* ["a", "b"]; >yield* ["a", "b"] : any @@ -197,13 +197,13 @@ async function * explicitReturnType8(): AsyncIterator { >"b" : "b" } async function * explicitReturnType9(): AsyncIterator { ->explicitReturnType9 : () => AsyncIterator +>explicitReturnType9 : () => AsyncIterator yield* (async function * () { yield "a"; })(); ->yield* (async function * () { yield "a"; })() : any ->(async function * () { yield "a"; })() : AsyncIterableIterator ->(async function * () { yield "a"; }) : () => AsyncIterableIterator ->async function * () { yield "a"; } : () => AsyncIterableIterator +>yield* (async function * () { yield "a"; })() : void +>(async function * () { yield "a"; })() : AsyncGenerator +>(async function * () { yield "a"; }) : () => AsyncGenerator +>async function * () { yield "a"; } : () => AsyncGenerator >yield "a" : any >"a" : "a" } @@ -211,7 +211,7 @@ async function * explicitReturnType10(): IterableIterator { >explicitReturnType10 : () => IterableIterator yield 1; ->yield 1 : any +>yield 1 : undefined >1 : 1 } async function * explicitReturnType11(): Iterable { @@ -222,14 +222,14 @@ async function * explicitReturnType11(): Iterable { >1 : 1 } async function * explicitReturnType12(): Iterator { ->explicitReturnType12 : () => Iterator +>explicitReturnType12 : () => Iterator yield 1; ->yield 1 : any +>yield 1 : undefined >1 : 1 } async function * yieldStar() { ->yieldStar : () => AsyncIterableIterator +>yieldStar : () => AsyncGenerator yield* {}; >yield* {} : any diff --git a/tests/baselines/reference/types.forAwait.es2018.1.types b/tests/baselines/reference/types.forAwait.es2018.1.types index aa1035b87cb..a606238658c 100644 --- a/tests/baselines/reference/types.forAwait.es2018.1.types +++ b/tests/baselines/reference/types.forAwait.es2018.1.types @@ -40,7 +40,7 @@ async function f1() { } } async function * f2() { ->f2 : () => AsyncIterableIterator +>f2 : () => AsyncGenerator let y: number; >y : number diff --git a/tests/baselines/reference/types.forAwait.es2018.3.errors.txt b/tests/baselines/reference/types.forAwait.es2018.3.errors.txt index 296ac0d066b..1aca869fb0c 100644 --- a/tests/baselines/reference/types.forAwait.es2018.3.errors.txt +++ b/tests/baselines/reference/types.forAwait.es2018.3.errors.txt @@ -1,11 +1,11 @@ -error TS2318: Cannot find global type 'AsyncIterableIterator'. +error TS2318: Cannot find global type 'AsyncGenerator'. tests/cases/conformance/types/forAwait/types.forAwait.es2018.3.ts(3,27): error TS2504: Type '{}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. tests/cases/conformance/types/forAwait/types.forAwait.es2018.3.ts(5,21): error TS2504: Type '{}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. tests/cases/conformance/types/forAwait/types.forAwait.es2018.3.ts(10,27): error TS2504: Type '{}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. tests/cases/conformance/types/forAwait/types.forAwait.es2018.3.ts(12,21): error TS2504: Type '{}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. -!!! error TS2318: Cannot find global type 'AsyncIterableIterator'. +!!! error TS2318: Cannot find global type 'AsyncGenerator'. ==== tests/cases/conformance/types/forAwait/types.forAwait.es2018.3.ts (4 errors) ==== async function f1() { let y: number; diff --git a/tests/baselines/reference/uniqueSymbols.types b/tests/baselines/reference/uniqueSymbols.types index 9ee3be1cb28..da2f9895218 100644 --- a/tests/baselines/reference/uniqueSymbols.types +++ b/tests/baselines/reference/uniqueSymbols.types @@ -113,17 +113,17 @@ function funcReturnConstCallWithTypeQuery(): typeof constCall { return constCall // generator function yield inference function* genFuncYieldConstCall() { yield constCall; } ->genFuncYieldConstCall : () => IterableIterator +>genFuncYieldConstCall : () => Generator >yield constCall : any >constCall : unique symbol function* genFuncYieldLetCall() { yield letCall; } ->genFuncYieldLetCall : () => IterableIterator +>genFuncYieldLetCall : () => Generator >yield letCall : any >letCall : symbol function* genFuncYieldVarCall() { yield varCall; } ->genFuncYieldVarCall : () => IterableIterator +>genFuncYieldVarCall : () => Generator >yield varCall : any >varCall : symbol @@ -131,7 +131,7 @@ function* genFuncYieldVarCall() { yield varCall; } function* genFuncYieldConstCallWithTypeQuery(): IterableIterator { yield constCall; } >genFuncYieldConstCallWithTypeQuery : () => IterableIterator >constCall : unique symbol ->yield constCall : any +>yield constCall : undefined >constCall : unique symbol // async function return inference @@ -149,17 +149,17 @@ async function asyncFuncReturnVarCall() { return varCall; } // async generator function yield inference async function* asyncGenFuncYieldConstCall() { yield constCall; } ->asyncGenFuncYieldConstCall : () => AsyncIterableIterator +>asyncGenFuncYieldConstCall : () => AsyncGenerator >yield constCall : any >constCall : unique symbol async function* asyncGenFuncYieldLetCall() { yield letCall; } ->asyncGenFuncYieldLetCall : () => AsyncIterableIterator +>asyncGenFuncYieldLetCall : () => AsyncGenerator >yield letCall : any >letCall : symbol async function* asyncGenFuncYieldVarCall() { yield varCall; } ->asyncGenFuncYieldVarCall : () => AsyncIterableIterator +>asyncGenFuncYieldVarCall : () => AsyncGenerator >yield varCall : any >varCall : symbol @@ -484,8 +484,8 @@ f(N["s"]); // property assignments/methods const o2 = { ->o2 : { a: symbol; b: symbol; c: symbol; method1(): symbol; method2(): Promise; method3(): AsyncIterableIterator; method4(): IterableIterator; method5(p?: symbol): symbol; } ->{ a: s, b: N.s, c: N["s"], method1() { return s; }, async method2() { return s; }, async * method3() { yield s; }, * method4() { yield s; }, method5(p = s) { return p; },} : { a: symbol; b: symbol; c: symbol; method1(): symbol; method2(): Promise; method3(): AsyncIterableIterator; method4(): IterableIterator; method5(p?: symbol): symbol; } +>o2 : { a: symbol; b: symbol; c: symbol; method1(): symbol; method2(): Promise; method3(): AsyncGenerator; method4(): Generator; method5(p?: symbol): symbol; } +>{ a: s, b: N.s, c: N["s"], method1() { return s; }, async method2() { return s; }, async * method3() { yield s; }, * method4() { yield s; }, method5(p = s) { return p; },} : { a: symbol; b: symbol; c: symbol; method1(): symbol; method2(): Promise; method3(): AsyncGenerator; method4(): Generator; method5(p?: symbol): symbol; } a: s, >a : symbol @@ -512,12 +512,12 @@ const o2 = { >s : unique symbol async * method3() { yield s; }, ->method3 : () => AsyncIterableIterator +>method3 : () => AsyncGenerator >yield s : any >s : unique symbol * method4() { yield s; }, ->method4 : () => IterableIterator +>method4 : () => Generator >yield s : any >s : unique symbol @@ -606,12 +606,12 @@ class C0 { >s : unique symbol async * method3() { yield s; } ->method3 : () => AsyncIterableIterator +>method3 : () => AsyncGenerator >yield s : any >s : unique symbol * method4() { yield s; } ->method4 : () => IterableIterator +>method4 : () => Generator >yield s : any >s : unique symbol @@ -819,7 +819,7 @@ interface Context { const o3: Context = { >o3 : Context ->{ method1() { return s; // return type should not widen due to contextual type }, async method2() { return s; // return type should not widen due to contextual type }, async * method3() { yield s; // yield type should not widen due to contextual type }, * method4() { yield s; // yield type should not widen due to contextual type }, method5(p = s) { // parameter should not widen due to contextual type return p; },} : { method1(): unique symbol; method2(): Promise; method3(): AsyncIterableIterator; method4(): IterableIterator; method5(p?: unique symbol): unique symbol; } +>{ method1() { return s; // return type should not widen due to contextual type }, async method2() { return s; // return type should not widen due to contextual type }, async * method3() { yield s; // yield type should not widen due to contextual type }, * method4() { yield s; // yield type should not widen due to contextual type }, method5(p = s) { // parameter should not widen due to contextual type return p; },} : { method1(): unique symbol; method2(): Promise; method3(): AsyncGenerator; method4(): Generator; method5(p?: unique symbol): unique symbol; } method1() { >method1 : () => unique symbol @@ -836,7 +836,7 @@ const o3: Context = { }, async * method3() { ->method3 : () => AsyncIterableIterator +>method3 : () => AsyncGenerator yield s; // yield type should not widen due to contextual type >yield s : any @@ -844,7 +844,7 @@ const o3: Context = { }, * method4() { ->method4 : () => IterableIterator +>method4 : () => Generator yield s; // yield type should not widen due to contextual type >yield s : any diff --git a/tests/baselines/reference/uniqueSymbolsDeclarations.js b/tests/baselines/reference/uniqueSymbolsDeclarations.js index 02a692aa9ff..15342a0bd97 100644 --- a/tests/baselines/reference/uniqueSymbolsDeclarations.js +++ b/tests/baselines/reference/uniqueSymbolsDeclarations.js @@ -430,16 +430,16 @@ declare function funcReturnConstCall(): symbol; declare function funcReturnLetCall(): symbol; declare function funcReturnVarCall(): symbol; declare function funcReturnConstCallWithTypeQuery(): typeof constCall; -declare function genFuncYieldConstCall(): IterableIterator; -declare function genFuncYieldLetCall(): IterableIterator; -declare function genFuncYieldVarCall(): IterableIterator; +declare function genFuncYieldConstCall(): Generator; +declare function genFuncYieldLetCall(): Generator; +declare function genFuncYieldVarCall(): Generator; declare function genFuncYieldConstCallWithTypeQuery(): IterableIterator; declare function asyncFuncReturnConstCall(): Promise; declare function asyncFuncReturnLetCall(): Promise; declare function asyncFuncReturnVarCall(): Promise; -declare function asyncGenFuncYieldConstCall(): AsyncIterableIterator; -declare function asyncGenFuncYieldLetCall(): AsyncIterableIterator; -declare function asyncGenFuncYieldVarCall(): AsyncIterableIterator; +declare function asyncGenFuncYieldConstCall(): AsyncGenerator; +declare function asyncGenFuncYieldLetCall(): AsyncGenerator; +declare function asyncGenFuncYieldVarCall(): AsyncGenerator; declare class C { static readonly readonlyStaticCall: unique symbol; static readonly readonlyStaticType: unique symbol; @@ -502,8 +502,8 @@ declare const o2: { c: symbol; method1(): symbol; method2(): Promise; - method3(): AsyncIterableIterator; - method4(): IterableIterator; + method3(): AsyncGenerator; + method4(): Generator; method5(p?: symbol): symbol; }; declare class C0 { @@ -521,8 +521,8 @@ declare class C0 { f: symbol; method1(): symbol; method2(): Promise; - method3(): AsyncIterableIterator; - method4(): IterableIterator; + method3(): AsyncGenerator; + method4(): Generator; method5(p?: symbol): symbol; } declare class C1 { diff --git a/tests/baselines/reference/uniqueSymbolsDeclarations.types b/tests/baselines/reference/uniqueSymbolsDeclarations.types index a741802e83f..b8c32385f4b 100644 --- a/tests/baselines/reference/uniqueSymbolsDeclarations.types +++ b/tests/baselines/reference/uniqueSymbolsDeclarations.types @@ -106,17 +106,17 @@ function funcReturnConstCallWithTypeQuery(): typeof constCall { return constCall // generator function yield inference function* genFuncYieldConstCall() { yield constCall; } ->genFuncYieldConstCall : () => IterableIterator +>genFuncYieldConstCall : () => Generator >yield constCall : any >constCall : unique symbol function* genFuncYieldLetCall() { yield letCall; } ->genFuncYieldLetCall : () => IterableIterator +>genFuncYieldLetCall : () => Generator >yield letCall : any >letCall : symbol function* genFuncYieldVarCall() { yield varCall; } ->genFuncYieldVarCall : () => IterableIterator +>genFuncYieldVarCall : () => Generator >yield varCall : any >varCall : symbol @@ -124,7 +124,7 @@ function* genFuncYieldVarCall() { yield varCall; } function* genFuncYieldConstCallWithTypeQuery(): IterableIterator { yield constCall; } >genFuncYieldConstCallWithTypeQuery : () => IterableIterator >constCall : unique symbol ->yield constCall : any +>yield constCall : undefined >constCall : unique symbol // async function return inference @@ -142,17 +142,17 @@ async function asyncFuncReturnVarCall() { return varCall; } // async generator function yield inference async function* asyncGenFuncYieldConstCall() { yield constCall; } ->asyncGenFuncYieldConstCall : () => AsyncIterableIterator +>asyncGenFuncYieldConstCall : () => AsyncGenerator >yield constCall : any >constCall : unique symbol async function* asyncGenFuncYieldLetCall() { yield letCall; } ->asyncGenFuncYieldLetCall : () => AsyncIterableIterator +>asyncGenFuncYieldLetCall : () => AsyncGenerator >yield letCall : any >letCall : symbol async function* asyncGenFuncYieldVarCall() { yield varCall; } ->asyncGenFuncYieldVarCall : () => AsyncIterableIterator +>asyncGenFuncYieldVarCall : () => AsyncGenerator >yield varCall : any >varCall : symbol @@ -477,8 +477,8 @@ f(N["s"]); // property assignments/methods const o2 = { ->o2 : { a: symbol; b: symbol; c: symbol; method1(): symbol; method2(): Promise; method3(): AsyncIterableIterator; method4(): IterableIterator; method5(p?: symbol): symbol; } ->{ a: s, b: N.s, c: N["s"], method1() { return s; }, async method2() { return s; }, async * method3() { yield s; }, * method4() { yield s; }, method5(p = s) { return p; }} : { a: symbol; b: symbol; c: symbol; method1(): symbol; method2(): Promise; method3(): AsyncIterableIterator; method4(): IterableIterator; method5(p?: symbol): symbol; } +>o2 : { a: symbol; b: symbol; c: symbol; method1(): symbol; method2(): Promise; method3(): AsyncGenerator; method4(): Generator; method5(p?: symbol): symbol; } +>{ a: s, b: N.s, c: N["s"], method1() { return s; }, async method2() { return s; }, async * method3() { yield s; }, * method4() { yield s; }, method5(p = s) { return p; }} : { a: symbol; b: symbol; c: symbol; method1(): symbol; method2(): Promise; method3(): AsyncGenerator; method4(): Generator; method5(p?: symbol): symbol; } a: s, >a : symbol @@ -505,12 +505,12 @@ const o2 = { >s : unique symbol async * method3() { yield s; }, ->method3 : () => AsyncIterableIterator +>method3 : () => AsyncGenerator >yield s : any >s : unique symbol * method4() { yield s; }, ->method4 : () => IterableIterator +>method4 : () => Generator >yield s : any >s : unique symbol @@ -599,12 +599,12 @@ class C0 { >s : unique symbol async * method3() { yield s; } ->method3 : () => AsyncIterableIterator +>method3 : () => AsyncGenerator >yield s : any >s : unique symbol * method4() { yield s; } ->method4 : () => IterableIterator +>method4 : () => Generator >yield s : any >s : unique symbol @@ -812,7 +812,7 @@ interface Context { const o4: Context = { >o4 : Context ->{ method1() { return s; // return type should not widen due to contextual type }, async method2() { return s; // return type should not widen due to contextual type }, async * method3() { yield s; // yield type should not widen due to contextual type }, * method4() { yield s; // yield type should not widen due to contextual type }, method5(p = s) { // parameter should not widen due to contextual type return p; }} : { method1(): unique symbol; method2(): Promise; method3(): AsyncIterableIterator; method4(): IterableIterator; method5(p?: unique symbol): unique symbol; } +>{ method1() { return s; // return type should not widen due to contextual type }, async method2() { return s; // return type should not widen due to contextual type }, async * method3() { yield s; // yield type should not widen due to contextual type }, * method4() { yield s; // yield type should not widen due to contextual type }, method5(p = s) { // parameter should not widen due to contextual type return p; }} : { method1(): unique symbol; method2(): Promise; method3(): AsyncGenerator; method4(): Generator; method5(p?: unique symbol): unique symbol; } method1() { >method1 : () => unique symbol @@ -829,7 +829,7 @@ const o4: Context = { }, async * method3() { ->method3 : () => AsyncIterableIterator +>method3 : () => AsyncGenerator yield s; // yield type should not widen due to contextual type >yield s : any @@ -837,7 +837,7 @@ const o4: Context = { }, * method4() { ->method4 : () => IterableIterator +>method4 : () => Generator yield s; // yield type should not widen due to contextual type >yield s : any diff --git a/tests/baselines/reference/yieldExpression1.types b/tests/baselines/reference/yieldExpression1.types index 5f7a1c2f69b..3e2510229e0 100644 --- a/tests/baselines/reference/yieldExpression1.types +++ b/tests/baselines/reference/yieldExpression1.types @@ -1,6 +1,6 @@ === tests/cases/compiler/yieldExpression1.ts === function* a() { ->a : () => IterableIterator<0 | undefined> +>a : () => Generator<0 | undefined, void, unknown> yield; >yield : any @@ -14,10 +14,10 @@ function* b(): IterableIterator { >b : () => IterableIterator yield; ->yield : any +>yield : undefined yield 0; ->yield 0 : any +>yield 0 : undefined >0 : 0 } diff --git a/tests/baselines/reference/yieldExpressionInControlFlow.types b/tests/baselines/reference/yieldExpressionInControlFlow.types index 14650ef0582..8e2a3dc76f5 100644 --- a/tests/baselines/reference/yieldExpressionInControlFlow.types +++ b/tests/baselines/reference/yieldExpressionInControlFlow.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/bug25149.js === function* f() { ->f : () => IterableIterator +>f : () => Generator var o >o : any @@ -19,7 +19,7 @@ function* f() { === tests/cases/conformance/es6/yieldExpressions/alsoFails.ts === // fails in Typescript too function* g() { ->g : () => IterableIterator +>g : () => Generator var o = [] >o : any[] diff --git a/tests/baselines/reference/yieldExpressionInFlowLoop.types b/tests/baselines/reference/yieldExpressionInFlowLoop.types index a178d4b5ce7..9af0ffd5901 100644 --- a/tests/baselines/reference/yieldExpressionInFlowLoop.types +++ b/tests/baselines/reference/yieldExpressionInFlowLoop.types @@ -1,6 +1,6 @@ === tests/cases/compiler/yieldExpressionInFlowLoop.ts === function* f() { ->f : () => IterableIterator +>f : () => Generator let result; >result : any diff --git a/tests/baselines/reference/yieldExpressionInnerCommentEmit.types b/tests/baselines/reference/yieldExpressionInnerCommentEmit.types index d6d384712f7..3c0aec3fdd5 100644 --- a/tests/baselines/reference/yieldExpressionInnerCommentEmit.types +++ b/tests/baselines/reference/yieldExpressionInnerCommentEmit.types @@ -1,6 +1,6 @@ === tests/cases/compiler/yieldExpressionInnerCommentEmit.ts === function * foo2() { ->foo2 : () => IterableIterator +>foo2 : () => Generator /*comment1*/ yield 1; >yield 1 : any diff --git a/tests/cases/conformance/es6/for-ofStatements/for-of30.ts b/tests/cases/conformance/es6/for-ofStatements/for-of30.ts index 67e1e3da70a..3d8ac3a93af 100644 --- a/tests/cases/conformance/es6/for-ofStatements/for-of30.ts +++ b/tests/cases/conformance/es6/for-ofStatements/for-of30.ts @@ -6,9 +6,9 @@ class StringIterator { value: "" } } - + return = 0; - + [Symbol.iterator]() { return this; } diff --git a/tests/cases/conformance/es6/for-ofStatements/for-of31.ts b/tests/cases/conformance/es6/for-ofStatements/for-of31.ts index 701fcb50ed0..1e8d7e10630 100644 --- a/tests/cases/conformance/es6/for-ofStatements/for-of31.ts +++ b/tests/cases/conformance/es6/for-ofStatements/for-of31.ts @@ -6,7 +6,7 @@ class StringIterator { value: "" } } - + [Symbol.iterator]() { return this; } diff --git a/tests/cases/conformance/es6/for-ofStatements/for-of34.ts b/tests/cases/conformance/es6/for-ofStatements/for-of34.ts index 63b88223996..b38a6a68bf6 100644 --- a/tests/cases/conformance/es6/for-ofStatements/for-of34.ts +++ b/tests/cases/conformance/es6/for-ofStatements/for-of34.ts @@ -4,7 +4,7 @@ class StringIterator { next() { return v; } - + [Symbol.iterator]() { return this; } diff --git a/tests/cases/conformance/es6/for-ofStatements/for-of35.ts b/tests/cases/conformance/es6/for-ofStatements/for-of35.ts index ab6e26d6d60..041f611699e 100644 --- a/tests/cases/conformance/es6/for-ofStatements/for-of35.ts +++ b/tests/cases/conformance/es6/for-ofStatements/for-of35.ts @@ -7,7 +7,7 @@ class StringIterator { value: v } } - + [Symbol.iterator]() { return this; } diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts index 06bceec84f5..d34f3b3b164 100644 --- a/tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts @@ -16,7 +16,7 @@ class SymbolIterator { } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -29,4 +29,4 @@ class StringIterator { } } -new Foo(...[...new SymbolIterator, ...[...new StringIterator]]); \ No newline at end of file +new Foo(...[...new SymbolIterator, ...[...new _StringIterator]]); \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall5.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall5.ts index 53b0e660379..0bc67491e94 100644 --- a/tests/cases/conformance/es6/spread/iteratorSpreadInCall5.ts +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall5.ts @@ -13,7 +13,7 @@ class SymbolIterator { } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -26,4 +26,4 @@ class StringIterator { } } -foo(...new SymbolIterator, ...new StringIterator); \ No newline at end of file +foo(...new SymbolIterator, ...new _StringIterator); \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts index c48260e97ea..d5a49882e45 100644 --- a/tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts @@ -13,7 +13,7 @@ class SymbolIterator { } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -26,4 +26,4 @@ class StringIterator { } } -foo(...new SymbolIterator, ...new StringIterator); \ No newline at end of file +foo(...new SymbolIterator, ...new _StringIterator); \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts index 6893cd9d8a4..be057412abd 100644 --- a/tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts @@ -13,7 +13,7 @@ class SymbolIterator { } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -26,4 +26,4 @@ class StringIterator { } } -foo(...new SymbolIterator, ...new StringIterator); \ No newline at end of file +foo(...new SymbolIterator, ...new _StringIterator); \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts index c81a475d7de..9f84a5b2bde 100644 --- a/tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts @@ -16,7 +16,7 @@ class SymbolIterator { } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -29,4 +29,4 @@ class StringIterator { } } -new Foo(...new SymbolIterator, ...new StringIterator); \ No newline at end of file +new Foo(...new SymbolIterator, ...new _StringIterator); \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts index 41ee21a5645..7f3f02eafb3 100644 --- a/tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts @@ -16,7 +16,7 @@ class SymbolIterator { } } -class StringIterator { +class _StringIterator { next() { return { value: "", @@ -29,4 +29,4 @@ class StringIterator { } } -new Foo(...new SymbolIterator, ...[...new StringIterator]); +new Foo(...new SymbolIterator, ...[...new _StringIterator]); diff --git a/tests/cases/conformance/generators/generatorAssignability.ts b/tests/cases/conformance/generators/generatorAssignability.ts new file mode 100644 index 00000000000..8dfa7f7d8cf --- /dev/null +++ b/tests/cases/conformance/generators/generatorAssignability.ts @@ -0,0 +1,73 @@ +// @target: esnext +// @strict: true +// @noEmit: true + +declare let _: any; +declare const g1: Generator; +declare const g2: Generator; +declare const g3: Generator; +declare const g4: AsyncGenerator; +declare const g5: AsyncGenerator; +declare const g6: AsyncGenerator; + +// spread iterable +[...g1]; // error +[...g2]; // ok + +// binding pattern over iterable +let [x1] = g1; // error +let [x2] = g2; // ok + +// binding rest pattern over iterable +let [...y1] = g1; // error +let [...y2] = g2; // ok + +// assignment pattern over iterable +[_] = g1; // error +[_] = g2; // ok + +// assignment rest pattern over iterable +[..._] = g1; // error +[..._] = g2; // ok + +// for-of over iterable +for (_ of g1); // error +for (_ of g2); // ok + +async function asyncfn() { + // for-await-of over iterable + for await (_ of g1); // error + for await (_ of g2); // ok + + // for-await-of over asynciterable + for await (_ of g4); // error + for await (_ of g5); // ok +} + +function* f1(): Generator { + // yield* over iterable + yield* g1; // error + yield* g3; // ok +} + +async function* f2(): AsyncGenerator { + // yield* over iterable + yield* g1; // error + yield* g3; // ok + + // yield* over asynciterable + yield* g4; // error + yield* g6; // ok +} + +async function f3() { + const syncGenerator = function*() { + yield 1; + yield 2; + }; + + const o = {[Symbol.asyncIterator]: syncGenerator}; + + for await (const x of o) { + } +} diff --git a/tests/cases/conformance/generators/generatorExplicitReturnType.ts b/tests/cases/conformance/generators/generatorExplicitReturnType.ts new file mode 100644 index 00000000000..affcc011467 --- /dev/null +++ b/tests/cases/conformance/generators/generatorExplicitReturnType.ts @@ -0,0 +1,28 @@ +// @target: esnext +// @strictNullChecks: true +// @noImplicitReturns: true +// @noImplicitAny: true + +function* g1(): Generator { + yield; // error + yield "a"; // error + const x: number = yield 1; // error + return 10; // error +} + +function* g2(): Generator { + const x = yield 1; + return true; +} + +declare const generator: Generator; + +function* g3(): Generator { + const x: number = yield* generator; // error + return true; +} + +function* g4(): Generator { + const x = yield* generator; + return true; +} \ No newline at end of file diff --git a/tests/cases/conformance/generators/generatorImplicitAny.ts b/tests/cases/conformance/generators/generatorImplicitAny.ts new file mode 100644 index 00000000000..441107defe5 --- /dev/null +++ b/tests/cases/conformance/generators/generatorImplicitAny.ts @@ -0,0 +1,6 @@ +// @target: esnext +// @strictNullChecks: true +// @noImplicitReturns: true +// @noImplicitAny: true + +function* g() {} \ No newline at end of file diff --git a/tests/cases/conformance/generators/generatorReturnTypeInference.ts b/tests/cases/conformance/generators/generatorReturnTypeInference.ts new file mode 100644 index 00000000000..30d35cebd77 --- /dev/null +++ b/tests/cases/conformance/generators/generatorReturnTypeInference.ts @@ -0,0 +1,137 @@ +// @target: esnext +// @strictNullChecks: true +// @noImplicitReturns: true +// @noImplicitAny: true + +declare const iterableIterator: IterableIterator; +declare const generator: Generator; +declare const never: never; + +function* g000() { // Generator +} + +// 'yield' iteration type inference +function* g001() { // Generator + yield; +} + +function* g002() { // Generator + yield 1; +} + +function* g003() { // Generator + yield* []; +} + +function* g004() { // Generator + yield* iterableIterator; +} + +function* g005() { // Generator + const x = yield* generator; +} + +function* g006() { // Generator<1 | 2, void, unknown> + yield 1; + yield 2; +} + +function* g007() { // Generator + yield never; +} + +// 'return' iteration type inference +function* g102() { // Generator + return 1; +} + +function* g103() { // Generator + if (Math.random()) return 1; + return 2; +} + +function* g104() { // Generator + return never; +} + +// 'next' iteration type inference +function* g201() { // Generator + let a: string = yield 1; +} + +function* g202() { // Generator<1 | 2, void, never> + let a: string = yield 1; + let b: number = yield 2; +} + +declare function f1(x: string): void; +declare function f1(x: number): void; + +function* g203() { // Generator + const x = f1(yield 1); +} + +declare function f2(x: T): T; + +function* g204() { // Generator + const x = f2(yield 1); +} + +// mixed iteration types inference + +function* g301() { // Generator + yield; + return; +} + +function* g302() { // Generator + yield 1; + return; +} + +function* g303() { // Generator + yield; + return "a"; +} + +function* g304() { // Generator + yield 1; + return "a"; +} + +function* g305() { // Generator<1 | 2, "a" | "b", unknown> + if (Math.random()) yield 1; + yield 2; + if (Math.random()) return "a"; + return "b"; +} + +function* g306() { // Generator + const a: "hi" = yield 1; + return true; +} + +function* g307() { // Generator + const a: T = yield 0; + return a; +} + +function* g308(x: T) { // Generator + const a: T = yield x; + return a; +} + +function* g309(x: T, y: U) { // Generator + const a: V = yield x; + return y; +} + +function* g310() { // Generator + const [a = 1, b = 2] = yield; +} + +function* g311() { // Generator + yield* (function*() { + const y: string = yield; + })(); +} diff --git a/tests/cases/conformance/generators/generatorReturnTypeInferenceNonStrict.ts b/tests/cases/conformance/generators/generatorReturnTypeInferenceNonStrict.ts new file mode 100644 index 00000000000..98519e20663 --- /dev/null +++ b/tests/cases/conformance/generators/generatorReturnTypeInferenceNonStrict.ts @@ -0,0 +1,139 @@ +// @target: esnext +// @strictNullChecks: false +// @noImplicitReturns: true +// @noImplicitAny: true + +declare const iterableIterator: IterableIterator; +declare const generator: Generator; +declare const never: never; + +function* g000() { // Generator +} + +// 'yield' iteration type inference +function* g001() { // Generator + yield; +} + +function* g002() { // Generator + yield 1; +} + +function* g003() { // Generator + // NOTE: In strict mode, `[]` produces the type `never[]`. + // In non-strict mode, `[]` produces the type `undefined[]` which is implicitly any. + yield* []; +} + +function* g004() { // Generator + yield* iterableIterator; +} + +function* g005() { // Generator + const x = yield* generator; +} + +function* g006() { // Generator<1 | 2, void, unknown> + yield 1; + yield 2; +} + +function* g007() { // Generator + yield never; +} + +// 'return' iteration type inference +function* g102() { // Generator + return 1; +} + +function* g103() { // Generator + if (Math.random()) return 1; + return 2; +} + +function* g104() { // Generator + return never; +} + +// 'next' iteration type inference +function* g201() { // Generator + let a: string = yield 1; +} + +function* g202() { // Generator<1 | 2, void, never> + let a: string = yield 1; + let b: number = yield 2; +} + +declare function f1(x: string): void; +declare function f1(x: number): void; + +function* g203() { // Generator + const x = f1(yield 1); +} + +declare function f2(x: T): T; + +function* g204() { // Generator + const x = f2(yield 1); +} + +// mixed iteration types inference + +function* g301() { // Generator + yield; + return; +} + +function* g302() { // Generator + yield 1; + return; +} + +function* g303() { // Generator + yield; + return "a"; +} + +function* g304() { // Generator + yield 1; + return "a"; +} + +function* g305() { // Generator<1 | 2, "a" | "b", unknown> + if (Math.random()) yield 1; + yield 2; + if (Math.random()) return "a"; + return "b"; +} + +function* g306() { // Generator + const a: "hi" = yield 1; + return true; +} + +function* g307() { // Generator + const a: T = yield 0; + return a; +} + +function* g308(x: T) { // Generator + const a: T = yield x; + return a; +} + +function* g309(x: T, y: U) { // Generator + const a: V = yield x; + return y; +} + +function* g310() { // Generator + const [a = 1, b = 2] = yield; +} + +function* g311() { // Generator + yield* (function*() { + const y: string = yield; + })(); +} From d7f8f0072e5ff8d6731f4f656f3319b4bd0d8e4f Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 4 Jul 2019 16:26:54 -1000 Subject: [PATCH 70/95] Include conditional types in top-level type parameter check --- src/compiler/checker.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 40b86ad679a..9b540573c26 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15208,7 +15208,11 @@ namespace ts { } function isTypeParameterAtTopLevel(type: Type, typeParameter: TypeParameter): boolean { - return type === typeParameter || !!(type.flags & TypeFlags.UnionOrIntersection) && some((type).types, t => isTypeParameterAtTopLevel(t, typeParameter)); + return !!(type === typeParameter || + type.flags & TypeFlags.UnionOrIntersection && some((type).types, t => isTypeParameterAtTopLevel(t, typeParameter)) || + type.flags & TypeFlags.Conditional && ( + isTypeParameterAtTopLevel(getTrueTypeFromConditionalType(type), typeParameter) || + isTypeParameterAtTopLevel(getFalseTypeFromConditionalType(type), typeParameter))); } /** Create an object with properties named in the string literal type. Every property has type `any` */ From de2fb9584e96738283ec921499bd90af1a281a29 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 4 Jul 2019 16:27:03 -1000 Subject: [PATCH 71/95] Add regression test --- .../cases/conformance/types/literal/literalTypeWidening.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/cases/conformance/types/literal/literalTypeWidening.ts b/tests/cases/conformance/types/literal/literalTypeWidening.ts index 17daedb3b0e..d1333601996 100644 --- a/tests/cases/conformance/types/literal/literalTypeWidening.ts +++ b/tests/cases/conformance/types/literal/literalTypeWidening.ts @@ -134,3 +134,10 @@ function test(obj: T): T { let { a, ...rest } = obj; return { a: 'hello', ...rest } as T; } + +// Repro from #32169 + +declare function f(x: T): NonNullable; +enum E { A, B } +const a = f(E.A); +const b: E.A = a; From 0d992921d5b96c527711dce52601959a2aa10248 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 4 Jul 2019 16:27:19 -1000 Subject: [PATCH 72/95] Accept new baselines --- .../reference/literalTypeWidening.js | 14 ++++++++++ .../reference/literalTypeWidening.symbols | 28 +++++++++++++++++++ .../reference/literalTypeWidening.types | 24 ++++++++++++++++ 3 files changed, 66 insertions(+) diff --git a/tests/baselines/reference/literalTypeWidening.js b/tests/baselines/reference/literalTypeWidening.js index ff1f41aa7eb..bb29b167add 100644 --- a/tests/baselines/reference/literalTypeWidening.js +++ b/tests/baselines/reference/literalTypeWidening.js @@ -135,6 +135,13 @@ function test(obj: T): T { let { a, ...rest } = obj; return { a: 'hello', ...rest } as T; } + +// Repro from #32169 + +declare function f(x: T): NonNullable; +enum E { A, B } +const a = f(E.A); +const b: E.A = a; //// [literalTypeWidening.js] @@ -267,3 +274,10 @@ function test(obj) { var a = obj.a, rest = __rest(obj, ["a"]); return __assign({ a: 'hello' }, rest); } +var E; +(function (E) { + E[E["A"] = 0] = "A"; + E[E["B"] = 1] = "B"; +})(E || (E = {})); +var a = f(E.A); +var b = a; diff --git a/tests/baselines/reference/literalTypeWidening.symbols b/tests/baselines/reference/literalTypeWidening.symbols index 4ce9c9a9468..c51210337f9 100644 --- a/tests/baselines/reference/literalTypeWidening.symbols +++ b/tests/baselines/reference/literalTypeWidening.symbols @@ -422,3 +422,31 @@ function test(obj: T): T { >T : Symbol(T, Decl(literalTypeWidening.ts, 132, 14)) } +// Repro from #32169 + +declare function f(x: T): NonNullable; +>f : Symbol(f, Decl(literalTypeWidening.ts, 135, 1)) +>T : Symbol(T, Decl(literalTypeWidening.ts, 139, 19)) +>x : Symbol(x, Decl(literalTypeWidening.ts, 139, 22)) +>T : Symbol(T, Decl(literalTypeWidening.ts, 139, 19)) +>NonNullable : Symbol(NonNullable, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(literalTypeWidening.ts, 139, 19)) + +enum E { A, B } +>E : Symbol(E, Decl(literalTypeWidening.ts, 139, 44)) +>A : Symbol(E.A, Decl(literalTypeWidening.ts, 140, 8)) +>B : Symbol(E.B, Decl(literalTypeWidening.ts, 140, 11)) + +const a = f(E.A); +>a : Symbol(a, Decl(literalTypeWidening.ts, 141, 5)) +>f : Symbol(f, Decl(literalTypeWidening.ts, 135, 1)) +>E.A : Symbol(E.A, Decl(literalTypeWidening.ts, 140, 8)) +>E : Symbol(E, Decl(literalTypeWidening.ts, 139, 44)) +>A : Symbol(E.A, Decl(literalTypeWidening.ts, 140, 8)) + +const b: E.A = a; +>b : Symbol(b, Decl(literalTypeWidening.ts, 142, 5)) +>E : Symbol(E, Decl(literalTypeWidening.ts, 139, 44)) +>A : Symbol(E.A, Decl(literalTypeWidening.ts, 140, 8)) +>a : Symbol(a, Decl(literalTypeWidening.ts, 141, 5)) + diff --git a/tests/baselines/reference/literalTypeWidening.types b/tests/baselines/reference/literalTypeWidening.types index 95bde9a08ac..8fed2df9986 100644 --- a/tests/baselines/reference/literalTypeWidening.types +++ b/tests/baselines/reference/literalTypeWidening.types @@ -454,3 +454,27 @@ function test(obj: T): T { >rest : Pick> } +// Repro from #32169 + +declare function f(x: T): NonNullable; +>f : (x: T) => NonNullable +>x : T + +enum E { A, B } +>E : E +>A : E.A +>B : E.B + +const a = f(E.A); +>a : E.A +>f(E.A) : E.A +>f : (x: T) => NonNullable +>E.A : E.A +>E : typeof E +>A : E.A + +const b: E.A = a; +>b : E.A +>E : any +>a : E.A + From 7d08f172d8006c5aa328adcf39b10f3003efebf3 Mon Sep 17 00:00:00 2001 From: Florian Regensburger Date: Sun, 7 Jul 2019 13:56:34 +0200 Subject: [PATCH 73/95] Added fourslash tests for standalone and array initialization cases and started implementing them --- ...ngConstInForLoop.ts => addMissingConst.ts} | 28 +++++++++++++++---- src/services/tsconfig.json | 2 +- .../codeFixAddMissingConstInForInLoop2.ts | 2 +- ...ngConstInForLoopWithArrayDestructuring2.ts | 2 +- ...gConstInForLoopWithObjectDestructuring2.ts | 2 +- .../codeFixAddMissingConstInForOfLoop2.ts | 2 +- ...FixAddMissingConstToArrayDestructuring1.ts | 8 ++++++ ...FixAddMissingConstToArrayDestructuring2.ts | 9 ++++++ ...FixAddMissingConstToArrayDestructuring3.ts | 6 ++++ ...xAddMissingConstToStandaloneIdentifier1.ts | 8 ++++++ ...xAddMissingConstToStandaloneIdentifier2.ts | 5 ++++ 11 files changed, 64 insertions(+), 10 deletions(-) rename src/services/codefixes/{addMissingConstInForLoop.ts => addMissingConst.ts} (55%) create mode 100644 tests/cases/fourslash/codeFixAddMissingConstToArrayDestructuring1.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingConstToArrayDestructuring2.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingConstToArrayDestructuring3.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingConstToStandaloneIdentifier1.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingConstToStandaloneIdentifier2.ts diff --git a/src/services/codefixes/addMissingConstInForLoop.ts b/src/services/codefixes/addMissingConst.ts similarity index 55% rename from src/services/codefixes/addMissingConstInForLoop.ts rename to src/services/codefixes/addMissingConst.ts index 9110fb31a10..857d7fb4282 100644 --- a/src/services/codefixes/addMissingConstInForLoop.ts +++ b/src/services/codefixes/addMissingConst.ts @@ -1,6 +1,6 @@ /* @internal */ namespace ts.codefix { - const fixId = "addMissingConstInForLoop"; + const fixId = "addMissingConst"; const errorCodes = [ Diagnostics.Cannot_find_name_0.code, Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code @@ -22,12 +22,30 @@ namespace ts.codefix { }); function makeChange(changeTracker: textChanges.ChangeTracker, sourceFile: SourceFile, pos: number, fixedNodes?: NodeSet) { - const forInitializer = findAncestor(getTokenAtPosition(sourceFile, pos), node => + const token = getTokenAtPosition(sourceFile, pos); + + const forInitializer = findAncestor(token, node => isForInOrOfStatement(node.parent) ? node.parent.initializer === node : isPossiblyPartOfDestructuring(node) ? false : "quit"); - if (!forInitializer) return; - if (!fixedNodes || fixedNodes.tryAdd(forInitializer)) { - changeTracker.insertNodeBefore(sourceFile, forInitializer, createToken(SyntaxKind.ConstKeyword)); + if (forInitializer) return applyChange(changeTracker, forInitializer, sourceFile, fixedNodes); + + const parent = token.parent; + const standaloneInitializer = isExpressionStatement(parent.parent); + if (standaloneInitializer) return applyChange(changeTracker, parent, sourceFile, fixedNodes); + + const arrayLiteralInitializer = isArrayLiteralExpression(token.parent); + if (arrayLiteralInitializer) { + const availableIdentifiers: string[] = []; // TODO: where to get/gather this information from? + const noIdentifiersDeclared = parent.forEachChild(node => availableIdentifiers.indexOf(node.getFullText()) < 0); + if (!noIdentifiersDeclared) return; + + return applyChange(changeTracker, parent, sourceFile, fixedNodes); + } + } + + function applyChange(changeTracker: textChanges.ChangeTracker, initializer: Node, sourceFile: SourceFile, fixedNodes?: NodeSet) { + if (!fixedNodes || fixedNodes.tryAdd(initializer)) { + changeTracker.insertNodeBefore(sourceFile, initializer, createToken(SyntaxKind.ConstKeyword)); } } diff --git a/src/services/tsconfig.json b/src/services/tsconfig.json index b48f27cf1c6..5e6de0f15ca 100644 --- a/src/services/tsconfig.json +++ b/src/services/tsconfig.json @@ -45,7 +45,7 @@ "codeFixProvider.ts", "refactorProvider.ts", "codefixes/addConvertToUnknownForNonOverlappingTypes.ts", - "codefixes/addMissingConstInForLoop.ts", + "codefixes/addMissingConst.ts", "codefixes/addMissingInvocationForDecorator.ts", "codefixes/addNameToNamelessParameter.ts", "codefixes/annotateWithTypeFromJSDoc.ts", diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForInLoop2.ts b/tests/cases/fourslash/codeFixAddMissingConstInForInLoop2.ts index d101f384044..03fb12f5d7e 100644 --- a/tests/cases/fourslash/codeFixAddMissingConstInForInLoop2.ts +++ b/tests/cases/fourslash/codeFixAddMissingConstInForInLoop2.ts @@ -4,7 +4,7 @@ ////for (y in []) {} verify.codeFixAll({ - fixId: "addMissingConstInForLoop", + fixId: "addMissingConst", fixAllDescription: "Add 'const' to all unresolved variables", newFileContent: `for (const x in []) {} diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithArrayDestructuring2.ts b/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithArrayDestructuring2.ts index 734b53ed4fb..c0f8b733aec 100644 --- a/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithArrayDestructuring2.ts +++ b/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithArrayDestructuring2.ts @@ -4,7 +4,7 @@ ////for ([x] of [[1,2]]) {} verify.codeFixAll({ - fixId: "addMissingConstInForLoop", + fixId: "addMissingConst", fixAllDescription: "Add 'const' to all unresolved variables", newFileContent: `for (const [x, y] of [[1,2]]) {} diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithObjectDestructuring2.ts b/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithObjectDestructuring2.ts index 82cd2db6dc2..aa8ec294972 100644 --- a/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithObjectDestructuring2.ts +++ b/tests/cases/fourslash/codeFixAddMissingConstInForLoopWithObjectDestructuring2.ts @@ -4,7 +4,7 @@ ////for ({ x } of [{ x: 0 }]) { } verify.codeFixAll({ - fixId: "addMissingConstInForLoop", + fixId: "addMissingConst", fixAllDescription: "Add 'const' to all unresolved variables", newFileContent: `for (const { x, y } of [{ x: 0, y: 1 }]) { } diff --git a/tests/cases/fourslash/codeFixAddMissingConstInForOfLoop2.ts b/tests/cases/fourslash/codeFixAddMissingConstInForOfLoop2.ts index 3dbab65de32..24f8b48dfc9 100644 --- a/tests/cases/fourslash/codeFixAddMissingConstInForOfLoop2.ts +++ b/tests/cases/fourslash/codeFixAddMissingConstInForOfLoop2.ts @@ -4,7 +4,7 @@ ////for (y of []) {} verify.codeFixAll({ - fixId: "addMissingConstInForLoop", + fixId: "addMissingConst", fixAllDescription: "Add 'const' to all unresolved variables", newFileContent: `for (const x of []) {} diff --git a/tests/cases/fourslash/codeFixAddMissingConstToArrayDestructuring1.ts b/tests/cases/fourslash/codeFixAddMissingConstToArrayDestructuring1.ts new file mode 100644 index 00000000000..8e40466c3ba --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstToArrayDestructuring1.ts @@ -0,0 +1,8 @@ +/// + +////[x] = [0]; + +verify.codeFix({ + description: "Add 'const' to unresolved variable", + newFileContent: "const [x] = [0];" +}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstToArrayDestructuring2.ts b/tests/cases/fourslash/codeFixAddMissingConstToArrayDestructuring2.ts new file mode 100644 index 00000000000..57a89076cb2 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstToArrayDestructuring2.ts @@ -0,0 +1,9 @@ +/// + +////[x, y] = [0, 1]; + +verify.codeFixAll({ + fixId: "addMissingConst", + fixAllDescription: "Add 'const' to all unresolved variables", + newFileContent: "const [x, y] = [0, 1];" +}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstToArrayDestructuring3.ts b/tests/cases/fourslash/codeFixAddMissingConstToArrayDestructuring3.ts new file mode 100644 index 00000000000..4099e1fe473 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstToArrayDestructuring3.ts @@ -0,0 +1,6 @@ +/// + +////let x: any; +////[x, y] = [0, 1]; + +verify.not.codeFixAvailable(); diff --git a/tests/cases/fourslash/codeFixAddMissingConstToStandaloneIdentifier1.ts b/tests/cases/fourslash/codeFixAddMissingConstToStandaloneIdentifier1.ts new file mode 100644 index 00000000000..0a603dced30 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstToStandaloneIdentifier1.ts @@ -0,0 +1,8 @@ +/// + +////x = 0; + +verify.codeFix({ + description: "Add 'const' to unresolved variable", + newFileContent: "const x = 0;" +}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstToStandaloneIdentifier2.ts b/tests/cases/fourslash/codeFixAddMissingConstToStandaloneIdentifier2.ts new file mode 100644 index 00000000000..aa08f4e9196 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstToStandaloneIdentifier2.ts @@ -0,0 +1,5 @@ +/// + +////x = 0, y = 0; + +verify.not.codeFixAvailable(); From 2233ebadeaf98162c2ffdb9e07ee90776baabe85 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 8 Jul 2019 09:52:12 -0700 Subject: [PATCH 74/95] Update baselines --- .../reference/promisePermutations.errors.txt | 392 +++++++++--------- .../reference/promisePermutations2.errors.txt | 144 +++---- .../reference/promisePermutations3.errors.txt | 248 +++++------ .../reference/underscoreTest1.errors.txt | 18 +- 4 files changed, 401 insertions(+), 401 deletions(-) diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index cfc491027ee..1cb61562fe3 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -1,125 +1,125 @@ -tests/cases/compiler/promisePermutations.ts(74,70): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(74,70): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(79,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(79,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(82,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(82,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(83,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(83,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(84,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(84,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(88,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(88,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(91,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(91,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(92,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(92,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations.ts(93,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(93,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(97,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(97,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(100,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(100,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(101,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(101,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations.ts(102,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(102,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(106,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(106,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(109,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(109,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(110,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(110,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(111,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(111,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(117,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(117,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(120,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(120,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(121,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(121,19): error TS2769: No overload matches this call. The last overload gave the following error. 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 TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(122,19): error TS2769: No overload matches this call. The last overload gave the following error. 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 TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(126,19): error TS2769: No overload matches this call. The last overload gave the following error. 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,33): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(129,33): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(132,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(132,19): error TS2769: No overload matches this call. The last overload gave the following error. 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 TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(133,19): error TS2769: No overload matches this call. The last overload gave the following error. 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 TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(134,19): error TS2769: No overload matches this call. The last overload gave the following error. 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,33): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(137,33): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations.ts(144,35): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(144,35): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -tests/cases/compiler/promisePermutations.ts(152,36): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(152,36): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -tests/cases/compiler/promisePermutations.ts(156,21): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(156,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations.ts(158,21): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(158,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations.ts(159,21): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(159,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations.ts(160,21): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'Promise' is not assignable to type 'IPromise'. @@ -206,143 +206,143 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2763: No overload m var s3c = s3.then(testFunction3P, testFunction3, testFunction3); var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'IPromise' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'IPromise' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var r4: IPromise; var sIPromise: (x: any) => IPromise; var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2769: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -350,78 +350,78 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2763: No overload m var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok ~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2769: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2769: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); @@ -430,10 +430,10 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2763: No overload m var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok ~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s10 = testFunction10P(x => x); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok @@ -443,51 +443,51 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2763: No overload m var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. -!!! error TS2763: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. +!!! error TS2769: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. !!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2763: Type 'number' is not assignable to type 'string'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2769: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2769: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2763: Type 'number' is not assignable to type 'string'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2763: Type 'Promise' is not assignable to type 'IPromise'. -!!! error TS2763: Types of property 'then' are incompatible. -!!! error TS2763: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. -!!! error TS2763: Types of parameters 'onfulfilled' and 'success' are incompatible. -!!! error TS2763: Types of parameters 'value' and 'value' are incompatible. -!!! error TS2763: Type 'number' is not assignable to type 'string'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2769: Type 'Promise' is not assignable to type 'IPromise'. +!!! error TS2769: Types of property 'then' are incompatible. +!!! error TS2769: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. +!!! error TS2769: Types of parameters 'onfulfilled' and 'success' are incompatible. +!!! error TS2769: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index 5ef78ed5769..d601a5049bf 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/promisePermutations2.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations2.ts(78,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(78,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. @@ -15,46 +15,46 @@ tests/cases/compiler/promisePermutations2.ts(82,19): error TS2345: Argument of t tests/cases/compiler/promisePermutations2.ts(83,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations2.ts(87,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(87,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(90,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations2.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(96,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(96,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(99,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(100,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations2.ts(101,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(105,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(105,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(108,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(108,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(109,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(109,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(110,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(110,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(116,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(116,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(119,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. 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 TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(125,19): error TS2769: No overload matches this call. The last overload gave the following error. 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,33): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(128,33): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. @@ -64,12 +64,12 @@ tests/cases/compiler/promisePermutations2.ts(132,19): error TS2345: Argument of 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,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations2.ts(143,35): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(143,35): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. tests/cases/compiler/promisePermutations2.ts(151,36): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -tests/cases/compiler/promisePermutations2.ts(155,21): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(155,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. @@ -172,12 +172,12 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error @@ -200,10 +200,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error @@ -220,10 +220,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error @@ -240,36 +240,36 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2769: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -277,10 +277,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error @@ -297,20 +297,20 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2769: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error @@ -336,10 +336,10 @@ 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 TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s10 = testFunction10P(x => x); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok @@ -357,12 +357,12 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2763: Type 'number' is not assignable to type 'string'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2769: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 89a154c9c7f..d3574d2a4c3 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/promisePermutations3.ts(68,69): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(73,70): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(73,70): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. @@ -9,39 +9,39 @@ tests/cases/compiler/promisePermutations3.ts(73,70): error TS2763: No overload m tests/cases/compiler/promisePermutations3.ts(78,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(81,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(81,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(82,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(82,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(83,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(83,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations3.ts(87,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(90,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(90,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(91,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(91,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations3.ts(92,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(92,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations3.ts(96,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(99,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(99,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(100,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(100,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations3.ts(101,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(101,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations3.ts(105,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. @@ -55,50 +55,50 @@ tests/cases/compiler/promisePermutations3.ts(110,19): error TS2345: Argument of Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. tests/cases/compiler/promisePermutations3.ts(116,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(119,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(119,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(120,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(120,19): error TS2769: No overload matches this call. The last overload gave the following error. 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 TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(121,19): error TS2769: No overload matches this call. The last overload gave the following error. 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,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(131,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(131,19): error TS2769: No overload matches this call. The last overload gave the following error. 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 TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(132,19): error TS2769: No overload matches this call. The last overload gave the following error. 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 TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(133,19): error TS2769: No overload matches this call. The last overload gave the following error. 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,33): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(136,33): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. tests/cases/compiler/promisePermutations3.ts(143,35): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(151,36): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(151,36): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. 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'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations3.ts(157,21): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(157,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations3.ts(158,21): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(158,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations3.ts(159,21): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(159,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'Promise' is not assignable to type 'IPromise'. @@ -190,12 +190,12 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s3c = s3.then(testFunction3P, testFunction3, testFunction3); var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'IPromise' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'IPromise' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var r4: IPromise; var sIPromise: (x: any) => IPromise; @@ -209,28 +209,28 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; @@ -241,22 +241,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; @@ -267,22 +267,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; @@ -318,22 +318,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; @@ -351,31 +351,31 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2769: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); @@ -394,12 +394,12 @@ 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 TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. -!!! error TS2763: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. +!!! error TS2769: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. !!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; @@ -411,31 +411,31 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2769: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2763: Type 'number' is not assignable to type 'string'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2763: Type 'Promise' is not assignable to type 'IPromise'. -!!! error TS2763: Types of property 'then' are incompatible. -!!! error TS2763: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. -!!! error TS2763: Types of parameters 'onfulfilled' and 'success' are incompatible. -!!! error TS2763: Types of parameters 'value' and 'value' are incompatible. -!!! error TS2763: Type 'number' is not assignable to type 'string'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2769: Type 'Promise' is not assignable to type 'IPromise'. +!!! error TS2769: Types of property 'then' are incompatible. +!!! error TS2769: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. +!!! error TS2769: Types of parameters 'onfulfilled' and 'success' are incompatible. +!!! error TS2769: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/underscoreTest1.errors.txt b/tests/baselines/reference/underscoreTest1.errors.txt index e51de99e216..7bc8e28cf08 100644 --- a/tests/baselines/reference/underscoreTest1.errors.txt +++ b/tests/baselines/reference/underscoreTest1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2763: No overload matches this call. +tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2769: No overload matches this call. Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. Type 'string | number | boolean' is not assignable to type 'boolean'. @@ -36,14 +36,14 @@ tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2763: No _.all([true, 1, null, 'yes'], _.identity); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. -!!! error TS2763: Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. -!!! error TS2763: Type 'string | number | boolean' is not assignable to type 'boolean'. -!!! error TS2763: Type 'string' is not assignable to type 'boolean'. -!!! error TS2763: Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. -!!! error TS2763: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. -!!! error TS2763: Index signature is missing in type '(string | number | boolean)[]'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. +!!! error TS2769: Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. +!!! error TS2769: Type 'string | number | boolean' is not assignable to type 'boolean'. +!!! error TS2769: Type 'string' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. +!!! error TS2769: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. +!!! error TS2769: Index signature is missing in type '(string | number | boolean)[]'. _.any([null, 0, 'yes', false]); From 05a4e8f29edcae99a9ebe6f84267bd9cefd10bfe Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 8 Jul 2019 13:04:59 -0700 Subject: [PATCH 75/95] Update more baselines (?) --- .../checkJsxChildrenCanBeTupleType.errors.txt | 24 +++---- ...actDefaultPropsInferenceSuccess.errors.txt | 50 ++++++------- .../reference/strictBindCallApply1.errors.txt | 72 +++++++++---------- .../tsxNotUsingApparentTypeOfSFC.errors.txt | 12 ++-- 4 files changed, 79 insertions(+), 79 deletions(-) diff --git a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt index d66298c0368..b8ad32a5408 100644 --- a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2763: No overload matches this call. +tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. Types of property 'children' are incompatible. @@ -30,17 +30,17 @@ tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2 const testErr = ~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. -!!! error TS2763: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. -!!! error TS2763: Types of property 'children' are incompatible. -!!! error TS2763: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. -!!! error TS2763: Types of property 'length' are incompatible. -!!! error TS2763: Type '3' is not assignable to type '2'. -!!! error TS2763: Overload 2 of 2, '(props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. -!!! error TS2763: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. -!!! error TS2763: Types of property 'children' are incompatible. -!!! error TS2763: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. +!!! error TS2769: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. +!!! error TS2769: Types of property 'children' are incompatible. +!!! error TS2769: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. +!!! error TS2769: Types of property 'length' are incompatible. +!!! error TS2769: Type '3' is not assignable to type '2'. +!!! error TS2769: Overload 2 of 2, '(props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. +!!! error TS2769: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. +!!! error TS2769: Types of property 'children' are incompatible. +!!! error TS2769: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.

diff --git a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt index b972a5bb7c5..ede187259de 100644 --- a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt +++ b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2763: No overload matches this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. @@ -6,7 +6,7 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2763: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2763: No overload matches this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. @@ -14,7 +14,7 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2763: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2763: No overload matches this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. Type 'void' is not assignable to type 'boolean'. @@ -51,14 +51,14 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2763: // Error: Void not assignable to boolean const Test2 = () => console.log(value)} />; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -!!! error TS2763: Type 'void' is not assignable to type 'boolean'. -!!! error TS2763: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2769: Type 'void' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. !!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' !!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' @@ -78,14 +78,14 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2763: // Error: Void not assignable to boolean const Test2a = () => console.log(value)} error>Hah; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -!!! error TS2763: Type 'void' is not assignable to type 'boolean'. -!!! error TS2763: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2769: Type 'void' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. !!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, "when" | "error">> & Partial>' !!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, "when" | "error">> & Partial>' @@ -110,12 +110,12 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2763: // Error: Void not assignable to boolean const Test4 = () => console.log(value)} />; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -!!! error TS2763: Type 'void' is not assignable to type 'boolean'. -!!! error TS2763: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2769: Type 'void' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. !!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' !!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' diff --git a/tests/baselines/reference/strictBindCallApply1.errors.txt b/tests/baselines/reference/strictBindCallApply1.errors.txt index e14635b1075..cd30931bcfe 100644 --- a/tests/baselines/reference/strictBindCallApply1.errors.txt +++ b/tests/baselines/reference/strictBindCallApply1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2763: No overload matches this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2769: No overload matches this call. Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. Argument of type '20' is not assignable to parameter of type 'string'. Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. @@ -15,7 +15,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(23,37): error TS2322: tests/cases/conformance/functions/strictBindCallApply1.ts(24,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. -tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2763: No overload matches this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2769: No overload matches this call. Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. Argument of type '20' is not assignable to parameter of type 'string'. Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. @@ -23,7 +23,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2763: Types of parameters 'b' and 'args' are incompatible. Type '10 | 20' is not assignable to type 'string'. Type '10' is not assignable to type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(42,11): error TS2763: No overload matches this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(42,11): error TS2769: No overload matches this call. Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. Argument of type 'undefined' is not assignable to parameter of type 'C'. Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. @@ -39,7 +39,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(54,26): error TS2345: tests/cases/conformance/functions/strictBindCallApply1.ts(55,31): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(56,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. tests/cases/conformance/functions/strictBindCallApply1.ts(57,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. -tests/cases/conformance/functions/strictBindCallApply1.ts(62,11): error TS2763: No overload matches this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(62,11): error TS2769: No overload matches this call. Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. Argument of type '20' is not assignable to parameter of type 'string'. Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. @@ -68,14 +68,14 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f02 = foo.bind(undefined, 10, "hello"); let f03 = foo.bind(undefined, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. -!!! error TS2763: Argument of type '20' is not assignable to parameter of type 'string'. -!!! error TS2763: Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. -!!! error TS2763: The 'this' context of type '(a: number, b: string) => string' is not assignable to method's 'this' of type '(this: undefined, ...args: (10 | 20)[]) => string'. -!!! error TS2763: Types of parameters 'b' and 'args' are incompatible. -!!! error TS2763: Type '10 | 20' is not assignable to type 'string'. -!!! error TS2763: Type '10' is not assignable to type 'string'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. +!!! error TS2769: Argument of type '20' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. +!!! error TS2769: The 'this' context of type '(a: number, b: string) => string' is not assignable to method's 'this' of type '(this: undefined, ...args: (10 | 20)[]) => string'. +!!! error TS2769: Types of parameters 'b' and 'args' are incompatible. +!!! error TS2769: Type '10 | 20' is not assignable to type 'string'. +!!! error TS2769: Type '10' is not assignable to type 'string'. let f04 = overloaded.bind(undefined); // typeof overloaded let f05 = generic.bind(undefined); // typeof generic @@ -122,24 +122,24 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f12 = c.foo.bind(c, 10, "hello"); let f13 = c.foo.bind(c, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. -!!! error TS2763: Argument of type '20' is not assignable to parameter of type 'string'. -!!! error TS2763: Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. -!!! error TS2763: The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (10 | 20)[]) => string'. -!!! error TS2763: Types of parameters 'b' and 'args' are incompatible. -!!! error TS2763: Type '10 | 20' is not assignable to type 'string'. -!!! error TS2763: Type '10' is not assignable to type 'string'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. +!!! error TS2769: Argument of type '20' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. +!!! error TS2769: The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (10 | 20)[]) => string'. +!!! error TS2769: Types of parameters 'b' and 'args' are incompatible. +!!! error TS2769: Type '10 | 20' is not assignable to type 'string'. +!!! error TS2769: Type '10' is not assignable to type 'string'. let f14 = c.foo.bind(undefined); // Error ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. -!!! error TS2763: Argument of type 'undefined' is not assignable to parameter of type 'C'. -!!! error TS2763: Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. -!!! error TS2763: The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (string | number)[]) => string'. -!!! error TS2763: Types of parameters 'a' and 'args' are incompatible. -!!! error TS2763: Type 'string | number' is not assignable to type 'number'. -!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type 'C'. +!!! error TS2769: Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. +!!! error TS2769: The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (string | number)[]) => string'. +!!! error TS2769: Types of parameters 'a' and 'args' are incompatible. +!!! error TS2769: Type 'string | number' is not assignable to type 'number'. +!!! error TS2769: Type 'string' is not assignable to type 'number'. let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded let f16 = c.generic.bind(c); // typeof C.prototype.generic @@ -177,14 +177,14 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f22 = C.bind(undefined, 10, "hello"); let f23 = C.bind(undefined, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. -!!! error TS2763: Argument of type '20' is not assignable to parameter of type 'string'. -!!! error TS2763: Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. -!!! error TS2763: The 'this' context of type 'typeof C' is not assignable to method's 'this' of type 'new (...args: (10 | 20)[]) => C'. -!!! error TS2763: Types of parameters 'b' and 'args' are incompatible. -!!! error TS2763: Type '10 | 20' is not assignable to type 'string'. -!!! error TS2763: Type '10' is not assignable to type 'string'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. +!!! error TS2769: Argument of type '20' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. +!!! error TS2769: The 'this' context of type 'typeof C' is not assignable to method's 'this' of type 'new (...args: (10 | 20)[]) => C'. +!!! error TS2769: Types of parameters 'b' and 'args' are incompatible. +!!! error TS2769: Type '10 | 20' is not assignable to type 'string'. +!!! error TS2769: Type '10' is not assignable to type 'string'. C.call(c, 10, "hello"); C.call(c, 10); // Error diff --git a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt index 80230ec72b1..056bd0b0dd7 100644 --- a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt +++ b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(14,14): error TS2322: Type '{}' is not assignable to type 'P'. '{}' is assignable to the constraint of type 'P', but 'P' could be instantiated with a different subtype of constraint '{}'. -tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2763: No overload matches this call. +tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. Type '{}' is not assignable to type 'Readonly

'. Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. @@ -27,11 +27,11 @@ tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2763: No o !!! error TS2322: '{}' is assignable to the constraint of type 'P', but 'P' could be instantiated with a different subtype of constraint '{}'. let y = ; // should error ~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. -!!! error TS2763: Type '{}' is not assignable to type 'Readonly

'. -!!! error TS2763: Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. -!!! error TS2763: Type '{}' is not assignable to type 'Readonly

'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. +!!! error TS2769: Type '{}' is not assignable to type 'Readonly

'. +!!! error TS2769: Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. +!!! error TS2769: Type '{}' is not assignable to type 'Readonly

'. let z = // should work let q = // should work From c48e34ef91fa9428a6e4d69196fe299671efad9a Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Tue, 2 Jul 2019 17:06:42 -0700 Subject: [PATCH 76/95] Did you forget to use await? for operators --- src/compiler/checker.ts | 106 +++++++++++++----- src/compiler/diagnosticMessages.json | 40 +++++++ ...existentPropertyAvailableOnPromisedType.ts | 3 - .../operationsAvailableOnPromisedType.ts | 25 +++++ 4 files changed, 146 insertions(+), 28 deletions(-) delete mode 100644 tests/cases/compiler/nonexistentPropertyAvailableOnPromisedType.ts create mode 100644 tests/cases/compiler/operationsAvailableOnPromisedType.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 610967cfc4f..f4bee2eef4f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -932,6 +932,18 @@ namespace ts { addErrorOrSuggestion(isError, "message" in message ? createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : createDiagnosticForNodeFromMessageChain(location, message)); } + function errorAndMaybeSuggestAwait( + location: Node | undefined, + maybeMissingAwait: boolean, + defaultMessage: DiagnosticMessage, + missingAwaitMessage: DiagnosticMessage, + arg0?: string | number | undefined, arg1?: string | number | undefined, arg2?: string | number | undefined, arg3?: string | number | undefined): Diagnostic { + if (maybeMissingAwait) { + return error(location, missingAwaitMessage, arg0, arg1, arg2, arg3); + } + return error(location, defaultMessage, arg0, arg1, arg2, arg3); + } + function createSymbol(flags: SymbolFlags, name: __String, checkFlags?: CheckFlags) { symbolCount++; const symbol = (new Symbol(flags | SymbolFlags.Transient, name)); @@ -23662,9 +23674,14 @@ namespace ts { } } - function checkArithmeticOperandType(operand: Node, type: Type, diagnostic: DiagnosticMessage): boolean { + function checkArithmeticOperandType(operand: Node, type: Type, diagnostic: DiagnosticMessage, missingAwaitDiagnostic: DiagnosticMessage): boolean { if (!isTypeAssignableTo(type, numberOrBigIntType)) { - error(operand, diagnostic); + const awaitedType = getAwaitedType(type); + errorAndMaybeSuggestAwait( + operand, + !!awaitedType && isTypeAssignableTo(awaitedType, numberOrBigIntType), + diagnostic, + missingAwaitDiagnostic); return false; } return true; @@ -23862,7 +23879,8 @@ namespace ts { case SyntaxKind.PlusPlusToken: case SyntaxKind.MinusMinusToken: const ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), - Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type); + Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type, + Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_Did_you_forget_to_use_await); if (ok) { // run check only if former checks succeeded to avoid reporting cascading errors checkReferenceExpression(node.operand, Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access); @@ -23880,7 +23898,8 @@ namespace ts { const ok = checkArithmeticOperandType( node.operand, checkNonNullType(operandType, node.operand), - Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type); + Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type, + Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_Did_you_forget_to_use_await); if (ok) { // run check only if former checks succeeded to avoid reporting cascading errors checkReferenceExpression(node.operand, Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access); @@ -24272,8 +24291,8 @@ namespace ts { } else { // otherwise just check each operand separately and report errors as normal - const leftOk = checkArithmeticOperandType(left, leftType, Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type); - const rightOk = checkArithmeticOperandType(right, rightType, Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type); + const leftOk = checkArithmeticOperandType(left, leftType, Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_Did_you_forget_to_use_await); + const rightOk = checkArithmeticOperandType(right, rightType, Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_Did_you_forget_to_use_await); let resultType: Type; // If both are any or unknown, allow operation; assume it will resolve to number if ((isTypeAssignableToKind(leftType, TypeFlags.AnyOrUnknown) && isTypeAssignableToKind(rightType, TypeFlags.AnyOrUnknown)) || @@ -24282,7 +24301,7 @@ namespace ts { ) { resultType = numberType; } - // At least one is assignable to bigint, so both should be only assignable to bigint + // At least one is assignable to bigint, so check that both are else if (isTypeAssignableToKind(leftType, TypeFlags.BigIntLike) && isTypeAssignableToKind(rightType, TypeFlags.BigIntLike)) { switch (operator) { case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: @@ -24291,8 +24310,9 @@ namespace ts { } resultType = bigintType; } + // Exactly one of leftType/rightType is assignable to bigint else { - reportOperatorError(); + reportOperatorError((awaitedLeft, awaitedRight) => isTypeAssignableToKind(awaitedLeft, TypeFlags.BigIntLike) && isTypeAssignableToKind(awaitedRight, TypeFlags.BigIntLike)); resultType = errorType; } if (leftOk && rightOk) { @@ -24337,7 +24357,14 @@ namespace ts { } if (!resultType) { - reportOperatorError(); + // Types that have a reasonably good chance of being a valid operand type. + // If both types have an awaited type of one of these, we’ll assume the user + // might be missing an await without doing an exhaustive check that inserting + // await(s) will actually be a completely valid binary expression. + const closeEnoughKind = TypeFlags.NumberLike | TypeFlags.BigIntLike | TypeFlags.StringLike | TypeFlags.AnyOrUnknown; + reportOperatorError((awaitedLeft, awaitedRight) => + isTypeAssignableToKind(awaitedLeft, closeEnoughKind) && + isTypeAssignableToKind(awaitedRight, closeEnoughKind)); return anyType; } @@ -24352,21 +24379,18 @@ namespace ts { if (checkForDisallowedESSymbolOperand(operator)) { leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left)); rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right)); - if (!(isTypeComparableTo(leftType, rightType) || isTypeComparableTo(rightType, leftType) || - (isTypeAssignableTo(leftType, numberOrBigIntType) && isTypeAssignableTo(rightType, numberOrBigIntType)) - )) { - reportOperatorError(); - } + reportOperatorErrorUnless((left, right) => + isTypeComparableTo(left, right) || isTypeComparableTo(right, left) || ( + isTypeAssignableTo(left, numberOrBigIntType) && isTypeAssignableTo(right, numberOrBigIntType))); } return booleanType; case SyntaxKind.EqualsEqualsToken: case SyntaxKind.ExclamationEqualsToken: case SyntaxKind.EqualsEqualsEqualsToken: case SyntaxKind.ExclamationEqualsEqualsToken: - if (!isTypeEqualityComparableTo(leftType, rightType) && !isTypeEqualityComparableTo(rightType, leftType)) { - reportOperatorError(); - } + reportOperatorErrorUnless((left, right) => isTypeEqualityComparableTo(left, right) || isTypeEqualityComparableTo(right, left)); return booleanType; + case SyntaxKind.InstanceOfKeyword: return checkInstanceOfExpression(left, right, leftType, rightType); case SyntaxKind.InKeyword: @@ -24493,13 +24517,33 @@ namespace ts { } } - function reportOperatorError() { - const [leftStr, rightStr] = getTypeNamesForErrorDisplay(leftType, rightType); + /** + * Returns true if an error is reported + */ + function reportOperatorErrorUnless(typesAreCompatible: (left: Type, right: Type) => boolean): boolean { + if (!typesAreCompatible(leftType, rightType)) { + reportOperatorError(typesAreCompatible); + return true; + } + return false; + } + + function reportOperatorError(awaitedTypesAreCompatible?: (left: Type, right: Type) => boolean) { + let wouldWorkWithAwait = false; const errNode = errorNode || operatorToken; - if (!tryGiveBetterPrimaryError(errNode, leftStr, rightStr)) { - error( + const [leftStr, rightStr] = getTypeNamesForErrorDisplay(leftType, rightType); + if (awaitedTypesAreCompatible) { + const awaitedLeftType = getAwaitedType(leftType); + const awaitedRightType = getAwaitedType(rightType); + wouldWorkWithAwait = !!(awaitedLeftType && awaitedRightType) && awaitedTypesAreCompatible(awaitedLeftType, awaitedRightType); + } + + if (!tryGiveBetterPrimaryError(errNode, wouldWorkWithAwait, leftStr, rightStr)) { + errorAndMaybeSuggestAwait( errNode, + wouldWorkWithAwait, Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2, + Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2_Did_you_forget_to_use_await, tokenToString(operatorToken.kind), leftStr, rightStr, @@ -24507,15 +24551,27 @@ namespace ts { } } - function tryGiveBetterPrimaryError(errNode: Node, leftStr: string, rightStr: string) { + function tryGiveBetterPrimaryError(errNode: Node, maybeMissingAwait: boolean, leftStr: string, rightStr: string) { + let typeName: string | undefined; switch (operatorToken.kind) { case SyntaxKind.EqualsEqualsEqualsToken: case SyntaxKind.EqualsEqualsToken: - return error(errNode, Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap, "false", leftStr, rightStr); + typeName = "true"; + break; case SyntaxKind.ExclamationEqualsEqualsToken: case SyntaxKind.ExclamationEqualsToken: - return error(errNode, Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap, "true", leftStr, rightStr); - } + typeName = "false"; + } + + if (typeName) { + return errorAndMaybeSuggestAwait( + errNode, + maybeMissingAwait, + Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap, + Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap_Did_you_forget_to_use_await, + typeName, leftStr, rightStr); + } + return undefined; } } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 3b426f2d0c6..446d4294272 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2693,6 +2693,46 @@ "category": "Error", "code": 2772 }, + "Operator '{0}' cannot be applied to types '{1}' and '{2}'. Did you forget to use 'await'?": { + "category": "Error", + "code": 2773 + }, + "An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'?": { + "category": "Error", + "code": 2774 + }, + "The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'?": { + "category": "Error", + "code": 2775 + }, + "The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'?": { + "category": "Error", + "code": 2777 + }, + "Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator. Did you forget to use 'await'?": { + "category": "Error", + "code": 2777 + }, + "Type '{0}' is not an array type or a string type. Did you forget to use 'await'?": { + "category": "Error", + "code": 2778 + }, + "Argument of type '{0}' is not assignable to parameter of type '{1}'. Did you forget to use 'await'?": { + "category": "Error", + "code": 2779 + }, + "Type '{0}' has no call signatures. Did you forget to use 'await'?": { + "category": "Error", + "code": 2780 + }, + "Type '{0}' has no construct signatures. Did you forget to use 'await'?": { + "category": "Error", + "code": 2781 + }, + "This condition will always return '{0}' since the types '{1}' and '{2}' have no overlap. Did you forget to use 'await'?": { + "category": "Error", + "code": 2782 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/tests/cases/compiler/nonexistentPropertyAvailableOnPromisedType.ts b/tests/cases/compiler/nonexistentPropertyAvailableOnPromisedType.ts deleted file mode 100644 index 476f4ac5636..00000000000 --- a/tests/cases/compiler/nonexistentPropertyAvailableOnPromisedType.ts +++ /dev/null @@ -1,3 +0,0 @@ -function f(x: Promise) { - x.toLowerCase(); -} diff --git a/tests/cases/compiler/operationsAvailableOnPromisedType.ts b/tests/cases/compiler/operationsAvailableOnPromisedType.ts new file mode 100644 index 00000000000..24e3f891fe4 --- /dev/null +++ b/tests/cases/compiler/operationsAvailableOnPromisedType.ts @@ -0,0 +1,25 @@ +function fn( + a: number, + b: Promise, + c: Promise, + d: Promise<{ prop: string }>, + e: Promise<() => void>, + f: Promise<() => void> | (() => void), + g: Promise<{ new(): any }> +) { + // All errors + a | b; + b | a; + a + b; + a > b; + b++; + --b; + a === b; + for (const s of c) { + fn(b, b, c, d); + d.prop; + } + e(); + f(); + new g(); +} From 48fc6b8b1775b632c285c401d9487db5c89eff10 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Tue, 2 Jul 2019 18:04:55 -0700 Subject: [PATCH 77/95] Did you forget to use await? on iterables --- src/compiler/checker.ts | 33 ++++++++++++------- src/compiler/diagnosticMessages.json | 26 ++++++++++++--- .../operationsAvailableOnPromisedType.ts | 4 ++- 3 files changed, 46 insertions(+), 17 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f4bee2eef4f..63fa0f7e889 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -27922,18 +27922,28 @@ namespace ts { // number and string input is allowed, we want to say that number is not an // array type or a string type. const yieldType = getIterationTypeOfIterable(use, IterationTypeKind.Yield, inputType, /*errorNode*/ undefined); - const diagnostic = !(use & IterationUse.AllowsStringInputFlag) || hasStringConstituent + const [defaultDiagnostic, missingAwaitDiagnostic]: [DiagnosticMessage, DiagnosticMessage | undefined] = !(use & IterationUse.AllowsStringInputFlag) || hasStringConstituent ? downlevelIteration - ? Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator + ? [Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_Did_you_forget_to_use_await] : yieldType - ? Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators - : Diagnostics.Type_0_is_not_an_array_type + ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators, undefined] + : [Diagnostics.Type_0_is_not_an_array_type, Diagnostics.Type_0_is_not_an_array_type_Did_you_forget_to_use_await] : downlevelIteration - ? Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator + ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_Did_you_forget_to_use_await] : yieldType - ? Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators - : Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; - error(errorNode, diagnostic, typeToString(arrayType)); + ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators, undefined] + : [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Did_you_forget_to_use_await]; + if (missingAwaitDiagnostic) { + errorAndMaybeSuggestAwait( + errorNode, + !!getAwaitedTypeOfPromise(arrayType), + defaultDiagnostic, + missingAwaitDiagnostic, + typeToString(arrayType)); + } + else { + error(errorNode, defaultDiagnostic, typeToString(arrayType)); + } } return hasStringConstituent ? stringType : undefined; } @@ -28232,9 +28242,10 @@ namespace ts { } function reportTypeNotIterableError(errorNode: Node, type: Type, allowAsyncIterables: boolean): void { - error(errorNode, allowAsyncIterables - ? Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator - : Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator, typeToString(type)); + const [defaultDiagnostic, missingAwaitDiagnostic] = allowAsyncIterables + ? [Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator, Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_Did_you_forget_to_use_await] + : [Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator, Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_Did_you_forget_to_use_await]; + errorAndMaybeSuggestAwait(errorNode, !!getAwaitedTypeOfPromise(type), defaultDiagnostic, missingAwaitDiagnostic, typeToString(type)); } /** diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 446d4294272..a7b62838249 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2713,26 +2713,42 @@ "category": "Error", "code": 2777 }, - "Type '{0}' is not an array type or a string type. Did you forget to use 'await'?": { + "Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. Did you forget to use 'await'?": { "category": "Error", "code": 2778 }, - "Argument of type '{0}' is not assignable to parameter of type '{1}'. Did you forget to use 'await'?": { + "Type '{0}' is not an array type. Did you forget to use 'await'?": { "category": "Error", "code": 2779 }, - "Type '{0}' has no call signatures. Did you forget to use 'await'?": { + "Type '{0}' is not an array type or a string type. Did you forget to use 'await'?": { "category": "Error", "code": 2780 }, - "Type '{0}' has no construct signatures. Did you forget to use 'await'?": { + "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator. Did you forget to use 'await'?": { "category": "Error", "code": 2781 }, - "This condition will always return '{0}' since the types '{1}' and '{2}' have no overlap. Did you forget to use 'await'?": { + "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator. Did you forget to use 'await'?": { "category": "Error", "code": 2782 }, + "Argument of type '{0}' is not assignable to parameter of type '{1}'. Did you forget to use 'await'?": { + "category": "Error", + "code": 2783 + }, + "Type '{0}' has no call signatures. Did you forget to use 'await'?": { + "category": "Error", + "code": 2784 + }, + "Type '{0}' has no construct signatures. Did you forget to use 'await'?": { + "category": "Error", + "code": 2785 + }, + "This condition will always return '{0}' since the types '{1}' and '{2}' have no overlap. Did you forget to use 'await'?": { + "category": "Error", + "code": 2786 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/tests/cases/compiler/operationsAvailableOnPromisedType.ts b/tests/cases/compiler/operationsAvailableOnPromisedType.ts index 24e3f891fe4..76e2cea6dd8 100644 --- a/tests/cases/compiler/operationsAvailableOnPromisedType.ts +++ b/tests/cases/compiler/operationsAvailableOnPromisedType.ts @@ -1,4 +1,4 @@ -function fn( +async function fn( a: number, b: Promise, c: Promise, @@ -15,10 +15,12 @@ function fn( b++; --b; a === b; + [...c]; for (const s of c) { fn(b, b, c, d); d.prop; } + for await (const s of c) {} e(); f(); new g(); From a3a076d79f46bc52c6fc4e1ddbda90783568a07b Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Wed, 3 Jul 2019 09:33:03 -0700 Subject: [PATCH 78/95] Did you forget to use await? for call and construct signatures --- src/compiler/checker.ts | 8 ++-- src/compiler/diagnosticMessages.json | 40 +++++++++++-------- .../operationsAvailableOnPromisedType.ts | 1 + 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 63fa0f7e889..1a99c2642fd 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -22342,6 +22342,8 @@ namespace ts { function invocationErrorDetails(apparentType: Type, kind: SignatureKind): DiagnosticMessageChain { let errorInfo: DiagnosticMessageChain | undefined; const isCall = kind === SignatureKind.Call; + const awaitedType = getAwaitedType(apparentType); + const mightWorkWithAwait = awaitedType && getSignaturesOfType(awaitedType, kind).length > 0; if (apparentType.flags & TypeFlags.Union) { const types = (apparentType as UnionType).types; let hasSignatures = false; @@ -22408,9 +22410,9 @@ namespace ts { } return chainDiagnosticMessages( errorInfo, - isCall ? - Diagnostics.This_expression_is_not_callable : - Diagnostics.This_expression_is_not_constructable + mightWorkWithAwait + ? isCall ? Diagnostics.This_expression_is_not_callable_Did_you_forget_to_use_await : Diagnostics.This_expression_is_not_constructable_Did_you_forget_to_use_await + : isCall ? Diagnostics.This_expression_is_not_callable : Diagnostics.This_expression_is_not_constructable ); } function invocationError(errorTarget: Node, apparentType: Type, kind: SignatureKind, relatedInformation?: DiagnosticRelatedInformation) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index a7b62838249..e3774296e0d 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2705,50 +2705,58 @@ "category": "Error", "code": 2775 }, + "This expression is not callable. Did you forget to use 'await'?": { + "category": "Error", + "code": 2776 + }, + "This expression is not constructable. Did you forget to use 'await'?": { + "category": "Error", + "code": 2777 + }, "The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'?": { - "category": "Error", - "code": 2777 - }, - "Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator. Did you forget to use 'await'?": { - "category": "Error", - "code": 2777 - }, - "Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. Did you forget to use 'await'?": { "category": "Error", "code": 2778 }, - "Type '{0}' is not an array type. Did you forget to use 'await'?": { + "Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator. Did you forget to use 'await'?": { "category": "Error", "code": 2779 }, - "Type '{0}' is not an array type or a string type. Did you forget to use 'await'?": { + "Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. Did you forget to use 'await'?": { "category": "Error", "code": 2780 }, - "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator. Did you forget to use 'await'?": { + "Type '{0}' is not an array type. Did you forget to use 'await'?": { "category": "Error", "code": 2781 }, - "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator. Did you forget to use 'await'?": { + "Type '{0}' is not an array type or a string type. Did you forget to use 'await'?": { "category": "Error", "code": 2782 }, - "Argument of type '{0}' is not assignable to parameter of type '{1}'. Did you forget to use 'await'?": { + "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator. Did you forget to use 'await'?": { "category": "Error", "code": 2783 }, - "Type '{0}' has no call signatures. Did you forget to use 'await'?": { + "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator. Did you forget to use 'await'?": { "category": "Error", "code": 2784 }, - "Type '{0}' has no construct signatures. Did you forget to use 'await'?": { + "Argument of type '{0}' is not assignable to parameter of type '{1}'. Did you forget to use 'await'?": { "category": "Error", "code": 2785 }, - "This condition will always return '{0}' since the types '{1}' and '{2}' have no overlap. Did you forget to use 'await'?": { + "Type '{0}' has no call signatures. Did you forget to use 'await'?": { "category": "Error", "code": 2786 }, + "Type '{0}' has no construct signatures. Did you forget to use 'await'?": { + "category": "Error", + "code": 2787 + }, + "This condition will always return '{0}' since the types '{1}' and '{2}' have no overlap. Did you forget to use 'await'?": { + "category": "Error", + "code": 2788 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/tests/cases/compiler/operationsAvailableOnPromisedType.ts b/tests/cases/compiler/operationsAvailableOnPromisedType.ts index 76e2cea6dd8..f6e339eab7f 100644 --- a/tests/cases/compiler/operationsAvailableOnPromisedType.ts +++ b/tests/cases/compiler/operationsAvailableOnPromisedType.ts @@ -24,4 +24,5 @@ async function fn( e(); f(); new g(); + b(); } From e89a2c457139bb6d0c40058a4c8a6838f9c543f5 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Wed, 3 Jul 2019 10:49:09 -0700 Subject: [PATCH 79/95] Update baselines --- src/compiler/checker.ts | 8 +- ...erationsAvailableOnPromisedType.errors.txt | 91 +++++++++++ .../operationsAvailableOnPromisedType.js | 141 ++++++++++++++++++ .../operationsAvailableOnPromisedType.symbols | 94 ++++++++++++ .../operationsAvailableOnPromisedType.types | 104 +++++++++++++ .../types.asyncGenerators.es2018.2.errors.txt | 4 +- 6 files changed, 437 insertions(+), 5 deletions(-) create mode 100644 tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt create mode 100644 tests/baselines/reference/operationsAvailableOnPromisedType.js create mode 100644 tests/baselines/reference/operationsAvailableOnPromisedType.symbols create mode 100644 tests/baselines/reference/operationsAvailableOnPromisedType.types diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1a99c2642fd..c89c78e83eb 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -24537,7 +24537,9 @@ namespace ts { if (awaitedTypesAreCompatible) { const awaitedLeftType = getAwaitedType(leftType); const awaitedRightType = getAwaitedType(rightType); - wouldWorkWithAwait = !!(awaitedLeftType && awaitedRightType) && awaitedTypesAreCompatible(awaitedLeftType, awaitedRightType); + wouldWorkWithAwait = !(awaitedLeftType === leftType && awaitedRightType === rightType) + && !!(awaitedLeftType && awaitedRightType) + && awaitedTypesAreCompatible(awaitedLeftType, awaitedRightType); } if (!tryGiveBetterPrimaryError(errNode, wouldWorkWithAwait, leftStr, rightStr)) { @@ -24558,11 +24560,11 @@ namespace ts { switch (operatorToken.kind) { case SyntaxKind.EqualsEqualsEqualsToken: case SyntaxKind.EqualsEqualsToken: - typeName = "true"; + typeName = "false"; break; case SyntaxKind.ExclamationEqualsEqualsToken: case SyntaxKind.ExclamationEqualsToken: - typeName = "false"; + typeName = "true"; } if (typeName) { diff --git a/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt b/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt new file mode 100644 index 00000000000..20f5767d027 --- /dev/null +++ b/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt @@ -0,0 +1,91 @@ +tests/cases/compiler/operationsAvailableOnPromisedType.ts(11,9): error TS2766: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'? +tests/cases/compiler/operationsAvailableOnPromisedType.ts(12,5): error TS2765: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'? +tests/cases/compiler/operationsAvailableOnPromisedType.ts(13,5): error TS2763: Operator '+' cannot be applied to types 'number' and 'Promise'. Did you forget to use 'await'? +tests/cases/compiler/operationsAvailableOnPromisedType.ts(14,5): error TS2763: Operator '>' cannot be applied to types 'number' and 'Promise'. Did you forget to use 'await'? +tests/cases/compiler/operationsAvailableOnPromisedType.ts(15,5): error TS2764: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'? +tests/cases/compiler/operationsAvailableOnPromisedType.ts(16,7): error TS2764: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'? +tests/cases/compiler/operationsAvailableOnPromisedType.ts(17,5): error TS2776: This condition will always return 'false' since the types 'number' and 'Promise' have no overlap. Did you forget to use 'await'? +tests/cases/compiler/operationsAvailableOnPromisedType.ts(18,9): error TS2769: Type 'Promise' is not an array type. Did you forget to use 'await'? +tests/cases/compiler/operationsAvailableOnPromisedType.ts(19,21): error TS2770: Type 'Promise' is not an array type or a string type. Did you forget to use 'await'? +tests/cases/compiler/operationsAvailableOnPromisedType.ts(20,9): error TS2554: Expected 7 arguments, but got 4. +tests/cases/compiler/operationsAvailableOnPromisedType.ts(21,11): error TS2570: Property 'prop' does not exist on type 'Promise<{ prop: string; }>'. Did you forget to use 'await'? +tests/cases/compiler/operationsAvailableOnPromisedType.ts(23,27): error TS2770: Type 'Promise' is not an array type or a string type. Did you forget to use 'await'? +tests/cases/compiler/operationsAvailableOnPromisedType.ts(24,5): error TS2774: This expression is not callable. Did you forget to use 'await'? + Type 'Promise<() => void>' has no call signatures. +tests/cases/compiler/operationsAvailableOnPromisedType.ts(25,5): error TS2774: This expression is not callable. Did you forget to use 'await'? + Not all constituents of type 'Promise<() => void> | (() => void)' are callable. + Type 'Promise<() => void>' has no call signatures. +tests/cases/compiler/operationsAvailableOnPromisedType.ts(26,9): error TS2775: This expression is not constructable. Did you forget to use 'await'? + Type 'Promise any>' has no construct signatures. +tests/cases/compiler/operationsAvailableOnPromisedType.ts(27,5): error TS2349: This expression is not callable. + Type 'Promise' has no call signatures. + + +==== tests/cases/compiler/operationsAvailableOnPromisedType.ts (16 errors) ==== + async function fn( + a: number, + b: Promise, + c: Promise, + d: Promise<{ prop: string }>, + e: Promise<() => void>, + f: Promise<() => void> | (() => void), + g: Promise<{ new(): any }> + ) { + // All errors + a | b; + ~ +!!! error TS2766: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'? + b | a; + ~ +!!! error TS2765: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'? + a + b; + ~~~~~ +!!! error TS2763: Operator '+' cannot be applied to types 'number' and 'Promise'. Did you forget to use 'await'? + a > b; + ~~~~~ +!!! error TS2763: Operator '>' cannot be applied to types 'number' and 'Promise'. Did you forget to use 'await'? + b++; + ~ +!!! error TS2764: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'? + --b; + ~ +!!! error TS2764: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'? + a === b; + ~~~~~~~ +!!! error TS2776: This condition will always return 'false' since the types 'number' and 'Promise' have no overlap. Did you forget to use 'await'? + [...c]; + ~ +!!! error TS2769: Type 'Promise' is not an array type. Did you forget to use 'await'? + for (const s of c) { + ~ +!!! error TS2770: Type 'Promise' is not an array type or a string type. Did you forget to use 'await'? + fn(b, b, c, d); + ~~~~~~~~~~~~~~ +!!! error TS2554: Expected 7 arguments, but got 4. +!!! related TS6210 tests/cases/compiler/operationsAvailableOnPromisedType.ts:6:5: An argument for 'e' was not provided. + d.prop; + ~~~~ +!!! error TS2570: Property 'prop' does not exist on type 'Promise<{ prop: string; }>'. Did you forget to use 'await'? + } + for await (const s of c) {} + ~ +!!! error TS2770: Type 'Promise' is not an array type or a string type. Did you forget to use 'await'? + e(); + ~ +!!! error TS2774: This expression is not callable. Did you forget to use 'await'? +!!! error TS2774: Type 'Promise<() => void>' has no call signatures. + f(); + ~ +!!! error TS2774: This expression is not callable. Did you forget to use 'await'? +!!! error TS2774: Not all constituents of type 'Promise<() => void> | (() => void)' are callable. +!!! error TS2774: Type 'Promise<() => void>' has no call signatures. + new g(); + ~ +!!! error TS2775: This expression is not constructable. Did you forget to use 'await'? +!!! error TS2775: Type 'Promise any>' has no construct signatures. + b(); + ~ +!!! error TS2349: This expression is not callable. +!!! error TS2349: Type 'Promise' has no call signatures. + } + \ No newline at end of file diff --git a/tests/baselines/reference/operationsAvailableOnPromisedType.js b/tests/baselines/reference/operationsAvailableOnPromisedType.js new file mode 100644 index 00000000000..889797a64b0 --- /dev/null +++ b/tests/baselines/reference/operationsAvailableOnPromisedType.js @@ -0,0 +1,141 @@ +//// [operationsAvailableOnPromisedType.ts] +async function fn( + a: number, + b: Promise, + c: Promise, + d: Promise<{ prop: string }>, + e: Promise<() => void>, + f: Promise<() => void> | (() => void), + g: Promise<{ new(): any }> +) { + // All errors + a | b; + b | a; + a + b; + a > b; + b++; + --b; + a === b; + [...c]; + for (const s of c) { + fn(b, b, c, d); + d.prop; + } + for await (const s of c) {} + e(); + f(); + new g(); + b(); +} + + +//// [operationsAvailableOnPromisedType.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncValues = (this && this.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +}; +var __spreadArrays = (this && this.__spreadArrays) || function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +}; +function fn(a, b, c, d, e, f, g) { + var c_1, c_1_1; + var e_1, _a; + return __awaiter(this, void 0, void 0, function () { + var _i, c_2, s, s, e_1_1; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + // All errors + a | b; + b | a; + a + b; + a > b; + b++; + --b; + a === b; + __spreadArrays(c); + for (_i = 0, c_2 = c; _i < c_2.length; _i++) { + s = c_2[_i]; + fn(b, b, c, d); + d.prop; + } + _b.label = 1; + case 1: + _b.trys.push([1, 6, 7, 12]); + c_1 = __asyncValues(c); + _b.label = 2; + case 2: return [4 /*yield*/, c_1.next()]; + case 3: + if (!(c_1_1 = _b.sent(), !c_1_1.done)) return [3 /*break*/, 5]; + s = c_1_1.value; + _b.label = 4; + case 4: return [3 /*break*/, 2]; + case 5: return [3 /*break*/, 12]; + case 6: + e_1_1 = _b.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 12]; + case 7: + _b.trys.push([7, , 10, 11]); + if (!(c_1_1 && !c_1_1.done && (_a = c_1["return"]))) return [3 /*break*/, 9]; + return [4 /*yield*/, _a.call(c_1)]; + case 8: + _b.sent(); + _b.label = 9; + case 9: return [3 /*break*/, 11]; + case 10: + if (e_1) throw e_1.error; + return [7 /*endfinally*/]; + case 11: return [7 /*endfinally*/]; + case 12: + e(); + f(); + new g(); + b(); + return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/operationsAvailableOnPromisedType.symbols b/tests/baselines/reference/operationsAvailableOnPromisedType.symbols new file mode 100644 index 00000000000..7f746d2486c --- /dev/null +++ b/tests/baselines/reference/operationsAvailableOnPromisedType.symbols @@ -0,0 +1,94 @@ +=== tests/cases/compiler/operationsAvailableOnPromisedType.ts === +async function fn( +>fn : Symbol(fn, Decl(operationsAvailableOnPromisedType.ts, 0, 0)) + + a: number, +>a : Symbol(a, Decl(operationsAvailableOnPromisedType.ts, 0, 18)) + + b: Promise, +>b : Symbol(b, Decl(operationsAvailableOnPromisedType.ts, 1, 14)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --)) + + c: Promise, +>c : Symbol(c, Decl(operationsAvailableOnPromisedType.ts, 2, 23)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --)) + + d: Promise<{ prop: string }>, +>d : Symbol(d, Decl(operationsAvailableOnPromisedType.ts, 3, 25)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --)) +>prop : Symbol(prop, Decl(operationsAvailableOnPromisedType.ts, 4, 16)) + + e: Promise<() => void>, +>e : Symbol(e, Decl(operationsAvailableOnPromisedType.ts, 4, 33)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --)) + + f: Promise<() => void> | (() => void), +>f : Symbol(f, Decl(operationsAvailableOnPromisedType.ts, 5, 27)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --)) + + g: Promise<{ new(): any }> +>g : Symbol(g, Decl(operationsAvailableOnPromisedType.ts, 6, 42)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --)) + +) { + // All errors + a | b; +>a : Symbol(a, Decl(operationsAvailableOnPromisedType.ts, 0, 18)) +>b : Symbol(b, Decl(operationsAvailableOnPromisedType.ts, 1, 14)) + + b | a; +>b : Symbol(b, Decl(operationsAvailableOnPromisedType.ts, 1, 14)) +>a : Symbol(a, Decl(operationsAvailableOnPromisedType.ts, 0, 18)) + + a + b; +>a : Symbol(a, Decl(operationsAvailableOnPromisedType.ts, 0, 18)) +>b : Symbol(b, Decl(operationsAvailableOnPromisedType.ts, 1, 14)) + + a > b; +>a : Symbol(a, Decl(operationsAvailableOnPromisedType.ts, 0, 18)) +>b : Symbol(b, Decl(operationsAvailableOnPromisedType.ts, 1, 14)) + + b++; +>b : Symbol(b, Decl(operationsAvailableOnPromisedType.ts, 1, 14)) + + --b; +>b : Symbol(b, Decl(operationsAvailableOnPromisedType.ts, 1, 14)) + + a === b; +>a : Symbol(a, Decl(operationsAvailableOnPromisedType.ts, 0, 18)) +>b : Symbol(b, Decl(operationsAvailableOnPromisedType.ts, 1, 14)) + + [...c]; +>c : Symbol(c, Decl(operationsAvailableOnPromisedType.ts, 2, 23)) + + for (const s of c) { +>s : Symbol(s, Decl(operationsAvailableOnPromisedType.ts, 18, 14)) +>c : Symbol(c, Decl(operationsAvailableOnPromisedType.ts, 2, 23)) + + fn(b, b, c, d); +>fn : Symbol(fn, Decl(operationsAvailableOnPromisedType.ts, 0, 0)) +>b : Symbol(b, Decl(operationsAvailableOnPromisedType.ts, 1, 14)) +>b : Symbol(b, Decl(operationsAvailableOnPromisedType.ts, 1, 14)) +>c : Symbol(c, Decl(operationsAvailableOnPromisedType.ts, 2, 23)) +>d : Symbol(d, Decl(operationsAvailableOnPromisedType.ts, 3, 25)) + + d.prop; +>d : Symbol(d, Decl(operationsAvailableOnPromisedType.ts, 3, 25)) + } + for await (const s of c) {} +>s : Symbol(s, Decl(operationsAvailableOnPromisedType.ts, 22, 20)) +>c : Symbol(c, Decl(operationsAvailableOnPromisedType.ts, 2, 23)) + + e(); +>e : Symbol(e, Decl(operationsAvailableOnPromisedType.ts, 4, 33)) + + f(); +>f : Symbol(f, Decl(operationsAvailableOnPromisedType.ts, 5, 27)) + + new g(); +>g : Symbol(g, Decl(operationsAvailableOnPromisedType.ts, 6, 42)) + + b(); +>b : Symbol(b, Decl(operationsAvailableOnPromisedType.ts, 1, 14)) +} + diff --git a/tests/baselines/reference/operationsAvailableOnPromisedType.types b/tests/baselines/reference/operationsAvailableOnPromisedType.types new file mode 100644 index 00000000000..207f9efcfd3 --- /dev/null +++ b/tests/baselines/reference/operationsAvailableOnPromisedType.types @@ -0,0 +1,104 @@ +=== tests/cases/compiler/operationsAvailableOnPromisedType.ts === +async function fn( +>fn : (a: number, b: Promise, c: Promise, d: Promise<{ prop: string; }>, e: Promise<() => void>, f: Promise<() => void> | (() => void), g: Promise any>) => Promise + + a: number, +>a : number + + b: Promise, +>b : Promise + + c: Promise, +>c : Promise + + d: Promise<{ prop: string }>, +>d : Promise<{ prop: string; }> +>prop : string + + e: Promise<() => void>, +>e : Promise<() => void> + + f: Promise<() => void> | (() => void), +>f : Promise<() => void> | (() => void) + + g: Promise<{ new(): any }> +>g : Promise any> + +) { + // All errors + a | b; +>a | b : number +>a : number +>b : Promise + + b | a; +>b | a : number +>b : Promise +>a : number + + a + b; +>a + b : any +>a : number +>b : Promise + + a > b; +>a > b : boolean +>a : number +>b : Promise + + b++; +>b++ : number +>b : Promise + + --b; +>--b : number +>b : Promise + + a === b; +>a === b : boolean +>a : number +>b : Promise + + [...c]; +>[...c] : any[] +>...c : any +>c : Promise + + for (const s of c) { +>s : any +>c : Promise + + fn(b, b, c, d); +>fn(b, b, c, d) : Promise +>fn : (a: number, b: Promise, c: Promise, d: Promise<{ prop: string; }>, e: Promise<() => void>, f: Promise<() => void> | (() => void), g: Promise any>) => Promise +>b : Promise +>b : Promise +>c : Promise +>d : Promise<{ prop: string; }> + + d.prop; +>d.prop : any +>d : Promise<{ prop: string; }> +>prop : any + } + for await (const s of c) {} +>s : any +>c : Promise + + e(); +>e() : any +>e : Promise<() => void> + + f(); +>f() : any +>f : Promise<() => void> | (() => void) + + new g(); +>new g() : any +>g : Promise any> + + b(); +>b() : any +>b : Promise +} + diff --git a/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt b/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt index c8c4ed39ed7..b00f35c503f 100644 --- a/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt +++ b/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(2,12): error TS2504: Type '{}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. -tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(8,12): error TS2504: Type 'Promise' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. +tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(8,12): error TS2780: Type 'Promise' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. Did you forget to use 'await'? tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(10,7): error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterableIterator'. Type 'AsyncGenerator' is not assignable to type 'AsyncIterableIterator'. Types of property 'next' are incompatible. @@ -71,7 +71,7 @@ tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts( async function * inferReturnType3() { yield* Promise.resolve([1, 2]); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2504: Type 'Promise' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. +!!! error TS2780: Type 'Promise' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. Did you forget to use 'await'? } const assignability1: () => AsyncIterableIterator = async function * () { ~~~~~~~~~~~~~~ From 094a001982b2180b933da03eb092fc2b889cb781 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Wed, 3 Jul 2019 16:04:09 -0700 Subject: [PATCH 80/95] Did you forget to use await? on arguments of function calls --- src/compiler/checker.ts | 11 +++++++++++ src/compiler/diagnosticMessages.json | 4 ++++ .../operationsAvailableOnPromisedType.errors.txt | 10 +++++----- .../reference/operationsAvailableOnPromisedType.js | 4 ++-- .../operationsAvailableOnPromisedType.symbols | 5 ++++- .../reference/operationsAvailableOnPromisedType.types | 7 +++++-- .../compiler/operationsAvailableOnPromisedType.ts | 2 +- 7 files changed, 32 insertions(+), 11 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c89c78e83eb..806e46b84c7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21434,6 +21434,7 @@ namespace ts { const checkArgType = checkMode & CheckMode.SkipContextSensitive ? getRegularTypeOfObjectLiteral(argType) : argType; if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain, errorOutputContainer)) { Debug.assert(!reportErrors || !!errorOutputContainer.errors, "parameter should have errors when reporting errors"); + maybeAddMissingAwaitInfo(arg, checkArgType, paramType); return errorOutputContainer.errors || []; } } @@ -21443,10 +21444,20 @@ namespace ts { const errorNode = reportErrors ? argCount < args.length ? args[argCount] : node : undefined; if (!checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, /*containingMessageChain*/ undefined, errorOutputContainer)) { Debug.assert(!reportErrors || !!errorOutputContainer.errors, "rest parameter should have errors when reporting errors"); + maybeAddMissingAwaitInfo(errorNode, spreadType, restType); return errorOutputContainer.errors || []; } } return undefined; + + function maybeAddMissingAwaitInfo(errorNode: Node | undefined, source: Type, target: Type) { + if (errorNode && reportErrors && errorOutputContainer.errors && errorOutputContainer.errors.length) { + const awaitedTypeOfSource = getAwaitedTypeOfPromise(source); + if (awaitedTypeOfSource && isTypeRelatedTo(awaitedTypeOfSource, target, relation)) { + addRelatedInfo(errorOutputContainer.errors[0], createDiagnosticForNode(errorNode, Diagnostics.Did_you_forget_to_use_await)); + } + } + } } /** diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e3774296e0d..b282484ab0c 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2757,6 +2757,10 @@ "category": "Error", "code": 2788 }, + "Did you forget to use 'await'?": { + "category": "Error", + "code": 2789 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt b/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt index 20f5767d027..50e37c7983b 100644 --- a/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt +++ b/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt @@ -7,7 +7,7 @@ tests/cases/compiler/operationsAvailableOnPromisedType.ts(16,7): error TS2764: A tests/cases/compiler/operationsAvailableOnPromisedType.ts(17,5): error TS2776: This condition will always return 'false' since the types 'number' and 'Promise' have no overlap. Did you forget to use 'await'? tests/cases/compiler/operationsAvailableOnPromisedType.ts(18,9): error TS2769: Type 'Promise' is not an array type. Did you forget to use 'await'? tests/cases/compiler/operationsAvailableOnPromisedType.ts(19,21): error TS2770: Type 'Promise' is not an array type or a string type. Did you forget to use 'await'? -tests/cases/compiler/operationsAvailableOnPromisedType.ts(20,9): error TS2554: Expected 7 arguments, but got 4. +tests/cases/compiler/operationsAvailableOnPromisedType.ts(20,12): error TS2345: Argument of type 'Promise' is not assignable to parameter of type 'number'. tests/cases/compiler/operationsAvailableOnPromisedType.ts(21,11): error TS2570: Property 'prop' does not exist on type 'Promise<{ prop: string; }>'. Did you forget to use 'await'? tests/cases/compiler/operationsAvailableOnPromisedType.ts(23,27): error TS2770: Type 'Promise' is not an array type or a string type. Did you forget to use 'await'? tests/cases/compiler/operationsAvailableOnPromisedType.ts(24,5): error TS2774: This expression is not callable. Did you forget to use 'await'? @@ -59,10 +59,10 @@ tests/cases/compiler/operationsAvailableOnPromisedType.ts(27,5): error TS2349: T for (const s of c) { ~ !!! error TS2770: Type 'Promise' is not an array type or a string type. Did you forget to use 'await'? - fn(b, b, c, d); - ~~~~~~~~~~~~~~ -!!! error TS2554: Expected 7 arguments, but got 4. -!!! related TS6210 tests/cases/compiler/operationsAvailableOnPromisedType.ts:6:5: An argument for 'e' was not provided. + fn(b, b, c, d, e, f, g); + ~ +!!! error TS2345: Argument of type 'Promise' is not assignable to parameter of type 'number'. +!!! related TS2777 tests/cases/compiler/operationsAvailableOnPromisedType.ts:20:12: Did you forget to use 'await'? d.prop; ~~~~ !!! error TS2570: Property 'prop' does not exist on type 'Promise<{ prop: string; }>'. Did you forget to use 'await'? diff --git a/tests/baselines/reference/operationsAvailableOnPromisedType.js b/tests/baselines/reference/operationsAvailableOnPromisedType.js index 889797a64b0..c9f8851fcc8 100644 --- a/tests/baselines/reference/operationsAvailableOnPromisedType.js +++ b/tests/baselines/reference/operationsAvailableOnPromisedType.js @@ -18,7 +18,7 @@ async function fn( a === b; [...c]; for (const s of c) { - fn(b, b, c, d); + fn(b, b, c, d, e, f, g); d.prop; } for await (const s of c) {} @@ -98,7 +98,7 @@ function fn(a, b, c, d, e, f, g) { __spreadArrays(c); for (_i = 0, c_2 = c; _i < c_2.length; _i++) { s = c_2[_i]; - fn(b, b, c, d); + fn(b, b, c, d, e, f, g); d.prop; } _b.label = 1; diff --git a/tests/baselines/reference/operationsAvailableOnPromisedType.symbols b/tests/baselines/reference/operationsAvailableOnPromisedType.symbols index 7f746d2486c..87c0aa129b4 100644 --- a/tests/baselines/reference/operationsAvailableOnPromisedType.symbols +++ b/tests/baselines/reference/operationsAvailableOnPromisedType.symbols @@ -65,12 +65,15 @@ async function fn( >s : Symbol(s, Decl(operationsAvailableOnPromisedType.ts, 18, 14)) >c : Symbol(c, Decl(operationsAvailableOnPromisedType.ts, 2, 23)) - fn(b, b, c, d); + fn(b, b, c, d, e, f, g); >fn : Symbol(fn, Decl(operationsAvailableOnPromisedType.ts, 0, 0)) >b : Symbol(b, Decl(operationsAvailableOnPromisedType.ts, 1, 14)) >b : Symbol(b, Decl(operationsAvailableOnPromisedType.ts, 1, 14)) >c : Symbol(c, Decl(operationsAvailableOnPromisedType.ts, 2, 23)) >d : Symbol(d, Decl(operationsAvailableOnPromisedType.ts, 3, 25)) +>e : Symbol(e, Decl(operationsAvailableOnPromisedType.ts, 4, 33)) +>f : Symbol(f, Decl(operationsAvailableOnPromisedType.ts, 5, 27)) +>g : Symbol(g, Decl(operationsAvailableOnPromisedType.ts, 6, 42)) d.prop; >d : Symbol(d, Decl(operationsAvailableOnPromisedType.ts, 3, 25)) diff --git a/tests/baselines/reference/operationsAvailableOnPromisedType.types b/tests/baselines/reference/operationsAvailableOnPromisedType.types index 207f9efcfd3..b22bd7fb1cc 100644 --- a/tests/baselines/reference/operationsAvailableOnPromisedType.types +++ b/tests/baselines/reference/operationsAvailableOnPromisedType.types @@ -68,13 +68,16 @@ async function fn( >s : any >c : Promise - fn(b, b, c, d); ->fn(b, b, c, d) : Promise + fn(b, b, c, d, e, f, g); +>fn(b, b, c, d, e, f, g) : Promise >fn : (a: number, b: Promise, c: Promise, d: Promise<{ prop: string; }>, e: Promise<() => void>, f: Promise<() => void> | (() => void), g: Promise any>) => Promise >b : Promise >b : Promise >c : Promise >d : Promise<{ prop: string; }> +>e : Promise<() => void> +>f : Promise<() => void> | (() => void) +>g : Promise any> d.prop; >d.prop : any diff --git a/tests/cases/compiler/operationsAvailableOnPromisedType.ts b/tests/cases/compiler/operationsAvailableOnPromisedType.ts index f6e339eab7f..b0bd677cf8d 100644 --- a/tests/cases/compiler/operationsAvailableOnPromisedType.ts +++ b/tests/cases/compiler/operationsAvailableOnPromisedType.ts @@ -17,7 +17,7 @@ async function fn( a === b; [...c]; for (const s of c) { - fn(b, b, c, d); + fn(b, b, c, d, e, f, g); d.prop; } for await (const s of c) {} From eb6b87aa2617416588392e6c1ac5f665400dbefd Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Wed, 3 Jul 2019 16:53:26 -0700 Subject: [PATCH 81/95] Refactor to use related info everywhere --- src/compiler/checker.ts | 98 +++++++++---------- src/compiler/diagnosticMessages.json | 3 +- ...erationsAvailableOnPromisedType.errors.txt | 75 ++++++++------ .../types.asyncGenerators.es2018.2.errors.txt | 5 +- 4 files changed, 96 insertions(+), 85 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 806e46b84c7..471a2c56742 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -933,15 +933,16 @@ namespace ts { } function errorAndMaybeSuggestAwait( - location: Node | undefined, + location: Node, maybeMissingAwait: boolean, - defaultMessage: DiagnosticMessage, - missingAwaitMessage: DiagnosticMessage, + message: DiagnosticMessage, arg0?: string | number | undefined, arg1?: string | number | undefined, arg2?: string | number | undefined, arg3?: string | number | undefined): Diagnostic { + const diagnostic = error(location, message, arg0, arg1, arg2, arg3); if (maybeMissingAwait) { - return error(location, missingAwaitMessage, arg0, arg1, arg2, arg3); + const related = createDiagnosticForNode(location, Diagnostics.Did_you_forget_to_use_await); + addRelatedInfo(diagnostic, related); } - return error(location, defaultMessage, arg0, arg1, arg2, arg3); + return diagnostic; } function createSymbol(flags: SymbolFlags, name: __String, checkFlags?: CheckFlags) { @@ -22350,11 +22351,11 @@ namespace ts { return true; } - function invocationErrorDetails(apparentType: Type, kind: SignatureKind): DiagnosticMessageChain { + function invocationErrorDetails(apparentType: Type, kind: SignatureKind): { messageChain: DiagnosticMessageChain, relatedMessage: DiagnosticMessage | undefined } { let errorInfo: DiagnosticMessageChain | undefined; const isCall = kind === SignatureKind.Call; const awaitedType = getAwaitedType(apparentType); - const mightWorkWithAwait = awaitedType && getSignaturesOfType(awaitedType, kind).length > 0; + const maybeMissingAwait = awaitedType && getSignaturesOfType(awaitedType, kind).length > 0; if (apparentType.flags & TypeFlags.Union) { const types = (apparentType as UnionType).types; let hasSignatures = false; @@ -22419,15 +22420,20 @@ namespace ts { typeToString(apparentType) ); } - return chainDiagnosticMessages( - errorInfo, - mightWorkWithAwait - ? isCall ? Diagnostics.This_expression_is_not_callable_Did_you_forget_to_use_await : Diagnostics.This_expression_is_not_constructable_Did_you_forget_to_use_await - : isCall ? Diagnostics.This_expression_is_not_callable : Diagnostics.This_expression_is_not_constructable - ); + return { + messageChain: chainDiagnosticMessages( + errorInfo, + isCall ? Diagnostics.This_expression_is_not_callable : Diagnostics.This_expression_is_not_constructable + ), + relatedMessage: maybeMissingAwait ? Diagnostics.Did_you_forget_to_use_await : undefined, + }; } function invocationError(errorTarget: Node, apparentType: Type, kind: SignatureKind, relatedInformation?: DiagnosticRelatedInformation) { - const diagnostic = createDiagnosticForNodeFromMessageChain(errorTarget, invocationErrorDetails(apparentType, kind)); + const { messageChain, relatedMessage: relatedInfo } = invocationErrorDetails(apparentType, kind); + const diagnostic = createDiagnosticForNodeFromMessageChain(errorTarget, messageChain); + if (relatedInfo) { + addRelatedInfo(diagnostic, createDiagnosticForNode(errorTarget, relatedInfo)); + } if (isCallExpression(errorTarget.parent)) { const { start, length } = getDiagnosticSpanForCallNode(errorTarget.parent, /* doNotIncludeArguments */ true); diagnostic.start = start; @@ -22527,9 +22533,12 @@ namespace ts { const headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); if (!callSignatures.length) { - let errorInfo = invocationErrorDetails(apparentType, SignatureKind.Call); - errorInfo = chainDiagnosticMessages(errorInfo, headMessage); - const diag = createDiagnosticForNodeFromMessageChain(node.expression, errorInfo); + const errorDetails = invocationErrorDetails(apparentType, SignatureKind.Call); + const messageChain = chainDiagnosticMessages(errorDetails.messageChain, headMessage); + const diag = createDiagnosticForNodeFromMessageChain(node.expression, messageChain); + if (errorDetails.relatedMessage) { + addRelatedInfo(diag, createDiagnosticForNode(node.expression, errorDetails.relatedMessage)); + } diagnostics.add(diag); invocationErrorRecovery(apparentType, SignatureKind.Call, diag); return resolveErrorCall(node); @@ -23687,14 +23696,13 @@ namespace ts { } } - function checkArithmeticOperandType(operand: Node, type: Type, diagnostic: DiagnosticMessage, missingAwaitDiagnostic: DiagnosticMessage): boolean { + function checkArithmeticOperandType(operand: Node, type: Type, diagnostic: DiagnosticMessage): boolean { if (!isTypeAssignableTo(type, numberOrBigIntType)) { const awaitedType = getAwaitedType(type); errorAndMaybeSuggestAwait( operand, !!awaitedType && isTypeAssignableTo(awaitedType, numberOrBigIntType), - diagnostic, - missingAwaitDiagnostic); + diagnostic); return false; } return true; @@ -23892,8 +23900,7 @@ namespace ts { case SyntaxKind.PlusPlusToken: case SyntaxKind.MinusMinusToken: const ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), - Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type, - Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_Did_you_forget_to_use_await); + Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type); if (ok) { // run check only if former checks succeeded to avoid reporting cascading errors checkReferenceExpression(node.operand, Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access); @@ -23911,8 +23918,7 @@ namespace ts { const ok = checkArithmeticOperandType( node.operand, checkNonNullType(operandType, node.operand), - Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type, - Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_Did_you_forget_to_use_await); + Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type); if (ok) { // run check only if former checks succeeded to avoid reporting cascading errors checkReferenceExpression(node.operand, Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access); @@ -24304,8 +24310,8 @@ namespace ts { } else { // otherwise just check each operand separately and report errors as normal - const leftOk = checkArithmeticOperandType(left, leftType, Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_Did_you_forget_to_use_await); - const rightOk = checkArithmeticOperandType(right, rightType, Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_Did_you_forget_to_use_await); + const leftOk = checkArithmeticOperandType(left, leftType, Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type); + const rightOk = checkArithmeticOperandType(right, rightType, Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type); let resultType: Type; // If both are any or unknown, allow operation; assume it will resolve to number if ((isTypeAssignableToKind(leftType, TypeFlags.AnyOrUnknown) && isTypeAssignableToKind(rightType, TypeFlags.AnyOrUnknown)) || @@ -24558,7 +24564,6 @@ namespace ts { errNode, wouldWorkWithAwait, Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2, - Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2_Did_you_forget_to_use_await, tokenToString(operatorToken.kind), leftStr, rightStr, @@ -24583,7 +24588,6 @@ namespace ts { errNode, maybeMissingAwait, Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap, - Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap_Did_you_forget_to_use_await, typeName, leftStr, rightStr); } @@ -27937,28 +27941,22 @@ namespace ts { // number and string input is allowed, we want to say that number is not an // array type or a string type. const yieldType = getIterationTypeOfIterable(use, IterationTypeKind.Yield, inputType, /*errorNode*/ undefined); - const [defaultDiagnostic, missingAwaitDiagnostic]: [DiagnosticMessage, DiagnosticMessage | undefined] = !(use & IterationUse.AllowsStringInputFlag) || hasStringConstituent + const [defaultDiagnostic, maybeMissingAwait]: [DiagnosticMessage, boolean] = !(use & IterationUse.AllowsStringInputFlag) || hasStringConstituent ? downlevelIteration - ? [Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_Did_you_forget_to_use_await] + ? [Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true] : yieldType - ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators, undefined] - : [Diagnostics.Type_0_is_not_an_array_type, Diagnostics.Type_0_is_not_an_array_type_Did_you_forget_to_use_await] + ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators, false] + : [Diagnostics.Type_0_is_not_an_array_type, true] : downlevelIteration - ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_Did_you_forget_to_use_await] + ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true] : yieldType - ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators, undefined] - : [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Did_you_forget_to_use_await]; - if (missingAwaitDiagnostic) { - errorAndMaybeSuggestAwait( - errorNode, - !!getAwaitedTypeOfPromise(arrayType), - defaultDiagnostic, - missingAwaitDiagnostic, - typeToString(arrayType)); - } - else { - error(errorNode, defaultDiagnostic, typeToString(arrayType)); - } + ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators, false] + : [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, true]; + errorAndMaybeSuggestAwait( + errorNode, + maybeMissingAwait && !!getAwaitedTypeOfPromise(arrayType), + defaultDiagnostic, + typeToString(arrayType)); } return hasStringConstituent ? stringType : undefined; } @@ -28257,10 +28255,10 @@ namespace ts { } function reportTypeNotIterableError(errorNode: Node, type: Type, allowAsyncIterables: boolean): void { - const [defaultDiagnostic, missingAwaitDiagnostic] = allowAsyncIterables - ? [Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator, Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_Did_you_forget_to_use_await] - : [Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator, Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_Did_you_forget_to_use_await]; - errorAndMaybeSuggestAwait(errorNode, !!getAwaitedTypeOfPromise(type), defaultDiagnostic, missingAwaitDiagnostic, typeToString(type)); + const message = allowAsyncIterables + ? Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator + : Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator; + errorAndMaybeSuggestAwait(errorNode, !!getAwaitedTypeOfPromise(type), message, typeToString(type)); } /** diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index b282484ab0c..f2c5d3805d7 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2655,8 +2655,7 @@ }, "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'.": { "category": "Error", - "code": 2763 - }, + "code": 77 }, "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'.": { "category": "Error", "code": 2764 diff --git a/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt b/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt index 50e37c7983b..955bb3c2951 100644 --- a/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt +++ b/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt @@ -1,21 +1,21 @@ -tests/cases/compiler/operationsAvailableOnPromisedType.ts(11,9): error TS2766: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'? -tests/cases/compiler/operationsAvailableOnPromisedType.ts(12,5): error TS2765: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'? -tests/cases/compiler/operationsAvailableOnPromisedType.ts(13,5): error TS2763: Operator '+' cannot be applied to types 'number' and 'Promise'. Did you forget to use 'await'? -tests/cases/compiler/operationsAvailableOnPromisedType.ts(14,5): error TS2763: Operator '>' cannot be applied to types 'number' and 'Promise'. Did you forget to use 'await'? -tests/cases/compiler/operationsAvailableOnPromisedType.ts(15,5): error TS2764: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'? -tests/cases/compiler/operationsAvailableOnPromisedType.ts(16,7): error TS2764: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'? -tests/cases/compiler/operationsAvailableOnPromisedType.ts(17,5): error TS2776: This condition will always return 'false' since the types 'number' and 'Promise' have no overlap. Did you forget to use 'await'? -tests/cases/compiler/operationsAvailableOnPromisedType.ts(18,9): error TS2769: Type 'Promise' is not an array type. Did you forget to use 'await'? -tests/cases/compiler/operationsAvailableOnPromisedType.ts(19,21): error TS2770: Type 'Promise' is not an array type or a string type. Did you forget to use 'await'? +tests/cases/compiler/operationsAvailableOnPromisedType.ts(11,9): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. +tests/cases/compiler/operationsAvailableOnPromisedType.ts(12,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. +tests/cases/compiler/operationsAvailableOnPromisedType.ts(13,5): error TS2365: Operator '+' cannot be applied to types 'number' and 'Promise'. +tests/cases/compiler/operationsAvailableOnPromisedType.ts(14,5): error TS2365: Operator '>' cannot be applied to types 'number' and 'Promise'. +tests/cases/compiler/operationsAvailableOnPromisedType.ts(15,5): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. +tests/cases/compiler/operationsAvailableOnPromisedType.ts(16,7): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. +tests/cases/compiler/operationsAvailableOnPromisedType.ts(17,5): error TS2367: This condition will always return 'false' since the types 'number' and 'Promise' have no overlap. +tests/cases/compiler/operationsAvailableOnPromisedType.ts(18,9): error TS2461: Type 'Promise' is not an array type. +tests/cases/compiler/operationsAvailableOnPromisedType.ts(19,21): error TS2495: Type 'Promise' is not an array type or a string type. tests/cases/compiler/operationsAvailableOnPromisedType.ts(20,12): error TS2345: Argument of type 'Promise' is not assignable to parameter of type 'number'. tests/cases/compiler/operationsAvailableOnPromisedType.ts(21,11): error TS2570: Property 'prop' does not exist on type 'Promise<{ prop: string; }>'. Did you forget to use 'await'? -tests/cases/compiler/operationsAvailableOnPromisedType.ts(23,27): error TS2770: Type 'Promise' is not an array type or a string type. Did you forget to use 'await'? -tests/cases/compiler/operationsAvailableOnPromisedType.ts(24,5): error TS2774: This expression is not callable. Did you forget to use 'await'? +tests/cases/compiler/operationsAvailableOnPromisedType.ts(23,27): error TS2495: Type 'Promise' is not an array type or a string type. +tests/cases/compiler/operationsAvailableOnPromisedType.ts(24,5): error TS2349: This expression is not callable. Type 'Promise<() => void>' has no call signatures. -tests/cases/compiler/operationsAvailableOnPromisedType.ts(25,5): error TS2774: This expression is not callable. Did you forget to use 'await'? +tests/cases/compiler/operationsAvailableOnPromisedType.ts(25,5): error TS2349: This expression is not callable. Not all constituents of type 'Promise<() => void> | (() => void)' are callable. Type 'Promise<() => void>' has no call signatures. -tests/cases/compiler/operationsAvailableOnPromisedType.ts(26,9): error TS2775: This expression is not constructable. Did you forget to use 'await'? +tests/cases/compiler/operationsAvailableOnPromisedType.ts(26,9): error TS2351: This expression is not constructable. Type 'Promise any>' has no construct signatures. tests/cases/compiler/operationsAvailableOnPromisedType.ts(27,5): error TS2349: This expression is not callable. Type 'Promise' has no call signatures. @@ -34,55 +34,68 @@ tests/cases/compiler/operationsAvailableOnPromisedType.ts(27,5): error TS2349: T // All errors a | b; ~ -!!! error TS2766: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'? +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. +!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:11:9: Did you forget to use 'await'? b | a; ~ -!!! error TS2765: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'? +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. +!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:12:5: Did you forget to use 'await'? a + b; ~~~~~ -!!! error TS2763: Operator '+' cannot be applied to types 'number' and 'Promise'. Did you forget to use 'await'? +!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'Promise'. +!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:13:5: Did you forget to use 'await'? a > b; ~~~~~ -!!! error TS2763: Operator '>' cannot be applied to types 'number' and 'Promise'. Did you forget to use 'await'? +!!! error TS2365: Operator '>' cannot be applied to types 'number' and 'Promise'. +!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:14:5: Did you forget to use 'await'? b++; ~ -!!! error TS2764: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'? +!!! error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. +!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:15:5: Did you forget to use 'await'? --b; ~ -!!! error TS2764: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'? +!!! error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. +!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:16:7: Did you forget to use 'await'? a === b; ~~~~~~~ -!!! error TS2776: This condition will always return 'false' since the types 'number' and 'Promise' have no overlap. Did you forget to use 'await'? +!!! error TS2367: This condition will always return 'false' since the types 'number' and 'Promise' have no overlap. +!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:17:5: Did you forget to use 'await'? [...c]; ~ -!!! error TS2769: Type 'Promise' is not an array type. Did you forget to use 'await'? +!!! error TS2461: Type 'Promise' is not an array type. +!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:18:9: Did you forget to use 'await'? for (const s of c) { ~ -!!! error TS2770: Type 'Promise' is not an array type or a string type. Did you forget to use 'await'? +!!! error TS2495: Type 'Promise' is not an array type or a string type. +!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:19:21: Did you forget to use 'await'? fn(b, b, c, d, e, f, g); ~ !!! error TS2345: Argument of type 'Promise' is not assignable to parameter of type 'number'. -!!! related TS2777 tests/cases/compiler/operationsAvailableOnPromisedType.ts:20:12: Did you forget to use 'await'? +!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:20:12: Did you forget to use 'await'? d.prop; ~~~~ !!! error TS2570: Property 'prop' does not exist on type 'Promise<{ prop: string; }>'. Did you forget to use 'await'? } for await (const s of c) {} ~ -!!! error TS2770: Type 'Promise' is not an array type or a string type. Did you forget to use 'await'? +!!! error TS2495: Type 'Promise' is not an array type or a string type. +!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:23:27: Did you forget to use 'await'? e(); ~ -!!! error TS2774: This expression is not callable. Did you forget to use 'await'? -!!! error TS2774: Type 'Promise<() => void>' has no call signatures. +!!! error TS2349: This expression is not callable. +!!! error TS2349: Type 'Promise<() => void>' has no call signatures. +!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:24:5: Did you forget to use 'await'? f(); ~ -!!! error TS2774: This expression is not callable. Did you forget to use 'await'? -!!! error TS2774: Not all constituents of type 'Promise<() => void> | (() => void)' are callable. -!!! error TS2774: Type 'Promise<() => void>' has no call signatures. +!!! error TS2349: This expression is not callable. +!!! error TS2349: Not all constituents of type 'Promise<() => void> | (() => void)' are callable. +!!! error TS2349: Type 'Promise<() => void>' has no call signatures. +!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:25:5: Did you forget to use 'await'? new g(); ~ -!!! error TS2775: This expression is not constructable. Did you forget to use 'await'? -!!! error TS2775: Type 'Promise any>' has no construct signatures. +!!! error TS2351: This expression is not constructable. +!!! error TS2351: Type 'Promise any>' has no construct signatures. +!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:26:9: Did you forget to use 'await'? b(); ~ !!! error TS2349: This expression is not callable. diff --git a/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt b/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt index b00f35c503f..2b214fe3d4b 100644 --- a/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt +++ b/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(2,12): error TS2504: Type '{}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. -tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(8,12): error TS2780: Type 'Promise' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. Did you forget to use 'await'? +tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(8,12): error TS2504: Type 'Promise' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts(10,7): error TS2322: Type '() => AsyncGenerator' is not assignable to type '() => AsyncIterableIterator'. Type 'AsyncGenerator' is not assignable to type 'AsyncIterableIterator'. Types of property 'next' are incompatible. @@ -71,7 +71,8 @@ tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts( async function * inferReturnType3() { yield* Promise.resolve([1, 2]); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2780: Type 'Promise' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. Did you forget to use 'await'? +!!! error TS2504: Type 'Promise' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. +!!! related TS2789 tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts:8:12: Did you forget to use 'await'? } const assignability1: () => AsyncIterableIterator = async function * () { ~~~~~~~~~~~~~~ From 6626a99f1190d0a432b81671c4249434c64b02ec Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 8 Jul 2019 14:44:57 -0700 Subject: [PATCH 82/95] Fix bad rebase --- src/compiler/diagnosticMessages.json | 69 ++-------------------------- 1 file changed, 3 insertions(+), 66 deletions(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index f2c5d3805d7..c2585e6b40b 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2655,7 +2655,8 @@ }, "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'.": { "category": "Error", - "code": 77 }, + "code": 2673 + }, "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'.": { "category": "Error", "code": 2764 @@ -2692,73 +2693,9 @@ "category": "Error", "code": 2772 }, - "Operator '{0}' cannot be applied to types '{1}' and '{2}'. Did you forget to use 'await'?": { - "category": "Error", - "code": 2773 - }, - "An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'?": { - "category": "Error", - "code": 2774 - }, - "The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'?": { - "category": "Error", - "code": 2775 - }, - "This expression is not callable. Did you forget to use 'await'?": { - "category": "Error", - "code": 2776 - }, - "This expression is not constructable. Did you forget to use 'await'?": { - "category": "Error", - "code": 2777 - }, - "The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. Did you forget to use 'await'?": { - "category": "Error", - "code": 2778 - }, - "Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator. Did you forget to use 'await'?": { - "category": "Error", - "code": 2779 - }, - "Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. Did you forget to use 'await'?": { - "category": "Error", - "code": 2780 - }, - "Type '{0}' is not an array type. Did you forget to use 'await'?": { - "category": "Error", - "code": 2781 - }, - "Type '{0}' is not an array type or a string type. Did you forget to use 'await'?": { - "category": "Error", - "code": 2782 - }, - "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator. Did you forget to use 'await'?": { - "category": "Error", - "code": 2783 - }, - "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator. Did you forget to use 'await'?": { - "category": "Error", - "code": 2784 - }, - "Argument of type '{0}' is not assignable to parameter of type '{1}'. Did you forget to use 'await'?": { - "category": "Error", - "code": 2785 - }, - "Type '{0}' has no call signatures. Did you forget to use 'await'?": { - "category": "Error", - "code": 2786 - }, - "Type '{0}' has no construct signatures. Did you forget to use 'await'?": { - "category": "Error", - "code": 2787 - }, - "This condition will always return '{0}' since the types '{1}' and '{2}' have no overlap. Did you forget to use 'await'?": { - "category": "Error", - "code": 2788 - }, "Did you forget to use 'await'?": { "category": "Error", - "code": 2789 + "code": 2773 }, "Import declaration '{0}' is using private name '{1}'.": { From 64501996cc0816e98d6fce343c8d48074809b790 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 8 Jul 2019 14:46:20 -0700 Subject: [PATCH 83/95] Update error code --- src/compiler/diagnosticMessages.json | 2 +- ...erationsAvailableOnPromisedType.errors.txt | 28 +++++++++---------- .../types.asyncGenerators.es2018.2.errors.txt | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index c2585e6b40b..c3396a70731 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2655,7 +2655,7 @@ }, "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'.": { "category": "Error", - "code": 2673 + "code": 2763 }, "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'.": { "category": "Error", diff --git a/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt b/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt index 955bb3c2951..0fc56b82c1d 100644 --- a/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt +++ b/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt @@ -35,43 +35,43 @@ tests/cases/compiler/operationsAvailableOnPromisedType.ts(27,5): error TS2349: T a | b; ~ !!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. -!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:11:9: Did you forget to use 'await'? +!!! related TS2773 tests/cases/compiler/operationsAvailableOnPromisedType.ts:11:9: Did you forget to use 'await'? b | a; ~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. -!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:12:5: Did you forget to use 'await'? +!!! related TS2773 tests/cases/compiler/operationsAvailableOnPromisedType.ts:12:5: Did you forget to use 'await'? a + b; ~~~~~ !!! error TS2365: Operator '+' cannot be applied to types 'number' and 'Promise'. -!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:13:5: Did you forget to use 'await'? +!!! related TS2773 tests/cases/compiler/operationsAvailableOnPromisedType.ts:13:5: Did you forget to use 'await'? a > b; ~~~~~ !!! error TS2365: Operator '>' cannot be applied to types 'number' and 'Promise'. -!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:14:5: Did you forget to use 'await'? +!!! related TS2773 tests/cases/compiler/operationsAvailableOnPromisedType.ts:14:5: Did you forget to use 'await'? b++; ~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. -!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:15:5: Did you forget to use 'await'? +!!! related TS2773 tests/cases/compiler/operationsAvailableOnPromisedType.ts:15:5: Did you forget to use 'await'? --b; ~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. -!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:16:7: Did you forget to use 'await'? +!!! related TS2773 tests/cases/compiler/operationsAvailableOnPromisedType.ts:16:7: Did you forget to use 'await'? a === b; ~~~~~~~ !!! error TS2367: This condition will always return 'false' since the types 'number' and 'Promise' have no overlap. -!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:17:5: Did you forget to use 'await'? +!!! related TS2773 tests/cases/compiler/operationsAvailableOnPromisedType.ts:17:5: Did you forget to use 'await'? [...c]; ~ !!! error TS2461: Type 'Promise' is not an array type. -!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:18:9: Did you forget to use 'await'? +!!! related TS2773 tests/cases/compiler/operationsAvailableOnPromisedType.ts:18:9: Did you forget to use 'await'? for (const s of c) { ~ !!! error TS2495: Type 'Promise' is not an array type or a string type. -!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:19:21: Did you forget to use 'await'? +!!! related TS2773 tests/cases/compiler/operationsAvailableOnPromisedType.ts:19:21: Did you forget to use 'await'? fn(b, b, c, d, e, f, g); ~ !!! error TS2345: Argument of type 'Promise' is not assignable to parameter of type 'number'. -!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:20:12: Did you forget to use 'await'? +!!! related TS2773 tests/cases/compiler/operationsAvailableOnPromisedType.ts:20:12: Did you forget to use 'await'? d.prop; ~~~~ !!! error TS2570: Property 'prop' does not exist on type 'Promise<{ prop: string; }>'. Did you forget to use 'await'? @@ -79,23 +79,23 @@ tests/cases/compiler/operationsAvailableOnPromisedType.ts(27,5): error TS2349: T for await (const s of c) {} ~ !!! error TS2495: Type 'Promise' is not an array type or a string type. -!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:23:27: Did you forget to use 'await'? +!!! related TS2773 tests/cases/compiler/operationsAvailableOnPromisedType.ts:23:27: Did you forget to use 'await'? e(); ~ !!! error TS2349: This expression is not callable. !!! error TS2349: Type 'Promise<() => void>' has no call signatures. -!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:24:5: Did you forget to use 'await'? +!!! related TS2773 tests/cases/compiler/operationsAvailableOnPromisedType.ts:24:5: Did you forget to use 'await'? f(); ~ !!! error TS2349: This expression is not callable. !!! error TS2349: Not all constituents of type 'Promise<() => void> | (() => void)' are callable. !!! error TS2349: Type 'Promise<() => void>' has no call signatures. -!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:25:5: Did you forget to use 'await'? +!!! related TS2773 tests/cases/compiler/operationsAvailableOnPromisedType.ts:25:5: Did you forget to use 'await'? new g(); ~ !!! error TS2351: This expression is not constructable. !!! error TS2351: Type 'Promise any>' has no construct signatures. -!!! related TS2763 tests/cases/compiler/operationsAvailableOnPromisedType.ts:26:9: Did you forget to use 'await'? +!!! related TS2773 tests/cases/compiler/operationsAvailableOnPromisedType.ts:26:9: Did you forget to use 'await'? b(); ~ !!! error TS2349: This expression is not callable. diff --git a/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt b/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt index 2b214fe3d4b..1ca77aebc86 100644 --- a/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt +++ b/tests/baselines/reference/types.asyncGenerators.es2018.2.errors.txt @@ -72,7 +72,7 @@ tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts( yield* Promise.resolve([1, 2]); ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2504: Type 'Promise' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. -!!! related TS2789 tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts:8:12: Did you forget to use 'await'? +!!! related TS2773 tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts:8:12: Did you forget to use 'await'? } const assignability1: () => AsyncIterableIterator = async function * () { ~~~~~~~~~~~~~~ From bdd8a3e8786426128e10f9778de1a2cdfd2de1d5 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 8 Jul 2019 16:32:53 -0700 Subject: [PATCH 84/95] Only add "Did you forget await" for function args when the parameter type is not promise-like --- src/compiler/checker.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 471a2c56742..943eb2f3df5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21453,6 +21453,10 @@ namespace ts { function maybeAddMissingAwaitInfo(errorNode: Node | undefined, source: Type, target: Type) { if (errorNode && reportErrors && errorOutputContainer.errors && errorOutputContainer.errors.length) { + // Bail if target is Promise-like---something else is wrong + if (getAwaitedTypeOfPromise(target)) { + return; + } const awaitedTypeOfSource = getAwaitedTypeOfPromise(source); if (awaitedTypeOfSource && isTypeRelatedTo(awaitedTypeOfSource, target, relation)) { addRelatedInfo(errorOutputContainer.errors[0], createDiagnosticForNode(errorNode, Diagnostics.Did_you_forget_to_use_await)); From 384669a1cefa5b1d68e07da1d016e506380b2b85 Mon Sep 17 00:00:00 2001 From: Florian Regensburger Date: Tue, 9 Jul 2019 01:56:50 +0200 Subject: [PATCH 85/95] Finish addMissingConst codefix for single variable and array literal assignments --- src/services/codefixes/addMissingConst.ts | 37 ++++++++++++------- src/services/textChanges.ts | 3 -- ...ixAddMissingConstPreservingIndentation1.ts | 19 ++++++++++ ...ixAddMissingConstPreservingIndentation2.ts | 19 ++++++++++ 4 files changed, 61 insertions(+), 17 deletions(-) create mode 100644 tests/cases/fourslash/codeFixAddMissingConstPreservingIndentation1.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingConstPreservingIndentation2.ts diff --git a/src/services/codefixes/addMissingConst.ts b/src/services/codefixes/addMissingConst.ts index 857d7fb4282..fa353cc5b83 100644 --- a/src/services/codefixes/addMissingConst.ts +++ b/src/services/codefixes/addMissingConst.ts @@ -9,7 +9,7 @@ namespace ts.codefix { registerCodeFix({ errorCodes, getCodeActions: (context) => { - const changes = textChanges.ChangeTracker.with(context, t => makeChange(t, context.sourceFile, context.span.start)); + const changes = textChanges.ChangeTracker.with(context, t => makeChange(t, context.sourceFile, context.span.start, context.program)); if (changes.length > 0) { return [createCodeFixAction(fixId, changes, Diagnostics.Add_const_to_unresolved_variable, fixId, Diagnostics.Add_const_to_all_unresolved_variables)]; } @@ -17,27 +17,28 @@ namespace ts.codefix { fixIds: [fixId], getAllCodeActions: context => { const fixedNodes = new NodeSet(); - return codeFixAll(context, errorCodes, (changes, diag) => makeChange(changes, diag.file, diag.start, fixedNodes)); + return codeFixAll(context, errorCodes, (changes, diag) => makeChange(changes, diag.file, diag.start, context.program, fixedNodes)); }, }); - function makeChange(changeTracker: textChanges.ChangeTracker, sourceFile: SourceFile, pos: number, fixedNodes?: NodeSet) { + function makeChange(changeTracker: textChanges.ChangeTracker, sourceFile: SourceFile, pos: number, program: Program, fixedNodes?: NodeSet) { const token = getTokenAtPosition(sourceFile, pos); - const forInitializer = findAncestor(token, node => - isForInOrOfStatement(node.parent) ? node.parent.initializer === node - : isPossiblyPartOfDestructuring(node) ? false : "quit"); + isForInOrOfStatement(node.parent) ? node.parent.initializer === node : + isPossiblyPartOfDestructuring(node) ? false : "quit" + ); if (forInitializer) return applyChange(changeTracker, forInitializer, sourceFile, fixedNodes); const parent = token.parent; - const standaloneInitializer = isExpressionStatement(parent.parent); - if (standaloneInitializer) return applyChange(changeTracker, parent, sourceFile, fixedNodes); + if (isBinaryExpression(parent) && isExpressionStatement(parent.parent)) { + return applyChange(changeTracker, token, sourceFile, fixedNodes); + } - const arrayLiteralInitializer = isArrayLiteralExpression(token.parent); - if (arrayLiteralInitializer) { - const availableIdentifiers: string[] = []; // TODO: where to get/gather this information from? - const noIdentifiersDeclared = parent.forEachChild(node => availableIdentifiers.indexOf(node.getFullText()) < 0); - if (!noIdentifiersDeclared) return; + if (isArrayLiteralExpression(parent)) { + const checker = program.getTypeChecker(); + if (!every(parent.elements, element => arrayElementCouldBeVariableDeclaration(element, checker))) { + return; + } return applyChange(changeTracker, parent, sourceFile, fixedNodes); } @@ -45,7 +46,7 @@ namespace ts.codefix { function applyChange(changeTracker: textChanges.ChangeTracker, initializer: Node, sourceFile: SourceFile, fixedNodes?: NodeSet) { if (!fixedNodes || fixedNodes.tryAdd(initializer)) { - changeTracker.insertNodeBefore(sourceFile, initializer, createToken(SyntaxKind.ConstKeyword)); + changeTracker.insertModifierBefore(sourceFile, SyntaxKind.ConstKeyword, initializer); } } @@ -61,4 +62,12 @@ namespace ts.codefix { return false; } } + + function arrayElementCouldBeVariableDeclaration(expression: Expression, checker: TypeChecker) { + const identifier = + isIdentifier(expression) ? expression : + isAssignmentExpression(expression, /*excludeCompoundAssignment*/ true) && isIdentifier(expression.left) ? expression.left : + undefined; + return !!identifier && !checker.getSymbolAtLocation(identifier); + } } diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index 52dd9a2b9a6..f6af03aa2c5 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -425,9 +425,6 @@ namespace ts.textChanges { else if (isStringLiteral(before) && isImportDeclaration(before.parent) || isNamedImports(before)) { return { suffix: ", " }; } - else if (isForInitializer(before)) { - return { suffix: " " }; - } return Debug.failBadSyntaxKind(before); // We haven't handled this kind of node yet -- add it } diff --git a/tests/cases/fourslash/codeFixAddMissingConstPreservingIndentation1.ts b/tests/cases/fourslash/codeFixAddMissingConstPreservingIndentation1.ts new file mode 100644 index 00000000000..10818a621bb --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstPreservingIndentation1.ts @@ -0,0 +1,19 @@ +/// + +////a = () => { +//// x = 0; +//// [y] = [1]; +//// weirdlyIndented = 2; +////}; +////b = 3; + +verify.codeFixAll({ + fixId: "addMissingConst", + fixAllDescription: "Add 'const' to all unresolved variables", + newFileContent: `const a = () => { + const x = 0; + const [y] = [1]; + const weirdlyIndented = 2; +}; +const b = 3;` +}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstPreservingIndentation2.ts b/tests/cases/fourslash/codeFixAddMissingConstPreservingIndentation2.ts new file mode 100644 index 00000000000..1411dc357e1 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstPreservingIndentation2.ts @@ -0,0 +1,19 @@ +/// + +////a = () => { +//// for (x in []) { +//// y = 0; +//// } +////}; +////b = 3; + +verify.codeFixAll({ + fixId: "addMissingConst", + fixAllDescription: "Add 'const' to all unresolved variables", + newFileContent: `const a = () => { + for (const x in []) { + const y = 0; + } +}; +const b = 3;` +}); From 1de7881141d8ef7556331f23d7d9f315a062cc53 Mon Sep 17 00:00:00 2001 From: Florian Regensburger Date: Tue, 9 Jul 2019 02:07:54 +0200 Subject: [PATCH 86/95] Add negative test case for addMissingConst codeFix with unexpected array elements --- .../fourslash/codeFixAddMissingConstToArrayDestructuring4.ts | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 tests/cases/fourslash/codeFixAddMissingConstToArrayDestructuring4.ts diff --git a/tests/cases/fourslash/codeFixAddMissingConstToArrayDestructuring4.ts b/tests/cases/fourslash/codeFixAddMissingConstToArrayDestructuring4.ts new file mode 100644 index 00000000000..2c077e4c149 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstToArrayDestructuring4.ts @@ -0,0 +1,5 @@ +/// + +////[x, y()] = [0, () => 1]; + +verify.not.codeFixAvailable(); From 949956b58662ed0549020b4482701e046ed0bd93 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 9 Jul 2019 15:39:42 -0700 Subject: [PATCH 87/95] Improve multiple overloads error span (#32315) * Improve multiple overloads error span When all errors for a multiple-overload error refer to the same span, use that span instead of the one for the entire call. This situation is quite common for 2-overload sets in React. * Update baselines * Fix lint --- src/compiler/checker.ts | 13 +++++++++++-- .../reference/bigintWithLib.errors.txt | 8 ++++---- .../checkJsxChildrenCanBeTupleType.errors.txt | 4 ++-- .../reference/constructorOverloads1.errors.txt | 8 ++++---- ...edStringLiteralsInJsxAttributes02.errors.txt | 16 ++++++++-------- .../controlFlowIterationErrors.errors.txt | 8 ++++---- .../reference/destructuringTuple.errors.txt | 4 ++-- .../reference/functionOverloads2.errors.txt | 4 ++-- .../reference/functionOverloads40.errors.txt | 4 ++-- .../reference/functionOverloads41.errors.txt | 4 ++-- ...adedMethodWithOverloadedArguments.errors.txt | 12 ++++++------ .../heterogeneousArrayAndOverloads.errors.txt | 4 ++-- .../reference/incompatibleTypes.errors.txt | 8 ++++---- .../reference/iteratorSpreadInArray6.errors.txt | 4 ++-- .../reference/overloadResolution.errors.txt | 12 ++++++------ ...erloadResolutionClassConstructors.errors.txt | 4 ++-- .../overloadResolutionConstructors.errors.txt | 12 ++++++------ .../overloadResolutionTest1.errors.txt | 12 ++++++------ .../overloadingOnConstants2.errors.txt | 4 ++-- ...ionWithConstraintCheckingDeferred.errors.txt | 17 +++++++---------- .../reference/promiseTypeInference.errors.txt | 4 ++-- ...reactDefaultPropsInferenceSuccess.errors.txt | 12 ++++++------ .../reference/recursiveFunctionTypes.errors.txt | 4 ++-- ...ateStringsWithOverloadResolution1.errors.txt | 16 ++++++++-------- ...tringsWithOverloadResolution1_ES6.errors.txt | 16 ++++++++-------- ...ateStringsWithOverloadResolution3.errors.txt | 12 ++++++------ ...tringsWithOverloadResolution3_ES6.errors.txt | 12 ++++++------ .../reference/tsxElementResolution9.errors.txt | 12 ++++++------ .../tsxNotUsingApparentTypeOfSFC.errors.txt | 4 ++-- ...atelessFunctionComponentOverload4.errors.txt | 16 ++++++++-------- ...atelessFunctionComponentOverload5.errors.txt | 12 ++++++------ ...ctionComponentsWithTypeArguments4.errors.txt | 4 ++-- .../unionTypeCallSignatures.errors.txt | 8 ++++---- .../unionTypeConstructSignatures.errors.txt | 8 ++++---- 34 files changed, 154 insertions(+), 148 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5d5d99f62c6..3cd8418bde0 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21836,9 +21836,18 @@ namespace ts { } const diags = max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics); - const chain = map(diags, d => typeof d.messageText === "string" ? (d as DiagnosticMessageChain) : d.messageText); + Debug.assert(diags.length > 0, "No errors reported for 3 or fewer overload signatures"); + const chain = chainDiagnosticMessages( + map(diags, d => typeof d.messageText === "string" ? (d as DiagnosticMessageChain) : d.messageText), + Diagnostics.No_overload_matches_this_call); const related = flatMap(diags, d => (d as Diagnostic).relatedInformation) as DiagnosticRelatedInformation[]; - diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(chain, Diagnostics.No_overload_matches_this_call), related)); + if (every(diags, d => d.start === diags[0].start && d.length === diags[0].length && d.file === diags[0].file)) { + const { file, start, length } = diags[0]; + diagnostics.add({ file, start, length, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related }); + } + else { + diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chain, related)); + } } } else if (candidateForArgumentArityError) { diff --git a/tests/baselines/reference/bigintWithLib.errors.txt b/tests/baselines/reference/bigintWithLib.errors.txt index 9b1b99401c2..b4c9f65cf9c 100644 --- a/tests/baselines/reference/bigintWithLib.errors.txt +++ b/tests/baselines/reference/bigintWithLib.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/bigintWithLib.ts(4,1): error TS2350: Only a void function can be called with the 'new' keyword. -tests/cases/compiler/bigintWithLib.ts(16,15): error TS2769: No overload matches this call. +tests/cases/compiler/bigintWithLib.ts(16,33): error TS2769: No overload matches this call. Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. Argument of type 'number[]' is not assignable to parameter of type 'number'. Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. @@ -17,7 +17,7 @@ tests/cases/compiler/bigintWithLib.ts(16,15): error TS2769: No overload matches Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] tests/cases/compiler/bigintWithLib.ts(21,13): error TS2540: Cannot assign to 'length' because it is a read-only property. -tests/cases/compiler/bigintWithLib.ts(28,16): error TS2769: No overload matches this call. +tests/cases/compiler/bigintWithLib.ts(28,35): error TS2769: No overload matches this call. Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. Argument of type 'number[]' is not assignable to parameter of type 'number'. Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. @@ -49,7 +49,7 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 bigIntArray = new BigInt64Array(10); bigIntArray = new BigInt64Array([1n, 2n, 3n]); bigIntArray = new BigInt64Array([1, 2, 3]); // should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. !!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'number'. @@ -81,7 +81,7 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 bigUintArray = new BigUint64Array(10); bigUintArray = new BigUint64Array([1n, 2n, 3n]); bigUintArray = new BigUint64Array([1, 2, 3]); // should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. !!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'number'. diff --git a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt index b8ad32a5408..aeaeb56ea75 100644 --- a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2769: No overload matches this call. +tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,18): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. Types of property 'children' are incompatible. @@ -29,7 +29,7 @@ tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2 const testErr = - ~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. !!! error TS2769: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. diff --git a/tests/baselines/reference/constructorOverloads1.errors.txt b/tests/baselines/reference/constructorOverloads1.errors.txt index f7775bf78ae..8bc0c1ecdbb 100644 --- a/tests/baselines/reference/constructorOverloads1.errors.txt +++ b/tests/baselines/reference/constructorOverloads1.errors.txt @@ -2,12 +2,12 @@ tests/cases/compiler/constructorOverloads1.ts(2,5): error TS2392: Multiple const tests/cases/compiler/constructorOverloads1.ts(3,5): error TS2392: Multiple constructor implementations are not allowed. tests/cases/compiler/constructorOverloads1.ts(4,5): error TS2392: Multiple constructor implementations are not allowed. tests/cases/compiler/constructorOverloads1.ts(7,5): error TS2392: Multiple constructor implementations are not allowed. -tests/cases/compiler/constructorOverloads1.ts(16,10): error TS2769: No overload matches this call. +tests/cases/compiler/constructorOverloads1.ts(16,18): error TS2769: No overload matches this call. Overload 1 of 2, '(s: string): Foo', gave the following error. Argument of type 'Foo' is not assignable to parameter of type 'string'. Overload 2 of 2, '(n: number): Foo', gave the following error. Argument of type 'Foo' is not assignable to parameter of type 'number'. -tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2769: No overload matches this call. +tests/cases/compiler/constructorOverloads1.ts(17,18): error TS2769: No overload matches this call. Overload 1 of 2, '(s: string): Foo', gave the following error. Argument of type 'any[]' is not assignable to parameter of type 'string'. Overload 2 of 2, '(n: number): Foo', gave the following error. @@ -43,14 +43,14 @@ tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2769: No overload var f1 = new Foo("hey"); var f2 = new Foo(0); var f3 = new Foo(f1); - ~~~~~~~~~~~ + ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(s: string): Foo', gave the following error. !!! error TS2769: Argument of type 'Foo' is not assignable to parameter of type 'string'. !!! error TS2769: Overload 2 of 2, '(n: number): Foo', gave the following error. !!! error TS2769: Argument of type 'Foo' is not assignable to parameter of type 'number'. var f4 = new Foo([f1,f2,f3]); - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(s: string): Foo', gave the following error. !!! error TS2769: Argument of type 'any[]' is not assignable to parameter of type 'string'. diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt index 96e40ea87cb..ff2ec7e5106 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt @@ -1,25 +1,25 @@ -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,12): error TS2769: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,13): error TS2769: No overload matches this call. Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,12): error TS2769: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,13): error TS2769: No overload matches this call. Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,12): error TS2769: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,13): error TS2769: No overload matches this call. Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,12): error TS2769: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,13): error TS2769: No overload matches this call. Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. @@ -60,7 +60,7 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): err } const b0 = {console.log(k)}}} extra />; // k has type "left" | "right" - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. !!! error TS2769: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. @@ -69,7 +69,7 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): err !!! error TS2769: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. !!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. const b2 = {console.log(k)}} extra />; // k has type "left" | "right" - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. !!! error TS2769: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. @@ -78,7 +78,7 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): err !!! error TS2769: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. !!! error TS2769: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. const b3 = ; // goTo has type"home" | "contact" - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. !!! error TS2769: Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. @@ -87,7 +87,7 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): err !!! error TS2769: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. !!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. const b4 = ; // goTo has type "home" | "contact" - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. !!! error TS2769: Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. diff --git a/tests/baselines/reference/controlFlowIterationErrors.errors.txt b/tests/baselines/reference/controlFlowIterationErrors.errors.txt index 3d9ac869649..ed71b3fe660 100644 --- a/tests/baselines/reference/controlFlowIterationErrors.errors.txt +++ b/tests/baselines/reference/controlFlowIterationErrors.errors.txt @@ -2,14 +2,14 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(11,17): error Type 'number' is not assignable to type 'string'. tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(22,17): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(34,13): error TS2769: No overload matches this call. +tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(34,17): error TS2769: No overload matches this call. Overload 1 of 2, '(x: string): number', gave the following error. Argument of type 'string | number' is not assignable to parameter of type 'string'. Type 'number' is not assignable to type 'string'. Overload 2 of 2, '(x: number): string', gave the following error. Argument of type 'string | number' is not assignable to parameter of type 'number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error TS2769: No overload matches this call. +tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,17): error TS2769: No overload matches this call. Overload 1 of 2, '(x: string): number', gave the following error. Argument of type 'string | number' is not assignable to parameter of type 'string'. Type 'number' is not assignable to type 'string'. @@ -59,7 +59,7 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error x = ""; while (cond) { x = foo(x); - ~~~~~~ + ~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(x: string): number', gave the following error. !!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'string'. @@ -78,7 +78,7 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error while (cond) { x; x = foo(x); - ~~~~~~ + ~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(x: string): number', gave the following error. !!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'string'. diff --git a/tests/baselines/reference/destructuringTuple.errors.txt b/tests/baselines/reference/destructuringTuple.errors.txt index 32b94ff4184..0f3c3c36182 100644 --- a/tests/baselines/reference/destructuringTuple.errors.txt +++ b/tests/baselines/reference/destructuringTuple.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/destructuringTuple.ts(11,8): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. -tests/cases/compiler/destructuringTuple.ts(11,48): error TS2769: No overload matches this call. +tests/cases/compiler/destructuringTuple.ts(11,60): error TS2769: No overload matches this call. Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. @@ -20,7 +20,7 @@ tests/cases/compiler/destructuringTuple.ts(11,48): error TS2769: No overload mat const [oops1] = [1, 2, 3].reduce((accu, el) => accu.concat(el), []); ~~~~~ !!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. - ~~~~~~~~~~~~~~~ + ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. !!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. diff --git a/tests/baselines/reference/functionOverloads2.errors.txt b/tests/baselines/reference/functionOverloads2.errors.txt index 521b8335647..93afc96bfd1 100644 --- a/tests/baselines/reference/functionOverloads2.errors.txt +++ b/tests/baselines/reference/functionOverloads2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads2.ts(4,9): error TS2769: No overload matches this call. +tests/cases/compiler/functionOverloads2.ts(4,13): error TS2769: No overload matches this call. Overload 1 of 2, '(bar: string): string', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. Overload 2 of 2, '(bar: number): number', gave the following error. @@ -10,7 +10,7 @@ tests/cases/compiler/functionOverloads2.ts(4,9): error TS2769: No overload match function foo(bar: number): number; function foo(bar: any): any { return bar }; var x = foo(true); - ~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(bar: string): string', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'string'. diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index 102b5845eba..42064ea8b09 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads40.ts(4,9): error TS2769: No overload matches this call. +tests/cases/compiler/functionOverloads40.ts(4,15): error TS2769: No overload matches this call. Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. Type 'string' is not assignable to type 'number'. Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. @@ -10,7 +10,7 @@ tests/cases/compiler/functionOverloads40.ts(4,9): error TS2769: No overload matc function foo(bar:{a:boolean;}[]):number; function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{a:'bar'}]); - ~~~~~~~~~~~~~~~~ + ~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. !!! error TS2769: Type 'string' is not assignable to type 'number'. diff --git a/tests/baselines/reference/functionOverloads41.errors.txt b/tests/baselines/reference/functionOverloads41.errors.txt index 59521a65681..560363153ce 100644 --- a/tests/baselines/reference/functionOverloads41.errors.txt +++ b/tests/baselines/reference/functionOverloads41.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads41.ts(4,9): error TS2769: No overload matches this call. +tests/cases/compiler/functionOverloads41.ts(4,14): error TS2769: No overload matches this call. Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. Property 'a' is missing in type '{}' but required in type '{ a: number; }'. Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. @@ -10,7 +10,7 @@ tests/cases/compiler/functionOverloads41.ts(4,9): error TS2769: No overload matc function foo(bar:{a:boolean;}[]):number; function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{}]); - ~~~~~~~~~ + ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. !!! error TS2769: Property 'a' is missing in type '{}' but required in type '{ a: number; }'. diff --git a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt index 7f9315e3b13..15d4c9bf167 100644 --- a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt +++ b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(23,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(52,22): error TS2769: No overload matches this call. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(52,38): error TS2769: No overload matches this call. Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. @@ -9,7 +9,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(68,22): error TS2769: No overload matches this call. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(68,38): error TS2769: No overload matches this call. Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. @@ -20,7 +20,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(84,22): error TS2769: No overload matches this call. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No overload matches this call. Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. @@ -87,7 +87,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. !!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. @@ -112,7 +112,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. !!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. @@ -140,7 +140,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. !!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt index baee91c067f..b643832907a 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2769: No overload matches this call. +tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,26): error TS2769: No overload matches this call. Overload 1 of 2, '(arg1: number[]): any', gave the following error. Type 'string' is not assignable to type 'number'. @@ -13,7 +13,7 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2769: No ov this.test(["hi"]); this.test([]); this.test([1, 2, "hi", 5]); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(arg1: number[]): any', gave the following error. !!! error TS2769: Type 'string' is not assignable to type 'number'. diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index ea4b10d6686..0b5e587ad53 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -9,7 +9,7 @@ tests/cases/compiler/incompatibleTypes.ts(26,12): error TS2416: Property 'p1' in Type 'number' is not assignable to type 'string'. tests/cases/compiler/incompatibleTypes.ts(34,12): error TS2416: Property 'p1' in type 'C4' is not assignable to the same property in base type 'IFoo4'. Type '{ c: { b: string; }; d: string; }' is missing the following properties from type '{ a: { a: string; }; b: string; }': a, b -tests/cases/compiler/incompatibleTypes.ts(42,1): error TS2769: No overload matches this call. +tests/cases/compiler/incompatibleTypes.ts(42,5): error TS2769: No overload matches this call. Overload 1 of 2, '(i: IFoo1): void', gave the following error. Argument of type 'C1' is not assignable to parameter of type 'IFoo1'. Types of property 'p1' are incompatible. @@ -20,7 +20,7 @@ tests/cases/compiler/incompatibleTypes.ts(42,1): error TS2769: No overload match Types of property 'p1' are incompatible. Type '() => string' is not assignable to type '(s: string) => number'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/incompatibleTypes.ts(49,1): error TS2769: No overload matches this call. +tests/cases/compiler/incompatibleTypes.ts(49,7): error TS2769: No overload matches this call. Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'. Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. @@ -91,7 +91,7 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => var c1: C1; var c2: C2; if1(c1); - ~~~~~~~ + ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(i: IFoo1): void', gave the following error. !!! error TS2769: Argument of type 'C1' is not assignable to parameter of type 'IFoo1'. @@ -110,7 +110,7 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => function of1(a: any) { return null; } of1({ e: 0, f: 0 }); - ~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. !!! error TS2769: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'. diff --git a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt index fdc017db306..0b114bc6477 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2769: No overload matches this call. +tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,14): error TS2769: No overload matches this call. Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. Types of property 'slice' are incompatible. @@ -26,7 +26,7 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2769 var array: number[] = [0, 1]; array.concat([...new SymbolIterator]); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. !!! error TS2769: Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index 10b81d58700..676d7ba8789 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,1): error TS2769: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,5): error TS2769: No overload matches this call. Overload 1 of 2, '(s: string): string', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. Overload 2 of 2, '(s: number): number', gave the following error. @@ -8,12 +8,12 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): e tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,1): error TS2769: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,5): error TS2769: No overload matches this call. Overload 1 of 2, '(n: string, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. Overload 2 of 2, '(n: number, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,1): error TS2769: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,11): error TS2769: No overload matches this call. Overload 1 of 2, '(n: any, m: number): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 2, '(n: any, m: string): any', gave the following error. @@ -50,7 +50,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // No candidate overloads found fn1({}); // Error - ~~~~~~~ + ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(s: string): string', gave the following error. !!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'. @@ -123,14 +123,14 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4(true, null); // Error - ~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(n: string, m: any): any', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'string'. !!! error TS2769: Overload 2 of 2, '(n: number, m: any): any', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'number'. fn4(null, true); // Error - ~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(n: any, m: number): any', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'number'. diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index f3028cf08b5..7f40cb4846d 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,1): error TS2769: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,9): error TS2769: No overload matches this call. Overload 1 of 2, '(s: string): fn1', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. Overload 2 of 2, '(s: number): fn1', gave the following error. @@ -46,7 +46,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru // No candidate overloads found new fn1({}); // Error - ~~~~~~~~~~~ + ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(s: string): fn1', gave the following error. !!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'. diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index b62a78a88b2..11c52075341 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,1): error TS2769: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,9): error TS2769: No overload matches this call. Overload 1 of 2, '(s: string): string', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. Overload 2 of 2, '(s: number): number', gave the following error. @@ -8,12 +8,12 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,1): error TS2769: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,9): error TS2769: No overload matches this call. Overload 1 of 2, '(n: string, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. Overload 2 of 2, '(n: number, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,1): error TS2769: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,15): error TS2769: No overload matches this call. Overload 1 of 2, '(n: any, m: number): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 2, '(n: any, m: string): any', gave the following error. @@ -50,7 +50,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // No candidate overloads found new fn1({}); // Error - ~~~~~~~~~~~ + ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(s: string): string', gave the following error. !!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'. @@ -130,14 +130,14 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints new fn4(true, null); // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(n: string, m: any): any', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'string'. !!! error TS2769: Overload 2 of 2, '(n: number, m: any): any', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'number'. new fn4(null, true); // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(n: any, m: number): any', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'number'. diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index 9e4023423df..cff94bda5ea 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -1,14 +1,14 @@ -tests/cases/compiler/overloadResolutionTest1.ts(7,12): error TS2769: No overload matches this call. +tests/cases/compiler/overloadResolutionTest1.ts(7,18): error TS2769: No overload matches this call. Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. Type 'string' is not assignable to type 'number'. Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. Type 'string' is not assignable to type 'boolean'. -tests/cases/compiler/overloadResolutionTest1.ts(18,10): error TS2769: No overload matches this call. +tests/cases/compiler/overloadResolutionTest1.ts(18,16): error TS2769: No overload matches this call. Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. Type 'string' is not assignable to type 'number'. Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. Type 'string' is not assignable to type 'boolean'. -tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2769: No overload matches this call. +tests/cases/compiler/overloadResolutionTest1.ts(24,15): error TS2769: No overload matches this call. Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. Type 'true' is not assignable to type 'number'. Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. @@ -23,7 +23,7 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2769: No overload var x1 = foo([{a:true}]); // works var x11 = foo([{a:0}]); // works var x111 = foo([{a:"s"}]); // error - does not match any signature - ~~~~~~~~~~~~~~ + ~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. !!! error TS2769: Type 'string' is not assignable to type 'number'. @@ -42,7 +42,7 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2769: No overload var x2 = foo2({a:0}); // works var x3 = foo2({a:true}); // works var x4 = foo2({a:"s"}); // error - ~~~~~~~~~~~~~ + ~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. !!! error TS2769: Type 'string' is not assignable to type 'number'. @@ -56,7 +56,7 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2769: No overload function foo4(bar:{a:string;}):string; function foo4(bar:{a:any;}):any{ return bar }; var x = foo4({a:true}); // error - ~~~~~~~~~~~~~~ + ~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. !!! error TS2769: Type 'true' is not assignable to type 'number'. diff --git a/tests/baselines/reference/overloadingOnConstants2.errors.txt b/tests/baselines/reference/overloadingOnConstants2.errors.txt index ff5c8883c52..0742774b62d 100644 --- a/tests/baselines/reference/overloadingOnConstants2.errors.txt +++ b/tests/baselines/reference/overloadingOnConstants2.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/overloadingOnConstants2.ts(9,10): error TS2394: This overload signature is not compatible with its implementation signature. -tests/cases/compiler/overloadingOnConstants2.ts(15,9): error TS2769: No overload matches this call. +tests/cases/compiler/overloadingOnConstants2.ts(15,13): error TS2769: No overload matches this call. Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. Argument of type '"um"' is not assignable to parameter of type '"hi"'. Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. @@ -26,7 +26,7 @@ tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overl var a: D = foo("hi", []); // D var b: E = foo("bye", []); // E var c = foo("um", []); // error - ~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. !!! error TS2769: Argument of type '"um"' is not assignable to parameter of type '"hi"'. diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt index 70f40199d4a..987ac30daca 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -3,7 +3,7 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,37): Property 'x' is missing in type 'D' but required in type 'A'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,38): error TS2344: Type 'D' does not satisfy the constraint 'A'. -tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,23): error TS2769: No overload matches this call. +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,27): error TS2769: No overload matches this call. Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. Type 'G' is not assignable to type 'number'. @@ -47,15 +47,7 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): !!! error TS2344: Type 'D' does not satisfy the constraint 'A'. var result3: string = foo(x => { // x has type D - ~~~~~~~~~~~~~~~~~~~~~~~~~~ - var y: G; // error that D does not satisfy constraint, y is of type G, entire call to foo is an error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ~~~~~~~~ -!!! error TS2344: Type 'D' does not satisfy the constraint 'A'. - return y; - ~~~~~~~~~~~~~ - }); - ~~ + ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. !!! error TS2769: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. @@ -70,4 +62,9 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): !!! error TS2769: Property 'q' is missing in type 'B' but required in type 'D'. !!! related TS2728 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. !!! related TS2728 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. + var y: G; // error that D does not satisfy constraint, y is of type G, entire call to foo is an error + ~~~~~~~~ +!!! error TS2344: Type 'D' does not satisfy the constraint 'A'. + return y; + }); \ No newline at end of file diff --git a/tests/baselines/reference/promiseTypeInference.errors.txt b/tests/baselines/reference/promiseTypeInference.errors.txt index d75e5045678..04ba3a0d878 100644 --- a/tests/baselines/reference/promiseTypeInference.errors.txt +++ b/tests/baselines/reference/promiseTypeInference.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2769: No overload matches this call. +tests/cases/compiler/promiseTypeInference.ts(10,39): error TS2769: No overload matches this call. Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. @@ -22,7 +22,7 @@ tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2769: No overload m declare function convert(s: string): IPromise; var $$x = load("something").then(s => convert(s)); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. !!! error TS2769: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. diff --git a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt index ede187259de..d9b222b32ab 100644 --- a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt +++ b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2769: No overload matches this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,36): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. @@ -6,7 +6,7 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2769: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2769: No overload matches this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,41): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. @@ -14,7 +14,7 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2769: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2769: No overload matches this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. Type 'void' is not assignable to type 'boolean'. @@ -50,7 +50,7 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2769: // Error: Void not assignable to boolean const Test2 = () => console.log(value)} />; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. !!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. @@ -77,7 +77,7 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2769: // Error: Void not assignable to boolean const Test2a = () => console.log(value)} error>Hah; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. !!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. @@ -109,7 +109,7 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2769: // Error: Void not assignable to boolean const Test4 = () => console.log(value)} />; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. !!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index 1d765d4196c..b2d21243089 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -11,7 +11,7 @@ tests/cases/compiler/recursiveFunctionTypes.ts(30,10): error TS2394: This overlo tests/cases/compiler/recursiveFunctionTypes.ts(33,8): error TS2554: Expected 0-1 arguments, but got 2. tests/cases/compiler/recursiveFunctionTypes.ts(34,4): error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. tests/cases/compiler/recursiveFunctionTypes.ts(42,8): error TS2554: Expected 0-1 arguments, but got 2. -tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2769: No overload matches this call. +tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2769: No overload matches this call. Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. Overload 2 of 4, '(a: number): number', gave the following error. @@ -90,7 +90,7 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2769: No overload ~ !!! error TS2554: Expected 0-1 arguments, but got 2. f7(""); // ok (function takes an any param) - ~~~~~~ + ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. !!! error TS2769: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt index 3e5720039ab..433d4f9832a 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -1,23 +1,23 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(9,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(11,9): error TS2769: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(11,13): error TS2769: No overload matches this call. Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,9): error TS2769: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,13): error TS2769: No overload matches this call. Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,9): error TS2769: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,13): error TS2769: No overload matches this call. Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,9): error TS2769: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,20): error TS2769: No overload matches this call. Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. @@ -43,21 +43,21 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio ~~ !!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var c = foo([], 1, 2); // boolean - ~~~~~~~~~~~~~ + ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. !!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. !!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. !!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var d = foo([], 1, true); // boolean (with error) - ~~~~~~~~~~~~~~~~ + ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. !!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. !!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. !!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var e = foo([], 1, "2"); // {} - ~~~~~~~~~~~~~~~ + ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. !!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. @@ -71,7 +71,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var v = foo `${1}`; // string var w = foo `${1}${2}`; // boolean var x = foo `${1}${true}`; // boolean (with error) - ~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'number'. diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt index 5cd4e635744..ac2daf30654 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt @@ -1,23 +1,23 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(9,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,9): error TS2769: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,13): error TS2769: No overload matches this call. Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,9): error TS2769: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,13): error TS2769: No overload matches this call. Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,9): error TS2769: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,13): error TS2769: No overload matches this call. Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,9): error TS2769: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,20): error TS2769: No overload matches this call. Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. @@ -43,21 +43,21 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio ~~ !!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var c = foo([], 1, 2); // boolean - ~~~~~~~~~~~~~ + ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. !!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. !!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. !!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var d = foo([], 1, true); // boolean (with error) - ~~~~~~~~~~~~~~~~ + ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. !!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. !!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. !!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var e = foo([], 1, "2"); // {} - ~~~~~~~~~~~~~~~ + ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. !!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. @@ -71,7 +71,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var v = foo `${1}`; // string var w = foo `${1}${2}`; // boolean var x = foo `${1}${true}`; // boolean (with error) - ~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'number'. diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt index 38631e58b17..8b08710d51d 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(9,1): error TS2769: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(9,9): error TS2769: No overload matches this call. Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(62,1): error TS2769: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(62,9): error TS2769: No overload matches this call. Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,1): error TS2769: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,18): error TS2769: No overload matches this call. Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. @@ -28,7 +28,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // No candidate overloads found fn1 `${ {} }`; // Error - ~~~~~~~~~~~~~ + ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. !!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'. @@ -92,14 +92,14 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4 `${ true }${ null }`; - ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'string'. !!! error TS2769: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; - ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'number'. diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt index 47639b2d6ac..95eb021c88b 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,1): error TS2769: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,9): error TS2769: No overload matches this call. Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,1): error TS2769: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,9): error TS2769: No overload matches this call. Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,1): error TS2769: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,18): error TS2769: No overload matches this call. Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. @@ -28,7 +28,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // No candidate overloads found fn1 `${ {} }`; // Error - ~~~~~~~~~~~~~ + ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. !!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'. @@ -92,14 +92,14 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4 `${ true }${ null }`; - ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'string'. !!! error TS2769: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; - ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'number'. diff --git a/tests/baselines/reference/tsxElementResolution9.errors.txt b/tests/baselines/reference/tsxElementResolution9.errors.txt index 971d4e3796d..b332e60e4e6 100644 --- a/tests/baselines/reference/tsxElementResolution9.errors.txt +++ b/tests/baselines/reference/tsxElementResolution9.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/jsx/file.tsx(11,1): error TS2769: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(11,2): error TS2769: No overload matches this call. Overload 1 of 2, '(n: string): { x: number; }', gave the following error. Type '{}' is not assignable to type 'string'. Overload 2 of 2, '(n: number): { y: string; }', gave the following error. Type '{}' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(18,1): error TS2769: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(18,2): error TS2769: No overload matches this call. Overload 1 of 2, '(n: string): { x: number; }', gave the following error. Type '{}' is not assignable to type 'string'. Overload 2 of 2, '(n: number): { y: string; }', gave the following error. Type '{}' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(25,1): error TS2769: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(25,2): error TS2769: No overload matches this call. Overload 1 of 2, '(n: string): { x: number; }', gave the following error. Type '{ x: number; }' is not assignable to type 'string'. Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. @@ -27,7 +27,7 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2769: No overload matches th } var Obj1: Obj1; ; // Error, return type is not an object type - ~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. !!! error TS2769: Type '{}' is not assignable to type 'string'. @@ -40,7 +40,7 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2769: No overload matches th } var Obj2: Obj2; ; // Error, return type is not an object type - ~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. !!! error TS2769: Type '{}' is not assignable to type 'string'. @@ -53,7 +53,7 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2769: No overload matches th } var Obj3: Obj3; ; // OK - ~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. !!! error TS2769: Type '{ x: number; }' is not assignable to type 'string'. diff --git a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt index 056bd0b0dd7..878f0466beb 100644 --- a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt +++ b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(14,14): error TS2322: Type '{}' is not assignable to type 'P'. '{}' is assignable to the constraint of type 'P', but 'P' could be instantiated with a different subtype of constraint '{}'. -tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2769: No overload matches this call. +tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,14): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. Type '{}' is not assignable to type 'Readonly

'. Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. @@ -26,7 +26,7 @@ tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2769: No o !!! error TS2322: Type '{}' is not assignable to type 'P'. !!! error TS2322: '{}' is assignable to the constraint of type 'P', but 'P' could be instantiated with a different subtype of constraint '{}'. let y = ; // should error - ~~~~~~~~~~~~~~~ + ~~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. !!! error TS2769: Type '{}' is not assignable to type 'Readonly

'. diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt index a7983385910..5318c77efae 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/jsx/file.tsx(12,12): error TS2769: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(12,13): error TS2769: No overload matches this call. Overload 1 of 2, '(): Element', gave the following error. Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. Property 'extraProp' does not exist on type 'IntrinsicAttributes'. Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -tests/cases/conformance/jsx/file.tsx(13,12): error TS2769: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(13,13): error TS2769: No overload matches this call. Overload 1 of 2, '(): Element', gave the following error. Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. Property 'yy' does not exist on type 'IntrinsicAttributes'. @@ -17,14 +17,14 @@ tests/cases/conformance/jsx/file.tsx(14,12): error TS2769: No overload matches t Property 'yy1' does not exist on type 'IntrinsicAttributes'. Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type 'true' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(16,12): error TS2769: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(16,13): error TS2769: No overload matches this call. Overload 1 of 2, '(): Element', gave the following error. Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. Property 'y1' does not exist on type 'IntrinsicAttributes'. Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -tests/cases/conformance/jsx/file.tsx(17,12): error TS2769: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(17,13): error TS2769: No overload matches this call. Overload 1 of 2, '(): Element', gave the following error. Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. @@ -89,7 +89,7 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2769: No overload matches t // Error const c0 = ; // extra property; - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(): Element', gave the following error. !!! error TS2769: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. @@ -98,7 +98,7 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2769: No overload matches t !!! error TS2769: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. !!! error TS2769: Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c1 = ; // missing property; - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(): Element', gave the following error. !!! error TS2769: Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. @@ -117,7 +117,7 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2769: No overload matches t !!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:43: The expected type comes from property 'yy1' which is declared here on type 'IntrinsicAttributes & { yy: number; yy1: string; }' const c3 = ; // This is OK becuase all attribute are spread const c4 = ; // extra property; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(): Element', gave the following error. !!! error TS2769: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. @@ -126,7 +126,7 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2769: No overload matches t !!! error TS2769: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. !!! error TS2769: Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c5 = ; // type incompatible; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(): Element', gave the following error. !!! error TS2769: Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt index 2b5a6cce926..faf129dda4b 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(48,12): error TS2769: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(48,13): error TS2769: No overload matches this call. Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. @@ -8,14 +8,14 @@ tests/cases/conformance/jsx/file.tsx(48,12): error TS2769: No overload matches t Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. -tests/cases/conformance/jsx/file.tsx(54,12): error TS2769: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(54,51): error TS2769: No overload matches this call. Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Type 'number' is not assignable to type 'string'. Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. Type 'number' is not assignable to type 'string'. Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(55,12): error TS2769: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(55,68): error TS2769: No overload matches this call. Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Type 'true' is not assignable to type 'string'. Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. @@ -80,7 +80,7 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2769: No overload matches t // Error const b0 = {}}>GO; // extra property; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. !!! error TS2769: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. @@ -97,7 +97,7 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2769: No overload matches t const b4 = ; // Should error because Incorrect type; but attributes are any so everything is allowed const b5 = ; // Spread retain method declaration (see GitHub #13365), so now there is an extra attributes const b6 = ; // incorrect type for optional attribute - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. !!! error TS2769: Type 'number' is not assignable to type 'string'. @@ -109,7 +109,7 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2769: No overload matches t !!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & LinkProps' !!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & HyphenProps' const b7 = ; // incorrect type for optional attribute - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. !!! error TS2769: Type 'true' is not assignable to type 'string'. diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt index edb9ceb1ac6..75da33f6e65 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt @@ -6,7 +6,7 @@ tests/cases/conformance/jsx/file.tsx(9,14): error TS2769: No overload matches th Type 'number' is not assignable to type 'string'. Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. -tests/cases/conformance/jsx/file.tsx(10,14): error TS2769: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(10,15): error TS2769: No overload matches this call. Overload 1 of 3, '(): Element', gave the following error. Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. @@ -39,7 +39,7 @@ tests/cases/conformance/jsx/file.tsx(10,14): error TS2769: No overload matches t !!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:52: The expected type comes from property 'a' which is declared here on type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }' !!! related TS2728 tests/cases/conformance/jsx/file.tsx:5:49: 'b' is declared here. let a2 = // missing a - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 3, '(): Element', gave the following error. !!! error TS2769: Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. diff --git a/tests/baselines/reference/unionTypeCallSignatures.errors.txt b/tests/baselines/reference/unionTypeCallSignatures.errors.txt index a94ec12dc63..f9be92375c5 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeCallSignatures.errors.txt @@ -1,10 +1,10 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(9,43): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(10,1): error TS2769: No overload matches this call. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(10,29): error TS2769: No overload matches this call. Overload 1 of 2, '(a: number): number | Date', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 2, '(a: string): string | boolean', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,1): error TS2769: No overload matches this call. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,29): error TS2769: No overload matches this call. Overload 1 of 2, '(a: number): number | Date', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 2, '(a: string): string | boolean', gave the following error. @@ -48,7 +48,7 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 ~~~~~~~ !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. unionOfDifferentReturnType1(true); // error in type of parameter - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(a: number): number | Date', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'number'. @@ -59,7 +59,7 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 numOrDate = unionOfDifferentReturnType1(10); strOrBoolean = unionOfDifferentReturnType1("hello"); unionOfDifferentReturnType1(true); // error in type of parameter - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(a: number): number | Date', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'number'. diff --git a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt index a9f5937144b..49e280f0312 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt @@ -1,10 +1,10 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(9,47): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(10,1): error TS2769: No overload matches this call. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(10,33): error TS2769: No overload matches this call. Overload 1 of 2, '(a: number): number | Date', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 2, '(a: string): string | boolean', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,1): error TS2769: No overload matches this call. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,33): error TS2769: No overload matches this call. Overload 1 of 2, '(a: number): number | Date', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 2, '(a: string): string | boolean', gave the following error. @@ -47,7 +47,7 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro ~~~~~~~ !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. new unionOfDifferentReturnType1(true); // error in type of parameter - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(a: number): number | Date', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'number'. @@ -58,7 +58,7 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro numOrDate = new unionOfDifferentReturnType1(10); strOrBoolean = new unionOfDifferentReturnType1("hello"); new unionOfDifferentReturnType1(true); // error in type of parameter - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(a: number): number | Date', gave the following error. !!! error TS2769: Argument of type 'true' is not assignable to parameter of type 'number'. From f273448925f5dd40136df414ecdc7fad56614d96 Mon Sep 17 00:00:00 2001 From: Florian Regensburger Date: Wed, 10 Jul 2019 02:11:02 +0200 Subject: [PATCH 88/95] Added addMissingConst codefix for comma separated initializers --- src/services/codefixes/addMissingConst.ts | 38 ++++++++++++++++++- ...issingConstToCommaSeparatedInitializer1.ts | 9 +++++ ...issingConstToCommaSeparatedInitializer2.ts | 11 ++++++ ...issingConstToCommaSeparatedInitializer3.ts | 15 ++++++++ ...ssingConstToCommaSeparatedInitializer4.ts} | 1 + 5 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/codeFixAddMissingConstToCommaSeparatedInitializer1.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingConstToCommaSeparatedInitializer2.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingConstToCommaSeparatedInitializer3.ts rename tests/cases/fourslash/{codeFixAddMissingConstToStandaloneIdentifier2.ts => codeFixAddMissingConstToCommaSeparatedInitializer4.ts} (80%) diff --git a/src/services/codefixes/addMissingConst.ts b/src/services/codefixes/addMissingConst.ts index fa353cc5b83..10dba5d9444 100644 --- a/src/services/codefixes/addMissingConst.ts +++ b/src/services/codefixes/addMissingConst.ts @@ -42,6 +42,19 @@ namespace ts.codefix { return applyChange(changeTracker, parent, sourceFile, fixedNodes); } + + const commaExpression = findAncestor(token, node => + isExpressionStatement(node.parent) ? true : + isPossiblyPartOfCommaSeperatedInitializer(node) ? false : "quit" + ); + if (commaExpression) { + const checker = program.getTypeChecker(); + if (!expressionCouldBeVariableDeclaration(commaExpression, checker)) { + return; + } + + return applyChange(changeTracker, commaExpression, sourceFile, fixedNodes); + } } function applyChange(changeTracker: textChanges.ChangeTracker, initializer: Node, sourceFile: SourceFile, fixedNodes?: NodeSet) { @@ -63,11 +76,34 @@ namespace ts.codefix { } } - function arrayElementCouldBeVariableDeclaration(expression: Expression, checker: TypeChecker) { + function arrayElementCouldBeVariableDeclaration(expression: Expression, checker: TypeChecker): boolean { const identifier = isIdentifier(expression) ? expression : isAssignmentExpression(expression, /*excludeCompoundAssignment*/ true) && isIdentifier(expression.left) ? expression.left : undefined; return !!identifier && !checker.getSymbolAtLocation(identifier); } + + function isPossiblyPartOfCommaSeperatedInitializer(node: Node): boolean { + switch (node.kind) { + case SyntaxKind.Identifier: + case SyntaxKind.BinaryExpression: + case SyntaxKind.CommaToken: + return true; + default: + return false; + } + } + + function expressionCouldBeVariableDeclaration(expression: Node, checker: TypeChecker): boolean { + if (!isBinaryExpression(expression)) { + return false; + } + + if (expression.operatorToken.kind === SyntaxKind.CommaToken) { + return every([expression.left, expression.right], expression => expressionCouldBeVariableDeclaration(expression, checker)); + } + + return isIdentifier(expression.left) && !checker.getSymbolAtLocation(expression.left); + } } diff --git a/tests/cases/fourslash/codeFixAddMissingConstToCommaSeparatedInitializer1.ts b/tests/cases/fourslash/codeFixAddMissingConstToCommaSeparatedInitializer1.ts new file mode 100644 index 00000000000..c5bb309698d --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstToCommaSeparatedInitializer1.ts @@ -0,0 +1,9 @@ +/// + +////x = 0, y = 0; + +verify.codeFixAll({ + fixId: "addMissingConst", + fixAllDescription: "Add 'const' to all unresolved variables", + newFileContent: "const x = 0, y = 0;" +}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstToCommaSeparatedInitializer2.ts b/tests/cases/fourslash/codeFixAddMissingConstToCommaSeparatedInitializer2.ts new file mode 100644 index 00000000000..1a60b16489d --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstToCommaSeparatedInitializer2.ts @@ -0,0 +1,11 @@ +/// + +////x = 0, +////y = 0; + +verify.codeFixAll({ + fixId: "addMissingConst", + fixAllDescription: "Add 'const' to all unresolved variables", + newFileContent: `const x = 0, +y = 0;` +}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstToCommaSeparatedInitializer3.ts b/tests/cases/fourslash/codeFixAddMissingConstToCommaSeparatedInitializer3.ts new file mode 100644 index 00000000000..d39388af335 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingConstToCommaSeparatedInitializer3.ts @@ -0,0 +1,15 @@ +/// + +////function f() { return 42; } +////x = 0, y = f() +//// +////, z = 0; + +verify.codeFixAll({ + fixId: "addMissingConst", + fixAllDescription: "Add 'const' to all unresolved variables", + newFileContent: `function f() { return 42; } +const x = 0, y = f() + +, z = 0;` +}); diff --git a/tests/cases/fourslash/codeFixAddMissingConstToStandaloneIdentifier2.ts b/tests/cases/fourslash/codeFixAddMissingConstToCommaSeparatedInitializer4.ts similarity index 80% rename from tests/cases/fourslash/codeFixAddMissingConstToStandaloneIdentifier2.ts rename to tests/cases/fourslash/codeFixAddMissingConstToCommaSeparatedInitializer4.ts index aa08f4e9196..263ed33231a 100644 --- a/tests/cases/fourslash/codeFixAddMissingConstToStandaloneIdentifier2.ts +++ b/tests/cases/fourslash/codeFixAddMissingConstToCommaSeparatedInitializer4.ts @@ -1,5 +1,6 @@ /// +////let y: any; ////x = 0, y = 0; verify.not.codeFixAvailable(); From 196db5bbcb6043c08526fc1821aa9e16f82c8a12 Mon Sep 17 00:00:00 2001 From: Florian Regensburger Date: Wed, 10 Jul 2019 02:35:40 +0200 Subject: [PATCH 89/95] Fixed lint error --- src/services/codefixes/addMissingConst.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/codefixes/addMissingConst.ts b/src/services/codefixes/addMissingConst.ts index 10dba5d9444..37739d01eee 100644 --- a/src/services/codefixes/addMissingConst.ts +++ b/src/services/codefixes/addMissingConst.ts @@ -99,7 +99,7 @@ namespace ts.codefix { if (!isBinaryExpression(expression)) { return false; } - + if (expression.operatorToken.kind === SyntaxKind.CommaToken) { return every([expression.left, expression.right], expression => expressionCouldBeVariableDeclaration(expression, checker)); } From 34ffefb922bb222cdafdc1db364536f6a77e4d45 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 10 Jul 2019 13:00:30 -0700 Subject: [PATCH 90/95] Update user baselines (#32324) --- .../baselines/reference/docker/azure-sdk.log | 106 +++++++++-- .../reference/docker/office-ui-fabric.log | 4 +- tests/baselines/reference/user/acorn.log | 20 ++- .../reference/user/adonis-framework.log | 28 +-- tests/baselines/reference/user/axios-src.log | 2 + .../user/chrome-devtools-frontend.log | 170 +++++++++++------- .../reference/user/enhanced-resolve.log | 27 ++- tests/baselines/reference/user/lodash.log | 42 +++-- tests/baselines/reference/user/mqtt.log | 8 + tests/baselines/reference/user/npm.log | 116 +++++++++--- tests/baselines/reference/user/npmlog.log | 9 +- tests/baselines/reference/user/prettier.log | 106 ++++++++--- tests/baselines/reference/user/util.log | 8 +- 13 files changed, 469 insertions(+), 177 deletions(-) create mode 100644 tests/baselines/reference/user/mqtt.log diff --git a/tests/baselines/reference/docker/azure-sdk.log b/tests/baselines/reference/docker/azure-sdk.log index 011937533de..5cda0e70df3 100644 --- a/tests/baselines/reference/docker/azure-sdk.log +++ b/tests/baselines/reference/docker/azure-sdk.log @@ -5,9 +5,16 @@ Rush Multi-Project Build Tool 5.7.3 - https://rushjs.io Starting "rush rebuild" Executing a maximum of 1 simultaneous processes... [@azure/cosmos] started -XX of XX: [@azure/cosmos] completed successfully in ? seconds +npm ERR! code ELIFECYCLE +npm ERR! errno 2 +npm ERR! @azure/cosmos@X.X.X compile: `echo Using TypeScript && tsc --version && tsc -p tsconfig.prod.json --pretty` +npm ERR! Exit status 2 +npm ERR! +npm ERR! Failed at the @azure/cosmos@X.X.X compile script. +npm ERR! This is probably not a problem with npm. There is likely additional logging output above. +npm ERR! A complete log of this run can be found in: +npm ERR! /root/.npm/_logs/2019-07-10T13_39_33_862Z-debug.log [@azure/service-bus] started -Warning: You have changed the public API signature for this project. Updating review/service-bus.api.md [@azure/storage-blob] started XX of XX: [@azure/storage-blob] completed successfully in ? seconds [@azure/storage-datalake] started @@ -22,8 +29,12 @@ XX of XX: [@azure/template] completed successfully in ? seconds XX of XX: [@azure/abort-controller] completed successfully in ? seconds [@azure/core-asynciterator-polyfill] started XX of XX: [@azure/core-asynciterator-polyfill] completed successfully in ? seconds +[@azure/core-auth] started +XX of XX: [@azure/core-auth] completed successfully in ? seconds [@azure/core-http] started XX of XX: [@azure/core-http] completed successfully in ? seconds +[@azure/core-arm] started +XX of XX: [@azure/core-arm] completed successfully in ? seconds [@azure/core-paging] started XX of XX: [@azure/core-paging] completed successfully in ? seconds [@azure/event-processor-host] started @@ -33,24 +44,37 @@ XX of XX: [testhub] completed successfully in ? seconds [@azure/identity] started XX of XX: [@azure/identity] completed successfully in ? seconds [@azure/keyvault-certificates] started -XX of XX: [@azure/keyvault-certificates] completed successfully in ? seconds [@azure/keyvault-keys] started -XX of XX: [@azure/keyvault-keys] completed successfully in ? seconds +npm ERR! code ELIFECYCLE +npm ERR! errno 2 +npm ERR! @azure/keyvault-keys@X.X.X-preview.2 extract-api: `tsc -p . && api-extractor run --local` +npm ERR! Exit status 2 +npm ERR! +npm ERR! Failed at the @azure/keyvault-keys@X.X.X-preview.2 extract-api script. +npm ERR! This is probably not a problem with npm. There is likely additional logging output above. +npm ERR! A complete log of this run can be found in: +npm ERR! /root/.npm/_logs/2019-07-10T13_41_42_464Z-debug.log [@azure/keyvault-secrets] started -XX of XX: [@azure/keyvault-secrets] completed successfully in ? seconds +npm ERR! code ELIFECYCLE +npm ERR! errno 2 +npm ERR! @azure/keyvault-secrets@X.X.X-preview.2 extract-api: `tsc -p . && api-extractor run --local` +npm ERR! Exit status 2 +npm ERR! +npm ERR! Failed at the @azure/keyvault-secrets@X.X.X-preview.2 extract-api script. +npm ERR! This is probably not a problem with npm. There is likely additional logging output above. +npm ERR! A complete log of this run can be found in: +npm ERR! /root/.npm/_logs/2019-07-10T13_41_46_371Z-debug.log [@azure/core-amqp] started -SUCCESS (16) +SUCCESS (14) ================================ @azure/abort-controller (? seconds) +@azure/core-arm (? seconds) @azure/core-asynciterator-polyfill (? seconds) +@azure/core-auth (? seconds) @azure/core-http (? seconds) @azure/core-paging (? seconds) -@azure/cosmos (? seconds) @azure/event-processor-host (? seconds) @azure/identity (? seconds) -@azure/keyvault-certificates (? seconds) -@azure/keyvault-keys (? seconds) -@azure/keyvault-secrets (? seconds) @azure/storage-blob (? seconds) @azure/storage-datalake (? seconds) @azure/storage-file (? seconds) @@ -58,16 +82,11 @@ SUCCESS (16) @azure/template (? seconds) testhub (? seconds) ================================ -SUCCESS WITH WARNINGS (1) -================================ -@azure/service-bus (? seconds) -Warning: You have changed the public API signature for this project. Updating review/service-bus.api.md -================================ BLOCKED (1) ================================ @azure/event-hubs ================================ -FAILURE (1) +FAILURE (6) ================================ @azure/core-amqp (? seconds) >>> @azure/core-amqp @@ -75,6 +94,50 @@ tsc -p . && rollup -c 2>&1 src/errors.ts(586,20): error TS7053: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type 'typeof ConditionErrorNameMapper'. src/errors.ts(607,34): error TS7053: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type 'typeof SystemErrorConditionMapper'. src/errors.ts(608,20): error TS7053: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type 'typeof ConditionErrorNameMapper'. +@azure/cosmos ( ? seconds) +npm ERR! code ELIFECYCLE +npm ERR! errno 2 +npm ERR! @azure/cosmos@X.X.X compile: `echo Using TypeScript && tsc --version && tsc -p tsconfig.prod.json --pretty` +npm ERR! Exit status 2 +npm ERR! +npm ERR! Failed at the @azure/cosmos@X.X.X compile script. +npm ERR! This is probably not a problem with npm. There is likely additional logging output above. +npm ERR! A complete log of this run can be found in: +npm ERR! /root/.npm/_logs/2019-07-10T13_39_33_862Z-debug.log +@azure/keyvault-certificates (? seconds) +>>> @azure/keyvault-certificates +tsc && rollup -c rollup.config.js 2>&1 +error TS2318: Cannot find global type 'AsyncGenerator'. +src/index.ts(154,60): error TS2739: Type '{}' is missing the following properties from type 'AsyncIterableIterator': [Symbol.asyncIterator], next +src/index.ts(180,128): error TS2322: Type '{}' is not assignable to type 'AsyncIterableIterator'. +src/index.ts(232,101): error TS2739: Type '{}' is missing the following properties from type 'AsyncIterableIterator': [Symbol.asyncIterator], next +src/index.ts(381,103): error TS2739: Type '{}' is missing the following properties from type 'AsyncIterableIterator': [Symbol.asyncIterator], next +@azure/keyvault-keys (? seconds) +npm ERR! code ELIFECYCLE +npm ERR! errno 2 +npm ERR! @azure/keyvault-keys@X.X.X-preview.2 extract-api: `tsc -p . && api-extractor run --local` +npm ERR! Exit status 2 +npm ERR! +npm ERR! Failed at the @azure/keyvault-keys@X.X.X-preview.2 extract-api script. +npm ERR! This is probably not a problem with npm. There is likely additional logging output above. +npm ERR! A complete log of this run can be found in: +npm ERR! /root/.npm/_logs/2019-07-10T13_41_42_464Z-debug.log +@azure/keyvault-secrets (? seconds) +npm ERR! code ELIFECYCLE +npm ERR! errno 2 +npm ERR! @azure/keyvault-secrets@X.X.X-preview.2 extract-api: `tsc -p . && api-extractor run --local` +npm ERR! Exit status 2 +npm ERR! +npm ERR! Failed at the @azure/keyvault-secrets@X.X.X-preview.2 extract-api script. +npm ERR! This is probably not a problem with npm. There is likely additional logging output above. +npm ERR! A complete log of this run can be found in: +npm ERR! /root/.npm/_logs/2019-07-10T13_41_46_371Z-debug.log +@azure/service-bus ( ? seconds) +>>> @azure/service-bus +tsc -p . && rollup -c 2>&1 && npm run extract-api +error TS2318: Cannot find global type 'AsyncGenerator'. +src/receiver.ts(193,32): error TS2739: Type '{}' is missing the following properties from type 'AsyncIterableIterator': [Symbol.asyncIterator], next +src/receiver.ts(742,32): error TS2322: Type '{}' is not assignable to type 'AsyncIterableIterator'. ================================ Error: Project(s) failed to build rush rebuild - Errors! ( ? seconds) @@ -83,7 +146,16 @@ rush rebuild - Errors! ( ? seconds) Standard error: Your version of Node.js (X.X.X) has not been tested with this release of Rush. The Rush team will not accept issue reports for it. Please consider upgrading Rush or downgrading Node.js. -XX of XX: [@azure/service-bus] completed with warnings in ? seconds +XX of XX: [@azure/cosmos] failed to build! +XX of XX: [@azure/service-bus] failed to build! +XX of XX: [@azure/keyvault-certificates] failed to build! +XX of XX: [@azure/keyvault-keys] failed to build! +XX of XX: [@azure/keyvault-secrets] failed to build! XX of XX: [@azure/core-amqp] failed to build! XX of XX: [@azure/event-hubs] blocked by [@azure/core-amqp]! [@azure/core-amqp] Returned error code: 2 +[@azure/cosmos] Returned error code: 2 +[@azure/keyvault-certificates] Returned error code: 2 +[@azure/keyvault-keys] Returned error code: 2 +[@azure/keyvault-secrets] Returned error code: 2 +[@azure/service-bus] Returned error code: 2 diff --git a/tests/baselines/reference/docker/office-ui-fabric.log b/tests/baselines/reference/docker/office-ui-fabric.log index f2b746a7e28..70e9ab2cc7b 100644 --- a/tests/baselines/reference/docker/office-ui-fabric.log +++ b/tests/baselines/reference/docker/office-ui-fabric.log @@ -205,7 +205,7 @@ ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed [XX:XX:XX XM] x ------------------------------------ [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node /office-ui-fabric-react/common/temp/node_modules/jest/bin/jest.js --config /office-ui-fabric-react/packages/foundation/jest.config.js --passWithNoTests --colors at ChildProcess. (/office-ui-fabric-react/common/temp/node_modules/.registry.npmjs.org/just-scripts-utils/0.8.1/node_modules/just-scripts-utils/lib/exec.js:70:31) - at ChildProcess.emit (events.js:200:13) + at ChildProcess.emit (events.js:203:13) at ChildProcess.EventEmitter.emit (domain.js:494:23) at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) [XX:XX:XX XM] x ------------------------------------ @@ -297,7 +297,7 @@ ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed [XX:XX:XX XM] x ------------------------------------ [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node /office-ui-fabric-react/common/temp/node_modules/jest/bin/jest.js --config /office-ui-fabric-react/packages/foundation/jest.config.js --passWithNoTests --colors at ChildProcess. (/office-ui-fabric-react/common/temp/node_modules/.registry.npmjs.org/just-scripts-utils/0.8.1/node_modules/just-scripts-utils/lib/exec.js:70:31) - at ChildProcess.emit (events.js:200:13) + at ChildProcess.emit (events.js:203:13) at ChildProcess.EventEmitter.emit (domain.js:494:23) at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) [XX:XX:XX XM] x ------------------------------------ diff --git a/tests/baselines/reference/user/acorn.log b/tests/baselines/reference/user/acorn.log index d1e557d3bc1..042e1bd7680 100644 --- a/tests/baselines/reference/user/acorn.log +++ b/tests/baselines/reference/user/acorn.log @@ -1,10 +1,22 @@ Exit Code: 1 Standard output: node_modules/acorn/bin/_acorn.js(51,30): error TS2339: Property 'getToken' does not exist on type 'Parser'. -node_modules/acorn/bin/_acorn.js(59,59): error TS2345: Argument of type '2 | null' is not assignable to parameter of type 'string | number | undefined'. - Type 'null' is not assignable to type 'string | number | undefined'. -node_modules/acorn/bin/_acorn.js(63,23): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string | number | Buffer | URL'. - Type 'undefined' is not assignable to type 'string | number | Buffer | URL'. +node_modules/acorn/bin/_acorn.js(59,30): error TS2769: No overload matches this call. + Overload 1 of 2, '(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string', gave the following error. + Argument of type 'null' is not assignable to parameter of type '((this: any, key: string, value: any) => any) | undefined'. + Overload 2 of 2, '(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string', gave the following error. + Argument of type '2 | null' is not assignable to parameter of type 'string | number | undefined'. + Type 'null' is not assignable to type 'string | number | undefined'. +node_modules/acorn/bin/_acorn.js(63,23): error TS2769: No overload matches this call. + Overload 1 of 3, '(path: string | number | Buffer | URL, options?: { encoding?: null | undefined; flag?: string | undefined; } | null | undefined): Buffer', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'string | number | Buffer | URL'. + Type 'undefined' is not assignable to type 'string | number | Buffer | URL'. + Overload 2 of 3, '(path: string | number | Buffer | URL, options: string | { encoding: string; flag?: string | undefined; }): string', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'string | number | Buffer | URL'. + Type 'undefined' is not assignable to type 'string | number | Buffer | URL'. + Overload 3 of 3, '(path: string | number | Buffer | URL, options?: string | { encoding?: string | null | undefined; flag?: string | undefined; } | null | undefined): string | Buffer', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'string | number | Buffer | URL'. + Type 'undefined' is not assignable to type 'string | number | Buffer | URL'. node_modules/acorn/bin/run_test262.js(3,21): error TS2307: Cannot find module 'test262-parser-runner'. node_modules/acorn/dist/acorn.es.js(36,1): error TS2322: Type 'null' is not assignable to type 'string'. node_modules/acorn/dist/acorn.es.js(36,32): error TS2322: Type 'null' is not assignable to type 'string'. diff --git a/tests/baselines/reference/user/adonis-framework.log b/tests/baselines/reference/user/adonis-framework.log index 211e61740b6..e3b19b5de04 100644 --- a/tests/baselines/reference/user/adonis-framework.log +++ b/tests/baselines/reference/user/adonis-framework.log @@ -19,11 +19,19 @@ node_modules/adonis-framework/src/Config/index.js(37,15): error TS2304: Cannot f node_modules/adonis-framework/src/Config/index.js(39,15): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Config/index.js(58,15): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Encryption/index.js(53,15): error TS2304: Cannot find name 'Mixed'. -node_modules/adonis-framework/src/Encryption/index.js(71,34): error TS2345: Argument of type 'string' is not assignable to parameter of type '"utf8" | "ascii" | "binary" | undefined'. +node_modules/adonis-framework/src/Encryption/index.js(71,34): error TS2769: No overload matches this call. + Overload 1 of 4, '(data: Binary, input_encoding: undefined, output_encoding: HexBase64BinaryEncoding): string', gave the following error. + Argument of type 'string' is not assignable to parameter of type 'undefined'. + Overload 2 of 4, '(data: string, input_encoding: "utf8" | "ascii" | "binary" | undefined, output_encoding: HexBase64BinaryEncoding): string', gave the following error. + Argument of type 'string' is not assignable to parameter of type '"utf8" | "ascii" | "binary" | undefined'. node_modules/adonis-framework/src/Encryption/index.js(77,50): error TS2345: Argument of type 'Buffer' is not assignable to parameter of type 'string'. node_modules/adonis-framework/src/Encryption/index.js(85,23): error TS8024: JSDoc '@param' tag has name 'value', but there is no parameter with that name. node_modules/adonis-framework/src/Encryption/index.js(87,15): error TS2304: Cannot find name 'Mixed'. -node_modules/adonis-framework/src/Encryption/index.js(101,62): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Utf8AsciiBinaryEncoding'. +node_modules/adonis-framework/src/Encryption/index.js(101,21): error TS2769: No overload matches this call. + Overload 1 of 4, '(data: Binary, input_encoding: undefined, output_encoding: Utf8AsciiBinaryEncoding): string', gave the following error. + Argument of type '"base64"' is not assignable to parameter of type 'undefined'. + Overload 2 of 4, '(data: string, input_encoding: "binary" | "base64" | "hex" | undefined, output_encoding: Utf8AsciiBinaryEncoding): string', gave the following error. + Argument of type 'string' is not assignable to parameter of type 'Utf8AsciiBinaryEncoding'. node_modules/adonis-framework/src/Encryption/index.js(114,15): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Encryption/index.js(119,23): error TS2554: Expected 2 arguments, but got 1. node_modules/adonis-framework/src/Encryption/index.js(183,15): error TS2304: Cannot find name 'Mixed'. @@ -164,14 +172,14 @@ node_modules/adonis-framework/src/Server/index.js(252,24): error TS1005: '}' exp node_modules/adonis-framework/src/Session/CookieManager.js(45,14): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Session/CookieManager.js(60,15): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Session/CookieManager.js(72,15): error TS2304: Cannot find name 'Stirng'. -node_modules/adonis-framework/src/Session/Drivers/Cookie/index.js(77,15): error TS2322: Type 'IterableIterator' is not assignable to type 'boolean'. -node_modules/adonis-framework/src/Session/Drivers/Cookie/index.js(88,15): error TS2322: Type 'IterableIterator' is not assignable to type 'boolean'. +node_modules/adonis-framework/src/Session/Drivers/Cookie/index.js(77,15): error TS2322: Type 'Generator' is not assignable to type 'boolean'. +node_modules/adonis-framework/src/Session/Drivers/Cookie/index.js(88,15): error TS2322: Type 'Generator' is not assignable to type 'boolean'. node_modules/adonis-framework/src/Session/Drivers/Cookie/index.js(118,14): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. node_modules/adonis-framework/src/Session/Drivers/File/index.js(25,14): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. node_modules/adonis-framework/src/Session/Drivers/File/index.js(79,15): error TS2505: A generator cannot have a 'void' type annotation. node_modules/adonis-framework/src/Session/Drivers/Redis/index.js(23,14): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -node_modules/adonis-framework/src/Session/Drivers/Redis/index.js(59,15): error TS2322: Type 'IterableIterator' is not assignable to type 'boolean'. -node_modules/adonis-framework/src/Session/Drivers/Redis/index.js(72,15): error TS2322: Type 'IterableIterator' is not assignable to type 'boolean'. +node_modules/adonis-framework/src/Session/Drivers/Redis/index.js(59,15): error TS2322: Type 'Generator' is not assignable to type 'boolean'. +node_modules/adonis-framework/src/Session/Drivers/Redis/index.js(72,15): error TS2322: Type 'Generator' is not assignable to type 'boolean'. node_modules/adonis-framework/src/Session/SessionManager.js(13,21): error TS2307: Cannot find module 'adonis-fold'. node_modules/adonis-framework/src/Session/SessionManager.js(69,22): error TS2339: Property 'drivers' does not exist on type 'Function'. node_modules/adonis-framework/src/Session/SessionManager.js(69,49): error TS2339: Property 'drivers' does not exist on type 'Function'. @@ -194,15 +202,15 @@ node_modules/adonis-framework/src/Session/index.js(107,92): error TS2339: Proper node_modules/adonis-framework/src/Session/index.js(107,126): error TS2339: Property 'driver' does not exist on type 'Function'. node_modules/adonis-framework/src/Session/index.js(123,23): error TS2532: Object is possibly 'undefined'. node_modules/adonis-framework/src/Session/index.js(137,5): error TS2532: Object is possibly 'undefined'. -node_modules/adonis-framework/src/Session/index.js(168,15): error TS2322: Type 'IterableIterator' is not assignable to type 'boolean'. +node_modules/adonis-framework/src/Session/index.js(168,15): error TS2322: Type 'Generator' is not assignable to type 'boolean'. node_modules/adonis-framework/src/Session/index.js(199,15): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Session/index.js(201,15): error TS2304: Cannot find name 'Mixed'. -node_modules/adonis-framework/src/Session/index.js(204,15): error TS2322: Type 'IterableIterator' is not assignable to type 'boolean'. -node_modules/adonis-framework/src/Session/index.js(234,15): error TS2322: Type 'IterableIterator' is not assignable to type 'boolean'. +node_modules/adonis-framework/src/Session/index.js(204,15): error TS2322: Type 'Generator' is not assignable to type 'boolean'. +node_modules/adonis-framework/src/Session/index.js(234,15): error TS2322: Type 'Generator' is not assignable to type 'boolean'. node_modules/adonis-framework/src/Session/index.js(247,15): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Session/index.js(249,15): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Session/index.js(267,15): error TS2304: Cannot find name 'Mixed'. -node_modules/adonis-framework/src/Session/index.js(287,15): error TS2322: Type 'IterableIterator' is not assignable to type 'boolean'. +node_modules/adonis-framework/src/Session/index.js(287,15): error TS2322: Type 'Generator' is not assignable to type 'boolean'. node_modules/adonis-framework/src/Session/index.js(293,12): error TS2532: Object is possibly 'undefined'. node_modules/adonis-framework/src/View/Form/index.js(75,11): error TS2532: Object is possibly 'undefined'. node_modules/adonis-framework/src/View/Form/index.js(115,15): error TS2304: Cannot find name 'Mixed'. diff --git a/tests/baselines/reference/user/axios-src.log b/tests/baselines/reference/user/axios-src.log index 088a83ccd2e..9193929eb71 100644 --- a/tests/baselines/reference/user/axios-src.log +++ b/tests/baselines/reference/user/axios-src.log @@ -1,5 +1,7 @@ Exit Code: 1 Standard output: +../../../../../built/local/lib.es2015.iterable.d.ts(41,6): error TS2300: Duplicate identifier 'IteratorResult'. +../../../../../node_modules/@types/node/index.d.ts(77,11): error TS2300: Duplicate identifier 'IteratorResult'. lib/adapters/http.js(12,19): error TS2732: Cannot find module './../../package.json'. Consider using '--resolveJsonModule' to import module with '.json' extension lib/adapters/http.js(85,22): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. Type 'undefined' is not assignable to type 'string'. diff --git a/tests/baselines/reference/user/chrome-devtools-frontend.log b/tests/baselines/reference/user/chrome-devtools-frontend.log index 228ae3113bd..e4350b2ad4a 100644 --- a/tests/baselines/reference/user/chrome-devtools-frontend.log +++ b/tests/baselines/reference/user/chrome-devtools-frontend.log @@ -11,8 +11,10 @@ Standard output: ../../../../built/local/lib.dom.d.ts(12625,13): error TS2300: Duplicate identifier 'Request'. ../../../../built/local/lib.dom.d.ts(17341,11): error TS2300: Duplicate identifier 'Window'. ../../../../built/local/lib.dom.d.ts(17475,13): error TS2300: Duplicate identifier 'Window'. +../../../../built/local/lib.es2015.iterable.d.ts(41,6): error TS2300: Duplicate identifier 'IteratorResult'. ../../../../built/local/lib.es5.d.ts(1416,11): error TS2300: Duplicate identifier 'ArrayLike'. ../../../../built/local/lib.es5.d.ts(1452,6): error TS2300: Duplicate identifier 'Record'. +../../../../node_modules/@types/node/index.d.ts(77,11): error TS2300: Duplicate identifier 'IteratorResult'. ../../../../node_modules/@types/node/index.d.ts(150,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'module' must be of type '{}', but here has type 'NodeModule'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(43,8): error TS2339: Property '_importScriptPathPrefix' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(77,16): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. @@ -722,7 +724,11 @@ node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighth node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(15687,1): error TS2304: Cannot find name 'fs'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(15694,1): error TS2322: Type 'Promise' is not assignable to type 'Promise'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(15695,1): error TS2304: Cannot find name 'fs'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(15695,78): error TS2345: Argument of type '0' is not assignable to parameter of type '(string | number)[]'. +node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(15695,78): error TS2769: No overload matches this call. + Overload 1 of 2, '(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string', gave the following error. + Argument of type '0' is not assignable to parameter of type '(this: any, key: string, value: any) => any'. + Overload 2 of 2, '(value: any, replacer?: (string | number)[], space?: string | number): string', gave the following error. + Argument of type '0' is not assignable to parameter of type '(string | number)[]'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(15791,19): error TS2304: Cannot find name 'fs'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(15810,1): error TS2304: Cannot find name 'fs'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(15814,1): error TS2304: Cannot find name 'fs'. @@ -908,9 +914,11 @@ node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighth node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(29961,8): error TS2339: Property 'on' does not exist on type 'Stream'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(29962,8): error TS2339: Property 'on' does not exist on type 'Stream'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(30114,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'end' must be of type 'any', but here has type 'number'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(30311,40): error TS2345: Argument of type '(x: string) => string | number' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. - Type 'string | number' is not assignable to type 'string'. - Type 'number' is not assignable to type 'string'. +node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(30311,40): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '(x: string) => string | number' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. + Type 'string | number' is not assignable to type 'string'. + Type 'number' is not assignable to type 'string'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(30729,1): error TS2323: Cannot redeclare exported variable 'isArray'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(30734,1): error TS2323: Cannot redeclare exported variable 'isBoolean'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(30739,1): error TS2323: Cannot redeclare exported variable 'isNull'. @@ -3456,7 +3464,11 @@ node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(8795,39): error Property 'offset' does not exist on type '{ node: any; start: number; end: number; collapse: any; coverStart: any; coverEnd: any; }'. node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(8799,38): error TS2339: Property 'offset' does not exist on type '{ node: any; start: number; end: number; collapse: any; coverStart: any; coverEnd: any; } | { node: any; offset: number; }'. Property 'offset' does not exist on type '{ node: any; start: number; end: number; collapse: any; coverStart: any; coverEnd: any; }'. -node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(8817,16): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. +node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(8817,16): error TS2769: No overload matches this call. + Overload 1 of 2, '(timeoutId: Timer): void', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'Timer'. + Overload 2 of 2, '(handle?: number): void', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'number'. node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(8818,3): error TS2322: Type 'Timer' is not assignable to type 'boolean'. node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(8840,24): error TS2339: Property 'div' does not exist on type 'ContentEditableInput'. node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(8847,10): error TS2339: Property 'div' does not exist on type 'ContentEditableInput'. @@ -5084,11 +5096,23 @@ node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(27 node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(279,24): error TS2339: Property 'getComponentSelection' does not exist on type 'Node'. node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(289,16): error TS2339: Property 'window' does not exist on type 'Node'. node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(293,19): error TS2339: Property 'removeChildren' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(305,42): error TS2559: Type 'string' has no properties in common with type 'ElementCreationOptions'. +node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(305,10): error TS2769: No overload matches this call. + Overload 1 of 3, '(tagName: "object" | "link" | "small" | "sub" | "sup" | "track" | "progress" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | ... 99 more ... | "wbr", options?: ElementCreationOptions): HTMLElement | ... 70 more ... | HTMLUListElement', gave the following error. + Argument of type 'string' is not assignable to parameter of type '"object" | "link" | "small" | "sub" | "sup" | "track" | "progress" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | ... 99 more ... | "wbr"'. + Overload 2 of 3, '(tagName: "listing" | "xmp", options?: ElementCreationOptions): HTMLPreElement', gave the following error. + Argument of type 'string' is not assignable to parameter of type '"listing" | "xmp"'. + Overload 3 of 3, '(tagName: string, options?: ElementCreationOptions): HTMLElement', gave the following error. + Type 'string' has no properties in common with type 'ElementCreationOptions'. node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(314,34): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'. Type 'number' is not assignable to type 'string'. node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(323,20): error TS2339: Property 'createElementWithClass' does not exist on type 'Document'. -node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(324,49): error TS2559: Type 'string' has no properties in common with type 'ElementCreationOptions'. +node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(324,17): error TS2769: No overload matches this call. + Overload 1 of 3, '(tagName: "object" | "link" | "small" | "sub" | "sup" | "track" | "progress" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | ... 99 more ... | "wbr", options?: ElementCreationOptions): HTMLElement | ... 70 more ... | HTMLUListElement', gave the following error. + Argument of type 'string' is not assignable to parameter of type '"object" | "link" | "small" | "sub" | "sup" | "track" | "progress" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | ... 99 more ... | "wbr"'. + Overload 2 of 3, '(tagName: "listing" | "xmp", options?: ElementCreationOptions): HTMLPreElement', gave the following error. + Argument of type 'string' is not assignable to parameter of type '"listing" | "xmp"'. + Overload 3 of 3, '(tagName: string, options?: ElementCreationOptions): HTMLElement', gave the following error. + Type 'string' has no properties in common with type 'ElementCreationOptions'. node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(338,19): error TS2339: Property 'createElementWithClass' does not exist on type 'Document'. node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(346,20): error TS2551: Property 'createSVGElement' does not exist on type 'Document'. Did you mean 'createElementNS'? node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(360,19): error TS2551: Property 'createSVGElement' does not exist on type 'Document'. Did you mean 'createElementNS'? @@ -5222,21 +5246,25 @@ node_modules/chrome-devtools-frontend/front_end/elements/ComputedStyleWidget.js( node_modules/chrome-devtools-frontend/front_end/elements/ComputedStyleWidget.js(52,56): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/elements/ComputedStyleWidget.js(58,78): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/elements/ComputedStyleWidget.js(73,12): error TS2339: Property '_filterRegex' does not exist on type 'ComputedStyleWidget'. -node_modules/chrome-devtools-frontend/front_end/elements/ComputedStyleWidget.js(91,24): error TS2345: Argument of type '(Promise | Promise)[]' is not assignable to parameter of type 'Iterable>'. - Types of property '[Symbol.iterator]' are incompatible. - Type '() => IterableIterator | Promise>' is not assignable to type '() => Iterator>'. - Type 'IterableIterator | Promise>' is not assignable to type 'Iterator>'. - Types of property 'next' are incompatible. - Type '{ (value?: any): IteratorResult | Promise>; (value?: any): IteratorResult | Promise>; }' is not assignable to type '{ (value?: any): IteratorResult>; (value?: any): IteratorResult>; }'. - Type 'IteratorResult | Promise>' is not assignable to type 'IteratorResult>'. - Type 'Promise | Promise' is not assignable to type 'ComputedStyle | PromiseLike'. - Type 'Promise' is not assignable to type 'ComputedStyle | PromiseLike'. - Type 'Promise' is not assignable to type 'PromiseLike'. - Types of property 'then' are incompatible. - Type '(onfulfilled?: (value: CSSMatchedStyles) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise<...>' is not assignable to type '(onfulfilled?: (value: ComputedStyle) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. - Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. - Types of parameters 'value' and 'value' are incompatible. - Property 'computedStyle' is missing in type 'CSSMatchedStyles' but required in type 'ComputedStyle'. +node_modules/chrome-devtools-frontend/front_end/elements/ComputedStyleWidget.js(91,24): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '(Promise | Promise)[]' is not assignable to parameter of type 'Iterable>'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => IterableIterator | Promise>' is not assignable to type '() => Iterator, any, undefined>'. + Type 'IterableIterator | Promise>' is not assignable to type 'Iterator, any, undefined>'. + Types of property 'next' are incompatible. + Type '{ (...args: [] | [undefined]): IteratorResult | Promise, any>; (value?: any): IteratorResult | Promise, any>; }' is not assignable to type '{ (...args: [] | [undefined]): IteratorResult, any>; (value?: any): IteratorResult, any>; }'. + Type 'IteratorResult | Promise, any>' is not assignable to type 'IteratorResult, any>'. + Type 'IteratorYieldResult | Promise>' is not assignable to type 'IteratorResult, any>'. + Type 'IteratorYieldResult | Promise>' is not assignable to type 'IteratorYieldResult>'. + Type 'Promise | Promise' is not assignable to type 'ComputedStyle | PromiseLike'. + Type 'Promise' is not assignable to type 'ComputedStyle | PromiseLike'. + Type 'Promise' is not assignable to type 'PromiseLike'. + Types of property 'then' are incompatible. + Type '(onfulfilled?: (value: CSSMatchedStyles) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise<...>' is not assignable to type '(onfulfilled?: (value: ComputedStyle) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. + Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. + Types of parameters 'value' and 'value' are incompatible. + Property 'computedStyle' is missing in type 'CSSMatchedStyles' but required in type 'ComputedStyle'. node_modules/chrome-devtools-frontend/front_end/elements/ComputedStyleWidget.js(147,52): error TS2339: Property 'keysArray' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/elements/ComputedStyleWidget.js(179,50): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/elements/ComputedStyleWidget.js(200,74): error TS2339: Property 'consume' does not exist on type 'Event'. @@ -5530,21 +5558,25 @@ node_modules/chrome-devtools-frontend/front_end/elements/InspectElementModeContr Type 'T' is not assignable to type 'OverlayModel'. node_modules/chrome-devtools-frontend/front_end/elements/InspectElementModeController.js(91,24): error TS2694: Namespace 'Protocol' has no exported member 'Overlay'. node_modules/chrome-devtools-frontend/front_end/elements/MetricsSidebarPane.js(56,27): error TS2339: Property 'removeChildren' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/elements/MetricsSidebarPane.js(82,24): error TS2345: Argument of type '(Promise> | Promise)[]' is not assignable to parameter of type 'Iterable | PromiseLike>>'. - Types of property '[Symbol.iterator]' are incompatible. - Type '() => IterableIterator> | Promise>' is not assignable to type '() => Iterator | PromiseLike>>'. - Type 'IterableIterator> | Promise>' is not assignable to type 'Iterator | PromiseLike>>'. - Types of property 'next' are incompatible. - Type '{ (value?: any): IteratorResult> | Promise>; (value?: any): IteratorResult> | Promise>; }' is not assignable to type '{ (value?: any): IteratorResult | PromiseLike>>; (value?: any): IteratorResult | PromiseLike>>; }'. - Type 'IteratorResult> | Promise>' is not assignable to type 'IteratorResult | PromiseLike>>'. - Type 'Promise> | Promise' is not assignable to type 'Map | PromiseLike>'. - Type 'Promise' is not assignable to type 'Map | PromiseLike>'. - Type 'Promise' is not assignable to type 'PromiseLike>'. - Types of property 'then' are incompatible. - Type '(onfulfilled?: (value: InlineStyleResult) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise<...>' is not assignable to type ', TResult2 = never>(onfulfilled?: (value: Map) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike<...>'. - Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. - Types of parameters 'value' and 'value' are incompatible. - Type 'InlineStyleResult' is missing the following properties from type 'Map': clear, delete, forEach, get, and 8 more. +node_modules/chrome-devtools-frontend/front_end/elements/MetricsSidebarPane.js(82,24): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '(Promise> | Promise)[]' is not assignable to parameter of type 'Iterable | PromiseLike>>'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => IterableIterator> | Promise>' is not assignable to type '() => Iterator | PromiseLike>, any, undefined>'. + Type 'IterableIterator> | Promise>' is not assignable to type 'Iterator | PromiseLike>, any, undefined>'. + Types of property 'next' are incompatible. + Type '{ (...args: [] | [undefined]): IteratorResult> | Promise, any>; (value?: any): IteratorResult> | Promise, any>; }' is not assignable to type '{ (...args: [] | [undefined]): IteratorResult | PromiseLike>, any>; (value?: any): IteratorResult | PromiseLike>, any>; }'. + Type 'IteratorResult> | Promise, any>' is not assignable to type 'IteratorResult | PromiseLike>, any>'. + Type 'IteratorYieldResult> | Promise>' is not assignable to type 'IteratorResult | PromiseLike>, any>'. + Type 'IteratorYieldResult> | Promise>' is not assignable to type 'IteratorYieldResult | PromiseLike>>'. + Type 'Promise> | Promise' is not assignable to type 'Map | PromiseLike>'. + Type 'Promise' is not assignable to type 'Map | PromiseLike>'. + Type 'Promise' is not assignable to type 'PromiseLike>'. + Types of property 'then' are incompatible. + Type '(onfulfilled?: (value: InlineStyleResult) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise<...>' is not assignable to type ', TResult2 = never>(onfulfilled?: (value: Map) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike<...>'. + Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. + Types of parameters 'value' and 'value' are incompatible. + Type 'InlineStyleResult' is missing the following properties from type 'Map': clear, delete, forEach, get, and 8 more. node_modules/chrome-devtools-frontend/front_end/elements/MetricsSidebarPane.js(120,11): error TS2339: Property 'consume' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/elements/MetricsSidebarPane.js(164,22): error TS2339: Property 'toFixedIfFloating' does not exist on type 'NumberConstructor'. node_modules/chrome-devtools-frontend/front_end/elements/MetricsSidebarPane.js(179,18): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. @@ -8181,8 +8213,13 @@ node_modules/chrome-devtools-frontend/front_end/persistence/IsolatedFileSystem.j node_modules/chrome-devtools-frontend/front_end/persistence/IsolatedFileSystem.js(267,17): error TS2304: Cannot find name 'FileEntry'. node_modules/chrome-devtools-frontend/front_end/persistence/IsolatedFileSystem.js(278,17): error TS2304: Cannot find name 'FileError'. node_modules/chrome-devtools-frontend/front_end/persistence/IsolatedFileSystem.js(317,14): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. -node_modules/chrome-devtools-frontend/front_end/persistence/IsolatedFileSystem.js(344,31): error TS2345: Argument of type 'string | ArrayBuffer' is not assignable to parameter of type 'string'. - Type 'ArrayBuffer' is not assignable to type 'string'. +node_modules/chrome-devtools-frontend/front_end/persistence/IsolatedFileSystem.js(344,31): error TS2769: No overload matches this call. + Overload 1 of 2, '(rawString: string): string', gave the following error. + Argument of type 'string | ArrayBuffer' is not assignable to parameter of type 'string'. + Type 'ArrayBuffer' is not assignable to type 'string'. + Overload 2 of 2, '(data: string): string', gave the following error. + Argument of type 'string | ArrayBuffer' is not assignable to parameter of type 'string'. + Type 'ArrayBuffer' is not assignable to type 'string'. node_modules/chrome-devtools-frontend/front_end/persistence/IsolatedFileSystem.js(357,14): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. node_modules/chrome-devtools-frontend/front_end/persistence/IsolatedFileSystem.js(364,17): error TS2304: Cannot find name 'FileEntry'. node_modules/chrome-devtools-frontend/front_end/persistence/IsolatedFileSystem.js(372,17): error TS2304: Cannot find name 'FileWriter'. @@ -8286,8 +8323,7 @@ node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(402,8): er node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(403,23): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(412,16): error TS2339: Property 'isValid' does not exist on type 'Date'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(419,16): error TS2339: Property 'toISO8601Compact' does not exist on type 'Date'. -node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(545,5): error TS2322: Type '{ value: (comparator: (arg0: number, arg1: number) => number, leftBound: number, rightBound: number, sortWindowLeft: number, sortWindowRight: number) => number[]; }' is not assignable to type 'number[]'. - Object literal may only specify known properties, but 'value' does not exist in type 'number[]'. Did you mean to write 'values'? +node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(560,7): error TS2740: Type '{ value: (comparator: (arg0: number, arg1: number) => number, leftBound: number, rightBound: number, sortWindowLeft: number, sortWindowRight: number) => number[]; }' is missing the following properties from type 'number[]': length, pop, push, concat, and 28 more. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(716,84): error TS2339: Property 'lowerBound' does not exist on type 'any[]'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(718,84): error TS2339: Property 'upperBound' does not exist on type 'any[]'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(720,83): error TS2339: Property 'lowerBound' does not exist on type 'any[]'. @@ -12619,12 +12655,12 @@ node_modules/chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js( node_modules/chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js(1260,29): error TS2339: Property 'MetadataEvents' does not exist on type 'typeof TimelineModel'. node_modules/chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js(1423,31): error TS2694: Namespace 'TimelineModel' has no exported member 'InvalidationCause'. node_modules/chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js(1433,61): error TS2694: Namespace 'Protocol' has no exported member 'Runtime'. -node_modules/chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js(1524,30): error TS2488: Type 'Iterator' must have a '[Symbol.iterator]()' method that returns an iterator. +node_modules/chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js(1524,30): error TS2488: Type 'Iterator' must have a '[Symbol.iterator]()' method that returns an iterator. node_modules/chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js(1532,22): error TS2339: Property 'linkedRecalcStyleEvent' does not exist on type 'InvalidationTrackingEvent'. node_modules/chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js(1548,18): error TS2339: Property 'linkedRecalcStyleEvent' does not exist on type 'InvalidationTrackingEvent'. node_modules/chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js(1600,23): error TS2339: Property 'linkedRecalcStyleEvent' does not exist on type 'InvalidationTrackingEvent'. -node_modules/chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js(1609,30): error TS2488: Type 'Iterator' must have a '[Symbol.iterator]()' method that returns an iterator. -node_modules/chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js(1642,30): error TS2488: Type 'Iterator' must have a '[Symbol.iterator]()' method that returns an iterator. +node_modules/chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js(1609,30): error TS2488: Type 'Iterator' must have a '[Symbol.iterator]()' method that returns an iterator. +node_modules/chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js(1642,30): error TS2488: Type 'Iterator' must have a '[Symbol.iterator]()' method that returns an iterator. node_modules/chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js(1709,67): error TS2339: Property '_asyncEvents' does not exist on type 'typeof TimelineAsyncEventTracker'. node_modules/chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js(1714,49): error TS2339: Property '_asyncEvents' does not exist on type 'typeof TimelineAsyncEventTracker'. node_modules/chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js(1730,45): error TS2339: Property '_asyncEvents' does not exist on type 'typeof TimelineAsyncEventTracker'. @@ -13524,25 +13560,31 @@ node_modules/chrome-devtools-frontend/front_end/ui/View.js(411,5): error TS2322: Property '_vbox' does not exist on type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ...; }, insertBefore?: { ...'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(440,18): error TS2339: Property 'tabIndex' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(454,38): error TS2339: Property 'hasFocus' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/ui/View.js(461,44): error TS2345: Argument of type '(Promise | Promise)[]' is not assignable to parameter of type 'Iterable>'. - Types of property '[Symbol.iterator]' are incompatible. - Type '() => IterableIterator | Promise>' is not assignable to type '() => Iterator>'. - Type 'IterableIterator | Promise>' is not assignable to type 'Iterator>'. - Types of property 'next' are incompatible. - Type '{ (value?: any): IteratorResult | Promise>; (value?: any): IteratorResult | Promise>; }' is not assignable to type '{ (value?: any): IteratorResult>; (value?: any): IteratorResult>; }'. - Type 'IteratorResult | Promise>' is not assignable to type 'IteratorResult>'. - Type 'Promise | Promise' is not assignable to type 'void | PromiseLike'. - Type 'Promise' is not assignable to type 'void | PromiseLike'. - Type 'Promise' is not assignable to type 'PromiseLike'. - Types of property 'then' are incompatible. - Type '(onfulfilled?: (value: ToolbarItem[]) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise' is not assignable to type '(onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. - Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. - Types of parameters 'value' and 'value' are incompatible. - Type 'ToolbarItem[]' is not assignable to type 'void'. +node_modules/chrome-devtools-frontend/front_end/ui/View.js(461,44): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '(Promise | Promise)[]' is not assignable to parameter of type 'Iterable>'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => IterableIterator | Promise>' is not assignable to type '() => Iterator, any, undefined>'. + Type 'IterableIterator | Promise>' is not assignable to type 'Iterator, any, undefined>'. + Types of property 'next' are incompatible. + Type '{ (...args: [] | [undefined]): IteratorResult | Promise, any>; (value?: any): IteratorResult | Promise, any>; }' is not assignable to type '{ (...args: [] | [undefined]): IteratorResult, any>; (value?: any): IteratorResult, any>; }'. + Type 'IteratorResult | Promise, any>' is not assignable to type 'IteratorResult, any>'. + Type 'IteratorYieldResult | Promise>' is not assignable to type 'IteratorResult, any>'. + Type 'IteratorYieldResult | Promise>' is not assignable to type 'IteratorYieldResult>'. + Type 'Promise | Promise' is not assignable to type 'void | PromiseLike'. + Type 'Promise' is not assignable to type 'void | PromiseLike'. + Type 'Promise' is not assignable to type 'PromiseLike'. + Types of property 'then' are incompatible. + Type '(onfulfilled?: (value: ToolbarItem[]) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise' is not assignable to type '(onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. + Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. + Types of parameters 'value' and 'value' are incompatible. + Type 'ToolbarItem[]' is not assignable to type 'void'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(495,24): error TS2339: Property 'createTextChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(496,24): error TS2339: Property 'tabIndex' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(501,25): error TS2339: Property 'createChild' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/ui/View.js(520,44): error TS2345: Argument of type '(Promise | Promise)[]' is not assignable to parameter of type 'Iterable>'. +node_modules/chrome-devtools-frontend/front_end/ui/View.js(520,44): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '(Promise | Promise)[]' is not assignable to parameter of type 'Iterable>'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(556,36): error TS2339: Property 'keyCode' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(558,22): error TS2339: Property 'key' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(560,22): error TS2339: Property 'key' does not exist on type 'Event'. @@ -13615,8 +13657,12 @@ node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(56,19): error TS23 node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(75,15): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(82,15): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(89,15): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. -node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(100,79): error TS2345: Argument of type '{ passive: boolean; capture: false; }' is not assignable to parameter of type 'boolean | EventListenerOptions'. - Object literal may only specify known properties, and 'passive' does not exist in type 'EventListenerOptions'. +node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(100,7): error TS2769: No overload matches this call. + Overload 1 of 2, '(type: "fullscreenchange" | "fullscreenerror", listener: (this: Element, ev: Event) => any, options?: boolean | EventListenerOptions): void', gave the following error. + Argument of type '"scroll"' is not assignable to parameter of type '"fullscreenchange" | "fullscreenerror"'. + Overload 2 of 2, '(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void', gave the following error. + Argument of type '{ passive: boolean; capture: false; }' is not assignable to parameter of type 'boolean | EventListenerOptions'. + Object literal may only specify known properties, and 'passive' does not exist in type 'EventListenerOptions'. node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(108,19): error TS2551: Property '_scrollTop' does not exist on type 'Element'. Did you mean 'scrollTop'? node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(109,37): error TS2551: Property '_scrollTop' does not exist on type 'Element'. Did you mean 'scrollTop'? node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(110,19): error TS2551: Property '_scrollLeft' does not exist on type 'Element'. Did you mean 'scrollLeft'? diff --git a/tests/baselines/reference/user/enhanced-resolve.log b/tests/baselines/reference/user/enhanced-resolve.log index 7dd284bf166..44f7c0712d0 100644 --- a/tests/baselines/reference/user/enhanced-resolve.log +++ b/tests/baselines/reference/user/enhanced-resolve.log @@ -1,11 +1,26 @@ Exit Code: 1 Standard output: -node_modules/enhanced-resolve/lib/CachedInputFileSystem.js(116,18): error TS2345: Argument of type 'Timeout | null' is not assignable to parameter of type 'number | undefined'. - Type 'null' is not assignable to type 'number | undefined'. -node_modules/enhanced-resolve/lib/CachedInputFileSystem.js(129,18): error TS2345: Argument of type 'Timeout | null' is not assignable to parameter of type 'number | undefined'. - Type 'null' is not assignable to type 'number | undefined'. -node_modules/enhanced-resolve/lib/CachedInputFileSystem.js(147,18): error TS2345: Argument of type 'Timeout | null' is not assignable to parameter of type 'number | undefined'. - Type 'null' is not assignable to type 'number | undefined'. +node_modules/enhanced-resolve/lib/CachedInputFileSystem.js(116,18): error TS2769: No overload matches this call. + Overload 1 of 2, '(intervalId: Timeout): void', gave the following error. + Argument of type 'Timeout | null' is not assignable to parameter of type 'Timeout'. + Type 'null' is not assignable to type 'Timeout'. + Overload 2 of 2, '(handle?: number | undefined): void', gave the following error. + Argument of type 'Timeout | null' is not assignable to parameter of type 'number | undefined'. + Type 'null' is not assignable to type 'number | undefined'. +node_modules/enhanced-resolve/lib/CachedInputFileSystem.js(129,18): error TS2769: No overload matches this call. + Overload 1 of 2, '(intervalId: Timeout): void', gave the following error. + Argument of type 'Timeout | null' is not assignable to parameter of type 'Timeout'. + Type 'null' is not assignable to type 'Timeout'. + Overload 2 of 2, '(handle?: number | undefined): void', gave the following error. + Argument of type 'Timeout | null' is not assignable to parameter of type 'number | undefined'. + Type 'null' is not assignable to type 'number | undefined'. +node_modules/enhanced-resolve/lib/CachedInputFileSystem.js(147,18): error TS2769: No overload matches this call. + Overload 1 of 2, '(intervalId: Timeout): void', gave the following error. + Argument of type 'Timeout | null' is not assignable to parameter of type 'Timeout'. + Type 'null' is not assignable to type 'Timeout'. + Overload 2 of 2, '(handle?: number | undefined): void', gave the following error. + Argument of type 'Timeout | null' is not assignable to parameter of type 'number | undefined'. + Type 'null' is not assignable to type 'number | undefined'. node_modules/enhanced-resolve/lib/CachedInputFileSystem.js(176,19): error TS2322: Type 'null' is not assignable to type '(path: any, callback: any) => void'. node_modules/enhanced-resolve/lib/CachedInputFileSystem.js(179,23): error TS2322: Type 'null' is not assignable to type '(path: any) => any'. node_modules/enhanced-resolve/lib/CachedInputFileSystem.js(182,22): error TS2322: Type 'null' is not assignable to type '(path: any, callback: any) => void'. diff --git a/tests/baselines/reference/user/lodash.log b/tests/baselines/reference/user/lodash.log index 4ff6cd2fa20..26b289dd425 100644 --- a/tests/baselines/reference/user/lodash.log +++ b/tests/baselines/reference/user/lodash.log @@ -31,7 +31,7 @@ node_modules/lodash/_baseClone.js(92,16): error TS2362: The left-hand side of an node_modules/lodash/_baseClone.js(93,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. node_modules/lodash/_baseClone.js(115,33): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean | undefined'. node_modules/lodash/_baseClone.js(128,43): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean | undefined'. -node_modules/lodash/_baseClone.js(157,17): error TS2552: Cannot find name 'keysIn'. Did you mean 'keys'? +node_modules/lodash/_baseClone.js(151,17): error TS2552: Cannot find name 'keysIn'. Did you mean 'keys'? node_modules/lodash/_baseDifference.js(37,5): error TS2322: Type '(array?: any[] | undefined, value: any, comparator: Function) => boolean' is not assignable to type '(array?: any[] | undefined, value: any) => boolean'. node_modules/lodash/_baseDifference.js(43,5): error TS2740: Type 'SetCache' is missing the following properties from type 'any[]': length, pop, concat, join, and 27 more. node_modules/lodash/_baseDifference.js(60,42): error TS2554: Expected 2 arguments, but got 3. @@ -251,8 +251,10 @@ node_modules/lodash/core.js(3245,58): error TS2345: Argument of type 'string | a Type 'any[]' is not assignable to type 'string | number | symbol'. Type 'any[]' is not assignable to type 'string'. node_modules/lodash/core.js(3354,53): error TS2538: Type 'any[]' cannot be used as an index type. -node_modules/lodash/core.js(3424,41): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. - Type 'Function' provides no match for the signature '(substring: string, ...args: any[]): string'. +node_modules/lodash/core.js(3424,41): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type 'Function' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. + Type 'Function' provides no match for the signature '(substring: string, ...args: any[]): string'. node_modules/lodash/core.js(3573,51): error TS2532: Object is possibly 'undefined'. node_modules/lodash/core.js(3590,63): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. Type 'IArguments' is missing the following properties from type 'any[]': pop, push, concat, join, and 26 more. @@ -273,7 +275,9 @@ node_modules/lodash/debounce.js(85,43): error TS2532: Object is possibly 'undefi node_modules/lodash/debounce.js(86,30): error TS2532: Object is possibly 'undefined'. node_modules/lodash/debounce.js(111,23): error TS2532: Object is possibly 'undefined'. node_modules/lodash/debounce.js(125,65): error TS2532: Object is possibly 'undefined'. -node_modules/lodash/deburr.js(42,44): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. +node_modules/lodash/deburr.js(42,44): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type 'Function' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. node_modules/lodash/difference.js(29,52): error TS2345: Argument of type '(value: any) => boolean' is not assignable to parameter of type 'boolean | undefined'. Type '(value: any) => boolean' is not assignable to type 'true'. node_modules/lodash/differenceBy.js(40,52): error TS2345: Argument of type '(value: any) => boolean' is not assignable to parameter of type 'boolean | undefined'. @@ -287,7 +291,9 @@ node_modules/lodash/dropRight.js(13,10): error TS1003: Identifier expected. node_modules/lodash/dropRight.js(13,10): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. node_modules/lodash/dropRightWhile.js(41,48): error TS2554: Expected 0-1 arguments, but got 2. node_modules/lodash/dropWhile.js(41,48): error TS2554: Expected 0-1 arguments, but got 2. -node_modules/lodash/escape.js(39,39): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. +node_modules/lodash/escape.js(39,39): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type 'Function' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. node_modules/lodash/every.js(23,10): error TS1003: Identifier expected. node_modules/lodash/every.js(23,10): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. node_modules/lodash/every.js(53,51): error TS2554: Expected 0-1 arguments, but got 2. @@ -378,6 +384,8 @@ node_modules/lodash/nthArg.js(28,26): error TS2345: Argument of type 'number | u node_modules/lodash/omit.js(48,32): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. node_modules/lodash/orderBy.js(18,10): error TS1003: Identifier expected. node_modules/lodash/orderBy.js(18,10): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. +node_modules/lodash/org.js(8,22): error TS2307: Cannot find module 'moment'. +node_modules/lodash/org.js(9,19): error TS2307: Cannot find module 'ncp'. node_modules/lodash/parseInt.js(24,10): error TS1003: Identifier expected. node_modules/lodash/parseInt.js(24,10): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. node_modules/lodash/partial.js(48,9): error TS2339: Property 'placeholder' does not exist on type 'Function'. @@ -411,16 +419,16 @@ node_modules/lodash/takeRight.js(13,10): error TS1003: Identifier expected. node_modules/lodash/takeRight.js(13,10): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. node_modules/lodash/takeRightWhile.js(41,48): error TS2554: Expected 0-1 arguments, but got 2. node_modules/lodash/takeWhile.js(41,48): error TS2554: Expected 0-1 arguments, but got 2. -node_modules/lodash/template.js(65,10): error TS1003: Identifier expected. -node_modules/lodash/template.js(65,10): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. -node_modules/lodash/template.js(146,34): error TS2532: Object is possibly 'undefined'. -node_modules/lodash/template.js(153,21): error TS2532: Object is possibly 'undefined'. -node_modules/lodash/template.js(158,6): error TS2532: Object is possibly 'undefined'. -node_modules/lodash/template.js(161,6): error TS2532: Object is possibly 'undefined'. -node_modules/lodash/template.js(165,34): error TS2532: Object is possibly 'undefined'. -node_modules/lodash/template.js(171,15): error TS2532: Object is possibly 'undefined'. -node_modules/lodash/template.js(196,18): error TS2532: Object is possibly 'undefined'. -node_modules/lodash/template.js(225,21): error TS2345: Argument of type 'any[]' is not assignable to parameter of type 'string'. +node_modules/lodash/template.js(71,10): error TS1003: Identifier expected. +node_modules/lodash/template.js(71,10): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. +node_modules/lodash/template.js(152,34): error TS2532: Object is possibly 'undefined'. +node_modules/lodash/template.js(159,21): error TS2532: Object is possibly 'undefined'. +node_modules/lodash/template.js(164,6): error TS2532: Object is possibly 'undefined'. +node_modules/lodash/template.js(167,6): error TS2532: Object is possibly 'undefined'. +node_modules/lodash/template.js(176,9): error TS2532: Object is possibly 'undefined'. +node_modules/lodash/template.js(184,15): error TS2532: Object is possibly 'undefined'. +node_modules/lodash/template.js(211,62): error TS2532: Object is possibly 'undefined'. +node_modules/lodash/template.js(240,21): error TS2345: Argument of type 'any[]' is not assignable to parameter of type 'string'. node_modules/lodash/templateSettings.js(63,12): error TS2322: Type '{ 'escape': (string?: string | undefined) => string; }' is not assignable to type 'Function'. Object literal may only specify known properties, and ''escape'' does not exist in type 'Function'. node_modules/lodash/throttle.js(59,28): error TS2532: Object is possibly 'undefined'. @@ -445,7 +453,9 @@ node_modules/lodash/truncate.js(62,30): error TS2532: Object is possibly 'undefi node_modules/lodash/truncate.js(78,16): error TS2454: Variable 'strSymbols' is used before being assigned. node_modules/lodash/truncate.js(85,7): error TS2454: Variable 'strSymbols' is used before being assigned. node_modules/lodash/unary.js(19,10): error TS2554: Expected 3 arguments, but got 2. -node_modules/lodash/unescape.js(30,37): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. +node_modules/lodash/unescape.js(30,37): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type 'Function' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. node_modules/lodash/union.js(23,42): error TS2345: Argument of type '(value: any) => boolean' is not assignable to parameter of type 'boolean | undefined'. Type '(value: any) => boolean' is not assignable to type 'true'. node_modules/lodash/unionBy.js(36,42): error TS2345: Argument of type '(value: any) => boolean' is not assignable to parameter of type 'boolean | undefined'. diff --git a/tests/baselines/reference/user/mqtt.log b/tests/baselines/reference/user/mqtt.log new file mode 100644 index 00000000000..54141b16777 --- /dev/null +++ b/tests/baselines/reference/user/mqtt.log @@ -0,0 +1,8 @@ +Exit Code: 1 +Standard output: +../../../../built/local/lib.es2015.iterable.d.ts(41,6): error TS2300: Duplicate identifier 'IteratorResult'. +../../../../node_modules/@types/node/index.d.ts(77,11): error TS2300: Duplicate identifier 'IteratorResult'. + + + +Standard error: diff --git a/tests/baselines/reference/user/npm.log b/tests/baselines/reference/user/npm.log index d00bf5aac17..25f27b16669 100644 --- a/tests/baselines/reference/user/npm.log +++ b/tests/baselines/reference/user/npm.log @@ -171,9 +171,11 @@ node_modules/npm/lib/config/core.js(307,8): error TS2339: Property 'sources' doe node_modules/npm/lib/config/core.js(308,8): error TS2339: Property 'push' does not exist on type 'Conf'. node_modules/npm/lib/config/core.js(309,8): error TS2339: Property '_await' does not exist on type 'Conf'. node_modules/npm/lib/config/core.js(333,10): error TS2339: Property 'emit' does not exist on type 'Conf'. -node_modules/npm/lib/config/core.js(409,29): error TS2345: Argument of type '(orig: string, esc: any, name: any) => string | undefined' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. - Type 'string | undefined' is not assignable to type 'string'. - Type 'undefined' is not assignable to type 'string'. +node_modules/npm/lib/config/core.js(409,29): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '(orig: string, esc: any, name: any) => string | undefined' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. + Type 'string | undefined' is not assignable to type 'string'. + Type 'undefined' is not assignable to type 'string'. node_modules/npm/lib/config/defaults.js(20,52): error TS2345: Argument of type 'never[]' is not assignable to parameter of type '[any, ...any[]]'. Property '0' is missing in type 'never[]' but required in type '[any, ...any[]]'. node_modules/npm/lib/config/gentle-fs.js(16,11): error TS2339: Property 'prefix' does not exist on type 'typeof EventEmitter'. @@ -282,7 +284,11 @@ node_modules/npm/lib/doctor.js(90,24): error TS2339: Property 'config' does not node_modules/npm/lib/doctor.js(108,92): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/doctor/check-files-permission.js(11,14): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/doctor/check-files-permission.js(11,38): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/doctor/verify-cached-files.js(10,90): error TS2345: Argument of type '2' is not assignable to parameter of type '(string | number)[] | null | undefined'. +node_modules/npm/lib/doctor/verify-cached-files.js(10,90): error TS2769: No overload matches this call. + Overload 1 of 2, '(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string', gave the following error. + Argument of type '2' is not assignable to parameter of type '((this: any, key: string, value: any) => any) | undefined'. + Overload 2 of 2, '(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string', gave the following error. + Argument of type '2' is not assignable to parameter of type '(string | number)[] | null | undefined'. node_modules/npm/lib/edit.js(18,15): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/edit.js(27,28): error TS2339: Property 'dir' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/edit.js(32,11): error TS2339: Property 'commands' does not exist on type 'typeof EventEmitter'. @@ -353,8 +359,12 @@ node_modules/npm/lib/install.js(273,7): error TS2532: Object is possibly 'undefi node_modules/npm/lib/install.js(273,7): error TS2684: The 'this' context of type '((err: any, ...args: any[]) => any) | undefined' is not assignable to method's 'this' of type '(this: null, err?: any, ...args: any[]) => any'. Type 'undefined' is not assignable to type '(this: null, err?: any, ...args: any[]) => any'. node_modules/npm/lib/install.js(340,25): error TS2339: Property 'failing' does not exist on type 'Installer'. -node_modules/npm/lib/install.js(369,18): error TS2345: Argument of type '"time"' is not assignable to parameter of type 'Signals'. -node_modules/npm/lib/install.js(376,16): error TS2345: Argument of type '"timeEnd"' is not assignable to parameter of type 'Signals'. +node_modules/npm/lib/install.js(369,18): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '"time"' is not assignable to parameter of type 'Signals'. +node_modules/npm/lib/install.js(376,16): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '"timeEnd"' is not assignable to parameter of type 'Signals'. node_modules/npm/lib/install.js(519,40): error TS2339: Property 'globalPrefix' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/install.js(597,12): error TS2339: Property 'failing' does not exist on type 'Installer'. node_modules/npm/lib/install.js(614,12): error TS2339: Property 'failing' does not exist on type 'Installer'. @@ -388,8 +398,12 @@ node_modules/npm/lib/install/action/refresh-package-json.js(31,43): error TS2339 node_modules/npm/lib/install/action/remove.js(25,37): error TS2339: Property 'prefix' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/install/action/remove.js(25,51): error TS2339: Property 'prefix' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/install/actions.js(126,24): error TS2339: Property 'limit' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install/actions.js(168,16): error TS2345: Argument of type '"time"' is not assignable to parameter of type 'Signals'. -node_modules/npm/lib/install/actions.js(171,16): error TS2345: Argument of type '"timeEnd"' is not assignable to parameter of type 'Signals'. +node_modules/npm/lib/install/actions.js(168,16): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '"time"' is not assignable to parameter of type 'Signals'. +node_modules/npm/lib/install/actions.js(171,16): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '"timeEnd"' is not assignable to parameter of type 'Signals'. node_modules/npm/lib/install/and-add-parent-to-errors.js(9,10): error TS2339: Property 'parent' does not exist on type 'Error'. node_modules/npm/lib/install/audit.js(32,19): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/install/audit.js(89,17): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. @@ -521,7 +535,9 @@ node_modules/npm/lib/ls.js(538,12): error TS2339: Property 'config' does not exi node_modules/npm/lib/ls.js(544,56): error TS2339: Property 'globalDir' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/npm.js(5,13): error TS2551: Property 'echo' does not exist on type '{ Echo(s: any): void; StdErr: TextStreamWriter; StdOut: TextStreamWriter; Arguments: { length: number; Item(n: number): string; }; ScriptFullName: string; Quit(exitCode?: number | undefined): number; ... 12 more ...; Sleep(intTime: number): void; }'. Did you mean 'Echo'? node_modules/npm/lib/npm.js(12,13): error TS2551: Property 'quit' does not exist on type '{ Echo(s: any): void; StdErr: TextStreamWriter; StdOut: TextStreamWriter; Arguments: { length: number; Item(n: number): string; }; ScriptFullName: string; Quit(exitCode?: number | undefined): number; ... 12 more ...; Sleep(intTime: number): void; }'. Did you mean 'Quit'? -node_modules/npm/lib/npm.js(30,14): error TS2345: Argument of type '"log"' is not assignable to parameter of type 'Signals'. +node_modules/npm/lib/npm.js(30,14): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '"log"' is not assignable to parameter of type 'Signals'. node_modules/npm/lib/npm.js(58,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/npm.js(68,7): error TS2339: Property 'commands' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/npm.js(71,7): error TS2339: Property 'limit' does not exist on type 'typeof EventEmitter'. @@ -677,9 +693,13 @@ node_modules/npm/lib/run-script.js(35,22): error TS2339: Property 'localPrefix' node_modules/npm/lib/run-script.js(46,26): error TS2339: Property 'localPrefix' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/run-script.js(56,20): error TS2339: Property 'localPrefix' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/run-script.js(66,28): error TS2339: Property 'localPrefix' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/run-script.js(77,22): error TS2322: Type 'string' is not assignable to type 'never'. -node_modules/npm/lib/run-script.js(77,33): error TS2322: Type 'string' is not assignable to type 'never'. -node_modules/npm/lib/run-script.js(77,36): error TS2322: Type 'string' is not assignable to type 'never'. +node_modules/npm/lib/run-script.js(77,12): error TS2769: No overload matches this call. + Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Type 'string' is not assignable to type 'never'. + Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Type 'string' is not assignable to type 'never'. + Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Type 'string' is not assignable to type 'never'. node_modules/npm/lib/run-script.js(94,13): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/run-script.js(99,13): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/run-script.js(148,22): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. @@ -783,8 +803,12 @@ node_modules/npm/lib/utils/completion/installed-shallow.js(79,14): error TS2339: node_modules/npm/lib/utils/error-handler.js(12,21): error TS2339: Property 'rollbacks' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/error-handler.js(23,36): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/error-handler.js(29,16): error TS2339: Property 'version' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/utils/error-handler.js(33,12): error TS2345: Argument of type '"timing"' is not assignable to parameter of type 'Signals'. -node_modules/npm/lib/utils/error-handler.js(38,16): error TS2345: Argument of type '"timeEnd"' is not assignable to parameter of type 'Signals'. +node_modules/npm/lib/utils/error-handler.js(33,12): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '"timing"' is not assignable to parameter of type 'Signals'. +node_modules/npm/lib/utils/error-handler.js(38,16): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '"timeEnd"' is not assignable to parameter of type 'Signals'. node_modules/npm/lib/utils/error-handler.js(40,11): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/error-handler.js(40,32): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/error-handler.js(43,39): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. @@ -838,8 +862,12 @@ node_modules/npm/lib/utils/metrics.js(62,7): error TS2339: Property 'load' does node_modules/npm/lib/utils/metrics.js(64,9): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/metrics.js(65,9): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/output.js(6,30): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, ...any[]]'. -node_modules/npm/lib/utils/perf.js(9,12): error TS2345: Argument of type '"time"' is not assignable to parameter of type 'Signals'. -node_modules/npm/lib/utils/perf.js(10,12): error TS2345: Argument of type '"timeEnd"' is not assignable to parameter of type 'Signals'. +node_modules/npm/lib/utils/perf.js(9,12): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '"time"' is not assignable to parameter of type 'Signals'. +node_modules/npm/lib/utils/perf.js(10,12): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '"timeEnd"' is not assignable to parameter of type 'Signals'. node_modules/npm/lib/utils/read-local-package.js(7,11): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/read-local-package.js(9,29): error TS2339: Property 'prefix' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/spawn.js(26,8): error TS2339: Property 'file' does not exist on type 'Error'. @@ -852,7 +880,11 @@ node_modules/npm/lib/utils/spawn.js(45,10): error TS2339: Property 'stdout' does node_modules/npm/lib/utils/spawn.js(46,10): error TS2339: Property 'stderr' does not exist on type 'EventEmitter'. node_modules/npm/lib/utils/spawn.js(47,10): error TS2339: Property 'kill' does not exist on type 'EventEmitter'. node_modules/npm/lib/utils/temp-filename.js(6,29): error TS2339: Property 'tmp' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/utils/usage.js(8,21): error TS2345: Argument of type 'string' is not assignable to parameter of type 'ConcatArray'. +node_modules/npm/lib/utils/usage.js(8,21): error TS2769: No overload matches this call. + Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type 'string' is not assignable to parameter of type 'ConcatArray'. + Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type 'string' is not assignable to parameter of type 'ConcatArray'. node_modules/npm/lib/version.js(24,27): error TS2339: Property 'version' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/version.js(82,22): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/version.js(97,12): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. @@ -951,7 +983,11 @@ node_modules/npm/test/need-npm5-update/need-outdated/update-symlink.js(6,20): er node_modules/npm/test/need-npm5-update/need-outdated/update-symlink.js(8,22): error TS2307: Cannot find module '../common-tap.js'. node_modules/npm/test/need-npm5-update/outdated-depth-deep.js(3,20): error TS2307: Cannot find module 'tap'. node_modules/npm/test/need-npm5-update/outdated-depth-deep.js(5,18): error TS2307: Cannot find module 'npm-registry-mock'. -node_modules/npm/test/need-npm5-update/outdated-depth-deep.js(69,52): error TS2322: Type 'number' is not assignable to type 'string'. +node_modules/npm/test/need-npm5-update/outdated-depth-deep.js(69,52): error TS2769: No overload matches this call. + Overload 1 of 2, '(...items: ConcatArray[]): string[]', gave the following error. + Type 'number' is not assignable to type 'string'. + Overload 2 of 2, '(...items: (string | ConcatArray)[]): string[]', gave the following error. + Type 'number' is not assignable to type 'string'. node_modules/npm/test/need-npm5-update/outdated-depth-integer.js(2,20): error TS2307: Cannot find module 'tap'. node_modules/npm/test/need-npm5-update/outdated-depth-integer.js(5,18): error TS2307: Cannot find module 'npm-registry-mock'. node_modules/npm/test/need-npm5-update/outdated-depth-integer.js(55,9): error TS2339: Property 'load' does not exist on type 'typeof EventEmitter'. @@ -1483,9 +1519,15 @@ node_modules/npm/test/tap/prepublish-only.js(6,21): error TS2307: Cannot find mo node_modules/npm/test/tap/prepublish.js(3,20): error TS2307: Cannot find module 'tap'. node_modules/npm/test/tap/process-logger.js(2,22): error TS2307: Cannot find module 'tap'. node_modules/npm/test/tap/process-logger.js(7,61): error TS2554: Expected 1-3 arguments, but got 4. -node_modules/npm/test/tap/process-logger.js(8,37): error TS2345: Argument of type '"log"' is not assignable to parameter of type 'Signals'. -node_modules/npm/test/tap/process-logger.js(9,37): error TS2345: Argument of type '"log"' is not assignable to parameter of type 'Signals'. -node_modules/npm/test/tap/process-logger.js(10,37): error TS2345: Argument of type '"log"' is not assignable to parameter of type 'Signals'. +node_modules/npm/test/tap/process-logger.js(8,37): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '"log"' is not assignable to parameter of type 'Signals'. +node_modules/npm/test/tap/process-logger.js(9,37): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '"log"' is not assignable to parameter of type 'Signals'. +node_modules/npm/test/tap/process-logger.js(10,37): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '"log"' is not assignable to parameter of type 'Signals'. node_modules/npm/test/tap/progress-config.js(3,20): error TS2307: Cannot find module 'tap'. node_modules/npm/test/tap/progress-config.js(12,29): error TS2307: Cannot find module 'require-inject'. node_modules/npm/test/tap/prune-dev-dep-cycle.js(4,20): error TS2307: Cannot find module 'tap'. @@ -1515,8 +1557,12 @@ node_modules/npm/test/tap/publish-scoped.js(4,20): error TS2307: Cannot find mod node_modules/npm/test/tap/publish-scoped.js(8,18): error TS2307: Cannot find module 'npm-registry-mock'. node_modules/npm/test/tap/publish.js(8,33): error TS2307: Cannot find module 'npm-registry-mock'. node_modules/npm/test/tap/publish.js(11,22): error TS2307: Cannot find module 'tap'. -node_modules/npm/test/tap/publish.js(56,47): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string | RegExp'. -node_modules/npm/test/tap/publish.js(117,45): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string | RegExp'. +node_modules/npm/test/tap/publish.js(56,47): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type 'number' is not assignable to parameter of type 'string | RegExp'. +node_modules/npm/test/tap/publish.js(117,45): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type 'number' is not assignable to parameter of type 'string | RegExp'. node_modules/npm/test/tap/pwd-prefix.js(5,20): error TS2307: Cannot find module 'tap'. node_modules/npm/test/tap/referer.js(2,20): error TS2307: Cannot find module 'tap'. node_modules/npm/test/tap/repo.js(2,18): error TS2307: Cannot find module 'npm-registry-mock'. @@ -1527,10 +1573,26 @@ node_modules/npm/test/tap/retry-on-stale-cache.js(6,47): error TS2339: Property node_modules/npm/test/tap/retry-on-stale-cache.js(7,21): error TS2307: Cannot find module 'tacks'. node_modules/npm/test/tap/run-script-filter-private.js(6,20): error TS2307: Cannot find module 'tap'. node_modules/npm/test/tap/run-script.js(5,20): error TS2307: Cannot find module 'tap'. -node_modules/npm/test/tap/run-script.js(213,18): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. - Type 'undefined' is not assignable to type 'string'. -node_modules/npm/test/tap/run-script.js(256,18): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. - Type 'undefined' is not assignable to type 'string'. +node_modules/npm/test/tap/run-script.js(213,18): error TS2769: No overload matches this call. + Overload 1 of 3, '(pattern: string | RegExp, flags?: string | undefined): RegExp', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'string | RegExp'. + Type 'undefined' is not assignable to type 'string | RegExp'. + Overload 2 of 3, '(pattern: string | RegExp): RegExp', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'string | RegExp'. + Type 'undefined' is not assignable to type 'string | RegExp'. + Overload 3 of 3, '(pattern: string, flags?: string | undefined): RegExp', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'string'. + Type 'undefined' is not assignable to type 'string'. +node_modules/npm/test/tap/run-script.js(256,18): error TS2769: No overload matches this call. + Overload 1 of 3, '(pattern: string | RegExp, flags?: string | undefined): RegExp', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'string | RegExp'. + Type 'undefined' is not assignable to type 'string | RegExp'. + Overload 2 of 3, '(pattern: string | RegExp): RegExp', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'string | RegExp'. + Type 'undefined' is not assignable to type 'string | RegExp'. + Overload 3 of 3, '(pattern: string, flags?: string | undefined): RegExp', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'string'. + Type 'undefined' is not assignable to type 'string'. node_modules/npm/test/tap/save-optional.js(3,22): error TS2307: Cannot find module 'tap'. node_modules/npm/test/tap/save-optional.js(4,20): error TS2307: Cannot find module 'npm-registry-mock'. node_modules/npm/test/tap/save-optional.js(5,23): error TS2307: Cannot find module 'tacks'. diff --git a/tests/baselines/reference/user/npmlog.log b/tests/baselines/reference/user/npmlog.log index 3bd136ecd23..1e6284674e3 100644 --- a/tests/baselines/reference/user/npmlog.log +++ b/tests/baselines/reference/user/npmlog.log @@ -7,8 +7,13 @@ node_modules/npmlog/log.js(155,8): error TS2551: Property '_paused' does not exi node_modules/npmlog/log.js(194,37): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[any, ...any[]]'. Property '0' is missing in type 'any[]' but required in type '[any, ...any[]]'. node_modules/npmlog/log.js(218,12): error TS2551: Property '_paused' does not exist on type 'typeof EventEmitter'. Did you mean 'pause'? -node_modules/npmlog/log.js(271,16): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. - Type 'undefined' is not assignable to type 'string'. +node_modules/npmlog/log.js(271,16): error TS2769: No overload matches this call. + Overload 1 of 2, '(buffer: string | Uint8Array | Buffer, cb?: ((err?: Error | null | undefined) => void) | undefined): boolean', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'string | Uint8Array | Buffer'. + Type 'undefined' is not assignable to type 'string | Uint8Array | Buffer'. + Overload 2 of 2, '(str: string, encoding?: string | undefined, cb?: ((err?: Error | null | undefined) => void) | undefined): boolean', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'string'. + Type 'undefined' is not assignable to type 'string'. diff --git a/tests/baselines/reference/user/prettier.log b/tests/baselines/reference/user/prettier.log index 4bebd0414b1..e0c8a987cd3 100644 --- a/tests/baselines/reference/user/prettier.log +++ b/tests/baselines/reference/user/prettier.log @@ -1,5 +1,7 @@ Exit Code: 1 Standard output: +../../../../../built/local/lib.es2015.iterable.d.ts(41,6): error TS2300: Duplicate identifier 'IteratorResult'. +../../../../../node_modules/@types/node/index.d.ts(77,11): error TS2300: Duplicate identifier 'IteratorResult'. node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts(1,8): error TS1259: Module '"/prettier/prettier/node_modules/typescript/lib/typescript"' can only be default-imported using the 'esModuleInterop' flag src/cli/util.js(60,44): error TS2345: Argument of type 'null' is not assignable to parameter of type 'number | undefined'. src/cli/util.js(119,38): error TS2339: Property 'sync' does not exist on type '(...args: any[]) => any'. @@ -114,17 +116,36 @@ src/language-html/parser-html.js(161,14): error TS2339: Property 'tagDefinition' src/language-html/parser-html.js(194,29): error TS2345: Argument of type '{ type: any; value: any; raw: any; }' is not assignable to parameter of type 'Node'. Type '{ type: any; value: any; raw: any; }' is missing the following properties from type 'Node': sourceSpan, visit src/language-html/preprocess.js(28,19): error TS2554: Expected 0-1 arguments, but got 2. -src/language-html/printer-html.js(313,13): error TS2345: Argument of type '"" | ">" | "/>" | "}}" | "]>" | ">" | "[endif]-->" | "]>"' is not assignable to parameter of type 'ConcatArray'. - Type '""' is not assignable to type 'ConcatArray'. -src/language-html/printer-html.js(470,11): error TS2345: Argument of type '{ type: string; parts: any; }[]' is not assignable to parameter of type 'ConcatArray'. - Types of property 'slice' are incompatible. - Type '(start?: number | undefined, end?: number | undefined) => { type: string; parts: any; }[]' is not assignable to type '(start?: number | undefined, end?: number | undefined) => never[]'. - Type '{ type: string; parts: any; }[]' is not assignable to type 'never[]'. - Type '{ type: string; parts: any; }' is not assignable to type 'never'. -src/language-html/printer-html.js(491,11): error TS2345: Argument of type '"" | ">" | "/>" | "}}" | "]>" | ">" | "[endif]-->" | "]>"' is not assignable to parameter of type 'ConcatArray'. - Type '""' is not assignable to type 'ConcatArray'. -src/language-html/printer-html.js(514,11): error TS2345: Argument of type '"" | ">" | "/>" | "}}" | "]>" | ">" | "[endif]-->" | "]>"' is not assignable to parameter of type 'ConcatArray'. - Type '""' is not assignable to type 'ConcatArray'. +src/language-html/printer-html.js(313,13): error TS2769: No overload matches this call. + Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type '"" | ">" | "/>" | "}}" | "]>" | ">" | "[endif]-->" | "]>"' is not assignable to parameter of type 'ConcatArray'. + Type '""' is not assignable to type 'ConcatArray'. + Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type '"" | ">" | "/>" | "}}" | "]>" | ">" | "[endif]-->" | "]>"' is not assignable to parameter of type 'ConcatArray'. + Type '""' is not assignable to type 'ConcatArray'. +src/language-html/printer-html.js(470,11): error TS2769: No overload matches this call. + Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type '{ type: string; parts: any; }[]' is not assignable to parameter of type 'ConcatArray'. + Types of property 'slice' are incompatible. + Type '(start?: number | undefined, end?: number | undefined) => { type: string; parts: any; }[]' is not assignable to type '(start?: number | undefined, end?: number | undefined) => never[]'. + Type '{ type: string; parts: any; }[]' is not assignable to type 'never[]'. + Type '{ type: string; parts: any; }' is not assignable to type 'never'. + Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type '{ type: string; parts: any; }[]' is not assignable to parameter of type 'ConcatArray'. +src/language-html/printer-html.js(491,11): error TS2769: No overload matches this call. + Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type '"" | ">" | "/>" | "}}" | "]>" | ">" | "[endif]-->" | "]>"' is not assignable to parameter of type 'ConcatArray'. + Type '""' is not assignable to type 'ConcatArray'. + Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type '"" | ">" | "/>" | "}}" | "]>" | ">" | "[endif]-->" | "]>"' is not assignable to parameter of type 'ConcatArray'. + Type '""' is not assignable to type 'ConcatArray'. +src/language-html/printer-html.js(514,11): error TS2769: No overload matches this call. + Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type '"" | ">" | "/>" | "}}" | "]>" | ">" | "[endif]-->" | "]>"' is not assignable to parameter of type 'ConcatArray'. + Type '""' is not assignable to type 'ConcatArray'. + Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type '"" | ">" | "/>" | "}}" | "]>" | ">" | "[endif]-->" | "]>"' is not assignable to parameter of type 'ConcatArray'. + Type '""' is not assignable to type 'ConcatArray'. src/language-html/printer-html.js(637,55): error TS2554: Expected 0 arguments, but got 1. src/language-html/syntax-vue.js(14,11): error TS2339: Property 'left' does not exist on type '{ left: string; operator: any; right: any; } | undefined'. src/language-html/syntax-vue.js(14,17): error TS2339: Property 'operator' does not exist on type '{ left: string; operator: any; right: any; } | undefined'. @@ -155,17 +176,32 @@ src/language-js/printer-estree.js(262,36): error TS2304: Cannot find name 'Doc'. src/language-js/printer-estree.js(263,62): error TS2304: Cannot find name 'Doc'. src/language-js/printer-estree.js(270,12): error TS2304: Cannot find name 'FastPath'. src/language-js/printer-estree.js(271,12): error TS2304: Cannot find name 'Options'. -src/language-js/printer-estree.js(397,9): error TS2345: Argument of type '{ type: string; parts: any; } | { type: string; contents: any; n: any; }' is not assignable to parameter of type 'ConcatArray'. - Type '{ type: string; parts: any; }' is missing the following properties from type 'ConcatArray': length, join, slice -src/language-js/printer-estree.js(1470,28): error TS2345: Argument of type '{ type: string; parts: any; }' is not assignable to parameter of type 'string | { type: string; id: any; contents: any; break: boolean; expandedStates: any; } | ConcatArray'. - Type '{ type: string; parts: any; }' is missing the following properties from type '{ type: string; id: any; contents: any; break: boolean; expandedStates: any; }': id, contents, break, expandedStates +src/language-js/printer-estree.js(397,9): error TS2769: No overload matches this call. + Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type '{ type: string; parts: any; } | { type: string; contents: any; n: any; }' is not assignable to parameter of type 'ConcatArray'. + Type '{ type: string; parts: any; }' is missing the following properties from type 'ConcatArray': length, join, slice + Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type '{ type: string; parts: any; } | { type: string; contents: any; n: any; }' is not assignable to parameter of type 'ConcatArray'. + Type '{ type: string; parts: any; }' is not assignable to type 'ConcatArray'. +src/language-js/printer-estree.js(1470,28): error TS2769: No overload matches this call. + Overload 1 of 2, '(...items: ConcatArray[]): (string | { type: string; id: any; contents: any; break: boolean; expandedStates: any; })[]', gave the following error. + Argument of type '{ type: string; parts: any; }' is not assignable to parameter of type 'ConcatArray'. + Type '{ type: string; parts: any; }' is missing the following properties from type 'ConcatArray': length, join, slice + Overload 2 of 2, '(...items: (string | { type: string; id: any; contents: any; break: boolean; expandedStates: any; } | ConcatArray)[]): (string | { ...; })[]', gave the following error. + Argument of type '{ type: string; parts: any; }' is not assignable to parameter of type 'string | { type: string; id: any; contents: any; break: boolean; expandedStates: any; } | ConcatArray'. + Type '{ type: string; parts: any; }' is missing the following properties from type '{ type: string; id: any; contents: any; break: boolean; expandedStates: any; }': id, contents, break, expandedStates src/language-js/printer-estree.js(1890,20): error TS2345: Argument of type '" "' is not assignable to parameter of type '{ type: string; id: any; contents: any; break: boolean; expandedStates: any; }'. src/language-js/printer-estree.js(1892,20): error TS2345: Argument of type '{ type: string; parts: any; }' is not assignable to parameter of type '{ type: string; id: any; contents: any; break: boolean; expandedStates: any; }'. src/language-js/printer-estree.js(1894,18): error TS2345: Argument of type '"while ("' is not assignable to parameter of type '{ type: string; id: any; contents: any; break: boolean; expandedStates: any; }'. src/language-js/printer-estree.js(1903,9): error TS2345: Argument of type '")"' is not assignable to parameter of type '{ type: string; id: any; contents: any; break: boolean; expandedStates: any; }'. src/language-js/printer-estree.js(2426,28): error TS2345: Argument of type 'any' is not assignable to parameter of type 'never'. -src/language-js/printer-estree.js(3513,11): error TS2345: Argument of type 'never[] | { type: string; parts: any; }' is not assignable to parameter of type 'ConcatArray'. - Type '{ type: string; parts: any; }' is not assignable to type 'ConcatArray'. +src/language-js/printer-estree.js(3513,11): error TS2769: No overload matches this call. + Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type 'never[] | { type: string; parts: any; }' is not assignable to parameter of type 'ConcatArray'. + Type '{ type: string; parts: any; }' is not assignable to type 'ConcatArray'. + Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type 'never[] | { type: string; parts: any; }' is not assignable to parameter of type 'ConcatArray'. + Type '{ type: string; parts: any; }' is not assignable to type 'ConcatArray'. src/language-js/printer-estree.js(4031,23): error TS2532: Object is possibly 'undefined'. src/language-js/printer-estree.js(4032,24): error TS2532: Object is possibly 'undefined'. src/language-js/printer-estree.js(4360,5): error TS2345: Argument of type '"" | { type: string; parts: any; } | { type: string; contents: any; }' is not assignable to parameter of type 'string'. @@ -174,13 +210,17 @@ src/language-js/printer-estree.js(4364,16): error TS2345: Argument of type '{ ty src/language-js/printer-estree.js(4406,9): error TS2345: Argument of type '{ type: string; parts: any; }' is not assignable to parameter of type 'string'. src/language-js/printer-estree.js(4708,9): error TS2554: Expected 0-2 arguments, but got 3. src/language-js/printer-estree.js(5939,55): error TS2554: Expected 0-1 arguments, but got 2. -src/language-js/printer-estree.js(5975,7): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type '((childPath: any) => any) | ConcatArray<(childPath: any) => any>'. - Type '(string | number)[]' is not assignable to type 'ConcatArray<(childPath: any) => any>'. - Types of property 'slice' are incompatible. - Type '(start?: number | undefined, end?: number | undefined) => (string | number)[]' is not assignable to type '(start?: number | undefined, end?: number | undefined) => ((childPath: any) => any)[]'. - Type '(string | number)[]' is not assignable to type '((childPath: any) => any)[]'. - Type 'string | number' is not assignable to type '(childPath: any) => any'. - Type 'string' is not assignable to type '(childPath: any) => any'. +src/language-js/printer-estree.js(5975,7): error TS2769: No overload matches this call. + Overload 1 of 2, '(...items: ConcatArray<(childPath: any) => any>[]): ((childPath: any) => any)[]', gave the following error. + Argument of type '(string | number)[]' is not assignable to parameter of type 'ConcatArray<(childPath: any) => any>'. + Types of property 'slice' are incompatible. + Type '(start?: number | undefined, end?: number | undefined) => (string | number)[]' is not assignable to type '(start?: number | undefined, end?: number | undefined) => ((childPath: any) => any)[]'. + Type '(string | number)[]' is not assignable to type '((childPath: any) => any)[]'. + Type 'string | number' is not assignable to type '(childPath: any) => any'. + Type 'string' is not assignable to type '(childPath: any) => any'. + Overload 2 of 2, '(...items: (((childPath: any) => any) | ConcatArray<(childPath: any) => any>)[]): ((childPath: any) => any)[]', gave the following error. + Argument of type '(string | number)[]' is not assignable to parameter of type '((childPath: any) => any) | ConcatArray<(childPath: any) => any>'. + Type '(string | number)[]' is not assignable to type 'ConcatArray<(childPath: any) => any>'. src/language-markdown/index.js(8,26): error TS2307: Cannot find module 'linguist-languages/data/markdown'. src/language-markdown/index.js(20,5): error TS2345: Argument of type '{ override: { since: string; parsers: string[]; vscodeLanguageIds: string[]; }; }' is not assignable to parameter of type '{ extend: any; override: any; }'. Property 'extend' is missing in type '{ override: { since: string; parsers: string[]; vscodeLanguageIds: string[]; }; }' but required in type '{ extend: any; override: any; }'. @@ -192,8 +232,13 @@ src/language-markdown/utils.js(208,39): error TS2345: Argument of type 'any[]' i src/language-yaml/index.js(8,26): error TS2307: Cannot find module 'linguist-languages/data/yaml'. src/language-yaml/index.js(8,59): error TS2345: Argument of type '{ override: { since: string; parsers: string[]; vscodeLanguageIds: string[]; }; }' is not assignable to parameter of type '{ extend: any; override: any; }'. Property 'extend' is missing in type '{ override: { since: string; parsers: string[]; vscodeLanguageIds: string[]; }; }' but required in type '{ extend: any; override: any; }'. -src/language-yaml/printer-yaml.js(226,41): error TS2345: Argument of type '"" | { type: string; parts: any; }' is not assignable to parameter of type 'ConcatArray'. - Type '""' is not assignable to type 'ConcatArray'. +src/language-yaml/printer-yaml.js(226,41): error TS2769: No overload matches this call. + Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type '"" | { type: string; parts: any; }' is not assignable to parameter of type 'ConcatArray'. + Type '""' is not assignable to type 'ConcatArray'. + Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type '"" | { type: string; parts: any; }' is not assignable to parameter of type 'ConcatArray'. + Type '""' is not assignable to type 'ConcatArray'. src/main/core-options.js(51,43): error TS1005: '}' expected. src/main/core-options.js(63,5): error TS2322: Type '{ since: string; category: string; type: "int"; default: number; range: { start: number; end: number; step: number; }; description: any; cliCategory: string; }' is not assignable to type 'OptionInfo'. Object literal may only specify known properties, and 'cliCategory' does not exist in type 'OptionInfo'. @@ -241,8 +286,13 @@ src/main/options-normalizer.js(90,44): error TS2345: Argument of type '{ name: s Object literal may only specify known properties, and 'name' does not exist in type 'SchemaHandlers'. src/main/options-normalizer.js(99,11): error TS2345: Argument of type '{ name: any; sourceName: any; }' is not assignable to parameter of type 'SchemaHandlers'. Object literal may only specify known properties, and 'name' does not exist in type 'SchemaHandlers'. -src/main/options-normalizer.js(143,13): error TS2345: Argument of type 'string | never[]' is not assignable to parameter of type 'ConcatArray'. - Type 'string' is not assignable to type 'ConcatArray'. +src/main/options-normalizer.js(143,13): error TS2769: No overload matches this call. + Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type 'string | never[]' is not assignable to parameter of type 'ConcatArray'. + Type 'string' is not assignable to type 'ConcatArray'. + Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type 'string | never[]' is not assignable to parameter of type 'ConcatArray'. + Type 'string' is not assignable to type 'ConcatArray'. src/main/options-normalizer.js(198,51): error TS2559: Type '{ name: any; }' has no properties in common with type 'SchemaHandlers'. src/main/parser.js(21,44): error TS2345: Argument of type 'PropertyDescriptor | undefined' is not assignable to parameter of type 'PropertyDescriptor & ThisType'. Type 'undefined' is not assignable to type 'PropertyDescriptor & ThisType'. diff --git a/tests/baselines/reference/user/util.log b/tests/baselines/reference/user/util.log index 0236e8e452b..5ede8516f9d 100644 --- a/tests/baselines/reference/user/util.log +++ b/tests/baselines/reference/user/util.log @@ -1,9 +1,11 @@ Exit Code: 1 Standard output: node_modules/util/util.js(27,20): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/util/util.js(35,45): error TS2345: Argument of type '(x: string) => string | number' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. - Type 'string | number' is not assignable to type 'string'. - Type 'number' is not assignable to type 'string'. +node_modules/util/util.js(35,45): error TS2769: No overload matches this call. + The last overload gave the following error. + Argument of type '(x: string) => string | number' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. + Type 'string | number' is not assignable to type 'string'. + Type 'number' is not assignable to type 'string'. node_modules/util/util.js(55,20): error TS2555: Expected at least 2 arguments, but got 1. node_modules/util/util.js(73,15): error TS2339: Property 'noDeprecation' does not exist on type 'Process'. node_modules/util/util.js(80,19): error TS2339: Property 'throwDeprecation' does not exist on type 'Process'. From ab9e583e451e287847752e48a0037e40b77ba73d Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Wed, 10 Jul 2019 13:18:37 -0700 Subject: [PATCH 91/95] Remove "Did you forget to use await" for unary arithmetic expressions --- src/compiler/checker.ts | 8 ++++---- .../operationsAvailableOnPromisedType.errors.txt | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 221caf82321..ef2b51ed37a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -23713,9 +23713,9 @@ namespace ts { } } - function checkArithmeticOperandType(operand: Node, type: Type, diagnostic: DiagnosticMessage): boolean { + function checkArithmeticOperandType(operand: Node, type: Type, diagnostic: DiagnosticMessage, tryAwait = false): boolean { if (!isTypeAssignableTo(type, numberOrBigIntType)) { - const awaitedType = getAwaitedType(type); + const awaitedType = tryAwait && getAwaitedTypeOfPromise(type); errorAndMaybeSuggestAwait( operand, !!awaitedType && isTypeAssignableTo(awaitedType, numberOrBigIntType), @@ -24327,8 +24327,8 @@ namespace ts { } else { // otherwise just check each operand separately and report errors as normal - const leftOk = checkArithmeticOperandType(left, leftType, Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type); - const rightOk = checkArithmeticOperandType(right, rightType, Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type); + const leftOk = checkArithmeticOperandType(left, leftType, Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, /*tryAwait*/ true); + const rightOk = checkArithmeticOperandType(right, rightType, Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, /*tryAwait*/ true); let resultType: Type; // If both are any or unknown, allow operation; assume it will resolve to number if ((isTypeAssignableToKind(leftType, TypeFlags.AnyOrUnknown) && isTypeAssignableToKind(rightType, TypeFlags.AnyOrUnknown)) || diff --git a/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt b/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt index 0fc56b82c1d..23782741215 100644 --- a/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt +++ b/tests/baselines/reference/operationsAvailableOnPromisedType.errors.txt @@ -51,11 +51,9 @@ tests/cases/compiler/operationsAvailableOnPromisedType.ts(27,5): error TS2349: T b++; ~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. -!!! related TS2773 tests/cases/compiler/operationsAvailableOnPromisedType.ts:15:5: Did you forget to use 'await'? --b; ~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. -!!! related TS2773 tests/cases/compiler/operationsAvailableOnPromisedType.ts:16:7: Did you forget to use 'await'? a === b; ~~~~~~~ !!! error TS2367: This condition will always return 'false' since the types 'number' and 'Promise' have no overlap. From f41c9b2c200762f9fe49c7db2c00a4c6f3d13648 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Wed, 10 Jul 2019 13:34:58 -0700 Subject: [PATCH 92/95] Rename parameter --- src/compiler/checker.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ef2b51ed37a..b9c3d4c16ce 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -23713,9 +23713,9 @@ namespace ts { } } - function checkArithmeticOperandType(operand: Node, type: Type, diagnostic: DiagnosticMessage, tryAwait = false): boolean { + function checkArithmeticOperandType(operand: Node, type: Type, diagnostic: DiagnosticMessage, isAwaitValid = false): boolean { if (!isTypeAssignableTo(type, numberOrBigIntType)) { - const awaitedType = tryAwait && getAwaitedTypeOfPromise(type); + const awaitedType = isAwaitValid && getAwaitedTypeOfPromise(type); errorAndMaybeSuggestAwait( operand, !!awaitedType && isTypeAssignableTo(awaitedType, numberOrBigIntType), @@ -24327,8 +24327,8 @@ namespace ts { } else { // otherwise just check each operand separately and report errors as normal - const leftOk = checkArithmeticOperandType(left, leftType, Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, /*tryAwait*/ true); - const rightOk = checkArithmeticOperandType(right, rightType, Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, /*tryAwait*/ true); + const leftOk = checkArithmeticOperandType(left, leftType, Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, /*isAwaitValid*/ true); + const rightOk = checkArithmeticOperandType(right, rightType, Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, /*isAwaitValid*/ true); let resultType: Type; // If both are any or unknown, allow operation; assume it will resolve to number if ((isTypeAssignableToKind(leftType, TypeFlags.AnyOrUnknown) && isTypeAssignableToKind(rightType, TypeFlags.AnyOrUnknown)) || From 5289f2ede9b7a70f42b34768796da52c71d510e8 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 10 Jul 2019 16:36:50 -0700 Subject: [PATCH 93/95] Update DOM from TSJS-lib-generator (#32335) * Update DOM from TSJS-lib-generator 1. Update Navigator and other small updates. 2. Make ProgressEvent generic. 3. Make `window: Window & typeof globalThis`. 4. Add types: * CSS Overflow * CSS Masking * Web Authentication * WebGL 2 The big change is that `window` now includes globals in its type via `typeof globalThis`. This helps some codebases a lot, such as chrome-devtools-frontend. * Update baselines --- src/lib/dom.generated.d.ts | 3774 +++++++++++------ src/lib/dom.iterable.generated.d.ts | 111 +- src/lib/webworker.generated.d.ts | 1167 ++++- .../reference/arrowFunctionContexts.symbols | 8 +- .../reference/arrowFunctionContexts.types | 16 +- .../reference/asyncFunctionNoReturnType.types | 2 +- ...eddedStatementsReplacedWithSemicolon.types | 2 +- .../baselines/reference/enumErrors.errors.txt | 4 +- tests/baselines/reference/enumErrors.types | 4 +- .../excessPropertyCheckWithEmptyObject.types | 2 +- .../reference/fixSignatureCaching.errors.txt | 4 +- .../reference/fixSignatureCaching.symbols | 20 +- .../reference/fixSignatureCaching.types | 16 +- .../reference/functionOverloadErrors.types | 8 +- ...eWithCommonJSAssignmentDeclaration.symbols | 4 +- ...rgeWithCommonJSAssignmentDeclaration.types | 4 +- .../globalThisBlockscopedProperties.types | 2 +- .../reference/globalThisCapture.types | 8 +- .../globalThisPropertyAssignment.errors.txt | 4 +- .../globalThisPropertyAssignment.types | 2 +- .../globalThisVarDeclaration.errors.txt | 28 +- .../globalThisVarDeclaration.symbols | 16 + .../reference/globalThisVarDeclaration.types | 48 +- tests/baselines/reference/importMeta.symbols | 4 +- .../baselines/reference/importMetaES5.symbols | 4 +- .../incompleteDottedExpressionAtEOF.types | 2 +- .../intersectionsOfLargeUnions2.errors.txt | 2 +- .../reference/keyofAndIndexedAccess2.types | 8 +- .../moduleExportAliasUnknown.errors.txt | 4 +- .../reference/moduleExportAliasUnknown.types | 2 +- .../multiExtendsSplitInterfaces1.symbols | 4 +- .../multiExtendsSplitInterfaces1.types | 6 +- .../reference/objectFromEntries.symbols | 2 +- ...rNoASIOnCallAfterFunctionExpression1.types | 2 +- .../baselines/reference/topLevelLambda2.types | 6 +- .../baselines/reference/topLevelLambda3.types | 4 +- .../baselines/reference/topLevelLambda4.types | 8 +- ...entInferenceConstructSignatures.errors.txt | 4 +- ...ArgumentInferenceConstructSignatures.types | 18 +- ...rgumentInferenceWithConstraints.errors.txt | 4 +- ...typeArgumentInferenceWithConstraints.types | 18 +- .../typeFromPropertyAssignment8.symbols | 2 + .../typeFromPropertyAssignment8.types | 8 +- .../typeFromPropertyAssignment9.symbols | 8 + .../typeFromPropertyAssignment9.types | 22 +- 45 files changed, 3817 insertions(+), 1579 deletions(-) diff --git a/src/lib/dom.generated.d.ts b/src/lib/dom.generated.d.ts index e527838fc76..e284ae377c9 100644 --- a/src/lib/dom.generated.d.ts +++ b/src/lib/dom.generated.d.ts @@ -133,6 +133,34 @@ interface AudioWorkletNodeOptions extends AudioNodeOptions { processorOptions?: any; } +interface AuthenticationExtensionsClientInputs { + appid?: string; + authnSel?: AuthenticatorSelectionList; + exts?: boolean; + loc?: boolean; + txAuthGeneric?: txAuthGenericArg; + txAuthSimple?: string; + uvi?: boolean; + uvm?: boolean; +} + +interface AuthenticationExtensionsClientOutputs { + appid?: boolean; + authnSel?: boolean; + exts?: AuthenticationExtensionsSupported; + loc?: Coordinates; + txAuthGeneric?: ArrayBuffer; + txAuthSimple?: string; + uvi?: ArrayBuffer; + uvm?: UvmEntries; +} + +interface AuthenticatorSelectionCriteria { + authenticatorAttachment?: AuthenticatorAttachment; + requireResidentKey?: boolean; + userVerification?: UserVerificationRequirement; +} + interface BiquadFilterOptions extends AudioNodeOptions { Q?: number; detune?: number; @@ -158,6 +186,7 @@ interface CacheQueryOptions { interface CanvasRenderingContext2DSettings { alpha?: boolean; + desynchronized?: boolean; } interface ChannelMergerOptions extends AudioNodeOptions { @@ -251,11 +280,13 @@ interface ConvolverOptions extends AudioNodeOptions { } interface CredentialCreationOptions { + publicKey?: PublicKeyCredentialCreationOptions; signal?: AbortSignal; } interface CredentialRequestOptions { mediation?: CredentialMediationRequirement; + publicKey?: PublicKeyCredentialRequestOptions; signal?: AbortSignal; } @@ -549,6 +580,10 @@ interface IIRFilterOptions extends AudioNodeOptions { feedforward: number[]; } +interface ImageBitmapRenderingContextSettings { + alpha?: boolean; +} + interface ImageEncodeOptions { quality?: number; type?: string; @@ -700,7 +735,6 @@ interface MediaTrackCapabilities { resizeMode?: string[]; sampleRate?: ULongRange; sampleSize?: ULongRange; - volume?: DoubleRange; width?: ULongRange; } @@ -719,7 +753,6 @@ interface MediaTrackConstraintSet { resizeMode?: ConstrainDOMString; sampleRate?: ConstrainULong; sampleSize?: ConstrainULong; - volume?: ConstrainDouble; width?: ConstrainULong; } @@ -742,7 +775,6 @@ interface MediaTrackSettings { resizeMode?: string; sampleRate?: number; sampleSize?: number; - volume?: number; width?: number; } @@ -761,7 +793,6 @@ interface MediaTrackSupportedConstraints { resizeMode?: boolean; sampleRate?: boolean; sampleSize?: boolean; - volume?: boolean; width?: boolean; } @@ -1033,6 +1064,52 @@ interface PropertyIndexedKeyframes { [property: string]: string | string[] | number | null | (number | null)[] | undefined; } +interface PublicKeyCredentialCreationOptions { + attestation?: AttestationConveyancePreference; + authenticatorSelection?: AuthenticatorSelectionCriteria; + challenge: BufferSource; + excludeCredentials?: PublicKeyCredentialDescriptor[]; + extensions?: AuthenticationExtensionsClientInputs; + pubKeyCredParams: PublicKeyCredentialParameters[]; + rp: PublicKeyCredentialRpEntity; + timeout?: number; + user: PublicKeyCredentialUserEntity; +} + +interface PublicKeyCredentialDescriptor { + id: BufferSource; + transports?: AuthenticatorTransport[]; + type: PublicKeyCredentialType; +} + +interface PublicKeyCredentialEntity { + icon?: string; + name: string; +} + +interface PublicKeyCredentialParameters { + alg: COSEAlgorithmIdentifier; + type: PublicKeyCredentialType; +} + +interface PublicKeyCredentialRequestOptions { + allowCredentials?: PublicKeyCredentialDescriptor[]; + challenge: BufferSource; + extensions?: AuthenticationExtensionsClientInputs; + rpId?: string; + timeout?: number; + userVerification?: UserVerificationRequirement; +} + +interface PublicKeyCredentialRpEntity extends PublicKeyCredentialEntity { + id?: string; +} + +interface PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity { + displayName: string; + id: BufferSource; +} + interface PushPermissionDescriptor extends PermissionDescriptor { name: "push"; userVisibleOnly?: boolean; @@ -1761,6 +1838,11 @@ interface WorkletOptions { credentials?: RequestCredentials; } +interface txAuthGenericArg { + content: ArrayBuffer; + contentType: string; +} + interface EventListener { (evt: Event): void; } @@ -1974,7 +2056,7 @@ interface ApplicationCacheEventMap { "error": Event; "noupdate": Event; "obsolete": Event; - "progress": ProgressEvent; + "progress": ProgressEvent; "updateready": Event; } @@ -1992,7 +2074,7 @@ interface ApplicationCache extends EventTarget { /** @deprecated */ onobsolete: ((this: ApplicationCache, ev: Event) => any) | null; /** @deprecated */ - onprogress: ((this: ApplicationCache, ev: ProgressEvent) => any) | null; + onprogress: ((this: ApplicationCache, ev: ProgressEvent) => any) | null; /** @deprecated */ onupdateready: ((this: ApplicationCache, ev: Event) => any) | null; /** @deprecated */ @@ -2286,6 +2368,35 @@ declare var AudioWorkletNode: { new(context: BaseAudioContext, name: string, options?: AudioWorkletNodeOptions): AudioWorkletNode; }; +interface AuthenticatorAssertionResponse extends AuthenticatorResponse { + readonly authenticatorData: ArrayBuffer; + readonly signature: ArrayBuffer; + readonly userHandle: ArrayBuffer | null; +} + +declare var AuthenticatorAssertionResponse: { + prototype: AuthenticatorAssertionResponse; + new(): AuthenticatorAssertionResponse; +}; + +interface AuthenticatorAttestationResponse extends AuthenticatorResponse { + readonly attestationObject: ArrayBuffer; +} + +declare var AuthenticatorAttestationResponse: { + prototype: AuthenticatorAttestationResponse; + new(): AuthenticatorAttestationResponse; +}; + +interface AuthenticatorResponse { + readonly clientDataJSON: ArrayBuffer; +} + +declare var AuthenticatorResponse: { + prototype: AuthenticatorResponse; + new(): AuthenticatorResponse; +}; + interface BarProp { readonly visible: boolean; } @@ -2684,9 +2795,9 @@ interface CSSStyleDeclaration { captionSide: string | null; caretColor: string; clear: string | null; - clip: string | null; - clipPath: string | null; - clipRule: string | null; + clip: string; + clipPath: string; + clipRule: string; color: string | null; colorInterpolationFilters: string; columnCount: string; @@ -2793,8 +2904,13 @@ interface CSSStyleDeclaration { markerEnd: string | null; markerMid: string | null; markerStart: string | null; - mask: string | null; - maskImage: string | null; + mask: string; + maskComposite: string; + maskImage: string; + maskPosition: string; + maskRepeat: string; + maskSize: string; + maskType: string; maxHeight: string | null; maxWidth: string | null; minHeight: string | null; @@ -2856,11 +2972,11 @@ interface CSSStyleDeclaration { outlineOffset: string; outlineStyle: string; outlineWidth: string; - overflow: string | null; + overflow: string; overflowAnchor: string; overflowWrap: string; - overflowX: string | null; - overflowY: string | null; + overflowX: string; + overflowY: string; padding: string | null; paddingBottom: string | null; paddingLeft: string | null; @@ -3026,6 +3142,7 @@ interface CSSStyleDeclaration { webkitFlexWrap: string; /** @deprecated */ webkitJustifyContent: string; + webkitLineClamp: string; /** @deprecated */ webkitMask: string; /** @deprecated */ @@ -4327,59 +4444,59 @@ interface DocumentEventMap extends GlobalEventHandlersEventMap, DocumentAndEleme "fullscreenerror": Event; "pointerlockchange": Event; "pointerlockerror": Event; - "readystatechange": ProgressEvent; + "readystatechange": ProgressEvent; "visibilitychange": Event; } /** Any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree. */ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, ParentNode, XPathEvaluatorBase, GlobalEventHandlers, DocumentAndElementEventHandlers { - /** - * Sets or gets the URL for the current document. + /** + * Sets or gets the URL for the current document. */ readonly URL: string; - /** - * Gets the object that has the focus when the parent document has focus. + /** + * Gets the object that has the focus when the parent document has focus. */ readonly activeElement: Element | null; - /** - * Sets or gets the color of all active links in the document. + /** + * Sets or gets the color of all active links in the document. */ /** @deprecated */ alinkColor: string; - /** - * Returns a reference to the collection of elements contained by the object. + /** + * Returns a reference to the collection of elements contained by the object. */ /** @deprecated */ readonly all: HTMLAllCollection; - /** - * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. + /** + * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. */ /** @deprecated */ readonly anchors: HTMLCollectionOf; - /** - * Retrieves a collection of all applet objects in the document. + /** + * Retrieves a collection of all applet objects in the document. */ /** @deprecated */ readonly applets: HTMLCollectionOf; - /** - * Deprecated. Sets or retrieves a value that indicates the background color behind the object. + /** + * Deprecated. Sets or retrieves a value that indicates the background color behind the object. */ /** @deprecated */ bgColor: string; - /** - * Specifies the beginning and end of the document body. + /** + * Specifies the beginning and end of the document body. */ body: HTMLElement; /** * Returns document's encoding. */ readonly characterSet: string; - /** - * Gets or sets the character set used to encode the object. + /** + * Gets or sets the character set used to encode the object. */ readonly charset: string; - /** - * Gets a value that indicates whether standards-compliant mode is switched on for the object. + /** + * Gets a value that indicates whether standards-compliant mode is switched on for the object. */ readonly compatMode: string; /** @@ -4401,41 +4518,41 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par */ readonly currentScript: HTMLOrSVGScriptElement | null; readonly defaultView: WindowProxy | null; - /** - * Sets or gets a value that indicates whether the document can be edited. + /** + * Sets or gets a value that indicates whether the document can be edited. */ designMode: string; - /** - * Sets or retrieves a value that indicates the reading order of the object. + /** + * Sets or retrieves a value that indicates the reading order of the object. */ dir: string; - /** - * Gets an object representing the document type declaration associated with the current document. + /** + * Gets an object representing the document type declaration associated with the current document. */ readonly doctype: DocumentType | null; - /** - * Gets a reference to the root node of the document. + /** + * Gets a reference to the root node of the document. */ readonly documentElement: HTMLElement; /** * Returns document's URL. */ readonly documentURI: string; - /** - * Sets or gets the security domain of the document. + /** + * Sets or gets the security domain of the document. */ domain: string; - /** - * Retrieves a collection of all embed objects in the document. + /** + * Retrieves a collection of all embed objects in the document. */ readonly embeds: HTMLCollectionOf; - /** - * Sets or gets the foreground (text) color of the document. + /** + * Sets or gets the foreground (text) color of the document. */ /** @deprecated */ fgColor: string; - /** - * Retrieves a collection, in source order, of all form objects in the document. + /** + * Retrieves a collection, in source order, of all form objects in the document. */ readonly forms: HTMLCollectionOf; /** @deprecated */ @@ -4449,44 +4566,44 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par */ readonly head: HTMLHeadElement; readonly hidden: boolean; - /** - * Retrieves a collection, in source order, of img objects in the document. + /** + * Retrieves a collection, in source order, of img objects in the document. */ readonly images: HTMLCollectionOf; - /** - * Gets the implementation object of the current document. + /** + * Gets the implementation object of the current document. */ readonly implementation: DOMImplementation; - /** - * Returns the character encoding used to create the webpage that is loaded into the document object. + /** + * Returns the character encoding used to create the webpage that is loaded into the document object. */ readonly inputEncoding: string; - /** - * Gets the date that the page was last modified, if the page supplies one. + /** + * Gets the date that the page was last modified, if the page supplies one. */ readonly lastModified: string; - /** - * Sets or gets the color of the document links. + /** + * Sets or gets the color of the document links. */ /** @deprecated */ linkColor: string; - /** - * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + /** + * Retrieves a collection of all a objects that specify the href property and all area objects in the document. */ readonly links: HTMLCollectionOf; - /** - * Contains information about the current URL. + /** + * Contains information about the current URL. */ location: Location; onfullscreenchange: ((this: Document, ev: Event) => any) | null; onfullscreenerror: ((this: Document, ev: Event) => any) | null; onpointerlockchange: ((this: Document, ev: Event) => any) | null; onpointerlockerror: ((this: Document, ev: Event) => any) | null; - /** - * Fires when the state of the object has changed. - * @param ev The event + /** + * Fires when the state of the object has changed. + * @param ev The event */ - onreadystatechange: ((this: Document, ev: ProgressEvent) => any) | null; + onreadystatechange: ((this: Document, ev: ProgressEvent) => any) | null; onvisibilitychange: ((this: Document, ev: Event) => any) | null; /** * Returns document's origin. @@ -4496,27 +4613,27 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par * Return an HTMLCollection of the embed elements in the Document. */ readonly plugins: HTMLCollectionOf; - /** - * Retrieves a value that indicates the current state of the object. + /** + * Retrieves a value that indicates the current state of the object. */ readonly readyState: DocumentReadyState; - /** - * Gets the URL of the location that referred the user to the current page. + /** + * Gets the URL of the location that referred the user to the current page. */ readonly referrer: string; - /** - * Retrieves a collection of all script objects in the document. + /** + * Retrieves a collection of all script objects in the document. */ readonly scripts: HTMLCollectionOf; readonly scrollingElement: Element | null; readonly timeline: DocumentTimeline; - /** - * Contains the title of the document. + /** + * Contains the title of the document. */ title: string; readonly visibilityState: VisibilityState; - /** - * Sets or gets the color of the links that the user has visited. + /** + * Sets or gets the color of the links that the user has visited. */ /** @deprecated */ vlinkColor: string; @@ -4533,13 +4650,13 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par caretRangeFromPoint(x: number, y: number): Range; /** @deprecated */ clear(): void; - /** - * Closes an output stream and forces the sent data to display. + /** + * Closes an output stream and forces the sent data to display. */ close(): void; - /** - * Creates an attribute object with a specified name. - * @param name String that sets the attribute object's name. + /** + * Creates an attribute object with a specified name. + * @param name String that sets the attribute object's name. */ createAttribute(localName: string): Attr; createAttributeNS(namespace: string | null, qualifiedName: string): Attr; @@ -4547,18 +4664,18 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par * Returns a CDATASection node whose data is data. */ createCDATASection(data: string): CDATASection; - /** - * Creates a comment object with the specified data. - * @param data Sets the comment object's data. + /** + * Creates a comment object with the specified data. + * @param data Sets the comment object's data. */ createComment(data: string): Comment; - /** - * Creates a new document. + /** + * Creates a new document. */ createDocumentFragment(): DocumentFragment; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. + /** + * Creates an instance of the element for the specified tag. + * @param tagName The name of an element. */ createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; /** @deprecated */ @@ -4599,7 +4716,6 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par createEvent(eventInterface: "ErrorEvent"): ErrorEvent; createEvent(eventInterface: "Event"): Event; createEvent(eventInterface: "Events"): Event; - createEvent(eventInterface: "FileReaderProgressEvent"): FileReaderProgressEvent; createEvent(eventInterface: "FocusEvent"): FocusEvent; createEvent(eventInterface: "FocusNavigationEvent"): FocusNavigationEvent; createEvent(eventInterface: "GamepadEvent"): GamepadEvent; @@ -4664,49 +4780,49 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent; createEvent(eventInterface: "WheelEvent"): WheelEvent; createEvent(eventInterface: string): Event; - /** - * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list - * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + /** + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list + * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. */ createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter | null): NodeIterator; /** * Returns a ProcessingInstruction node whose target is target and data is data. If target does not match the Name production an "InvalidCharacterError" DOMException will be thrown. If data contains "?>" an "InvalidCharacterError" DOMException will be thrown. */ createProcessingInstruction(target: string, data: string): ProcessingInstruction; - /** - * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. + /** + * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. */ createRange(): Range; - /** - * Creates a text string from the specified value. - * @param data String that specifies the nodeValue property of the text node. + /** + * Creates a text string from the specified value. + * @param data String that specifies the nodeValue property of the text node. */ createTextNode(data: string): Text; - /** - * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. - * @param filter A custom NodeFilter function to use. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + /** + * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. + * @param filter A custom NodeFilter function to use. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. */ createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker; /** @deprecated */ createTreeWalker(root: Node, whatToShow: number, filter: NodeFilter | null, entityReferenceExpansion?: boolean): TreeWalker; - /** - * Returns the element for the specified x coordinate and the specified y coordinate. - * @param x The x-offset - * @param y The y-offset + /** + * Returns the element for the specified x coordinate and the specified y coordinate. + * @param x The x-offset + * @param y The y-offset */ elementFromPoint(x: number, y: number): Element | null; elementsFromPoint(x: number, y: number): Element[]; - /** - * Executes a command on the current document, current selection, or the given range. - * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. - * @param showUI Display the user interface, defaults to false. - * @param value Value to assign. + /** + * Executes a command on the current document, current selection, or the given range. + * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. + * @param showUI Display the user interface, defaults to false. + * @param value Value to assign. */ execCommand(commandId: string, showUI?: boolean, value?: string): boolean; /** @@ -4715,23 +4831,23 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par exitFullscreen(): Promise; exitPointerLock(): void; getAnimations(): Animation[]; - /** - * Returns a reference to the first object with the specified value of the ID or NAME attribute. - * @param elementId String that specifies the ID value. Case-insensitive. + /** + * Returns a reference to the first object with the specified value of the ID or NAME attribute. + * @param elementId String that specifies the ID value. Case-insensitive. */ getElementById(elementId: string): HTMLElement | null; /** * Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes. */ getElementsByClassName(classNames: string): HTMLCollectionOf; - /** - * Gets a collection of objects based on the value of the NAME or ID attribute. - * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. + /** + * Gets a collection of objects based on the value of the NAME or ID attribute. + * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. */ getElementsByName(elementName: string): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. + /** + * Retrieves a collection of objects based on the specified element name. + * @param name Specifies the name of an element. */ getElementsByTagName(qualifiedName: K): HTMLCollectionOf; getElementsByTagName(qualifiedName: K): HTMLCollectionOf; @@ -4748,12 +4864,12 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; - /** - * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. + /** + * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. */ getSelection(): Selection | null; - /** - * Gets a value indicating whether the object currently has focus. + /** + * Gets a value indicating whether the object currently has focus. */ hasFocus(): boolean; /** @@ -4762,49 +4878,49 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par * If node is a document or a shadow root, throws a "NotSupportedError" DOMException. */ importNode(importedNode: T, deep: boolean): T; - /** - * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. - * @param url Specifies a MIME type for the document. - * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. - * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. - * @param replace Specifies whether the existing entry for the document is replaced in the history list. + /** + * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. + * @param url Specifies a MIME type for the document. + * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. + * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. + * @param replace Specifies whether the existing entry for the document is replaced in the history list. */ open(url?: string, name?: string, features?: string, replace?: boolean): Document; - /** - * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. - * @param commandId Specifies a command identifier. + /** + * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. + * @param commandId Specifies a command identifier. */ queryCommandEnabled(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. - * @param commandId String that specifies a command identifier. + /** + * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. + * @param commandId String that specifies a command identifier. */ queryCommandIndeterm(commandId: string): boolean; - /** - * Returns a Boolean value that indicates the current state of the command. - * @param commandId String that specifies a command identifier. + /** + * Returns a Boolean value that indicates the current state of the command. + * @param commandId String that specifies a command identifier. */ queryCommandState(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the current command is supported on the current range. - * @param commandId Specifies a command identifier. + /** + * Returns a Boolean value that indicates whether the current command is supported on the current range. + * @param commandId Specifies a command identifier. */ queryCommandSupported(commandId: string): boolean; - /** - * Returns the current value of the document, range, or current selection for the given command. - * @param commandId String that specifies a command identifier. + /** + * Returns the current value of the document, range, or current selection for the given command. + * @param commandId String that specifies a command identifier. */ queryCommandValue(commandId: string): string; /** @deprecated */ releaseEvents(): void; - /** - * Writes one or more HTML expressions to a document in the specified window. - * @param content Specifies the text and HTML tags to write. + /** + * Writes one or more HTML expressions to a document in the specified window. + * @param content Specifies the text and HTML tags to write. */ write(...text: string[]): void; - /** - * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. - * @param content The text and HTML tags to write. + /** + * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. + * @param content The text and HTML tags to write. */ writeln(...text: string[]): void; addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; @@ -4850,7 +4966,6 @@ interface DocumentEvent { createEvent(eventInterface: "ErrorEvent"): ErrorEvent; createEvent(eventInterface: "Event"): Event; createEvent(eventInterface: "Events"): Event; - createEvent(eventInterface: "FileReaderProgressEvent"): FileReaderProgressEvent; createEvent(eventInterface: "FocusEvent"): FocusEvent; createEvent(eventInterface: "FocusNavigationEvent"): FocusNavigationEvent; createEvent(eventInterface: "GamepadEvent"): GamepadEvent; @@ -4934,8 +5049,8 @@ interface DocumentOrShadowRoot { */ readonly fullscreenElement: Element | null; readonly pointerLockElement: Element | null; - /** - * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. + /** + * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. */ readonly styleSheets: StyleSheetList; caretPositionFromPoint(x: number, y: number): CaretPosition | null; @@ -5256,7 +5371,7 @@ interface Event { */ readonly type: string; /** - * Returns the item objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget. + * Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget. */ composedPath(): EventTarget[]; initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void; @@ -5418,23 +5533,23 @@ declare var FileList: { }; interface FileReaderEventMap { - "abort": FileReaderProgressEvent; - "error": FileReaderProgressEvent; - "load": FileReaderProgressEvent; - "loadend": FileReaderProgressEvent; - "loadstart": FileReaderProgressEvent; - "progress": FileReaderProgressEvent; + "abort": ProgressEvent; + "error": ProgressEvent; + "load": ProgressEvent; + "loadend": ProgressEvent; + "loadstart": ProgressEvent; + "progress": ProgressEvent; } /** Lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read. */ interface FileReader extends EventTarget { readonly error: DOMException | null; - onabort: ((this: FileReader, ev: FileReaderProgressEvent) => any) | null; - onerror: ((this: FileReader, ev: FileReaderProgressEvent) => any) | null; - onload: ((this: FileReader, ev: FileReaderProgressEvent) => any) | null; - onloadend: ((this: FileReader, ev: FileReaderProgressEvent) => any) | null; - onloadstart: ((this: FileReader, ev: FileReaderProgressEvent) => any) | null; - onprogress: ((this: FileReader, ev: FileReaderProgressEvent) => any) | null; + onabort: ((this: FileReader, ev: ProgressEvent) => any) | null; + onerror: ((this: FileReader, ev: ProgressEvent) => any) | null; + onload: ((this: FileReader, ev: ProgressEvent) => any) | null; + onloadend: ((this: FileReader, ev: ProgressEvent) => any) | null; + onloadstart: ((this: FileReader, ev: ProgressEvent) => any) | null; + onprogress: ((this: FileReader, ev: ProgressEvent) => any) | null; readonly readyState: number; readonly result: string | ArrayBuffer | null; abort(): void; @@ -5459,10 +5574,6 @@ declare var FileReader: { readonly LOADING: number; }; -interface FileReaderProgressEvent extends ProgressEvent { - readonly target: FileReader | null; -} - /** Focus-related events like focus, blur, focusin, or focusout. */ interface FocusEvent extends UIEvent { readonly relatedTarget: EventTarget | null; @@ -5703,9 +5814,9 @@ interface GlobalEventHandlersEventMap { } interface GlobalEventHandlers { - /** - * Fires when the user aborts the download. - * @param ev The event. + /** + * Fires when the user aborts the download. + * @param ev The event. */ onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; @@ -5713,177 +5824,177 @@ interface GlobalEventHandlers { onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - /** - * Fires when the object loses the input focus. - * @param ev The focus event. + /** + * Fires when the object loses the input focus. + * @param ev The focus event. */ onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null; oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when playback is possible, but would require further buffering. - * @param ev The event. + /** + * Occurs when playback is possible, but would require further buffering. + * @param ev The event. */ oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null; oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Fires when the contents of the object or selection have changed. - * @param ev The event. + /** + * Fires when the contents of the object or selection have changed. + * @param ev The event. */ onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Fires when the user clicks the left mouse button on the object - * @param ev The mouse event. + /** + * Fires when the user clicks the left mouse button on the object + * @param ev The mouse event. */ onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Fires when the user clicks the right mouse button in the client area, opening the context menu. - * @param ev The mouse event. + /** + * Fires when the user clicks the right mouse button in the client area, opening the context menu. + * @param ev The mouse event. */ oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Fires when the user double-clicks the object. - * @param ev The mouse event. + /** + * Fires when the user double-clicks the object. + * @param ev The mouse event. */ ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - /** - * Fires on the source object continuously during a drag operation. - * @param ev The event. + /** + * Fires on the source object continuously during a drag operation. + * @param ev The event. */ ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; - /** - * Fires on the source object when the user releases the mouse at the close of a drag operation. - * @param ev The event. + /** + * Fires on the source object when the user releases the mouse at the close of a drag operation. + * @param ev The event. */ ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; - /** - * Fires on the target element when the user drags the object to a valid drop target. - * @param ev The drag event. + /** + * Fires on the target element when the user drags the object to a valid drop target. + * @param ev The drag event. */ ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; ondragexit: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. - * @param ev The drag event. + /** + * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. + * @param ev The drag event. */ ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; - /** - * Fires on the target element continuously while the user drags the object over a valid drop target. - * @param ev The event. + /** + * Fires on the target element continuously while the user drags the object over a valid drop target. + * @param ev The event. */ ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; - /** - * Fires on the source object when the user starts to drag a text selection or selected object. - * @param ev The event. + /** + * Fires on the source object when the user starts to drag a text selection or selected object. + * @param ev The event. */ ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; - /** - * Occurs when the duration attribute is updated. - * @param ev The event. + /** + * Occurs when the duration attribute is updated. + * @param ev The event. */ ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when the media element is reset to its initial state. - * @param ev The event. + /** + * Occurs when the media element is reset to its initial state. + * @param ev The event. */ onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when the end of playback is reached. - * @param ev The event + /** + * Occurs when the end of playback is reached. + * @param ev The event */ onended: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Fires when an error occurs during object loading. - * @param ev The event. + /** + * Fires when an error occurs during object loading. + * @param ev The event. */ onerror: OnErrorEventHandler; - /** - * Fires when the object receives focus. - * @param ev The event. + /** + * Fires when the object receives focus. + * @param ev The event. */ onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null; ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null; oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Fires when the user presses a key. - * @param ev The keyboard event + /** + * Fires when the user presses a key. + * @param ev The keyboard event */ onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; - /** - * Fires when the user presses an alphanumeric key. - * @param ev The event. + /** + * Fires when the user presses an alphanumeric key. + * @param ev The event. */ onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; - /** - * Fires when the user releases a key. - * @param ev The keyboard event + /** + * Fires when the user releases a key. + * @param ev The keyboard event */ onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; - /** - * Fires immediately after the browser loads the object. - * @param ev The event. + /** + * Fires immediately after the browser loads the object. + * @param ev The event. */ onload: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when media data is loaded at the current playback position. - * @param ev The event. + /** + * Occurs when media data is loaded at the current playback position. + * @param ev The event. */ onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when the duration and dimensions of the media have been determined. - * @param ev The event. + /** + * Occurs when the duration and dimensions of the media have been determined. + * @param ev The event. */ onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null; onloadend: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null; - /** - * Occurs when Internet Explorer begins looking for media data. - * @param ev The event. + /** + * Occurs when Internet Explorer begins looking for media data. + * @param ev The event. */ onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; - /** - * Fires when the user clicks the object with either mouse button. - * @param ev The mouse event. + /** + * Fires when the user clicks the object with either mouse button. + * @param ev The mouse event. */ onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - /** - * Fires when the user moves the mouse over the object. - * @param ev The mouse event. + /** + * Fires when the user moves the mouse over the object. + * @param ev The mouse event. */ onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - /** - * Fires when the user moves the mouse pointer outside the boundaries of the object. - * @param ev The mouse event. + /** + * Fires when the user moves the mouse pointer outside the boundaries of the object. + * @param ev The mouse event. */ onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - /** - * Fires when the user moves the mouse pointer into the object. - * @param ev The mouse event. + /** + * Fires when the user moves the mouse pointer into the object. + * @param ev The mouse event. */ onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - /** - * Fires when the user releases a mouse button while the mouse is over the object. - * @param ev The mouse event. + /** + * Fires when the user releases a mouse button while the mouse is over the object. + * @param ev The mouse event. */ onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - /** - * Occurs when playback is paused. - * @param ev The event. + /** + * Occurs when playback is paused. + * @param ev The event. */ onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when the play method is requested. - * @param ev The event. + /** + * Occurs when the play method is requested. + * @param ev The event. */ onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when the audio or video has started playing. - * @param ev The event. + /** + * Occurs when the audio or video has started playing. + * @param ev The event. */ onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null; onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; @@ -5894,59 +6005,59 @@ interface GlobalEventHandlers { onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; - /** - * Occurs to indicate progress while downloading media data. - * @param ev The event. + /** + * Occurs to indicate progress while downloading media data. + * @param ev The event. */ onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null; - /** - * Occurs when the playback rate is increased or decreased. - * @param ev The event. + /** + * Occurs when the playback rate is increased or decreased. + * @param ev The event. */ onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Fires when the user resets a form. - * @param ev The event. + /** + * Fires when the user resets a form. + * @param ev The event. */ onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null; onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; - /** - * Fires when the user repositions the scroll box in the scroll bar on the object. - * @param ev The event. + /** + * Fires when the user repositions the scroll box in the scroll bar on the object. + * @param ev The event. */ onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null; onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null; - /** - * Occurs when the seek operation ends. - * @param ev The event. + /** + * Occurs when the seek operation ends. + * @param ev The event. */ onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when the current playback position is moved. - * @param ev The event. + /** + * Occurs when the current playback position is moved. + * @param ev The event. */ onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Fires when the current selection changes. - * @param ev The event. + /** + * Fires when the current selection changes. + * @param ev The event. */ onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null; onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when the download has stopped. - * @param ev The event. + /** + * Occurs when the download has stopped. + * @param ev The event. */ onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null; onsubmit: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs if the load operation has been intentionally halted. - * @param ev The event. + /** + * Occurs if the load operation has been intentionally halted. + * @param ev The event. */ onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs to indicate the current playback position. - * @param ev The event. + /** + * Occurs to indicate the current playback position. + * @param ev The event. */ ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null; ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null; @@ -5958,14 +6069,14 @@ interface GlobalEventHandlers { ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; - /** - * Occurs when the volume is changed, or playback is muted or unmuted. - * @param ev The event. + /** + * Occurs when the volume is changed, or playback is muted or unmuted. + * @param ev The event. */ onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when playback stops because the next frame of a video resource is not available. - * @param ev The event. + /** + * Occurs when playback stops because the next frame of a video resource is not available. + * @param ev The event. */ onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null; onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null; @@ -6002,49 +6113,49 @@ declare var HTMLAllCollection: { /** Hyperlink elements and provides special properties and methods (beyond those of the regular HTMLElement object interface that they inherit from) for manipulating the layout and presentation of such elements. */ interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils { - /** - * Sets or retrieves the character set used to encode the object. + /** + * Sets or retrieves the character set used to encode the object. */ /** @deprecated */ charset: string; - /** - * Sets or retrieves the coordinates of the object. + /** + * Sets or retrieves the coordinates of the object. */ /** @deprecated */ coords: string; download: string; - /** - * Sets or retrieves the language code of the object. + /** + * Sets or retrieves the language code of the object. */ hreflang: string; - /** - * Sets or retrieves the shape of the object. + /** + * Sets or retrieves the shape of the object. */ /** @deprecated */ name: string; ping: string; referrerPolicy: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. + /** + * Sets or retrieves the relationship between the object and the destination of the link. */ rel: string; readonly relList: DOMTokenList; - /** - * Sets or retrieves the relationship between the object and the destination of the link. + /** + * Sets or retrieves the relationship between the object and the destination of the link. */ /** @deprecated */ rev: string; - /** - * Sets or retrieves the shape of the object. + /** + * Sets or retrieves the shape of the object. */ /** @deprecated */ shape: string; - /** - * Sets or retrieves the window or frame at which to target content. + /** + * Sets or retrieves the window or frame at which to target content. */ target: string; - /** - * Retrieves or sets the text of the object as a string. + /** + * Retrieves or sets the text of the object as a string. */ text: string; type: string; @@ -6062,33 +6173,33 @@ declare var HTMLAnchorElement: { interface HTMLAppletElement extends HTMLElement { /** @deprecated */ align: string; - /** - * Sets or retrieves a text alternative to the graphic. + /** + * Sets or retrieves a text alternative to the graphic. */ /** @deprecated */ alt: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. */ /** @deprecated */ archive: string; /** @deprecated */ code: string; - /** - * Sets or retrieves the URL of the component. + /** + * Sets or retrieves the URL of the component. */ /** @deprecated */ codeBase: string; readonly form: HTMLFormElement | null; - /** - * Sets or retrieves the height of the object. + /** + * Sets or retrieves the height of the object. */ /** @deprecated */ height: string; /** @deprecated */ hspace: number; - /** - * Sets or retrieves the shape of the object. + /** + * Sets or retrieves the shape of the object. */ /** @deprecated */ name: string; @@ -6111,17 +6222,17 @@ declare var HTMLAppletElement: { /** Provides special properties and methods (beyond those of the regular object HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of elements. */ interface HTMLAreaElement extends HTMLElement, HTMLHyperlinkElementUtils { - /** - * Sets or retrieves a text alternative to the graphic. + /** + * Sets or retrieves a text alternative to the graphic. */ alt: string; - /** - * Sets or retrieves the coordinates of the object. + /** + * Sets or retrieves the coordinates of the object. */ coords: string; download: string; - /** - * Sets or gets whether clicks in this region cause action. + /** + * Sets or gets whether clicks in this region cause action. */ /** @deprecated */ noHref: boolean; @@ -6129,12 +6240,12 @@ interface HTMLAreaElement extends HTMLElement, HTMLHyperlinkElementUtils { referrerPolicy: string; rel: string; readonly relList: DOMTokenList; - /** - * Sets or retrieves the shape of the object. + /** + * Sets or retrieves the shape of the object. */ shape: string; - /** - * Sets or retrieves the window or frame at which to target content. + /** + * Sets or retrieves the window or frame at which to target content. */ target: string; addEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; @@ -6163,8 +6274,8 @@ declare var HTMLAudioElement: { /** A HTML line break element (
). It inherits from HTMLElement. */ interface HTMLBRElement extends HTMLElement { - /** - * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. + /** + * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. */ /** @deprecated */ clear: string; @@ -6181,12 +6292,12 @@ declare var HTMLBRElement: { /** Contains the base URI for a document. This object inherits all of the properties and methods as described in the HTMLElement interface. */ interface HTMLBaseElement extends HTMLElement { - /** - * Gets or sets the baseline URL on which relative links are based. + /** + * Gets or sets the baseline URL on which relative links are based. */ href: string; - /** - * Sets or retrieves the window or frame at which to target content. + /** + * Sets or retrieves the window or frame at which to target content. */ target: string; addEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; @@ -6202,13 +6313,13 @@ declare var HTMLBaseElement: { /** Provides special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating elements. */ interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { - /** - * Sets or retrieves the current typeface family. + /** + * Sets or retrieves the current typeface family. */ /** @deprecated */ face: string; - /** - * Sets or retrieves the font size of the object. + /** + * Sets or retrieves the font size of the object. */ /** @deprecated */ size: number; @@ -6259,68 +6370,68 @@ declare var HTMLBodyElement: { /** Provides properties and methods (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating