Added correct error handling of declaration errors during lazy typechecking
commit459bc56db95b9205788c9d64a04692fafe9dd7f8
authorJingze Wu <jjwu@fb.com>
Fri, 29 Jul 2016 18:23:51 +0000 (29 11:23 -0700)
committerHhvm Bot <hhvm-bot-bot@fb.com>
Fri, 29 Jul 2016 18:43:55 +0000 (29 11:43 -0700)
treef7df4e5a31512306d473aa605749bb53c25ace00
parentaf33b7036a78a2bd939ada2c080e295fa80f8858
Added correct error handling of declaration errors during lazy typechecking

Summary:
During server initialization and incremental typechecking, we maintain a list of files that have errors in them in order to redeclare them.
Before, naming and parsing errors could only occur in the parsing step, declaration errors in the decl step, etc. But with lazy decls, the typechecker now
calls Decl, meaning that files can have decl errors during the typechecking phase. This diff addresses this issue by allowing the error library to set a flag indicating
that declaration errors occurred, and return the result of the flag.

Essentially, the lazy typechecking heap now calls Errors.run_in_decl_mode, and all errors in Decl while running in this mode will cause a flag flip, which is returned
to the typechecker.

Reviewed By: dlreeves

Differential Revision: D3633805

fbshipit-source-id: 890dbc81da1efbca8d009ea0a4e39dff1f670427
25 files changed:
hphp/hack/src/decl/decl_redecl_service.ml
hphp/hack/src/decl/decl_service.ml
hphp/hack/src/decl/decl_service.mli
hphp/hack/src/format/format_hack.ml
hphp/hack/src/full_fidelity_parse.ml
hphp/hack/src/h2tp/common/parser_hack_ext.ml
hphp/hack/src/hh_format.ml
hphp/hack/src/hh_match.ml
hphp/hack/src/hh_matcher/hh_match_utils.ml
hphp/hack/src/hh_matcher/patcher.ml
hphp/hack/src/hh_single_parse.ml
hphp/hack/src/hh_single_type_check.ml
hphp/hack/src/js/hh_ide.ml
hphp/hack/src/naming/namingGlobal.ml
hphp/hack/src/parsing/parsing_service.ml
hphp/hack/src/server/serverInit.ml
hphp/hack/src/server/serverTypeCheck.ml
hphp/hack/src/typing/typing_check_service.ml
hphp/hack/src/typing/typing_check_utils.ml
hphp/hack/src/typing/typing_lazy_heap.ml
hphp/hack/src/utils/errors.ml
hphp/hack/src/utils/errors_sig.ml
hphp/hack/test/full_fidelity/classic_ast_mapper_test.ml
hphp/hack/test/integration/hierarchy_tests.py
hphp/hack/test/integration/test_save_mini.py