Type accesses cleanup: do not thread the generics seen and limit 'let rec' use
commit5912054360eb55064a8a9da5ce906b4ef27f3264
authorQuentin Carbonneaux <qcar@fb.com>
Tue, 17 Dec 2019 18:34:38 +0000 (17 10:34 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 17 Dec 2019 18:38:45 +0000 (17 10:38 -0800)
tree33a01ad78a24b35ff8aa8b4c579420b423c756d4
parent23e95a8069d5d80e6c8cd27119a4bdb09ad7897f
Type accesses cleanup: do not thread the generics seen and limit 'let rec' use

Summary:
The `gen_seen` was needlessly passed around in the local 'env'. Only data
which has to be mutated needs to be passed around this way.

In this diff I make it clear that `gen_seen` is simply passed downwards the
call stack, and can only grow with recursive calls. That is the typical
pattern to detect cycles when navigating a graph.

I also re-ordered the functions to not abuse the 'let rec' construct and make
it clear which functions call which.

Finally, I inlined `expand_with_env_` in `expand_with_env`.

Reviewed By: dlreeves

Differential Revision: D19091338

fbshipit-source-id: bc987902fbfef8b817a17c73d401143bda5456bd
hphp/hack/src/typing/typing_taccess.ml