Simplify the type comparison of Java classes

Reviewed By: cristianoc

Differential Revision: D2876204

fb-gh-sync-id: d6a1849
master
Jeremy Dubreil 9 years ago committed by facebook-github-bot-1
parent 5da7823df5
commit 70dbe8db74

@ -1298,6 +1298,9 @@ let rec const_compare (c1 : const) (c2 : const) : int =
| Ctuple el1, Ctuple el2 -> IList.compare exp_compare el1 el2 | Ctuple el1, Ctuple el2 -> IList.compare exp_compare el1 el2
and struct_typ_compare struct_typ1 struct_typ2 = and struct_typ_compare struct_typ1 struct_typ2 =
if struct_typ1.csu = Csu.Class Csu.Java && struct_typ2.csu = Csu.Class Csu.Java then
cname_opt_compare struct_typ1.struct_name struct_typ2.struct_name
else
let n = fld_typ_ann_list_compare struct_typ1.instance_fields struct_typ2.instance_fields in let n = fld_typ_ann_list_compare struct_typ1.instance_fields struct_typ2.instance_fields in
if n <> 0 then n else if n <> 0 then n else
let n = fld_typ_ann_list_compare struct_typ1.static_fields struct_typ2.static_fields in let n = fld_typ_ann_list_compare struct_typ1.static_fields struct_typ2.static_fields in

Loading…
Cancel
Save