Mercurial > urweb
comparison 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 |
comparison
equal
deleted
inserted
replaced
1741:d6e233db97c8 | 1742:fca4a6d05ac1 |
---|---|
237 (ErrorMsg.errorAt loc "Type class wildcard occurs out of context"; | 237 (ErrorMsg.errorAt loc "Type class wildcard occurs out of context"; |
238 Option.app (fn (e, c) => eprefaces' [("Function", p_exp env e), | 238 Option.app (fn (e, c) => eprefaces' [("Function", p_exp env e), |
239 ("Type", p_con env c)]) co) | 239 ("Type", p_con env c)]) co) |
240 | Unresolvable (loc, c) => | 240 | Unresolvable (loc, c) => |
241 (ErrorMsg.errorAt loc "Can't resolve type class instance"; | 241 (ErrorMsg.errorAt loc "Can't resolve type class instance"; |
242 eprefaces' [("Class constraint", p_con env c)(*, | 242 eprefaces' ([("Class constraint", p_con env c)] |
243 ("Class database", p_list (fn (c, rules) => | 243 @ (case E.resolveFailureCause () of |
244 box [P.p_con env c, | 244 NONE => [] |
245 PD.string ":", | 245 | SOME c' => [("Reduced to unresolvable", p_con env c')]))) |
246 space, | |
247 p_list (fn (c, e) => | |
248 box [p_exp env e, | |
249 PD.string ":", | |
250 space, | |
251 P.p_con env c]) rules]) | |
252 (E.listClasses env))*)]) | |
253 | IllegalRec (x, e) => | 246 | IllegalRec (x, e) => |
254 (ErrorMsg.errorAt (#2 e) "Illegal 'val rec' righthand side (must be a function abstraction)"; | 247 (ErrorMsg.errorAt (#2 e) "Illegal 'val rec' righthand side (must be a function abstraction)"; |
255 eprefaces' [("Variable", PD.string x), | 248 eprefaces' [("Variable", PD.string x), |
256 ("Expression", p_exp env e)]) | 249 ("Expression", p_exp env e)]) |
257 | 250 |