Closed
Description
TypeScript Version: 3.2.2
Search Terms: Promise, function return type
Code
Example 1
const increment: (
num: number,
str: string
) => Promise<((s: string) => any) | string> | string = async (num, str) => {
// return ''
return a => {
return a.length
}
}
Exmaple 2
const increment: (
num: number,
str: string
) => Promise<((s: string) => any) | string> = async (num, str) => {
// return ''
return a => {
return a.length
}
}
Expected behavior:
type of a is string
Actual behavior:
a in Example 1 doesn't have type
Playground Link:
Related Issues: