diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 409d785a2274d..88b23670d14dd 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -819,6 +819,7 @@ namespace ts { let deferredGlobalESSymbolConstructorSymbol: Symbol | undefined; let deferredGlobalESSymbolType: ObjectType; let deferredGlobalTypedPropertyDescriptorType: GenericType; + let deferredGlobalAwaitedSymbol: Symbol | undefined; let deferredGlobalPromiseType: GenericType; let deferredGlobalPromiseLikeType: GenericType; let deferredGlobalPromiseConstructorSymbol: Symbol | undefined; @@ -873,7 +874,6 @@ namespace ts { const potentialThisCollisions: Node[] = []; const potentialNewTargetCollisions: Node[] = []; const potentialWeakMapCollisions: Node[] = []; - const awaitedTypeStack: number[] = []; const diagnostics = createDiagnosticCollection(); const suggestionDiagnostics = createDiagnosticCollection(); @@ -11288,6 +11288,10 @@ namespace ts { return deferredGlobalESSymbolType || (deferredGlobalESSymbolType = getGlobalType("Symbol" as __String, /*arity*/ 0, reportErrors)) || emptyObjectType; } + function getGlobalAwaitedSymbol(reportErrors: boolean) { + return deferredGlobalAwaitedSymbol || (deferredGlobalAwaitedSymbol = getGlobalTypeSymbol("Awaited" as __String, reportErrors)); + } + function getGlobalPromiseType(reportErrors: boolean) { return deferredGlobalPromiseType || (deferredGlobalPromiseType = getGlobalType("Promise" as __String, /*arity*/ 1, reportErrors)) || emptyGenericType; } @@ -29379,98 +29383,22 @@ namespace ts { return typeAsAwaitable.awaitedTypeOfType = type; } - if (type.flags & TypeFlags.Union) { - let types: Type[] | undefined; - for (const constituentType of (type).types) { - types = append(types, getAwaitedType(constituentType, errorNode, diagnosticMessage, arg0)); - } - - if (!types) { - return undefined; - } - - return typeAsAwaitable.awaitedTypeOfType = getUnionType(types); + const symbol = getGlobalAwaitedSymbol(/*reportErrors*/ false); + if (!symbol) { + return typeAsAwaitable.awaitedTypeOfType = type; } - 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; + const result = getTypeAliasInstantiation(symbol, [type]); + if (result !== unknownType || type === unknownType || getPromisedTypeOfPromise(type) === unknownType) { + return typeAsAwaitable.awaitedTypeOfType = (result as PromiseOrAwaitableType).awaitedTypeOfType = result; } - // 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; + if (errorNode) { + if (!diagnosticMessage) return Debug.fail(); + error(errorNode, diagnosticMessage, arg0); } - return typeAsAwaitable.awaitedTypeOfType = type; + return undefined; } /** diff --git a/src/harness/fourslashInterfaceImpl.ts b/src/harness/fourslashInterfaceImpl.ts index 14356ecc4799b..df4cab483d95d 100644 --- a/src/harness/fourslashInterfaceImpl.ts +++ b/src/harness/fourslashInterfaceImpl.ts @@ -957,6 +957,7 @@ namespace FourSlashInterface { typeEntry("PropertyDecorator"), typeEntry("MethodDecorator"), typeEntry("ParameterDecorator"), + typeEntry("Awaited"), typeEntry("PromiseConstructorLike"), interfaceEntry("PromiseLike"), interfaceEntry("Promise"), diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 8893a7b0bb63e..34e1553ed9335 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -1378,6 +1378,11 @@ declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; +// The undefined case is for strictNullChecks false, in which case +// undefined extends PromiseLike is true, which would otherwise +// make Awaited -> unknown. +type Awaited = T extends undefined ? T : T extends PromiseLike ? U : T extends { then: Function } ? unknown : T; + declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; interface PromiseLike { diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es2017.types b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es2017.types index 57f59302bb5bc..93e3136c139b5 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> +>async () => await this : () => Promise> +>await this : Awaited >this : this } } diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5.types b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5.types index da378ee2718f9..90f89654c0518 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> +>async () => await this : () => Promise> +>await this : Awaited >this : this } } diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es6.types b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es6.types index 5386a956ada9a..3b77fc642e4a2 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> +>async () => await this : () => Promise> +>await this : Awaited >this : this } } diff --git a/tests/baselines/reference/asyncFunctionReturnType.js b/tests/baselines/reference/asyncFunctionReturnType.js index 04b3a04a036d3..bd432fd7d8a67 100644 --- a/tests/baselines/reference/asyncFunctionReturnType.js +++ b/tests/baselines/reference/asyncFunctionReturnType.js @@ -63,7 +63,7 @@ async function fGenericIndexedTypeForExplicitPromiseOfAnyProp( return Promise.resolve(obj.anyProp); } -async function fGenericIndexedTypeForKProp(obj: TObj, key: K): Promise { +async function fGenericIndexedTypeForKProp(obj: TObj, key: K): Promise> { return obj[key]; } @@ -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..7a106495b0afd 100644 --- a/tests/baselines/reference/asyncFunctionReturnType.symbols +++ b/tests/baselines/reference/asyncFunctionReturnType.symbols @@ -221,7 +221,7 @@ async function fGenericIndexedTypeForExplicitPromiseOfAnyProp( >anyProp : Symbol(Obj.anyProp, Decl(asyncFunctionReturnType.ts, 12, 23)) } -async function fGenericIndexedTypeForKProp(obj: TObj, key: K): Promise { +async function fGenericIndexedTypeForKProp(obj: TObj, key: K): Promise> { >fGenericIndexedTypeForKProp : Symbol(fGenericIndexedTypeForKProp, Decl(asyncFunctionReturnType.ts, 62, 1)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 64, 43)) >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) @@ -232,6 +232,7 @@ async function fGenericIndexedTypeForKPropkey : Symbol(key, Decl(asyncFunctionReturnType.ts, 64, 93)) >K : Symbol(K, Decl(asyncFunctionReturnType.ts, 64, 60)) >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, --, --)) +>Awaited : Symbol(Awaited, Decl(lib.es5.d.ts, --, --)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 64, 43)) >K : Symbol(K, Decl(asyncFunctionReturnType.ts, 64, 60)) @@ -285,3 +286,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..a942588f43187 100644 --- a/tests/baselines/reference/asyncFunctionReturnType.types +++ b/tests/baselines/reference/asyncFunctionReturnType.types @@ -180,8 +180,8 @@ async function fGenericIndexedTypeForExplicitPromiseOfAnyProp( >anyProp : any } -async function fGenericIndexedTypeForKProp(obj: TObj, key: K): Promise { ->fGenericIndexedTypeForKProp : (obj: TObj, key: K) => Promise +async function fGenericIndexedTypeForKProp(obj: TObj, key: K): Promise> { +>fGenericIndexedTypeForKProp : (obj: TObj, key: K) => Promise> >obj : TObj >key : K @@ -220,3 +220,20 @@ async function fGenericIndexedTypeForExplicitPromiseOfKPropobj : TObj >key : K } + +// #27711 + +async function fGeneric(x: T) { +>fGeneric : (x: T) => Promise> +>x : T + + return x; +>x : T +} +const expected: Promise = fGeneric(undefined as Promise); +>expected : Promise +>fGeneric(undefined as Promise) : Promise +>fGeneric : (x: T) => Promise> +>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/docker/azure-sdk.log b/tests/baselines/reference/docker/azure-sdk.log index a8a12bd94808a..d140dd8f04f9a 100644 --- a/tests/baselines/reference/docker/azure-sdk.log +++ b/tests/baselines/reference/docker/azure-sdk.log @@ -150,18 +150,18 @@ npm ERR! This is probably not a problem with npm. There is likely additional log npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/XXXX-XX-XXXXXXXXX-debug.log ================================ -Error: Project(s) failed to build +Error: Project(s) failed rush rebuild - Errors! ( ? seconds) Standard error: -XX of XX: [@azure/app-configuration] failed to build! +XX of XX: [@azure/app-configuration] failed! XX of XX: [@azure/cosmos] completed with warnings in ? seconds -XX of XX: [@azure/eventhubs-checkpointstore-blob] failed to build! -XX of XX: [@azure/keyvault-certificates] failed to build! -XX of XX: [@azure/storage-file-datalake] failed to build! +XX of XX: [@azure/eventhubs-checkpointstore-blob] failed! +XX of XX: [@azure/keyvault-certificates] failed! +XX of XX: [@azure/storage-file-datalake] failed! [@azure/app-configuration] Returned error code: 2 [@azure/eventhubs-checkpointstore-blob] Returned error code: 2 [@azure/keyvault-certificates] Returned error code: 2 diff --git a/tests/baselines/reference/forAwaitForUnion.types b/tests/baselines/reference/forAwaitForUnion.types index 180197b26eafc..db54e1d0e43f3 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 | Awaited >source : Iterable | AsyncIterable } } diff --git a/tests/baselines/reference/mappedTypesArraysTuples.js b/tests/baselines/reference/mappedTypesArraysTuples.js index 7bd4b03a6e54f..516cf6685e996 100644 --- a/tests/baselines/reference/mappedTypesArraysTuples.js +++ b/tests/baselines/reference/mappedTypesArraysTuples.js @@ -58,7 +58,6 @@ let y21 = nonpartial(x21); declare let x22: { a: number | undefined, b?: string[] }; let y22 = nonpartial(x22); -type Awaited = T extends PromiseLike ? U : T; type Awaitified = { [P in keyof T]: Awaited }; declare function all(...values: T): Promise>; @@ -189,7 +188,6 @@ declare let y22: { a: number; b: string[]; }; -declare type Awaited = T extends PromiseLike ? U : T; declare type Awaitified = { [P in keyof T]: Awaited; }; diff --git a/tests/baselines/reference/mappedTypesArraysTuples.symbols b/tests/baselines/reference/mappedTypesArraysTuples.symbols index 48a3979585c7e..ef4f4f36945ca 100644 --- a/tests/baselines/reference/mappedTypesArraysTuples.symbols +++ b/tests/baselines/reference/mappedTypesArraysTuples.symbols @@ -214,173 +214,164 @@ let y22 = nonpartial(x22); >nonpartial : Symbol(nonpartial, Decl(mappedTypesArraysTuples.ts, 46, 24)) >x22 : Symbol(x22, Decl(mappedTypesArraysTuples.ts, 56, 11)) -type Awaited = T extends PromiseLike ? U : T; ->Awaited : Symbol(Awaited, Decl(mappedTypesArraysTuples.ts, 57, 26)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 59, 13)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 59, 13)) ->PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --)) ->U : Symbol(U, Decl(mappedTypesArraysTuples.ts, 59, 45)) ->U : Symbol(U, Decl(mappedTypesArraysTuples.ts, 59, 45)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 59, 13)) - type Awaitified = { [P in keyof T]: Awaited }; ->Awaitified : Symbol(Awaitified, Decl(mappedTypesArraysTuples.ts, 59, 57)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 60, 16)) ->P : Symbol(P, Decl(mappedTypesArraysTuples.ts, 60, 24)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 60, 16)) ->Awaited : Symbol(Awaited, Decl(mappedTypesArraysTuples.ts, 57, 26)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 60, 16)) ->P : Symbol(P, Decl(mappedTypesArraysTuples.ts, 60, 24)) +>Awaitified : Symbol(Awaitified, Decl(mappedTypesArraysTuples.ts, 57, 26)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 59, 16)) +>P : Symbol(P, Decl(mappedTypesArraysTuples.ts, 59, 24)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 59, 16)) +>Awaited : Symbol(Awaited, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 59, 16)) +>P : Symbol(P, Decl(mappedTypesArraysTuples.ts, 59, 24)) declare function all(...values: T): Promise>; ->all : Symbol(all, Decl(mappedTypesArraysTuples.ts, 60, 55)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 62, 21)) ->values : Symbol(values, Decl(mappedTypesArraysTuples.ts, 62, 38)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 62, 21)) +>all : Symbol(all, Decl(mappedTypesArraysTuples.ts, 59, 55)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 61, 21)) +>values : Symbol(values, Decl(mappedTypesArraysTuples.ts, 61, 38)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 61, 21)) >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --)) ->Awaitified : Symbol(Awaitified, Decl(mappedTypesArraysTuples.ts, 59, 57)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 62, 21)) +>Awaitified : Symbol(Awaitified, Decl(mappedTypesArraysTuples.ts, 57, 26)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 61, 21)) function f1(a: number, b: Promise, c: string[], d: Promise) { ->f1 : Symbol(f1, Decl(mappedTypesArraysTuples.ts, 62, 76)) ->a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 64, 12)) ->b : Symbol(b, Decl(mappedTypesArraysTuples.ts, 64, 22)) +>f1 : Symbol(f1, Decl(mappedTypesArraysTuples.ts, 61, 76)) +>a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 63, 12)) +>b : Symbol(b, Decl(mappedTypesArraysTuples.ts, 63, 22)) >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --)) ->c : Symbol(c, Decl(mappedTypesArraysTuples.ts, 64, 42)) ->d : Symbol(d, Decl(mappedTypesArraysTuples.ts, 64, 55)) +>c : Symbol(c, Decl(mappedTypesArraysTuples.ts, 63, 42)) +>d : Symbol(d, Decl(mappedTypesArraysTuples.ts, 63, 55)) >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --)) let x1 = all(a); ->x1 : Symbol(x1, Decl(mappedTypesArraysTuples.ts, 65, 7)) ->all : Symbol(all, Decl(mappedTypesArraysTuples.ts, 60, 55)) ->a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 64, 12)) +>x1 : Symbol(x1, Decl(mappedTypesArraysTuples.ts, 64, 7)) +>all : Symbol(all, Decl(mappedTypesArraysTuples.ts, 59, 55)) +>a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 63, 12)) let x2 = all(a, b); ->x2 : Symbol(x2, Decl(mappedTypesArraysTuples.ts, 66, 7)) ->all : Symbol(all, Decl(mappedTypesArraysTuples.ts, 60, 55)) ->a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 64, 12)) ->b : Symbol(b, Decl(mappedTypesArraysTuples.ts, 64, 22)) +>x2 : Symbol(x2, Decl(mappedTypesArraysTuples.ts, 65, 7)) +>all : Symbol(all, Decl(mappedTypesArraysTuples.ts, 59, 55)) +>a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 63, 12)) +>b : Symbol(b, Decl(mappedTypesArraysTuples.ts, 63, 22)) let x3 = all(a, b, c); ->x3 : Symbol(x3, Decl(mappedTypesArraysTuples.ts, 67, 7)) ->all : Symbol(all, Decl(mappedTypesArraysTuples.ts, 60, 55)) ->a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 64, 12)) ->b : Symbol(b, Decl(mappedTypesArraysTuples.ts, 64, 22)) ->c : Symbol(c, Decl(mappedTypesArraysTuples.ts, 64, 42)) +>x3 : Symbol(x3, Decl(mappedTypesArraysTuples.ts, 66, 7)) +>all : Symbol(all, Decl(mappedTypesArraysTuples.ts, 59, 55)) +>a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 63, 12)) +>b : Symbol(b, Decl(mappedTypesArraysTuples.ts, 63, 22)) +>c : Symbol(c, Decl(mappedTypesArraysTuples.ts, 63, 42)) let x4 = all(a, b, c, d); ->x4 : Symbol(x4, Decl(mappedTypesArraysTuples.ts, 68, 7)) ->all : Symbol(all, Decl(mappedTypesArraysTuples.ts, 60, 55)) ->a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 64, 12)) ->b : Symbol(b, Decl(mappedTypesArraysTuples.ts, 64, 22)) ->c : Symbol(c, Decl(mappedTypesArraysTuples.ts, 64, 42)) ->d : Symbol(d, Decl(mappedTypesArraysTuples.ts, 64, 55)) +>x4 : Symbol(x4, Decl(mappedTypesArraysTuples.ts, 67, 7)) +>all : Symbol(all, Decl(mappedTypesArraysTuples.ts, 59, 55)) +>a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 63, 12)) +>b : Symbol(b, Decl(mappedTypesArraysTuples.ts, 63, 22)) +>c : Symbol(c, Decl(mappedTypesArraysTuples.ts, 63, 42)) +>d : Symbol(d, Decl(mappedTypesArraysTuples.ts, 63, 55)) } function f2(a: Boxified) { ->f2 : Symbol(f2, Decl(mappedTypesArraysTuples.ts, 69, 1)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 71, 12)) ->a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 71, 29)) +>f2 : Symbol(f2, Decl(mappedTypesArraysTuples.ts, 68, 1)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 70, 12)) +>a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 70, 29)) >Boxified : Symbol(Boxified, Decl(mappedTypesArraysTuples.ts, 0, 27)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 71, 12)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 70, 12)) let x: Box | undefined = a.pop(); ->x : Symbol(x, Decl(mappedTypesArraysTuples.ts, 72, 7)) +>x : Symbol(x, Decl(mappedTypesArraysTuples.ts, 71, 7)) >Box : Symbol(Box, Decl(mappedTypesArraysTuples.ts, 0, 0)) >a.pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) ->a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 71, 29)) +>a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 70, 29)) >pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) let y: Box[] = a.concat(a); ->y : Symbol(y, Decl(mappedTypesArraysTuples.ts, 73, 7)) +>y : Symbol(y, Decl(mappedTypesArraysTuples.ts, 72, 7)) >Box : Symbol(Box, Decl(mappedTypesArraysTuples.ts, 0, 0)) >a.concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 71, 29)) +>a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 70, 29)) >concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 71, 29)) +>a : Symbol(a, Decl(mappedTypesArraysTuples.ts, 70, 29)) } // Repro from #26163 type ElementType = T extends Array ? U : never; ->ElementType : Symbol(ElementType, Decl(mappedTypesArraysTuples.ts, 74, 1)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 78, 17)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 78, 17)) +>ElementType : Symbol(ElementType, Decl(mappedTypesArraysTuples.ts, 73, 1)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 77, 17)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 77, 17)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->U : Symbol(U, Decl(mappedTypesArraysTuples.ts, 78, 43)) ->U : Symbol(U, Decl(mappedTypesArraysTuples.ts, 78, 43)) +>U : Symbol(U, Decl(mappedTypesArraysTuples.ts, 77, 43)) +>U : Symbol(U, Decl(mappedTypesArraysTuples.ts, 77, 43)) type Mapped = { [K in keyof T]: T[K] }; ->Mapped : Symbol(Mapped, Decl(mappedTypesArraysTuples.ts, 78, 59)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 79, 12)) ->K : Symbol(K, Decl(mappedTypesArraysTuples.ts, 79, 20)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 79, 12)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 79, 12)) ->K : Symbol(K, Decl(mappedTypesArraysTuples.ts, 79, 20)) +>Mapped : Symbol(Mapped, Decl(mappedTypesArraysTuples.ts, 77, 59)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 78, 12)) +>K : Symbol(K, Decl(mappedTypesArraysTuples.ts, 78, 20)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 78, 12)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 78, 12)) +>K : Symbol(K, Decl(mappedTypesArraysTuples.ts, 78, 20)) type F = ElementType>; ->F : Symbol(F, Decl(mappedTypesArraysTuples.ts, 79, 42)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 81, 7)) ->ElementType : Symbol(ElementType, Decl(mappedTypesArraysTuples.ts, 74, 1)) ->Mapped : Symbol(Mapped, Decl(mappedTypesArraysTuples.ts, 78, 59)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 81, 7)) +>F : Symbol(F, Decl(mappedTypesArraysTuples.ts, 78, 42)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 80, 7)) +>ElementType : Symbol(ElementType, Decl(mappedTypesArraysTuples.ts, 73, 1)) +>Mapped : Symbol(Mapped, Decl(mappedTypesArraysTuples.ts, 77, 59)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 80, 7)) type R1 = F<[string, number, boolean]>; // string | number | boolean ->R1 : Symbol(R1, Decl(mappedTypesArraysTuples.ts, 81, 35)) ->F : Symbol(F, Decl(mappedTypesArraysTuples.ts, 79, 42)) +>R1 : Symbol(R1, Decl(mappedTypesArraysTuples.ts, 80, 35)) +>F : Symbol(F, Decl(mappedTypesArraysTuples.ts, 78, 42)) type R2 = ElementType>; // string | number | boolean ->R2 : Symbol(R2, Decl(mappedTypesArraysTuples.ts, 82, 39)) ->ElementType : Symbol(ElementType, Decl(mappedTypesArraysTuples.ts, 74, 1)) ->Mapped : Symbol(Mapped, Decl(mappedTypesArraysTuples.ts, 78, 59)) +>R2 : Symbol(R2, Decl(mappedTypesArraysTuples.ts, 81, 39)) +>ElementType : Symbol(ElementType, Decl(mappedTypesArraysTuples.ts, 73, 1)) +>Mapped : Symbol(Mapped, Decl(mappedTypesArraysTuples.ts, 77, 59)) // Repro from #26163 declare function acceptArray(arr: any[]): void; ->acceptArray : Symbol(acceptArray, Decl(mappedTypesArraysTuples.ts, 83, 57)) ->arr : Symbol(arr, Decl(mappedTypesArraysTuples.ts, 87, 29)) +>acceptArray : Symbol(acceptArray, Decl(mappedTypesArraysTuples.ts, 82, 57)) +>arr : Symbol(arr, Decl(mappedTypesArraysTuples.ts, 86, 29)) declare function mapArray(arr: T): Mapped; ->mapArray : Symbol(mapArray, Decl(mappedTypesArraysTuples.ts, 87, 47)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 88, 26)) ->arr : Symbol(arr, Decl(mappedTypesArraysTuples.ts, 88, 43)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 88, 26)) ->Mapped : Symbol(Mapped, Decl(mappedTypesArraysTuples.ts, 78, 59)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 88, 26)) +>mapArray : Symbol(mapArray, Decl(mappedTypesArraysTuples.ts, 86, 47)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 87, 26)) +>arr : Symbol(arr, Decl(mappedTypesArraysTuples.ts, 87, 43)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 87, 26)) +>Mapped : Symbol(Mapped, Decl(mappedTypesArraysTuples.ts, 77, 59)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 87, 26)) function acceptMappedArray(arr: T) { ->acceptMappedArray : Symbol(acceptMappedArray, Decl(mappedTypesArraysTuples.ts, 88, 62)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 89, 27)) ->arr : Symbol(arr, Decl(mappedTypesArraysTuples.ts, 89, 44)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 89, 27)) +>acceptMappedArray : Symbol(acceptMappedArray, Decl(mappedTypesArraysTuples.ts, 87, 62)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 88, 27)) +>arr : Symbol(arr, Decl(mappedTypesArraysTuples.ts, 88, 44)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 88, 27)) acceptArray(mapArray(arr)); ->acceptArray : Symbol(acceptArray, Decl(mappedTypesArraysTuples.ts, 83, 57)) ->mapArray : Symbol(mapArray, Decl(mappedTypesArraysTuples.ts, 87, 47)) ->arr : Symbol(arr, Decl(mappedTypesArraysTuples.ts, 89, 44)) +>acceptArray : Symbol(acceptArray, Decl(mappedTypesArraysTuples.ts, 82, 57)) +>mapArray : Symbol(mapArray, Decl(mappedTypesArraysTuples.ts, 86, 47)) +>arr : Symbol(arr, Decl(mappedTypesArraysTuples.ts, 88, 44)) } // Repro from #26163 type Unconstrained = ElementType>; ->Unconstrained : Symbol(Unconstrained, Decl(mappedTypesArraysTuples.ts, 91, 1)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 95, 19)) ->ElementType : Symbol(ElementType, Decl(mappedTypesArraysTuples.ts, 74, 1)) ->Mapped : Symbol(Mapped, Decl(mappedTypesArraysTuples.ts, 78, 59)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 95, 19)) +>Unconstrained : Symbol(Unconstrained, Decl(mappedTypesArraysTuples.ts, 90, 1)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 94, 19)) +>ElementType : Symbol(ElementType, Decl(mappedTypesArraysTuples.ts, 73, 1)) +>Mapped : Symbol(Mapped, Decl(mappedTypesArraysTuples.ts, 77, 59)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 94, 19)) type T1 = Unconstrained<[string, number, boolean]>; // string | number | boolean ->T1 : Symbol(T1, Decl(mappedTypesArraysTuples.ts, 95, 47)) ->Unconstrained : Symbol(Unconstrained, Decl(mappedTypesArraysTuples.ts, 91, 1)) +>T1 : Symbol(T1, Decl(mappedTypesArraysTuples.ts, 94, 47)) +>Unconstrained : Symbol(Unconstrained, Decl(mappedTypesArraysTuples.ts, 90, 1)) type Constrained = ElementType>; ->Constrained : Symbol(Constrained, Decl(mappedTypesArraysTuples.ts, 96, 51)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 98, 17)) ->ElementType : Symbol(ElementType, Decl(mappedTypesArraysTuples.ts, 74, 1)) ->Mapped : Symbol(Mapped, Decl(mappedTypesArraysTuples.ts, 78, 59)) ->T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 98, 17)) +>Constrained : Symbol(Constrained, Decl(mappedTypesArraysTuples.ts, 95, 51)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 97, 17)) +>ElementType : Symbol(ElementType, Decl(mappedTypesArraysTuples.ts, 73, 1)) +>Mapped : Symbol(Mapped, Decl(mappedTypesArraysTuples.ts, 77, 59)) +>T : Symbol(T, Decl(mappedTypesArraysTuples.ts, 97, 17)) type T2 = Constrained<[string, number, boolean]>; // string | number | boolean ->T2 : Symbol(T2, Decl(mappedTypesArraysTuples.ts, 98, 59)) ->Constrained : Symbol(Constrained, Decl(mappedTypesArraysTuples.ts, 96, 51)) +>T2 : Symbol(T2, Decl(mappedTypesArraysTuples.ts, 97, 59)) +>Constrained : Symbol(Constrained, Decl(mappedTypesArraysTuples.ts, 95, 51)) diff --git a/tests/baselines/reference/mappedTypesArraysTuples.types b/tests/baselines/reference/mappedTypesArraysTuples.types index 2ec00ad565e3e..62fdd252f24f3 100644 --- a/tests/baselines/reference/mappedTypesArraysTuples.types +++ b/tests/baselines/reference/mappedTypesArraysTuples.types @@ -152,9 +152,6 @@ let y22 = nonpartial(x22); >nonpartial : (x: Partial) => T >x22 : { a: number | undefined; b?: string[] | undefined; } -type Awaited = T extends PromiseLike ? U : T; ->Awaited : Awaited - type Awaitified = { [P in keyof T]: Awaited }; >Awaitified : Awaitified diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index 8b70977a0e5a2..2904b5f51b9f9 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -447,7 +447,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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:1430:5: 'catch' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1435:5: 'catch' 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 diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index bc676c9dd5e85..dcc5013532b5c 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -351,7 +351,7 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of ~~~~~~~~~ !!! 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'. -!!! related TS2728 /.ts/lib.es5.d.ts:1430:5: 'catch' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1435:5: 'catch' is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 7467009abce93..c971cb35d64d6 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -398,7 +398,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! 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:1430:5: 'catch' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1435:5: 'catch' 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 @@ -445,5 +445,5 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of ~~~~~~~~~~~~~~~ !!! 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'. !!! error TS2345: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! related TS2728 /.ts/lib.es5.d.ts:1430:5: 'catch' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1435:5: 'catch' is declared here. var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok \ No newline at end of file diff --git a/tests/baselines/reference/promiseType.js b/tests/baselines/reference/promiseType.js index 84d9d713b4810..6285d0415f358 100644 --- a/tests/baselines/reference/promiseType.js +++ b/tests/baselines/reference/promiseType.js @@ -217,6 +217,8 @@ const pc6 = p.then(() => Promise.reject("1"), () => {}); const pc7 = p.then(() => Promise.reject("1"), () => {throw 1}); const pc8 = p.then(() => Promise.reject("1"), () => Promise.resolve(1)); const pc9 = p.then(() => Promise.reject("1"), () => Promise.reject(1)); + +const expected: undefined = undefined as Awaited; //// [promiseType.js] @@ -440,3 +442,4 @@ const pc6 = p.then(() => Promise.reject("1"), () => { }); const pc7 = p.then(() => Promise.reject("1"), () => { throw 1; }); const pc8 = p.then(() => Promise.reject("1"), () => Promise.resolve(1)); const pc9 = p.then(() => Promise.reject("1"), () => Promise.reject(1)); +const expected = undefined; diff --git a/tests/baselines/reference/promiseType.symbols b/tests/baselines/reference/promiseType.symbols index cec81cd7d8266..60589b5f4464b 100644 --- a/tests/baselines/reference/promiseType.symbols +++ b/tests/baselines/reference/promiseType.symbols @@ -1089,3 +1089,8 @@ const pc9 = p.then(() => Promise.reject("1"), () => Promise.reject(1)); >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, --, --)) >reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --)) +const expected: undefined = undefined as Awaited; +>expected : Symbol(expected, Decl(promiseType.ts, 219, 5)) +>undefined : Symbol(undefined) +>Awaited : Symbol(Awaited, Decl(lib.es5.d.ts, --, --)) + diff --git a/tests/baselines/reference/promiseType.types b/tests/baselines/reference/promiseType.types index dd20fb656ea5a..18e943c0ad032 100644 --- a/tests/baselines/reference/promiseType.types +++ b/tests/baselines/reference/promiseType.types @@ -1583,3 +1583,8 @@ const pc9 = p.then(() => Promise.reject("1"), () => Promise.reject(1)); >reject : (reason?: any) => Promise >1 : 1 +const expected: undefined = undefined as Awaited; +>expected : undefined +>undefined as Awaited : undefined +>undefined : undefined + diff --git a/tests/baselines/reference/promiseTypeInference.errors.txt b/tests/baselines/reference/promiseTypeInference.errors.txt index ada81bfb4962b..86dc5cdbd5f74 100644 --- a/tests/baselines/reference/promiseTypeInference.errors.txt +++ b/tests/baselines/reference/promiseTypeInference.errors.txt @@ -32,7 +32,7 @@ tests/cases/compiler/promiseTypeInference.ts(10,39): error TS2769: No overload m !!! error TS2769: Types of parameters 'success' and 'onfulfilled' are incompatible. !!! error TS2769: Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. !!! error TS2769: Type 'TResult1' is not assignable to type 'IPromise'. -!!! related TS2728 /.ts/lib.es5.d.ts:1430:5: 'catch' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1435: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:1423:57: The expected type comes from the return type of this signature. +!!! related TS6502 /.ts/lib.es5.d.ts:1428:57: The expected type comes from the return type of this signature. \ 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/baselines/reference/user/chrome-devtools-frontend.log b/tests/baselines/reference/user/chrome-devtools-frontend.log index 0a62d4af67571..4bf5d8259a1cd 100644 --- a/tests/baselines/reference/user/chrome-devtools-frontend.log +++ b/tests/baselines/reference/user/chrome-devtools-frontend.log @@ -1,6 +1,6 @@ Exit Code: 1 Standard output: -../../../../built/local/lib.es5.d.ts(1433,11): error TS2300: Duplicate identifier 'ArrayLike'. +../../../../built/local/lib.es5.d.ts(1438,11): error TS2300: Duplicate identifier 'ArrayLike'. ../../../../node_modules/@types/node/globals.d.ts(168,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 & typeof globalThis'. 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. diff --git a/tests/baselines/reference/user/follow-redirects.log b/tests/baselines/reference/user/follow-redirects.log index 34010feffeb43..4a398936a3862 100644 --- a/tests/baselines/reference/user/follow-redirects.log +++ b/tests/baselines/reference/user/follow-redirects.log @@ -1,18 +1,21 @@ Exit Code: 1 Standard output: -node_modules/follow-redirects/index.js(82,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(83,10): error TS2339: Property 'abort' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(130,10): error TS2339: Property 'once' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(133,12): error TS2339: Property 'socket' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(143,8): error TS2339: Property 'once' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(144,8): error TS2339: Property 'once' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(214,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(253,16): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(303,12): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(337,35): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. +node_modules/follow-redirects/index.js(96,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(97,10): error TS2339: Property 'abort' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(144,10): error TS2339: Property 'once' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(147,12): error TS2339: Property 'socket' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(157,8): error TS2339: Property 'once' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(158,8): error TS2339: Property 'once' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(228,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(267,16): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(317,12): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(343,35): 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/follow-redirects/index.js(345,14): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(357,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(354,14): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(366,13): error TS2339: Property 'cause' does not exist on type 'CustomError'. +node_modules/follow-redirects/index.js(367,12): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(374,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(483,25): error TS2339: Property 'code' does not exist on type 'Error'. diff --git a/tests/baselines/reference/user/puppeteer.log b/tests/baselines/reference/user/puppeteer.log index 4694668e4349f..6fe479f6404b3 100644 --- a/tests/baselines/reference/user/puppeteer.log +++ b/tests/baselines/reference/user/puppeteer.log @@ -22,6 +22,7 @@ lib/Coverage.js(208,15): error TS2503: Cannot find namespace 'Protocol'. lib/EmulationManager.js(36,16): error TS2503: Cannot find namespace 'Protocol'. lib/ExecutionContext.js(26,15): error TS2503: Cannot find namespace 'Protocol'. lib/ExecutionContext.js(158,18): error TS2503: Cannot find namespace 'Protocol'. +lib/ExecutionContext.js(186,14): error TS2503: Cannot find namespace 'Protocol'. lib/FrameManager.js(151,15): error TS2503: Cannot find namespace 'Protocol'. lib/FrameManager.js(173,15): error TS2503: Cannot find namespace 'Protocol'. lib/FrameManager.js(230,15): error TS2503: Cannot find namespace 'Protocol'. @@ -42,7 +43,7 @@ lib/NetworkManager.js(295,15): error TS2503: Cannot find namespace 'Protocol'. lib/NetworkManager.js(319,15): error TS2503: Cannot find namespace 'Protocol'. lib/NetworkManager.js(529,15): error TS2503: Cannot find namespace 'Protocol'. lib/NetworkManager.js(668,15): error TS2503: Cannot find namespace 'Protocol'. -lib/Page.js(94,33): error TS2345: Argument of type 'CDPSession' is not assignable to parameter of type 'Puppeteer.CDPSession'. +lib/Page.js(93,33): error TS2345: Argument of type 'CDPSession' is not assignable to parameter of type 'Puppeteer.CDPSession'. Types of property 'on' are incompatible. Type '(event: string | symbol, listener: (...args: any[]) => void) => CDPSession' is not assignable to type '(event: T, listener: (arg: any) => void) => CDPSession'. Types of parameters 'event' and 'event' are incompatible. @@ -52,20 +53,20 @@ lib/Page.js(94,33): error TS2345: Argument of type 'CDPSession' is not assignabl Type 'T' is not assignable to type 'symbol'. Type 'string | number | symbol' is not assignable to type 'symbol'. Type 'string' is not assignable to type 'symbol'. -lib/Page.js(147,15): error TS2503: Cannot find namespace 'Protocol'. -lib/Page.js(220,15): error TS2503: Cannot find namespace 'Protocol'. -lib/Page.js(388,20): error TS2503: Cannot find namespace 'Protocol'. -lib/Page.js(451,7): error TS2740: Type '(...args: any[]) => Promise' is missing the following properties from type 'Window': applicationCache, clientInformation, closed, customElements, and 222 more. -lib/Page.js(461,9): error TS2349: This expression is not callable. +lib/Page.js(143,15): error TS2503: Cannot find namespace 'Protocol'. +lib/Page.js(215,15): error TS2503: Cannot find namespace 'Protocol'. +lib/Page.js(383,20): error TS2503: Cannot find namespace 'Protocol'. +lib/Page.js(446,7): error TS2740: Type '(...args: any[]) => Promise' is missing the following properties from type 'Window': applicationCache, clientInformation, closed, customElements, and 222 more. +lib/Page.js(456,9): error TS2349: This expression is not callable. Type 'Window' has no call signatures. -lib/Page.js(497,15): error TS2503: Cannot find namespace 'Protocol'. -lib/Page.js(507,22): error TS2503: Cannot find namespace 'Protocol'. -lib/Page.js(520,15): error TS2503: Cannot find namespace 'Protocol'. -lib/Page.js(530,15): error TS2503: Cannot find namespace 'Protocol'. -lib/Page.js(555,15): error TS2503: Cannot find namespace 'Protocol'. -lib/Page.js(608,14): error TS2503: Cannot find namespace 'Protocol'. -lib/Page.js(944,19): error TS2503: Cannot find namespace 'Protocol'. -lib/Page.js(1354,15): error TS2503: Cannot find namespace 'Protocol'. +lib/Page.js(492,15): error TS2503: Cannot find namespace 'Protocol'. +lib/Page.js(502,22): error TS2503: Cannot find namespace 'Protocol'. +lib/Page.js(515,15): error TS2503: Cannot find namespace 'Protocol'. +lib/Page.js(525,15): error TS2503: Cannot find namespace 'Protocol'. +lib/Page.js(550,15): error TS2503: Cannot find namespace 'Protocol'. +lib/Page.js(603,14): error TS2503: Cannot find namespace 'Protocol'. +lib/Page.js(939,19): error TS2503: Cannot find namespace 'Protocol'. +lib/Page.js(1350,15): error TS2503: Cannot find namespace 'Protocol'. lib/Target.js(23,15): error TS2503: Cannot find namespace 'Protocol'. lib/Target.js(87,7): error TS2322: Type 'Promise' is not assignable to type 'Promise'. Type 'Worker | Worker' is not assignable to type 'Worker'. diff --git a/tests/baselines/reference/user/sift.log b/tests/baselines/reference/user/sift.log deleted file mode 100644 index 198e2fd125bae..0000000000000 --- a/tests/baselines/reference/user/sift.log +++ /dev/null @@ -1,7 +0,0 @@ -Exit Code: 1 -Standard output: -node_modules/sift/index.d.ts(80,15): error TS2307: Cannot find module './core'. - - - -Standard error: diff --git a/tests/cases/compiler/asyncFunctionReturnType.ts b/tests/cases/compiler/asyncFunctionReturnType.ts index 3bd7a0e998ac2..906b5fb6946cf 100644 --- a/tests/cases/compiler/asyncFunctionReturnType.ts +++ b/tests/cases/compiler/asyncFunctionReturnType.ts @@ -63,7 +63,7 @@ async function fGenericIndexedTypeForExplicitPromiseOfAnyProp( return Promise.resolve(obj.anyProp); } -async function fGenericIndexedTypeForKProp(obj: TObj, key: K): Promise { +async function fGenericIndexedTypeForKProp(obj: TObj, key: K): Promise> { return obj[key]; } @@ -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); diff --git a/tests/cases/compiler/promiseType.ts b/tests/cases/compiler/promiseType.ts index ba4a7f6041396..db3fe4caa5553 100644 --- a/tests/cases/compiler/promiseType.ts +++ b/tests/cases/compiler/promiseType.ts @@ -217,3 +217,5 @@ const pc6 = p.then(() => Promise.reject("1"), () => {}); const pc7 = p.then(() => Promise.reject("1"), () => {throw 1}); const pc8 = p.then(() => Promise.reject("1"), () => Promise.resolve(1)); const pc9 = p.then(() => Promise.reject("1"), () => Promise.reject(1)); + +const expected: undefined = undefined as Awaited; diff --git a/tests/cases/conformance/types/mapped/mappedTypesArraysTuples.ts b/tests/cases/conformance/types/mapped/mappedTypesArraysTuples.ts index 2c0f7433ea31c..e3d0a594ffb61 100644 --- a/tests/cases/conformance/types/mapped/mappedTypesArraysTuples.ts +++ b/tests/cases/conformance/types/mapped/mappedTypesArraysTuples.ts @@ -60,7 +60,6 @@ let y21 = nonpartial(x21); declare let x22: { a: number | undefined, b?: string[] }; let y22 = nonpartial(x22); -type Awaited = T extends PromiseLike ? U : T; type Awaitified = { [P in keyof T]: Awaited }; declare function all(...values: T): Promise>;