summaryrefslogtreecommitdiff
path: root/testsuite/tests/polykinds/T18451b.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2020-07-18 23:16:19 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-07-24 18:13:35 -0400
commitba205046e4f2ea94b1c978c050b917de4daaf092 (patch)
tree6b249028512e4d08cd0a3581d6f54e3f34868285 /testsuite/tests/polykinds/T18451b.hs
parentc1f4f81d3a439cd1a8128e4ab11c7caac7cc0ad8 (diff)
downloadhaskell-ba205046e4f2ea94b1c978c050b917de4daaf092.tar.gz
Care with occCheckExpand in kind of occurrences
Issue #18451 showed that we could get an infinite type, through over-use of occCheckExpand in the kind of an /occurrence/ of a type variable. See Note [Occurrence checking: look inside kinds] in GHC.Core.Type This patch fixes the problem by making occCheckExpand less eager to expand synonyms in kinds. It also improves pretty printing of kinds, by *not* suppressing the kind on a tyvar-binder like (a :: Const Type b) where type Const p q = p. Even though the kind of 'a' is Type, we don't want to suppress the kind ascription. Example: the error message for polykinds/T18451{a,b}. See GHC.Core.TyCo.Ppr Note [Suppressing * kinds].
Diffstat (limited to 'testsuite/tests/polykinds/T18451b.hs')
-rw-r--r--testsuite/tests/polykinds/T18451b.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/polykinds/T18451b.hs b/testsuite/tests/polykinds/T18451b.hs
new file mode 100644
index 0000000000..9b5248c30f
--- /dev/null
+++ b/testsuite/tests/polykinds/T18451b.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE TypeInType #-}
+module Bug where
+
+import Data.Kind
+import Data.Proxy
+
+type Const a b = a
+
+foo :: forall a b (c :: Const Type b). Proxy '[a, c]
+foo = error "ruk"