facebook / facebook/flow

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

Open
#3,504 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

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

```jsx
/* @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 = // not ok
}
```

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

I guess it should be added to #1331 as well

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.