Introduce secondary errors in place of explicit application of reasons to `Typing...
commitcac1933b19e90f7326dd2a83f7a8754f89e0d5c7
authorMichael Thomas <mjt@fb.com>
Thu, 6 Jan 2022 14:04:47 +0000 (6 06:04 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 6 Jan 2022 14:06:04 +0000 (6 06:06 -0800)
tree9fd65af7d152baa6b8343569a6499a8cf67cac55
parenta167ddd73ea85b2a3f039cbf475eb961f59732fa
Introduce secondary errors in place of explicit application of reasons to `Typing.Reasons_callback.t`

Summary:
This diff replaces explicit use of `Errors.apply_error_from_reasons` in favor of introducing explicit `Typing_error.Secondary.t` errors and `Typing_errors.apply_reasons`. This means that we are able to use the data representation of `Typing_error.t`, rather than the pretty-printed `User_error.t`, and can avoid eagerly evaluation.

Note we are not yet able to remove `Errors.apply_error_from_reason` entirely; this is remedied in a subsequent diff

Reviewed By: CatherineGasnier

Differential Revision: D33426163

fbshipit-source-id: d3379d392f5d16bc245054531f6ff2e552122559
hphp/hack/src/errors/typing_error.ml
hphp/hack/src/errors/typing_error.mli
hphp/hack/src/typing/typing_escape.ml
hphp/hack/src/typing/typing_subtype.ml