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
-
The types of '(new (...)).then(...)' are incompatible between these types.
9
-
Type 'void' is not assignable to type 'PromiseLike<TResult1 | TResult2>'.
8
+
Construct signature return types 'Thenable' and 'PromiseLike<T>' are incompatible.
9
+
The types of 'then(...)' are incompatible between these types.
10
+
Type 'void' is not assignable to type 'PromiseLike<TResult1 | TResult2>'.
10
11
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.
11
12
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.
39
-
!!! error TS1055: The types of '(new (...)).then(...)' are incompatible between these types.
40
-
!!! error TS1055: Type 'void' is not assignable to type 'PromiseLike<TResult1 | TResult2>'.
40
+
!!! error TS1055: Construct signature return types 'Thenable' and 'PromiseLike<T>' are incompatible.
41
+
!!! error TS1055: The types of 'then(...)' are incompatible between these types.
42
+
!!! error TS1055: Type 'void' is not assignable to type 'PromiseLike<TResult1 | TResult2>'.
41
43
async function fn7() { return; } // valid: Promise<void>
42
44
async function fn8() { return 1; } // valid: Promise<number>
43
45
async function fn9() { return null; } // valid: Promise<any>
Copy file name to clipboardExpand all lines: tests/baselines/reference/generatorTypeCheck25.errors.txt
+14-12
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,11 @@
1
1
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck25.ts(4,5): error TS2322: Type '() => Generator<Bar | Baz, void, undefined>' is not assignable to type '() => Iterable<Foo>'.
2
-
The types of '()[Symbol.iterator]().next(...)' are incompatible between these types.
3
-
Type 'IteratorResult<Bar | Baz, void>' is not assignable to type 'IteratorResult<Foo, any>'.
4
-
Type 'IteratorYieldResult<Bar | Baz>' is not assignable to type 'IteratorResult<Foo, any>'.
5
-
Type 'IteratorYieldResult<Bar | Baz>' is not assignable to type 'IteratorYieldResult<Foo>'.
6
-
Type 'Bar | Baz' is not assignable to type 'Foo'.
7
-
Property 'x' is missing in type 'Baz' but required in type 'Foo'.
2
+
Call signature return types 'Generator<Bar | Baz, void, undefined>' and 'Iterable<Foo>' are incompatible.
3
+
The types of '[Symbol.iterator]().next(...)' are incompatible between these types.
4
+
Type 'IteratorResult<Bar | Baz, void>' is not assignable to type 'IteratorResult<Foo, any>'.
5
+
Type 'IteratorYieldResult<Bar | Baz>' is not assignable to type 'IteratorResult<Foo, any>'.
6
+
Type 'IteratorYieldResult<Bar | Baz>' is not assignable to type 'IteratorYieldResult<Foo>'.
7
+
Type 'Bar | Baz' is not assignable to type 'Foo'.
8
+
Property 'x' is missing in type 'Baz' but required in type 'Foo'.
Copy file name to clipboardExpand all lines: tests/baselines/reference/generatorTypeCheck63.errors.txt
+12-10
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,10 @@
1
1
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts(24,61): error TS2345: Argument of type '(state: State) => Generator<number, State, undefined>' is not assignable to parameter of type '(a: State) => IterableIterator<State>'.
2
-
The types of '(...).next(...)' are incompatible between these types.
3
-
Type 'IteratorResult<number, State>' is not assignable to type 'IteratorResult<State, any>'.
4
-
Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorResult<State, any>'.
5
-
Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorYieldResult<State>'.
6
-
Type 'number' is not assignable to type 'State'.
2
+
Call signature return types 'Generator<number, State, undefined>' and 'IterableIterator<State>' are incompatible.
3
+
The types of 'next(...)' are incompatible between these types.
4
+
Type 'IteratorResult<number, State>' is not assignable to type 'IteratorResult<State, any>'.
5
+
Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorResult<State, any>'.
6
+
Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorYieldResult<State>'.
!!! error TS2345: Argument of type '(state: State) => Generator<number, State, undefined>' is not assignable to parameter of type '(a: State) => IterableIterator<State>'.
36
-
!!! error TS2345: The types of '(...).next(...)' are incompatible between these types.
37
-
!!! error TS2345: Type 'IteratorResult<number, State>' is not assignable to type 'IteratorResult<State, any>'.
38
-
!!! error TS2345: Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorResult<State, any>'.
39
-
!!! error TS2345: Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorYieldResult<State>'.
40
-
!!! error TS2345: Type 'number' is not assignable to type 'State'.
37
+
!!! error TS2345: Call signature return types 'Generator<number, State, undefined>' and 'IterableIterator<State>' are incompatible.
38
+
!!! error TS2345: The types of 'next(...)' are incompatible between these types.
39
+
!!! error TS2345: Type 'IteratorResult<number, State>' is not assignable to type 'IteratorResult<State, any>'.
40
+
!!! error TS2345: Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorResult<State, any>'.
41
+
!!! error TS2345: Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorYieldResult<State>'.
42
+
!!! error TS2345: Type 'number' is not assignable to type 'State'.
0 commit comments