async function AsyncFunction(): Promise<number> {
return 0;
}
Runs smoothly without any issues;
async function AsyncFunction(): AsyncFunctionReturnType {
return 0;
}
type AsyncFunctionReturnType = Promise<number>
Generates an error message stating:
"Type 'AsyncFunctionReturnType' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value. ts(1055)"
At first glance, they appear identical, so why does the syntax make a difference here?