facebook / facebook/flow

(a | b) & c != (a & c) | (b & c) for objects

Open
#4,269 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

```js
/* @flow */

type DataType =
| {'grant_type': 'silent'}
| {'grant_type': 'password', 'username': string, 'password': string}
type BodyType = {
'client_id': string,
'client_secret': string,
'scope': string,
} & DataType

function request(data: DataType) {
const body: BodyType = {
...data,
'client_id': '123',
'client_secret': '123',
'scope': '123',
}
}
```
Why we can't do that? What's wrong?

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.