Remove sub_type parameter from Typing_coercion
Summary:
The code in Typing_coercion is more complex then it needs to be, because it supports passing in a different sub type function. This was used in only one place, Typing.anon_coerce_type. The sub type function used was the same everywhere else, but it wasn't obvious since Typing_op.sub_type uses Typing_utils.sub_type instead of Typing_subtype.sub_type.
Once I switched Typing_op.sub_type to call Typing_subtype.sub_type, it was obvious that the same function was being called so I cleaned up a decent amount of code. I also eliminated the requirement of passing in a Pos.t and Typing_reason.ureason since it is only needed for error reporting, and the relevant error is reported in the Errors.try in coerce_type.
Reviewed By: vassilmladenov
Differential Revision:
D17651770
fbshipit-source-id:
39d4e6000f7d57bbcc5781b42df375a577dfce06