summaryrefslogtreecommitdiff
path: root/testsuite/tests/dependent
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2019-03-17 09:37:27 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-03-20 20:10:57 -0400
commit8d18a873c5d7688c6e7d91efab6bb0d6f99393c6 (patch)
tree9d66f0b2647ebd968ab9ec6d2cc0debe900da9a0 /testsuite/tests/dependent
parent646e3dc20ebe25baae898a6b22895ddd015fc975 (diff)
downloadhaskell-8d18a873c5d7688c6e7d91efab6bb0d6f99393c6.tar.gz
Reject nested predicates in impredicativity checking
When GHC attempts to unify a metavariable with a type containing foralls, it will be rejected as an occurrence of impredicativity. GHC was /not/ extending the same treatment to predicate types, such as in the following (erroneous) example from #11514: ```haskell foo :: forall a. (Show a => a -> a) -> () foo = undefined ``` This will attempt to instantiate `undefined` at `(Show a => a -> a) -> ()`, which is impredicative. This patch catches impredicativity arising from predicates in this fashion. Since GHC is pickier about impredicative instantiations, some test cases needed to be updated to be updated so as not to fall afoul of the new validity check. (There were a surprising number of impredicative uses of `undefined`!) Moreover, the `T14828` test case now has slightly less informative types shown with `:print`. This is due to a a much deeper issue with the GHCi debugger (see #14828). Fixes #11514.
Diffstat (limited to 'testsuite/tests/dependent')
-rw-r--r--testsuite/tests/dependent/should_compile/dynamic-paper.hs2
-rw-r--r--testsuite/tests/dependent/should_compile/dynamic-paper.stderr2
2 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/tests/dependent/should_compile/dynamic-paper.hs b/testsuite/tests/dependent/should_compile/dynamic-paper.hs
index c998f0967c..1188bf17d4 100644
--- a/testsuite/tests/dependent/should_compile/dynamic-paper.hs
+++ b/testsuite/tests/dependent/should_compile/dynamic-paper.hs
@@ -34,7 +34,7 @@ fromInteger = Prelude.fromInteger
insertStore = undefined
schema = undefined
-withTypeable = undefined
+withTypeable _ _ = undefined
throw# = undefined
toDynamicST = undefined
diff --git a/testsuite/tests/dependent/should_compile/dynamic-paper.stderr b/testsuite/tests/dependent/should_compile/dynamic-paper.stderr
index a170d29c46..56da989d37 100644
--- a/testsuite/tests/dependent/should_compile/dynamic-paper.stderr
+++ b/testsuite/tests/dependent/should_compile/dynamic-paper.stderr
@@ -12,4 +12,4 @@ Simplifier ticks exhausted
simplifier non-termination has been judged acceptable.
To see detailed counts use -ddump-simpl-stats
- Total ticks: 140007
+ Total ticks: 140086