Flow: [Question] Using disjoint unions

Created on 14 Nov 2018  路  3Comments  路  Source: facebook/flow

Reproduced example: https://flow.org/try/#0PTAEAEDMBsHsHcBQAXAngBwKagMrIIbLYC8oA3oqKANTIAWAlgHYDmAzgFygCCATr-lQAeCgEhR1JvgC2mLm2S9mLADSUqGqtQDGsAK5NkXJnukAjTLzWgAvgD5ENgNyJEupgtwBRACoB9ADluAFkvUFIAchxfQJCvCLdYD2RvfwBhAHkAVQCfcNAomMycnwSUDGwcTGQAmRJyUDQsLibMWEhU2NCVUClZeUVlWxdW3Gq0-UN8skaKlor2zuLcnt0DI17TC15h11HubWQGJPyqmrrQAB8x5An1l0RIA0PjplBeTAATPW1LAAoFIQ5LgCEQevgXkkuAcjkkAJRcPBA8jqNjwBjIbR0UB-CGwpgAOlacJRmm0+DYlRiQVCHHUmg+yD0vDeFE0mgJnMBYPp7Poyk4oG5mCJjFYbAJ0nw6D+f35rBJxDspPZVFEjOZrN5mnEnNFymsqqNVD6wLxrwJpu1oHENmtohscOtzlconJlKW2VydNVGpZKtVeuFhtV8vYAyB+vFkulsrDiuVbKN6uqmoD7N1nLDIeN7LWhi45qSBPzyHtDvtjudD00n0wkHwemgRlE1r9b2FLiodpsQA

Having read the documentation and read similar issues, I am unclear how to correctly use disjoint unions in the simple example above.

Is anyone able to point me in the right direction here?

Most helpful comment

The problem is actually not with the union, but with your map call which invalidates the refinement. Pulling count/name before the call to map works. Here is a working example.

All 3 comments

The problem is actually not with the union, but with your map call which invalidates the refinement. Pulling count/name before the call to map works. Here is a working example.

@AugustinLF is correct. Here are the [docs on refinement invalidations].
Here is a [fixed example] of your code.

Thanks @AugustinLF @wchargin

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cubika picture cubika  路  3Comments

marcelbeumer picture marcelbeumer  路  3Comments

ctrlplusb picture ctrlplusb  路  3Comments

Beingbook picture Beingbook  路  3Comments

mjj2000 picture mjj2000  路  3Comments