mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
77 lines
3.3 KiB
Diff
77 lines
3.3 KiB
Diff
--- old.asyncArrowFunction_allowJs.errors.txt
|
|
+++ new.asyncArrowFunction_allowJs.errors.txt
|
|
@@= skipped -0, +0 lines =@@
|
|
-file.js(3,17): error TS2322: Type 'number' is not assignable to type 'string'.
|
|
-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>'?
|
|
-file.js(7,23): error TS2322: Type 'number' is not assignable to type 'string'.
|
|
-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>'?
|
|
-file.js(12,2): error TS2322: Type 'number' is not assignable to type 'string'.
|
|
-file.js(16,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>'?
|
|
-file.js(25,3): error TS2345: Argument of type '() => Promise<number>' is not assignable to parameter of type '() => string'.
|
|
- Type 'Promise<number>' is not assignable to type 'string'.
|
|
-
|
|
-
|
|
-==== file.js (7 errors) ====
|
|
+file.js(2,20): error TS1005: '}' expected.
|
|
+file.js(6,20): error TS1005: '}' expected.
|
|
+file.js(10,20): error TS1005: '}' expected.
|
|
+file.js(16,20): error TS1005: '}' expected.
|
|
+file.js(21,20): error TS1005: '}' expected.
|
|
+file.js(22,12): error TS7006: Parameter 'p' implicitly has an 'any' type.
|
|
+
|
|
+
|
|
+==== file.js (6 errors) ====
|
|
// Error (good)
|
|
/** @type {function(): string} */
|
|
+ ~
|
|
+!!! error TS1005: '}' expected.
|
|
const a = () => 0
|
|
- ~
|
|
-!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
|
|
|
// Error (good)
|
|
/** @type {function(): string} */
|
|
- ~~~~~~
|
|
-!!! 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>'?
|
|
+ ~
|
|
+!!! error TS1005: '}' expected.
|
|
const b = async () => 0
|
|
- ~
|
|
-!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
|
|
|
// No error (bad)
|
|
/** @type {function(): string} */
|
|
- ~~~~~~
|
|
-!!! 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>'?
|
|
+ ~
|
|
+!!! error TS1005: '}' expected.
|
|
const c = async () => {
|
|
return 0
|
|
- ~~~~~~
|
|
-!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
|
}
|
|
|
|
// Error (good)
|
|
/** @type {function(): string} */
|
|
- ~~~~~~
|
|
-!!! 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>'?
|
|
+ ~
|
|
+!!! error TS1005: '}' expected.
|
|
const d = async () => {
|
|
return ""
|
|
}
|
|
|
|
/** @type {function(function(): string): void} */
|
|
+ ~
|
|
+!!! error TS1005: '}' expected.
|
|
const f = (p) => {}
|
|
+ ~
|
|
+!!! error TS7006: Parameter 'p' implicitly has an 'any' type.
|
|
|
|
// Error (good)
|
|
f(async () => {
|
|
- ~~~~~~~~~~~~~
|
|
-!!! error TS2345: Argument of type '() => Promise<number>' is not assignable to parameter of type '() => string'.
|
|
-!!! error TS2345: Type 'Promise<number>' is not assignable to type 'string'.
|
|
return 0
|
|
})
|