From 026016dfba8b9fe718e84fb64ce6ccf098fed124 Mon Sep 17 00:00:00 2001 From: Lucian Wischik Date: Mon, 21 Dec 2020 17:25:12 -0800 Subject: [PATCH] sometimes hack simply drops errors, due to deferred-decl Summary: We got user accounts that sometimes hack wasn't reporting errors that it should. This fixes it. Reviewed By: Wilfred Differential Revision: D25672172 fbshipit-source-id: 39b7ab988841b5ea4d75451e6d1fabcc204d4694 --- hphp/hack/src/typing/typing_check_service.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hphp/hack/src/typing/typing_check_service.ml b/hphp/hack/src/typing/typing_check_service.ml index ecac028c425..f347ab13fdc 100644 --- a/hphp/hack/src/typing/typing_check_service.ml +++ b/hphp/hack/src/typing/typing_check_service.ml @@ -228,9 +228,9 @@ let process_file (errors : Errors.t) (file : check_file_computation) : process_file_results = let fn = file.path in - let (err, ast) = Ast_provider.get_ast_with_error ~full:true ctx fn in - if not (Errors.is_empty err) then - { errors = err; deferred_decls = [] } + let (errors', ast) = Ast_provider.get_ast_with_error ~full:true ctx fn in + if not (Errors.is_empty errors') then + { errors = Errors.merge errors' errors; deferred_decls = [] } else let opts = { @@ -508,7 +508,7 @@ let process_files let (_ : Decl_provider.class_decl option) = Decl_provider.get_class ctx class_name in - (Errors.empty, [], ProcessFilesTally.incr_decls tally) + (errors, [], ProcessFilesTally.incr_decls tally) | Prefetch paths -> Vfs.prefetch paths; (errors, [], ProcessFilesTally.incr_prefetches tally) -- 2.11.4.GIT