summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-10-04 17:55:38 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2012-10-04 17:55:38 +0100
commitb9fccbc8bc377cde8e75bce8c78470e3c4fa4018 (patch)
treedcc0de15f0e1d44a6cbabfd1d12468776a5b6a32 /compiler
parent629d1f48b513be3cc662ea79376737dbcdb6b18f (diff)
downloadhaskell-b9fccbc8bc377cde8e75bce8c78470e3c4fa4018.tar.gz
Do not do type-class defaulting if there are insoluble constraints
Type-class defaulting won't help with those insolubles, and it does make arbitrary choices that obfuscate the error messages from the insolubles.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/typecheck/TcSimplify.lhs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/typecheck/TcSimplify.lhs b/compiler/typecheck/TcSimplify.lhs
index c0ff59d793..09a5b11c22 100644
--- a/compiler/typecheck/TcSimplify.lhs
+++ b/compiler/typecheck/TcSimplify.lhs
@@ -79,7 +79,9 @@ simplifyTop wanteds
; simpl_top_loop wc_first_go }
simpl_top_loop wc
- | isEmptyWC wc
+ | isEmptyWC wc || insolubleWC wc
+ -- Don't do type-class defaulting if there are insolubles
+ -- Doing so is not going to solve the insolubles
= return wc
| otherwise
= do { wc_residual <- nestTcS (solve_wanteds_and_drop wc)