Remove Typing_taccess dependency on Typing_dependent_type
commit185d732590623872813f34ecfe1ea634bd8247e6
authorDwayne Reeves <dreeves@fb.com>
Tue, 2 Jul 2019 01:36:55 +0000 (1 18:36 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 2 Jul 2019 01:40:29 +0000 (1 18:40 -0700)
treec60767c2608d3fabe6a6ffa5b63b7acf9c1d3e1d
parentaa29bc3fffe8514791b50ccb3ee536e206ead469
Remove Typing_taccess dependency on Typing_dependent_type

Summary:
When I originally wrote Typing_taccess it had a strong dependency on Typing_dependent_type. After all the previous clean up, it now makes it simple to move the code that handles dependent types with ids to Typing_taccess and remove any reference of Typing_dependent_type from Typing_taccess.

To do this I replaced the Typing_taccess.env.dep_tys with `choose_assigned_type`. This is essentially what an empty dep_tys encoded. I also changed `expand` to return an additional bool that marks if the assigned type was chosen. This is used to determine whether or not we create generic types or not. This isn't ideal since it isn't obvious why this is correct, but it matches closely with the current implementation and is more explicit.

I'm experimenting with a more principled rewrite of this module but this is good enough to land on it's own.

Reviewed By: Matt-Schellhas

Differential Revision: D15957343

fbshipit-source-id: 99e25f3bfca6a67ec4a9ca4054558f650f30e920
hphp/hack/src/typing/typing_dependent_type.ml
hphp/hack/src/typing/typing_taccess.ml