Closed
Description
Bug Report
π Search Terms
omit loses type info union generic
π Version & Regression Information
Version: 4.2.4
- I was unable to test this on prior versions because omg it's exhausting
β― Playground Link
Playground link with relevant code
π» Code
interface Base<T> {
x: T,
y: number;
}
type Additional = { a: number } | { b: string };
type Specific<T> = Base<T> & Additional;
type Final<T> = Omit<Specific<T>, 'y'>
const x: Final<number> = { x: 23 }; // must warn about missing 'a' | 'b', but doesn't
π Actual behavior
Final
type doesn't have properties of type Additional
π Expected behavior
Final
type must properties of type Additional