diff src/elab_err.sml @ 1742:fca4a6d05ac1

More diagnostic information about some type class resolution failures
author Adam Chlipala <adam@chlipala.net>
date Fri, 04 May 2012 10:33:04 -0400
parents 0bafdfae2ac7
children 818d4097e2ed
line wrap: on
line diff
--- a/src/elab_err.sml	Fri May 04 10:07:27 2012 -0400
+++ b/src/elab_err.sml	Fri May 04 10:33:04 2012 -0400
@@ -239,17 +239,10 @@
                                               ("Type", p_con env c)]) co)
       | Unresolvable (loc, c) =>
         (ErrorMsg.errorAt loc "Can't resolve type class instance";
-         eprefaces' [("Class constraint", p_con env c)(*,
-                     ("Class database", p_list (fn (c, rules) =>
-                                                   box [P.p_con env c,
-                                                        PD.string ":",
-                                                        space,
-                                                        p_list (fn (c, e) =>
-                                                                   box [p_exp env e,
-                                                                        PD.string ":",
-                                                                        space,
-                                                                        P.p_con env c]) rules])
-                                        (E.listClasses env))*)])
+         eprefaces' ([("Class constraint", p_con env c)]
+                     @ (case E.resolveFailureCause () of
+                            NONE => []
+                          | SOME c' => [("Reduced to unresolvable", p_con env c')])))
       | IllegalRec (x, e) =>
         (ErrorMsg.errorAt (#2 e) "Illegal 'val rec' righthand side (must be a function abstraction)";
          eprefaces' [("Variable", PD.string x),