forked from microsoft/TypeScript
/
asyncArrowFunction10_es5.errors.txt
36 lines (33 loc) · 4.17 KB
/
asyncArrowFunction10_es5.errors.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction10_es5.ts(1,21): error TS1055: Type 'PromiseConstructor' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
Type 'Promise<T | (T extends PromiseLike<infer U> ? U : T)>' is not assignable to type 'PromiseLike<T>'.
Types of property 'then' are incompatible.
Type '<TResult1 = T | (T extends PromiseLike<infer U> ? U : T), TResult2 = never>(onfulfilled?: (value: T | (T extends PromiseLike<infer U> ? U : T)) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>' is not assignable to type '<TResult1 = T, TResult2 = never>(onfulfilled?: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => PromiseLike<TResult1 | TResult2>'.
Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible.
Types of parameters 'value' and 'value' are incompatible.
Type 'T | (T extends PromiseLike<infer U> ? U : T)' is not assignable to type 'T'.
'T | (T extends PromiseLike<infer U> ? U : T)' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
Type 'T extends PromiseLike<infer U> ? U : T' is not assignable to type 'T'.
'T extends PromiseLike<infer U> ? U : T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
Type 'unknown' is not assignable to type 'T'.
'unknown' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction10_es5.ts(3,11): error TS2304: Cannot find name 'await'.
==== tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction10_es5.ts (2 errors) ====
var foo = async (): Promise<void> => {
~~~~~~~~~~~~~
!!! error TS1055: Type 'PromiseConstructor' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
!!! error TS1055: Type 'Promise<T | (T extends PromiseLike<infer U> ? U : T)>' is not assignable to type 'PromiseLike<T>'.
!!! error TS1055: Types of property 'then' are incompatible.
!!! error TS1055: Type '<TResult1 = T | (T extends PromiseLike<infer U> ? U : T), TResult2 = never>(onfulfilled?: (value: T | (T extends PromiseLike<infer U> ? U : T)) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>' is not assignable to type '<TResult1 = T, TResult2 = never>(onfulfilled?: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => PromiseLike<TResult1 | TResult2>'.
!!! error TS1055: Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible.
!!! error TS1055: Types of parameters 'value' and 'value' are incompatible.
!!! error TS1055: Type 'T | (T extends PromiseLike<infer U> ? U : T)' is not assignable to type 'T'.
!!! error TS1055: 'T | (T extends PromiseLike<infer U> ? U : T)' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
!!! error TS1055: Type 'T extends PromiseLike<infer U> ? U : T' is not assignable to type 'T'.
!!! error TS1055: 'T extends PromiseLike<infer U> ? U : T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
!!! error TS1055: Type 'unknown' is not assignable to type 'T'.
!!! error TS1055: 'unknown' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
// Legal to use 'await' in a type context.
var v: await;
~~~~~
!!! error TS2304: Cannot find name 'await'.
}