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
Copy file name to clipboardExpand all lines: src/compiler/diagnosticMessages.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -175,7 +175,7 @@
175
175
"category": "Error",
176
176
"code": 1057
177
177
},
178
-
"Type used as operand to 'await' or the return type of an async function must not contain a callable 'then' member if it is not a promise.": {
178
+
"Type used as operand to 'await' or the return type of an async function must either be a valid promise or must not contain a callable 'then' member.": {
Type 'void' is not assignable to type 'PromiseLike<any>'.
11
-
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(17,16): error TS1058: Type used as operand to 'await' or the return type of an async function must not contain a callable 'then' member if it is not a promise.
12
-
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(23,25): error TS1058: Type used as operand to 'await' or the return type of an async function must not contain a callable 'then' member if it is not a promise.
11
+
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(17,16): error TS1058: Type used as operand to 'await' or the return type of an async function must either be a valid promise or must not contain a callable 'then' member.
12
+
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(23,25): error TS1058: Type used as operand to 'await' or the return type of an async function must either be a valid promise or must not contain a callable 'then' member.
async function fn13() { return thenable; } // error
49
49
~~~~
50
-
!!! error TS1058: Type used as operand to 'await' or the return type of an async function must not contain a callable 'then' member if it is not a promise.
50
+
!!! error TS1058: Type used as operand to 'await' or the return type of an async function must either be a valid promise or must not contain a callable 'then' member.
51
51
async function fn14() { await 1; } // valid: Promise<void>
52
52
async function fn15() { await null; } // valid: Promise<void>
53
53
async function fn16() { await undefined; } // valid: Promise<void>
54
54
async function fn17() { await a; } // valid: Promise<void>
55
55
async function fn18() { await obj; } // valid: Promise<void>
56
56
async function fn19() { await thenable; } // error
57
57
~~~~~~~~~~~~~~
58
-
!!! error TS1058: Type used as operand to 'await' or the return type of an async function must not contain a callable 'then' member if it is not a promise.
58
+
!!! error TS1058: Type used as operand to 'await' or the return type of an async function must either be a valid promise or must not contain a callable 'then' member.
0 commit comments