Closed
Description
openedon Oct 4, 2019
TypeScript Version: 3.6.3, 3.7-Beta
Search Terms:
- generic function infer return type
- generic function destructure
Code
Minimal reproducible example:
interface TestGeneric<TG> {
f: string
g: TG
}
const removeF = <TX>({ f, ...rest }: TestGeneric<TX>) => {
return rest
}
const result: number = removeF<number>({ f: '', g: 3 }).g
Expected behavior:
No type errors
Actual behavior:
Type 'TX' is not assignable to type 'number'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment