diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2014-09-26 10:44:46 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2014-09-26 10:56:47 +0100 |
commit | 20632d37b5bcb68bb0ca34238f1ed49c7be3a8f7 (patch) | |
tree | bd989d8a78331093ef62294939104c22fcc84fe3 /testsuite/tests/typecheck/should_fail/mc22.stderr | |
parent | 74ae59896e4222a8115f5548845f13495f5bb76e (diff) | |
download | haskell-20632d37b5bcb68bb0ca34238f1ed49c7be3a8f7.tar.gz |
Do not discard insoluble Derived constraints
This is preparing for a fix to Trac #9612. The idea is that insoluble
constraints are nice solid errors that we should not discard before
we have a chance to report them. So TcRnTypes.dropDerivedWC now
keeps insoluble Derived constrains, and instead TcSimplify.solve_wanteds
filters them out
We get somewhat better error message for kind-equality failures too.
A slight downside is that to avoid *duplicate* kind-equality failures
when we float a kind-incompatible equality (e.g. alpha:* ~ Int#),
I've disabled constraint-floating when there are insolubles. But that
in turn makes a handful of error messages a little less informative;
good examples are mc21, mc22, mc25. But I am re-jigging the
constraint floating machinery in another branch, which will make this
go back to the way it was before.
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/mc22.stderr')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/mc22.stderr | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/testsuite/tests/typecheck/should_fail/mc22.stderr b/testsuite/tests/typecheck/should_fail/mc22.stderr index f3da3c5eeb..44a2eebdc7 100644 --- a/testsuite/tests/typecheck/should_fail/mc22.stderr +++ b/testsuite/tests/typecheck/should_fail/mc22.stderr @@ -1,21 +1,22 @@ mc22.hs:10:9: - No instance for (Functor t) arising from a use of ‘fmap’ + No instance for (Functor t1) arising from a use of ‘fmap’ Possible fix: - add (Functor t) to the context of - a type expected by the context: (a -> b) -> t a -> t b - or the inferred type of foo :: [t [Char]] + add (Functor t1) to the context of + a type expected by the context: (a -> b) -> t1 a -> t1 b + or the inferred type of foo :: t (t1 [Char]) In the expression: fmap In a stmt of a monad comprehension: then group using take 5 In the expression: [x + 1 | x <- ["Hello", "World"], then group using take 5] mc22.hs:10:26: - Couldn't match type ‘a’ with ‘t a’ + Couldn't match type ‘a’ with ‘t1 a’ ‘a’ is a rigid type variable bound by - a type expected by the context: [a] -> [t a] at mc22.hs:10:9 - Expected type: [a] -> [t a] + a type expected by the context: [a] -> t (t1 a) at mc22.hs:10:9 + Expected type: [a] -> t (t1 a) Actual type: [a] -> [a] - Relevant bindings include foo :: [t [Char]] (bound at mc22.hs:8:1) + Relevant bindings include + foo :: t (t1 [Char]) (bound at mc22.hs:8:1) In the expression: take 5 In a stmt of a monad comprehension: then group using take 5 |