state transition invariants in Decl_linearize state machine
commit0a444efa03d0173f6a9777182eb9ef99739e7779
authorLucian Wischik <ljw@fb.com>
Thu, 3 Dec 2020 23:32:22 +0000 (3 15:32 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 3 Dec 2020 23:40:02 +0000 (3 15:40 -0800)
tree048bfc7c78bed4be27a2e73e0d7aabb37e349058
parent08edbb1ae4f888e53c2f9c6c6b9c432c632537ab
state transition invariants in Decl_linearize state machine

Summary:
The Decl_linearize state machine has seq_unfold_state (state, ancestors, synths, acc).

There are a few invariants associated with it:
* while in state Child, synths is empty
* while in state Synths_elt, ancestors is empty

I decided to embody those invariants in the type system.

Differential Revision: D25179200

fbshipit-source-id: 74990ccb4ef751e87bf882586e2b94614e4d0dc0
hphp/hack/src/decl/decl_linearize.ml