Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit does not work well with unions #9046

Closed
lazytype opened this issue Jul 4, 2023 · 3 comments
Closed

Omit does not work well with unions #9046

lazytype opened this issue Jul 4, 2023 · 3 comments

Comments

@lazytype
Copy link

lazytype commented Jul 4, 2023

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

@jbrown215
Copy link
Contributor

Addressed by 328d949 and coming out in 0.211

@lazytype
Copy link
Author

lazytype commented Jul 5, 2023

@jbrown215 I see the following error in the playground

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

@jbrown215
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants