facebook / facebook/flow

[improvement suggestion] Disjoint type refinement over destructured properties

Open
#5,370 0 comments 1 reaction 0 assignees View on GitHub
destructuring enhancement
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Destructured properties lose information that they are actually 'connected' and belong to the same disjoint type - [example](https://flow.org/try/#0PTAEAEDMBsHsHcBQiAuBPADgU1ASQHYYCuKAgqALygDe62AXKAOQCGTANKBi2nCwCaNqoLAA8WAWwzQsjfEQkAjLACdQAX3WpMOAsRQAhSjTqzmijlx59BNULBQALVYwDOKFQEt8Acw1btbDxCEmM9EnIAH2D9A2QAY1h8dy4VWHisV1dyKgAKbl5YAQBKSgA+K0KBADoxSWkcAGpQAFYEpJSMNIysozyCm1KKCoGi-mqHZzVmpkhYWCZkEFB4WBUAa28fREgifHiUTyTU9MzXcJRc731GC9LqRABIV3hPFHjHUCuQlGrTe8QoCBwPiLFcOFYTHogOBsJUWBQRBU+BOPWy3301VGJRhsNB4PMUNxsNA8MRyNRZwMGJIWOsY2KTy0AWW+AcKzWm18Oz2ByOKK6pyyFwAIpkPEQDkisPxcsJTJxsfwNLcfgDnq93p9cv8aMSgfiIWxoSTgWSkQLumdSPl6TjTYbCSbTaSERbKb1bVV+IzHsygA)

I realize it might not be trivial, but it's causing us to write extra code, which also cannot be at the moment optimized away by minifiers.

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.