Intersection of union type cannot be assigned to that union type
Offen
- Vorherrschende Sprache
- Rust
- Sterne
- 22.3k
- Forks
- 1.9k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
[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
}
```
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.