Closed as not planned
Description
Bug Report
π Search Terms
destructure, union, narrowing
π Version & Regression Information
v.4.7.4
, v4.8.0-beta
.
β― Playground Link
π» Code
const removeX = <T, X>({x, ...rest}: T & {x: X}): T => rest
π Actual behavior
It produces the following error:
Type 'Omit<T & { x: X; }, "x">' is not assignable to type 'T'.
'T' could be instantiated with an arbitrary type which could be unrelated to 'Omit<T & { x: X; }, "x">'.
π Expected behavior
There should be no error since Omit<T & { x: X; }, "x">
is essentially equal to T
.
Metadata
Metadata
Assignees
Labels
No labels