summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/T14000.hs
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/T14000.hs
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/T14000.hs')
-rw-r--r--testsuite/tests/typecheck/should_fail/T14000.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T14000.hs b/testsuite/tests/typecheck/should_fail/T14000.hs
new file mode 100644
index 0000000000..854a78b6ad
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T14000.hs
@@ -0,0 +1,8 @@
+{-# LANGUAGE TypeFamilies #-}
+module T14000 where
+
+class C a where
+ type T a
+ c :: a -> T a
+
+foo = c noSuchThing -- noSuchThing is not in scope