Add decl_errors field to folded class definition
Summary:
Errors in the decl folding process are handled interestingly. I believe the following is happening:
Errors are being thrown as they are in the normal typechecking step, by adding the error to global state.
https://www.internalfb.com/code/fbsource/[
f738d273de54]/fbcode/hphp/hack/src/decl/decl_folded_class.ml?lines=112-129
Those errors that are added during the `class_decl` step are then captured in this `Errors.do_` and then added to the `dc_decl_errors` field in the folded decl.
https://www.internalfb.com/code/fbsource/[
4b5de3c992492ee6a53d96f71bcea06f9decc7fc]/fbcode/hphp/hack/src/decl/decl_folded_class.ml?lines=785-790
So, as an attempt to not go down this path, this diff attempts to just collect the errors locally.
The `decl_errors` field is currently a `Box<[TypingError]>`, which I'm not entirely sure is a direct match with the OCaml version of the field which is `Errors.t option` which is `(error files_t) option` which is `(error file_t Relative_path.Map.t) option` which is `error list PhaseMap.t Relative_path.Map.t option`.
So... Not entirely sure what a more representative data structure for that would be.
Reviewed By: shayne-fletcher
Differential Revision:
D34539432
fbshipit-source-id:
402ec4a4589537e6048c58969e36be2edfc30202