Fix completeness with inference variables and coercion to dynamic
Summary:
When coercing to dynamic, the subtype check sets the allow_subtype_of_dynamic flag. If one of the type is an inference variable, it needs to record a constraint and remember that when satisfying that constraint later on, allow_subtype_of_dynamic should be set. This already happens for the treat_dynamic_as_bottom flag using the Typing_logic.Coerce constraint, so we just make that more flexible.
Since allow_subtype_of_dynamic and treat_dynamic_as_bottom should never both be true (the former is for coercing to dynamic, and the latter is for coercing from dynamic), these two named arguments to subtyping can be merged and renamed later on.
Also add an .mli file for Typing_logic.
Reviewed By: vsiles
Differential Revision:
D25946059
fbshipit-source-id:
eecaed0f8716c734e36800018210ad1eb2387d5a