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