Commit f7e0e5f9 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Improve tracing in checkValidInstance

parent 42c6263f
......@@ -1149,6 +1149,7 @@ checkValidInstance ctxt hs_type ty
| Just (clas,inst_tys) <- getClassPredTys_maybe tau
, inst_tys `lengthIs` classArity clas
= do { setSrcSpan head_loc (checkValidInstHead ctxt clas inst_tys)
; traceTc "checkValidInstance {" (ppr ty)
; checkValidTheta ctxt theta
-- The Termination and Coverate Conditions
......@@ -1162,15 +1163,18 @@ checkValidInstance ctxt hs_type ty
-- the termination condition, because 'a' appears more often
-- in the constraint than in the head
; undecidable_ok <- xoptM LangExt.UndecidableInstances
; traceTc "cvi" (ppr undecidable_ok $$ ppr ty)
; if undecidable_ok
then checkAmbiguity ctxt ty
else checkInstTermination inst_tys theta
; traceTc "cvi 2" (ppr ty)
; case (checkInstCoverage undecidable_ok clas theta inst_tys) of
IsValid -> return () -- Check succeeded
NotValid msg -> addErrTc (instTypeErr clas inst_tys msg)
; traceTc "End checkValidInstance }" empty
; return (tvs, theta, clas, inst_tys) }
| otherwise
......
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