Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
f7e0e5f9
Commit
f7e0e5f9
authored
Jan 25, 2016
by
Simon Peyton Jones
Browse files
Improve tracing in checkValidInstance
parent
42c6263f
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/typecheck/TcValidity.hs
View file @
f7e0e5f9
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment