Skip to content
New issue

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

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

Already on GitHub? # to your account

Can't spread props with intersection-of-objects type #3504

Open
gaelollivier opened this issue Mar 13, 2017 · 0 comments
Open

Can't spread props with intersection-of-objects type #3504

gaelollivier opened this issue Mar 13, 2017 · 0 comments
Labels

Comments

@gaelollivier
Copy link

This one is very much like #1329, but with JSX props spread instead of object spread:

/* @flow */

type T = { foo: string } & { bar: string };

const Test = (props: T) => null

function bar(x: T): void {
  (x.foo : string); // ok
  (x.bar : string); // ok

  const y = <Test {...x} /> // not ok
}

https://flowtype.org/try/#0PQKgBAAgZgNg9gdzCYAoVAXAngBwKZgAqYAvGAN5hRxwBcYAzhgE4CWAdgOZgC+YAZBTAAjAIbN6TNl14BudAGM47JkTyqyAChzM4OBvUIBKUgD4w7AK4wY6KJfYKMrZSPGaAHoaP0AbnFYAEwpUMDBPADpqODBJFg5OI1kwYGAwOABrUPCPCLFmWMZ4riSUtMz0MKUVDDAsUjAAHkJ1WvIIjo8+YHNUizhaip4gA

I guess it should be added to #1331 as well

@nmn nmn added the bug label Mar 13, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants