facebook / facebook/flow

Intersection type doesn't refine unions inside matching properties

Open
#5,018 18 comments 0 reactions 0 assignees View on GitHub
Typing: unions/intersections
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

[Reproducing using https://flow.org/try/](https://flow.org/try/#0C4TwDgpgBAshDO8CGBzaBeKBvAJk4SAXFALYCWAHhDgL5QBk2eBxWAUFFAGZkA2ErHv2IBGGmxriAxgHsAdvGBR5JBMjRRMXAK5ypwMvKgAKAbDWoIASmwcoZLiYgA6ZkmdDrtzuJpA)
```js
type Message = MessageEvent & {data: {
file: {file: File}
}}
onmessage = function (e: Message) {
if (e.data.file) {
// do stuff with File
}
}
```
## Expected
> :grinning:
## Actual
> property `file` Property not found in mixed

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.