[Git][ghc/ghc][master] Add regression test for #17963

Marge Bot gitlab at gitlab.haskell.org
Tue Mar 31 14:55:11 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
33f09551 by Ryan Scott at 2020-03-31T10:54:57-04:00
Add regression test for #17963

The panic in #17963 happened to be fixed by commit
e3c374cc5bd7eb49649b9f507f9f7740697e3f70. This patch adds a
regression test to ensure that it remains fixed.

Fixes #17963.

- - - - -


3 changed files:

- + testsuite/tests/polykinds/T17963.hs
- + testsuite/tests/polykinds/T17963.stderr
- testsuite/tests/polykinds/all.T


Changes:

=====================================
testsuite/tests/polykinds/T17963.hs
=====================================
@@ -0,0 +1,15 @@
+{-# Language DataKinds                #-}
+{-# Language PolyKinds                #-}
+{-# Language RankNTypes               #-}
+{-# Language StandaloneKindSignatures #-}
+{-# Language TypeApplications         #-}
+module T17963 where
+
+import GHC.Types (Constraint, Type, TYPE, RuntimeRep(..))
+
+type Cat :: forall (rep :: RuntimeRep). TYPE rep -> Type
+type Cat ob = ob -> ob -> Type
+
+type  Category' :: forall rep (ob :: TYPE rep). Cat @rep ob -> Constraint
+class Category' (cat :: Cat @rep ob) where
+ id' :: forall a. cat a a


=====================================
testsuite/tests/polykinds/T17963.stderr
=====================================
@@ -0,0 +1,13 @@
+
+T17963.hs:15:23: error:
+    • Couldn't match a lifted type with an unlifted type
+      ‘rep1’ is a rigid type variable bound by
+        the class declaration for ‘Category'’
+        at T17963.hs:13:27-29
+      When matching kinds
+        k0 :: *
+        ob :: TYPE rep1
+      Expected kind ‘ob’, but ‘a’ has kind ‘k0’
+    • In the first argument of ‘cat’, namely ‘a’
+      In the type signature: id' :: forall a. cat a a
+      In the class declaration for ‘Category'’


=====================================
testsuite/tests/polykinds/all.T
=====================================
@@ -216,3 +216,4 @@ test('T16263', normal, compile_fail, [''])
 test('T16902', normal, compile_fail, [''])
 test('CuskFam', normal, compile, [''])
 test('T17841', normal, compile_fail, [''])
+test('T17963', normal, compile_fail, [''])



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/33f095511a8fce4c945bbcd4feb3910c854dcb61

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/33f095511a8fce4c945bbcd4feb3910c854dcb61
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200331/a2838124/attachment-0001.html>


More information about the ghc-commits mailing list