From 68356a40d23d35a43dd4fc3d6ba88862dcdabfa2 Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Fri, 2 Jul 2021 05:18:06 -0700 Subject: [PATCH] [sourcefile] die on extension of invalid file Reviewed By: rgrig Differential Revision: D29485217 fbshipit-source-id: b871a13c7 --- infer/src/base/SourceFile.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/infer/src/base/SourceFile.ml b/infer/src/base/SourceFile.ml index 2cab224ed..51af7e42c 100644 --- a/infer/src/base/SourceFile.ml +++ b/infer/src/base/SourceFile.ml @@ -171,8 +171,9 @@ let to_string ?(force_relative = false) fname = let has_extension ~ext = function - | Invalid _ -> - false + | Invalid {ml_source_file} -> + L.die InternalError + "has_extension cannot be called with Invalid source file originating in %s" ml_source_file | RelativeProjectRootAndWorkspace {rel_path= path} | HashedBuckOut path | RelativeProjectRoot path