|
|
@@ -317,9 +317,13 @@ let check_global_metadata ctx meta f_add mpath tpath so =
|
|
|
let check_module_types ctx m p t =
|
|
|
let t = t_infos t in
|
|
|
try
|
|
|
- let m2 = ctx.com.type_to_module#find t.mt_path in
|
|
|
- if m.m_path <> m2 && String.lowercase (s_type_path m2) = String.lowercase (s_type_path m.m_path) then typing_error ("Module " ^ s_type_path m2 ^ " is loaded with a different case than " ^ s_type_path m.m_path) p;
|
|
|
- typing_error ("Type name " ^ s_type_path t.mt_path ^ " is redefined from module " ^ s_type_path m2) p
|
|
|
+ let path2 = ctx.com.type_to_module#find t.mt_path in
|
|
|
+ if m.m_path <> path2 && String.lowercase (s_type_path path2) = String.lowercase (s_type_path m.m_path) then typing_error ("Module " ^ s_type_path path2 ^ " is loaded with a different case than " ^ s_type_path m.m_path) p;
|
|
|
+ let m2 = ctx.com.module_lut#find path2 in
|
|
|
+ let hex1 = Digest.to_hex m.m_extra.m_sign in
|
|
|
+ let hex2 = Digest.to_hex m2.m_extra.m_sign in
|
|
|
+ let s = if hex1 = hex2 then hex1 else Printf.sprintf "was %s, is %s" hex2 hex1 in
|
|
|
+ typing_error (Printf.sprintf "Type name %s is redefined from module %s (%s)" (s_type_path t.mt_path) (s_type_path path2) s) p
|
|
|
with
|
|
|
Not_found ->
|
|
|
ctx.com.type_to_module#add t.mt_path m.m_path
|