facebook / facebook/flow

Intersection of union type cannot be assigned to that union type

Aperta
#3,376 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
22.3k
Fork
1.9k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

[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
}
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.