|
| 1 | +tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction7_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. |
| 2 | + Type 'Promise<T | (T extends PromiseLike<infer U> ? U : T)>' is not assignable to type 'PromiseLike<T>'. |
| 3 | + Types of property 'then' are incompatible. |
| 4 | + 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>'. |
| 5 | + Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. |
| 6 | + Types of parameters 'value' and 'value' are incompatible. |
| 7 | + Type 'T | (T extends PromiseLike<infer U> ? U : T)' is not assignable to type 'T'. |
| 8 | + '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 '{}'. |
| 9 | + Type 'T extends PromiseLike<infer U> ? U : T' is not assignable to type 'T'. |
| 10 | + '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 '{}'. |
| 11 | + Type 'unknown' is not assignable to type 'T'. |
| 12 | + 'unknown' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'. |
1 | 13 | tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction7_es5.ts(3,24): error TS2524: 'await' expressions cannot be used in a parameter initializer.
|
2 | 14 | tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction7_es5.ts(3,29): error TS1109: Expression expected.
|
| 15 | +tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction7_es5.ts(3,32): 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. |
3 | 16 |
|
4 | 17 |
|
5 |
| -==== tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction7_es5.ts (2 errors) ==== |
| 18 | +==== tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction7_es5.ts (4 errors) ==== |
6 | 19 | var bar = async (): Promise<void> => {
|
| 20 | + ~~~~~~~~~~~~~ |
| 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. |
| 22 | +!!! error TS1055: Type 'Promise<T | (T extends PromiseLike<infer U> ? U : T)>' is not assignable to type 'PromiseLike<T>'. |
| 23 | +!!! error TS1055: Types of property 'then' are incompatible. |
| 24 | +!!! 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>'. |
| 25 | +!!! error TS1055: Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. |
| 26 | +!!! error TS1055: Types of parameters 'value' and 'value' are incompatible. |
| 27 | +!!! error TS1055: Type 'T | (T extends PromiseLike<infer U> ? U : T)' is not assignable to type 'T'. |
| 28 | +!!! 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 '{}'. |
| 29 | +!!! error TS1055: Type 'T extends PromiseLike<infer U> ? U : T' is not assignable to type 'T'. |
| 30 | +!!! 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 '{}'. |
| 31 | +!!! error TS1055: Type 'unknown' is not assignable to type 'T'. |
| 32 | +!!! error TS1055: 'unknown' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'. |
7 | 33 | // 'await' here is an identifier, and not an await expression.
|
8 | 34 | var foo = async (a = await): Promise<void> => {
|
9 | 35 | ~~~~~
|
10 | 36 | !!! error TS2524: 'await' expressions cannot be used in a parameter initializer.
|
11 | 37 | ~
|
12 | 38 | !!! error TS1109: Expression expected.
|
| 39 | + ~~~~~~~~~~~~~ |
| 40 | +!!! 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. |
13 | 41 | }
|
14 | 42 | }
|
0 commit comments