Commits

camlspotter committed 7fa7816

typeloc message

Comments (0)

Files changed (1)

typing/printtyp.ml

   (if t == t' then type_expr ppf t else
    let t' = if proxy t == proxy t' then unalias t' else t' in
    fprintf ppf "@[<2>%a@ =@ %a@]" type_expr t type_expr t');
+(*
   match t.tyloc with
   | Some loc -> fprintf ppf " introduced at %a" Location.print loc
   | _ -> ()
+*)
+  ()
+
+let differing_types ppf (t, t') =
+  let typ ppf t = match t.tyloc with
+    | Some loc -> 
+        fprintf ppf "@[<v2>%a : introduced at %a@]" 
+          type_expr t
+          Location.print loc
+    | None -> 
+        fprintf ppf "@[<2>%a@]" 
+          type_expr t
+  in
+  fprintf ppf "@[<v>The differing types are:@ %a@ %a@]"
+    typ t
+    typ t'
 
 let rec trace fst txt ppf = function
   | (t1, t1') :: (t2, t2') :: rem ->
           @[%t@;<1 2>%a@ \
             %t@;<1 2>%a\
           @]%a%t\
-         @]"
+         @]\
+         @;%a"
         txt1 (type_expansion t1) t1'
         txt2 (type_expansion t2) t2'
         (trace false "is not compatible with type") tr
-        (explanation unif mis);
+        (explanation unif mis)
+        differing_types (t1, t2);
       print_labels := true
     with exn ->
       print_labels := true;