Closed
Description
TypeScript Version: 3.2.1
Search Terms:
strucutre spread + generic
Code
function id<T>(input: T): T { return input }
function getFoo ({ foo = 42 }) {
return foo
}
const newGetFoo = id(getFoo)
const newGetFoo2 = id(function getFoo ({ foo = 42 }) {
return foo
})
Expected behavior:
newGetFoo and newGetFoo2 should have the same signature
Actual behavior:
newGetFoo
is:
({ foo }: {
foo?: number | undefined;
}) => number
but newGetFoo2
is
({ foo }: any) => number
Related Issues: