You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(8,23): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
6
6
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(9,23): error TS1055: Type 'PromiseLike' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
7
7
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(10,23): error TS1055: Type 'typeof Thenable' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
8
-
Type 'Thenable' is not assignable to type 'PromiseLike<T>'.
8
+
Type 'Thenable' is not assignable to type 'PromiseLike<T extends PromiseLike<infer U> ? U : T>'.
9
9
Types of property 'then' are incompatible.
10
-
Type '() => void' is not assignable to type '<TResult1 = T, TResult2 = never>(onfulfilled?: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => PromiseLike<TResult1 | TResult2>'.
10
+
Type '() => void' is not assignable to type '<TResult1 = T extends PromiseLike<infer U> ? U : T, TResult2 = never>(onfulfilled?: (value: T extends PromiseLike<infer U> ? U : T) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => PromiseLike<TResult1 | TResult2>'.
11
11
Type 'void' is not assignable to type 'PromiseLike<TResult1 | TResult2>'.
12
12
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.
13
13
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.
!!! error TS1055: Type 'typeof Thenable' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
41
-
!!! error TS1055: Type 'Thenable' is not assignable to type 'PromiseLike<T>'.
41
+
!!! error TS1055: Type 'Thenable' is not assignable to type 'PromiseLike<T extends PromiseLike<infer U> ? U : T>'.
42
42
!!! error TS1055: Types of property 'then' are incompatible.
43
-
!!! error TS1055: Type '() => void' is not assignable to type '<TResult1 = T, TResult2 = never>(onfulfilled?: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => PromiseLike<TResult1 | TResult2>'.
43
+
!!! error TS1055: Type '() => void' is not assignable to type '<TResult1 = T extends PromiseLike<infer U> ? U : T, TResult2 = never>(onfulfilled?: (value: T extends PromiseLike<infer U> ? U : T) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => PromiseLike<TResult1 | TResult2>'.
44
44
!!! error TS1055: Type 'void' is not assignable to type 'PromiseLike<TResult1 | TResult2>'.
45
45
async function fn7() { return; } // valid: Promise<void>
46
46
async function fn8() { return 1; } // valid: Promise<number>
0 commit comments