Intersection of union type cannot be assigned to that union type
Open
- Dominant language
- Rust
- Stars
- 22.3k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
[Reproducible Code Snippet](https://flowtype.org/try/#0C4TwDgpgBAglC8UDeUCGAuKBnYAnAlgHYDmUAvgFCiRQBCCyUARpjgSeVeNAMIMoBjVniKlK1aDHqI4AHzpcaMAB7TYUAGQKJsWsr4z6WnhQoAzAK6EBwfAHtCUYBBwBGABQZYAGjQtdvqjK-iq0gUzKQrr6AJTIFFBoDEFMCX7JEQIUZEA):
```javascript
type A = { a: string }
type B = { b: string }
type C = { c: string }
type AB = A | B
type AxB = A & B
type ABxC = AB & C
function test1(a: A, ab: AB, axb: AxB, abxc: ABxC) {
a = axb
ab = abxc // error
}
```
Contributor guide
Assessment
This issue has not been assessed yet.