From 56201964ca996019a459068de01c038c206725fd Mon Sep 17 00:00:00 2001 From: Sam Blackshear Date: Mon, 5 Jun 2017 10:37:25 -0700 Subject: [PATCH] [cleanup] make `PatternMatch.is_subtype` reflexive Reviewed By: jeremydubreil Differential Revision: D5177506 fbshipit-source-id: dd47154 --- infer/src/checkers/patternMatch.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infer/src/checkers/patternMatch.ml b/infer/src/checkers/patternMatch.ml index 533203a49..49f5497cd 100644 --- a/infer/src/checkers/patternMatch.ml +++ b/infer/src/checkers/patternMatch.ml @@ -61,11 +61,11 @@ let is_immediate_subtype tenv this_type_name super_type_name = (** return true if [typ0] <: [typ1] *) let is_subtype tenv name0 name1 = + Typ.Name.equal name0 name1 || supertype_exists tenv (fun name _ -> Typ.Name.equal name name1) name0 let is_subtype_of_str tenv cn1 classname_str = let typename = Typ.Name.Java.from_string classname_str in - Typ.Name.equal cn1 typename || is_subtype tenv cn1 typename (** The type the method is invoked on *)