Skip to content

Commit 2f0e50c

Browse files
committed
Make getAwaitedType private
Also, fix an additional baseline change.
1 parent 766a201 commit 2f0e50c

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

src/compiler/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3421,6 +3421,7 @@ namespace ts {
34213421
getWidenedType(type: Type): Type;
34223422
/* @internal */
34233423
getPromisedTypeOfPromise(promise: Type, errorNode?: Node): Type | undefined;
3424+
/* @internal */
34243425
getAwaitedType(type: Type): Type | undefined;
34253426
getReturnTypeOfSignature(signature: Signature): Type;
34263427
/**

tests/baselines/reference/api/tsserverlibrary.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2035,7 +2035,6 @@ declare namespace ts {
20352035
getBaseTypes(type: InterfaceType): BaseType[];
20362036
getBaseTypeOfLiteralType(type: Type): Type;
20372037
getWidenedType(type: Type): Type;
2038-
getAwaitedType(type: Type): Type | undefined;
20392038
getReturnTypeOfSignature(signature: Signature): Type;
20402039
getNullableType(type: Type, flags: TypeFlags): Type;
20412040
getNonNullableType(type: Type): Type;

tests/baselines/reference/api/typescript.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2035,7 +2035,6 @@ declare namespace ts {
20352035
getBaseTypes(type: InterfaceType): BaseType[];
20362036
getBaseTypeOfLiteralType(type: Type): Type;
20372037
getWidenedType(type: Type): Type;
2038-
getAwaitedType(type: Type): Type | undefined;
20392038
getReturnTypeOfSignature(signature: Signature): Type;
20402039
getNullableType(type: Type, flags: TypeFlags): Type;
20412040
getNonNullableType(type: Type): Type;

tests/baselines/reference/asyncArrowFunction_allowJs.errors.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
tests/cases/conformance/async/es2017/asyncArrowFunction/file.js(3,17): error TS2322: Type '0' is not assignable to type 'string'.
2-
tests/cases/conformance/async/es2017/asyncArrowFunction/file.js(6,24): error TS1064: The return type of an async function or method must be the global Promise<T> type.
2+
tests/cases/conformance/async/es2017/asyncArrowFunction/file.js(6,24): error TS1064: The return type of an async function or method must be the global Promise<T> type. Did you mean to write 'Promise<string>'?
33
tests/cases/conformance/async/es2017/asyncArrowFunction/file.js(7,23): error TS2322: Type '0' is not assignable to type 'string'.
4-
tests/cases/conformance/async/es2017/asyncArrowFunction/file.js(10,24): error TS1064: The return type of an async function or method must be the global Promise<T> type.
4+
tests/cases/conformance/async/es2017/asyncArrowFunction/file.js(10,24): error TS1064: The return type of an async function or method must be the global Promise<T> type. Did you mean to write 'Promise<string>'?
55
tests/cases/conformance/async/es2017/asyncArrowFunction/file.js(12,2): error TS2322: Type '0' is not assignable to type 'string'.
66
tests/cases/conformance/async/es2017/asyncArrowFunction/file.js(19,3): error TS2345: Argument of type '() => Promise<number>' is not assignable to parameter of type '() => string'.
77
Type 'Promise<number>' is not assignable to type 'string'.
@@ -17,15 +17,15 @@ tests/cases/conformance/async/es2017/asyncArrowFunction/file.js(19,3): error TS2
1717
// Error (good)
1818
/** @type {function(): string} */
1919
~~~~~~
20-
!!! error TS1064: The return type of an async function or method must be the global Promise<T> type.
20+
!!! error TS1064: The return type of an async function or method must be the global Promise<T> type. Did you mean to write 'Promise<string>'?
2121
const b = async () => 0
2222
~
2323
!!! error TS2322: Type '0' is not assignable to type 'string'.
2424

2525
// No error (bad)
2626
/** @type {function(): string} */
2727
~~~~~~
28-
!!! error TS1064: The return type of an async function or method must be the global Promise<T> type.
28+
!!! error TS1064: The return type of an async function or method must be the global Promise<T> type. Did you mean to write 'Promise<string>'?
2929
const c = async () => {
3030
return 0
3131
~~~~~~~~

0 commit comments

Comments
 (0)