summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/T8142.stderr
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-07-27 14:52:38 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2017-07-28 09:31:55 +0100
commit452755de717fad5d8fbfc6330cb42a3335c8912d (patch)
tree9907deeb28850a6f98322b7ef3386828baed4b2a /testsuite/tests/typecheck/should_fail/T8142.stderr
parentb1317a35770b19838c7f6b07e794bfc61419e889 (diff)
downloadhaskell-452755de717fad5d8fbfc6330cb42a3335c8912d.tar.gz
Do not discard insolubles in implications
Trac #14000 showed up two errors * In TcRnTypes.dropInsolubles we dropped all implications, which might contain the very insolubles we wanted to keep. This was an outright error, and is why the out-of-scope error was actually lost altogether in Trac #14000 * In TcSimplify.simplifyInfer, if there are definite (insoluble) errors, it's better to suppress the following ambiguity test, because the type may be bogus anyway. See TcSimplify Note [Quantification with errors]. This fix seems a bit clunky, but it'll do for now.
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/T8142.stderr')
-rw-r--r--testsuite/tests/typecheck/should_fail/T8142.stderr26
1 files changed, 17 insertions, 9 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T8142.stderr b/testsuite/tests/typecheck/should_fail/T8142.stderr
index aec8b3b55c..25d60d1aff 100644
--- a/testsuite/tests/typecheck/should_fail/T8142.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8142.stderr
@@ -1,16 +1,24 @@
-T8142.hs:6:18: error:
- • Couldn't match type ‘Nu g0’ with ‘Nu g’
- Expected type: Nu ((,) a) -> Nu g
+T8142.hs:6:10: error:
+ • Couldn't match type ‘Nu ((,) a0)’ with ‘c -> f c’
+ Expected type: (c -> f c) -> c -> f c
Actual type: Nu ((,) a0) -> Nu g0
- NB: ‘Nu’ is a type function, and may not be injective
- The type variable ‘g0’ is ambiguous
- • In the ambiguity check for the inferred type for ‘h’
- To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- When checking the inferred type
- h :: forall a (g :: * -> *). Nu ((,) a) -> Nu g
+ The type variable ‘a0’ is ambiguous
+ • In the expression: h
In an equation for ‘tracer’:
tracer
= h
where
h = (\ (_, b) -> ((outI . fmap h) b)) . out
+ • Relevant bindings include
+ tracer :: (c -> f c) -> c -> f c (bound at T8142.hs:6:1)
+
+T8142.hs:6:57: error:
+ • Couldn't match type ‘Nu ((,) a)’ with ‘g (Nu ((,) a))’
+ Expected type: Nu ((,) a) -> (a, g (Nu ((,) a)))
+ Actual type: Nu ((,) a) -> (a, Nu ((,) a))
+ • In the second argument of ‘(.)’, namely ‘out’
+ In the expression: (\ (_, b) -> ((outI . fmap h) b)) . out
+ In an equation for ‘h’: h = (\ (_, b) -> ((outI . fmap h) b)) . out
+ • Relevant bindings include
+ h :: Nu ((,) a) -> Nu g (bound at T8142.hs:6:18)