[cleanup] make `PatternMatch.is_subtype` reflexive

Reviewed By: jeremydubreil

Differential Revision: D5177506

fbshipit-source-id: dd47154
master
Sam Blackshear 8 years ago committed by Facebook Github Bot
parent 93cc3266e8
commit 56201964ca

@ -61,11 +61,11 @@ let is_immediate_subtype tenv this_type_name super_type_name =
(** return true if [typ0] <: [typ1] *) (** return true if [typ0] <: [typ1] *)
let is_subtype tenv name0 name1 = let is_subtype tenv name0 name1 =
Typ.Name.equal name0 name1 ||
supertype_exists tenv (fun name _ -> Typ.Name.equal name name1) name0 supertype_exists tenv (fun name _ -> Typ.Name.equal name name1) name0
let is_subtype_of_str tenv cn1 classname_str = let is_subtype_of_str tenv cn1 classname_str =
let typename = Typ.Name.Java.from_string classname_str in let typename = Typ.Name.Java.from_string classname_str in
Typ.Name.equal cn1 typename ||
is_subtype tenv cn1 typename is_subtype tenv cn1 typename
(** The type the method is invoked on *) (** The type the method is invoked on *)

Loading…
Cancel
Save