`Omit` does not work well with unions
lazytype opened this issue · 3 comments
lazytype commented
Flow version: 0.211.0
Expected behavior
The following code has no type error
const object: Omit<
| {
type: 'A';
data: number;
a: number;
}
| {
type: 'B';
data: string;
b: string;
},
'type'
> = {data: 42, a: 42}
Actual behavior
Flow displays multiple errors
lazytype commented
@jbrown215 I see the following error in the playground
TryFlow encountered an internal error: [0,[248,"Jsoo_runtime.Error.Exn",35],{}]
jbrown215 commented
I confirmed in a local project that it works. Not sure why it makes the playground overflow