diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 409d785a2274d..59a513a4f65a1 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -873,7 +873,6 @@ namespace ts { const potentialThisCollisions: Node[] = []; const potentialNewTargetCollisions: Node[] = []; const potentialWeakMapCollisions: Node[] = []; - const awaitedTypeStack: number[] = []; const diagnostics = createDiagnosticCollection(); const suggestionDiagnostics = createDiagnosticCollection(); @@ -4013,7 +4012,7 @@ namespace ts { } if (type.flags & TypeFlags.TypeParameter || objectFlags & ObjectFlags.ClassOrInterface) { if (type.flags & TypeFlags.TypeParameter && contains(context.inferTypeParameters, type)) { - context.approximateLength += (symbolName(type.symbol).length + 6); + context.approximateLength += 6 + (type.symbol ? symbolName(type.symbol).length : 1); return createInferTypeNode(typeParameterToDeclarationWithConstraint(type as TypeParameter, context, /*constraintNode*/ undefined)); } if (context.flags & NodeBuilderFlags.GenerateNamesForShadowedTypeParams && @@ -4948,7 +4947,7 @@ namespace ts { return cached; } } - let result = symbolToName(type.symbol, context, SymbolFlags.Type, /*expectsIdentifier*/ true); + let result = type.symbol ? symbolToName(type.symbol, context, SymbolFlags.Type, /*expectsIdentifier*/ true) : createIdentifier("?"); if (!(result.kind & SyntaxKind.Identifier)) { return createIdentifier("(Missing type parameter)"); } @@ -29392,82 +29391,30 @@ namespace ts { return typeAsAwaitable.awaitedTypeOfType = getUnionType(types); } - const promisedType = getPromisedTypeOfPromise(type); - if (promisedType) { - if (type.id === promisedType.id || awaitedTypeStack.indexOf(promisedType.id) >= 0) { - // Verify that we don't have a bad actor in the form of a promise whose - // promised type is the same as the promise type, or a mutually recursive - // promise. If so, we return undefined as we cannot guess the shape. If this - // were the actual case in the JavaScript, this Promise would never resolve. - // - // An example of a bad actor with a singly-recursive promise type might - // be: - // - // interface BadPromise { - // then( - // onfulfilled: (value: BadPromise) => any, - // onrejected: (error: any) => any): BadPromise; - // } - // The above interface will pass the PromiseLike check, and return a - // promised type of `BadPromise`. Since this is a self reference, we - // don't want to keep recursing ad infinitum. - // - // An example of a bad actor in the form of a mutually-recursive - // promise type might be: - // - // interface BadPromiseA { - // then( - // onfulfilled: (value: BadPromiseB) => any, - // onrejected: (error: any) => any): BadPromiseB; - // } - // - // interface BadPromiseB { - // then( - // onfulfilled: (value: BadPromiseA) => any, - // onrejected: (error: any) => any): BadPromiseA; - // } - // - if (errorNode) { - error(errorNode, Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); - } - return undefined; - } - - // 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, arg0); - awaitedTypeStack.pop(); - - if (!awaitedType) { - return undefined; - } - - return typeAsAwaitable.awaitedTypeOfType = awaitedType; - } - - // The type was not a promise, so it could not be unwrapped any further. - // As long as the type does not have a callable "then" property, it is - // safe to return the type; otherwise, an error will be reported in - // the call to getNonThenableType and we will return undefined. - // - // An example of a non-promise "thenable" might be: - // - // await { then(): void {} } - // - // The "thenable" does not match the minimal definition for a promise. When - // a Promise/A+-compatible or ES6 promise tries to adopt this value, the promise - // will never settle. We treat this as an error to help flag an early indicator - // of a runtime problem. If the user wants to return this value from an async - // function, they would need to wrap it in some other value. If they want it to - // be treated as a promise, they can cast to . - const thenFunction = getTypeOfPropertyOfType(type, "then" as __String); - if (thenFunction && getSignaturesOfType(thenFunction, SignatureKind.Call).length > 0) { - if (errorNode) { - if (!diagnosticMessage) return Debug.fail(); - error(errorNode, diagnosticMessage, arg0); - } - return undefined; + const globalPromiseLikeType = getGlobalPromiseLikeType(/*reportErrors*/ false); + if (globalPromiseLikeType !== emptyGenericType) { + const promisedType = createTypeParameter(); + const result = getConditionalType({ + node: undefined as unknown as ConditionalTypeNode, + checkType: type, + extendsType: undefinedType, + trueType: type, + falseType: getConditionalType({ + node: undefined as unknown as ConditionalTypeNode, + checkType: type, + extendsType: createTypeReference(globalPromiseLikeType, [promisedType]), + trueType: promisedType, + falseType: type, + isDistributive: true, + inferTypeParameters: [promisedType], + outerTypeParameters: [type], + instantiations: createMap() + }, /*mapper*/ undefined), + isDistributive: true, + outerTypeParameters: [type], + instantiations: createMap() + }, /*mapper*/ undefined) as PromiseOrAwaitableType; + return typeAsAwaitable.awaitedTypeOfType = result.awaitedTypeOfType = result; } return typeAsAwaitable.awaitedTypeOfType = type; diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es2017.types b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es2017.types index 57f59302bb5bc..012a817f62f49 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es2017.types +++ b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es2017.types @@ -6,9 +6,9 @@ class C { >method : () => void var fn = async () => await this; ->fn : () => Promise ->async () => await this : () => Promise ->await this : this +>fn : () => Promise ? ? : this> +>async () => await this : () => Promise ? ? : this> +>await this : this extends undefined ? this : this extends PromiseLike ? ? : this >this : this } } diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5.types b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5.types index da378ee2718f9..925e6374bb862 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5.types +++ b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5.types @@ -6,9 +6,9 @@ class C { >method : () => void var fn = async () => await this; ->fn : () => Promise ->async () => await this : () => Promise ->await this : this +>fn : () => Promise ? ? : this> +>async () => await this : () => Promise ? ? : this> +>await this : this extends undefined ? this : this extends PromiseLike ? ? : this >this : this } } diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es6.types b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es6.types index 5386a956ada9a..49b72b0dab5c0 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es6.types +++ b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es6.types @@ -6,9 +6,9 @@ class C { >method : () => void var fn = async () => await this; ->fn : () => Promise ->async () => await this : () => Promise ->await this : this +>fn : () => Promise ? ? : this> +>async () => await this : () => Promise ? ? : this> +>await this : this extends undefined ? this : this extends PromiseLike ? ? : this >this : this } } diff --git a/tests/baselines/reference/asyncFunctionDeclaration15_es5.errors.txt b/tests/baselines/reference/asyncFunctionDeclaration15_es5.errors.txt index 7e3595ec6f4e0..c41904a247820 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration15_es5.errors.txt +++ b/tests/baselines/reference/asyncFunctionDeclaration15_es5.errors.txt @@ -8,11 +8,10 @@ tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration1 Construct signature return types 'Thenable' and 'PromiseLike' are incompatible. The types returned by 'then(...)' are incompatible between these types. Type 'void' is not assignable to type 'PromiseLike'. -tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(17,16): error TS1058: The return type of an async function must either be a valid promise or must not contain a callable 'then' member. -tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(23,25): error TS1320: Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member. +tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(10,23): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. -==== tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts (9 errors) ==== +==== tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts (8 errors) ==== declare class Thenable { then(): void; } declare let a: any; declare let obj: { then: string; }; @@ -40,6 +39,8 @@ tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration1 !!! error TS1055: Construct signature return types 'Thenable' and 'PromiseLike' are incompatible. !!! error TS1055: The types returned by 'then(...)' are incompatible between these types. !!! error TS1055: Type 'void' is not assignable to type 'PromiseLike'. + ~~~~~~~~ +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. async function fn7() { return; } // valid: Promise async function fn8() { return 1; } // valid: Promise async function fn9() { return null; } // valid: Promise @@ -47,14 +48,10 @@ tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration1 async function fn11() { return a; } // valid: Promise async function fn12() { return obj; } // valid: Promise<{ then: string; }> async function fn13() { return thenable; } // error - ~~~~ -!!! error TS1058: The return type of an async function must either be a valid promise or must not contain a callable 'then' member. async function fn14() { await 1; } // valid: Promise async function fn15() { await null; } // valid: Promise async function fn16() { await undefined; } // valid: Promise async function fn17() { await a; } // valid: Promise async function fn18() { await obj; } // valid: Promise async function fn19() { await thenable; } // error - ~~~~~~~~~~~~~~ -!!! error TS1320: Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member. \ No newline at end of file diff --git a/tests/baselines/reference/asyncFunctionDeclaration15_es5.types b/tests/baselines/reference/asyncFunctionDeclaration15_es5.types index dc7f69e0d0269..0582b88c2a339 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration15_es5.types +++ b/tests/baselines/reference/asyncFunctionDeclaration15_es5.types @@ -55,7 +55,7 @@ async function fn12() { return obj; } // valid: Promise<{ then: string; }> >obj : { then: string; } async function fn13() { return thenable; } // error ->fn13 : () => Promise +>fn13 : () => Promise >thenable : Thenable async function fn14() { await 1; } // valid: Promise @@ -85,6 +85,6 @@ async function fn18() { await obj; } // valid: Promise async function fn19() { await thenable; } // error >fn19 : () => Promise ->await thenable : any +>await thenable : Thenable >thenable : Thenable diff --git a/tests/baselines/reference/asyncFunctionDeclaration15_es6.errors.txt b/tests/baselines/reference/asyncFunctionDeclaration15_es6.errors.txt index 5ff67861350fd..b50ef2652b6d8 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration15_es6.errors.txt +++ b/tests/baselines/reference/asyncFunctionDeclaration15_es6.errors.txt @@ -5,11 +5,10 @@ tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration1 tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts(8,23): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts(9,23): error TS1064: The return type of an async function or method must be the global Promise type. tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts(10,23): error TS1064: The return type of an async function or method must be the global Promise type. -tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts(17,16): error TS1058: The return type of an async function must either be a valid promise or must not contain a callable 'then' member. -tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts(23,25): error TS1320: Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member. +tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts(10,23): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. -==== tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts (9 errors) ==== +==== tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts (8 errors) ==== declare class Thenable { then(): void; } declare let a: any; declare let obj: { then: string; }; @@ -34,6 +33,8 @@ tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration1 async function fn6(): Thenable { } // error ~~~~~~~~ !!! error TS1064: The return type of an async function or method must be the global Promise type. + ~~~~~~~~ +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. async function fn7() { return; } // valid: Promise async function fn8() { return 1; } // valid: Promise async function fn9() { return null; } // valid: Promise @@ -41,14 +42,10 @@ tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration1 async function fn11() { return a; } // valid: Promise async function fn12() { return obj; } // valid: Promise<{ then: string; }> async function fn13() { return thenable; } // error - ~~~~ -!!! error TS1058: The return type of an async function must either be a valid promise or must not contain a callable 'then' member. async function fn14() { await 1; } // valid: Promise async function fn15() { await null; } // valid: Promise async function fn16() { await undefined; } // valid: Promise async function fn17() { await a; } // valid: Promise async function fn18() { await obj; } // valid: Promise async function fn19() { await thenable; } // error - ~~~~~~~~~~~~~~ -!!! error TS1320: Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member. \ No newline at end of file diff --git a/tests/baselines/reference/asyncFunctionDeclaration15_es6.types b/tests/baselines/reference/asyncFunctionDeclaration15_es6.types index 9955f7708e65e..c1c6346ea22ae 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration15_es6.types +++ b/tests/baselines/reference/asyncFunctionDeclaration15_es6.types @@ -55,7 +55,7 @@ async function fn12() { return obj; } // valid: Promise<{ then: string; }> >obj : { then: string; } async function fn13() { return thenable; } // error ->fn13 : () => Promise +>fn13 : () => Promise >thenable : Thenable async function fn14() { await 1; } // valid: Promise @@ -85,6 +85,6 @@ async function fn18() { await obj; } // valid: Promise async function fn19() { await thenable; } // error >fn19 : () => Promise ->await thenable : any +>await thenable : Thenable >thenable : Thenable diff --git a/tests/baselines/reference/asyncFunctionReturnType.js b/tests/baselines/reference/asyncFunctionReturnType.js index 04b3a04a036d3..56428e10826e8 100644 --- a/tests/baselines/reference/asyncFunctionReturnType.js +++ b/tests/baselines/reference/asyncFunctionReturnType.js @@ -73,7 +73,15 @@ async function fGenericIndexedTypeForPromiseOfKProp(obj: TObj, key: K): Promise { return Promise.resolve(obj[key]); -} +} + +// #27711 + +async function fGeneric(x: T) { + return x; +} +const expected: Promise = fGeneric(undefined as Promise); + //// [asyncFunctionReturnType.js] var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { @@ -172,3 +180,10 @@ function fGenericIndexedTypeForExplicitPromiseOfKProp(obj, key) { return Promise.resolve(obj[key]); }); } +// #27711 +function fGeneric(x) { + return __awaiter(this, void 0, void 0, function* () { + return x; + }); +} +const expected = fGeneric(undefined); diff --git a/tests/baselines/reference/asyncFunctionReturnType.symbols b/tests/baselines/reference/asyncFunctionReturnType.symbols index 25a7e944c6a7a..fe5181eb9e603 100644 --- a/tests/baselines/reference/asyncFunctionReturnType.symbols +++ b/tests/baselines/reference/asyncFunctionReturnType.symbols @@ -285,3 +285,22 @@ async function fGenericIndexedTypeForExplicitPromiseOfKPropobj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 72, 100)) >key : Symbol(key, Decl(asyncFunctionReturnType.ts, 72, 110)) } + +// #27711 + +async function fGeneric(x: T) { +>fGeneric : Symbol(fGeneric, Decl(asyncFunctionReturnType.ts, 74, 1)) +>T : Symbol(T, Decl(asyncFunctionReturnType.ts, 78, 24)) +>x : Symbol(x, Decl(asyncFunctionReturnType.ts, 78, 27)) +>T : Symbol(T, Decl(asyncFunctionReturnType.ts, 78, 24)) + + return x; +>x : Symbol(x, Decl(asyncFunctionReturnType.ts, 78, 27)) +} +const expected: Promise = fGeneric(undefined as Promise); +>expected : Symbol(expected, Decl(asyncFunctionReturnType.ts, 81, 5)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>fGeneric : Symbol(fGeneric, Decl(asyncFunctionReturnType.ts, 74, 1)) +>undefined : Symbol(undefined) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + diff --git a/tests/baselines/reference/asyncFunctionReturnType.types b/tests/baselines/reference/asyncFunctionReturnType.types index d2cb63e0a35f3..c6148cd6c1463 100644 --- a/tests/baselines/reference/asyncFunctionReturnType.types +++ b/tests/baselines/reference/asyncFunctionReturnType.types @@ -220,3 +220,20 @@ async function fGenericIndexedTypeForExplicitPromiseOfKPropobj : TObj >key : K } + +// #27711 + +async function fGeneric(x: T) { +>fGeneric : (x: T) => Promise ? ? : T> +>x : T + + return x; +>x : T +} +const expected: Promise = fGeneric(undefined as Promise); +>expected : Promise +>fGeneric(undefined as Promise) : Promise +>fGeneric : (x: T) => Promise ? ? : T> +>undefined as Promise : Promise +>undefined : undefined + diff --git a/tests/baselines/reference/compareTypeParameterConstrainedByLiteralToLiteral.errors.txt b/tests/baselines/reference/compareTypeParameterConstrainedByLiteralToLiteral.errors.txt index aa8a0572e6be8..33c750d71b0a3 100644 --- a/tests/baselines/reference/compareTypeParameterConstrainedByLiteralToLiteral.errors.txt +++ b/tests/baselines/reference/compareTypeParameterConstrainedByLiteralToLiteral.errors.txt @@ -9,5 +9,6 @@ tests/cases/compiler/compareTypeParameterConstrainedByLiteralToLiteral.ts(5,5): t === "x"; // Should be error ~~~~~~~~~ !!! error TS2367: This condition will always return 'false' since the types 'T' and '"x"' have no overlap. +!!! related TS2773 tests/cases/compiler/compareTypeParameterConstrainedByLiteralToLiteral.ts:5:5: Did you forget to use 'await'? } \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt index da497e03a2206..1c2cb3b1e6603 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt @@ -161,359 +161,471 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso var r1a1 = t < a; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:22:16: Did you forget to use 'await'? var r1a2 = t < b; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:23:16: Did you forget to use 'await'? var r1a3 = t < c; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:24:16: Did you forget to use 'await'? var r1a4 = t < d; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:25:16: Did you forget to use 'await'? var r1a5 = t < e; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:26:16: Did you forget to use 'await'? var r1a6 = t < f; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:27:16: Did you forget to use 'await'? var r1a7 = t < g; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:28:16: Did you forget to use 'await'? var r1b1 = a < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:30:16: Did you forget to use 'await'? var r1b2 = b < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:31:16: Did you forget to use 'await'? var r1b3 = c < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:32:16: Did you forget to use 'await'? var r1b4 = d < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:33:16: Did you forget to use 'await'? var r1b5 = e < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:34:16: Did you forget to use 'await'? var r1b6 = f < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:35:16: Did you forget to use 'await'? var r1b7 = g < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:36:16: Did you forget to use 'await'? // operator > var r2a1 = t < a; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:39:16: Did you forget to use 'await'? var r2a2 = t < b; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:40:16: Did you forget to use 'await'? var r2a3 = t < c; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:41:16: Did you forget to use 'await'? var r2a4 = t < d; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:42:16: Did you forget to use 'await'? var r2a5 = t < e; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:43:16: Did you forget to use 'await'? var r2a6 = t < f; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:44:16: Did you forget to use 'await'? var r2a7 = t < g; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:45:16: Did you forget to use 'await'? var r2b1 = a < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:47:16: Did you forget to use 'await'? var r2b2 = b < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:48:16: Did you forget to use 'await'? var r2b3 = c < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:49:16: Did you forget to use 'await'? var r2b4 = d < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:50:16: Did you forget to use 'await'? var r2b5 = e < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:51:16: Did you forget to use 'await'? var r2b6 = f < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:52:16: Did you forget to use 'await'? var r2b7 = g < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:53:16: Did you forget to use 'await'? // operator <= var r3a1 = t < a; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:56:16: Did you forget to use 'await'? var r3a2 = t < b; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:57:16: Did you forget to use 'await'? var r3a3 = t < c; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:58:16: Did you forget to use 'await'? var r3a4 = t < d; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:59:16: Did you forget to use 'await'? var r3a5 = t < e; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:60:16: Did you forget to use 'await'? var r3a6 = t < f; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:61:16: Did you forget to use 'await'? var r3a7 = t < g; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:62:16: Did you forget to use 'await'? var r3b1 = a < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:64:16: Did you forget to use 'await'? var r3b2 = b < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:65:16: Did you forget to use 'await'? var r3b3 = c < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:66:16: Did you forget to use 'await'? var r3b4 = d < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:67:16: Did you forget to use 'await'? var r3b5 = e < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:68:16: Did you forget to use 'await'? var r3b6 = f < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:69:16: Did you forget to use 'await'? var r3b7 = g < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:70:16: Did you forget to use 'await'? // operator >= var r4a1 = t < a; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:73:16: Did you forget to use 'await'? var r4a2 = t < b; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:74:16: Did you forget to use 'await'? var r4a3 = t < c; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:75:16: Did you forget to use 'await'? var r4a4 = t < d; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:76:16: Did you forget to use 'await'? var r4a5 = t < e; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:77:16: Did you forget to use 'await'? var r4a6 = t < f; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:78:16: Did you forget to use 'await'? var r4a7 = t < g; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:79:16: Did you forget to use 'await'? var r4b1 = a < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:81:16: Did you forget to use 'await'? var r4b2 = b < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:82:16: Did you forget to use 'await'? var r4b3 = c < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:83:16: Did you forget to use 'await'? var r4b4 = d < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:84:16: Did you forget to use 'await'? var r4b5 = e < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:85:16: Did you forget to use 'await'? var r4b6 = f < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:86:16: Did you forget to use 'await'? var r4b7 = g < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:87:16: Did you forget to use 'await'? // operator == var r5a1 = t < a; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:90:16: Did you forget to use 'await'? var r5a2 = t < b; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:91:16: Did you forget to use 'await'? var r5a3 = t < c; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:92:16: Did you forget to use 'await'? var r5a4 = t < d; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:93:16: Did you forget to use 'await'? var r5a5 = t < e; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:94:16: Did you forget to use 'await'? var r5a6 = t < f; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:95:16: Did you forget to use 'await'? var r5a7 = t < g; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:96:16: Did you forget to use 'await'? var r5b1 = a < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:98:16: Did you forget to use 'await'? var r5b2 = b < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:99:16: Did you forget to use 'await'? var r5b3 = c < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:100:16: Did you forget to use 'await'? var r5b4 = d < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:101:16: Did you forget to use 'await'? var r5b5 = e < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:102:16: Did you forget to use 'await'? var r5b6 = f < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:103:16: Did you forget to use 'await'? var r5b7 = g < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:104:16: Did you forget to use 'await'? // operator != var r6a1 = t < a; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:107:16: Did you forget to use 'await'? var r6a2 = t < b; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:108:16: Did you forget to use 'await'? var r6a3 = t < c; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:109:16: Did you forget to use 'await'? var r6a4 = t < d; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:110:16: Did you forget to use 'await'? var r6a5 = t < e; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:111:16: Did you forget to use 'await'? var r6a6 = t < f; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:112:16: Did you forget to use 'await'? var r6a7 = t < g; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:113:16: Did you forget to use 'await'? var r6b1 = a < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:115:16: Did you forget to use 'await'? var r6b2 = b < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:116:16: Did you forget to use 'await'? var r6b3 = c < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:117:16: Did you forget to use 'await'? var r6b4 = d < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:118:16: Did you forget to use 'await'? var r6b5 = e < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:119:16: Did you forget to use 'await'? var r6b6 = f < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:120:16: Did you forget to use 'await'? var r6b7 = g < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:121:16: Did you forget to use 'await'? // operator === var r7a1 = t < a; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:124:16: Did you forget to use 'await'? var r7a2 = t < b; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:125:16: Did you forget to use 'await'? var r7a3 = t < c; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:126:16: Did you forget to use 'await'? var r7a4 = t < d; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:127:16: Did you forget to use 'await'? var r7a5 = t < e; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:128:16: Did you forget to use 'await'? var r7a6 = t < f; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:129:16: Did you forget to use 'await'? var r7a7 = t < g; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:130:16: Did you forget to use 'await'? var r7b1 = a < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:132:16: Did you forget to use 'await'? var r7b2 = b < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:133:16: Did you forget to use 'await'? var r7b3 = c < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:134:16: Did you forget to use 'await'? var r7b4 = d < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:135:16: Did you forget to use 'await'? var r7b5 = e < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:136:16: Did you forget to use 'await'? var r7b6 = f < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:137:16: Did you forget to use 'await'? var r7b7 = g < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:138:16: Did you forget to use 'await'? // operator !== var r8a1 = t < a; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:141:16: Did you forget to use 'await'? var r8a2 = t < b; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:142:16: Did you forget to use 'await'? var r8a3 = t < c; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:143:16: Did you forget to use 'await'? var r8a4 = t < d; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:144:16: Did you forget to use 'await'? var r8a5 = t < e; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:145:16: Did you forget to use 'await'? var r8a6 = t < f; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:146:16: Did you forget to use 'await'? var r8a7 = t < g; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:147:16: Did you forget to use 'await'? var r8b1 = a < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:149:16: Did you forget to use 'await'? var r8b2 = b < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:150:16: Did you forget to use 'await'? var r8b3 = c < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:151:16: Did you forget to use 'await'? var r8b4 = d < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:152:16: Did you forget to use 'await'? var r8b5 = e < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:153:16: Did you forget to use 'await'? var r8b6 = f < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:154:16: Did you forget to use 'await'? var r8b7 = g < t; ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. +!!! related TS2773 tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts:155:16: Did you forget to use 'await'? } \ No newline at end of file diff --git a/tests/baselines/reference/forAwaitForUnion.types b/tests/baselines/reference/forAwaitForUnion.types index 180197b26eafc..9c7e3138b1c3a 100644 --- a/tests/baselines/reference/forAwaitForUnion.types +++ b/tests/baselines/reference/forAwaitForUnion.types @@ -4,7 +4,7 @@ async function f(source: Iterable | AsyncIterable) { >source : Iterable | AsyncIterable for await (const x of source) { ->x : T +>x : T | (T extends undefined ? T : T extends PromiseLike ? ? : T) >source : Iterable | AsyncIterable } } diff --git a/tests/baselines/reference/incorrectRecursiveMappedTypeConstraint.errors.txt b/tests/baselines/reference/incorrectRecursiveMappedTypeConstraint.errors.txt index ac068bfba74c3..3e1212f421b6a 100644 --- a/tests/baselines/reference/incorrectRecursiveMappedTypeConstraint.errors.txt +++ b/tests/baselines/reference/incorrectRecursiveMappedTypeConstraint.errors.txt @@ -13,5 +13,6 @@ tests/cases/compiler/incorrectRecursiveMappedTypeConstraint.ts(3,5): error TS236 n += v[k]; ~~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'number' and 'T[K]'. +!!! related TS2773 tests/cases/compiler/incorrectRecursiveMappedTypeConstraint.ts:3:5: Did you forget to use 'await'? } \ No newline at end of file diff --git a/tests/baselines/reference/unionTypeInference.types b/tests/baselines/reference/unionTypeInference.types index b8107f3c04d0a..c86be843b5477 100644 --- a/tests/baselines/reference/unionTypeInference.types +++ b/tests/baselines/reference/unionTypeInference.types @@ -221,18 +221,18 @@ async function fun(deepPromised: DeepPromised) { >deepPromisedWithIndexer : DeepPromised<{ [name: string]: {} | null | undefined; }> const awaitedValue = await value; ->awaitedValue : {} | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined ->await value : {} | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined +>awaitedValue : {} | ({ [containsPromises]?: true | undefined; } & {}) | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined +>await value : {} | ({ [containsPromises]?: true | undefined; } & {}) | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined >value : {} | ({ [containsPromises]?: true | undefined; } & {}) | Promise<{ [containsPromises]?: true | undefined; } & {}> | null | undefined if (awaitedValue) ->awaitedValue : {} | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined +>awaitedValue : {} | ({ [containsPromises]?: true | undefined; } & {}) | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined await fun(awaitedValue); >await fun(awaitedValue) : void >fun(awaitedValue) : Promise >fun : (deepPromised: DeepPromised) => Promise ->awaitedValue : {} | ({ [containsPromises]?: true | undefined; } & {}) +>awaitedValue : {} | ({ [containsPromises]?: true | undefined; } & {}) | ({ [containsPromises]?: true | undefined; } & {}) } } diff --git a/tests/cases/compiler/asyncFunctionReturnType.ts b/tests/cases/compiler/asyncFunctionReturnType.ts index 3bd7a0e998ac2..b48a6a89e422f 100644 --- a/tests/cases/compiler/asyncFunctionReturnType.ts +++ b/tests/cases/compiler/asyncFunctionReturnType.ts @@ -73,4 +73,11 @@ async function fGenericIndexedTypeForPromiseOfKProp(obj: TObj, key: K): Promise { return Promise.resolve(obj[key]); -} \ No newline at end of file +} + +// #27711 + +async function fGeneric(x: T) { + return x; +} +const expected: Promise = fGeneric(undefined as Promise);