Commit 6018a66f authored by Kim Nguyễn's avatar Kim Nguyễn

Change the ordering use for types during constraint generation with one which...

Change the ordering use for types during constraint generation with one which is compatible with subtyping, when types are comparable.
parent 865e16c6
......@@ -15,13 +15,14 @@ exception UnSatConstr of string
module CS = struct
(* we require that types are semantically equivalent and not structurally
* equivalent *)
let semantic_compare t1 t2 =
let inf12 = Types.subtype t1 t2 in
let inf21 = Types.subtype t2 t1 in
if inf12 && inf21 then 0
else if inf12 then -1 else if inf21 then 1 else
let c = Types.compare t1 t2 in
if c = 0 then 0 else
if equiv t1 t2 then 0
else c
assert (c <> 0);
c
(* constraint set : map to store constraints of the form (s <= alpha <= t) *)
module M = struct
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment