facebook/flow

`Omit` does not work well with unions

lazytype opened this issue · 3 comments

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

Addressed by 328d949 and coming out in 0.211

@jbrown215 I see the following error in the playground

TryFlow encountered an internal error: [0,[248,"Jsoo_runtime.Error.Exn",35],{}]

I confirmed in a local project that it works. Not sure why it makes the playground overflow