[Git][ghc/ghc][master] Add test for T22793
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Sat Mar 4 06:18:40 UTC 2023
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
bf43ba92 by Simon Peyton Jones at 2023-03-04T01:18:23-05:00
Add test for T22793
- - - - -
3 changed files:
- + testsuite/tests/polykinds/T22793.hs
- + testsuite/tests/polykinds/T22793.stderr
- testsuite/tests/polykinds/all.T
Changes:
=====================================
testsuite/tests/polykinds/T22793.hs
=====================================
@@ -0,0 +1,17 @@
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+
+module T22793 where
+
+import Data.Kind
+
+type Foo :: forall k. k -> k -> Constraint
+
+class Foo s a
+
+bob :: forall {k1} {ks} {ka} q (p :: k1 -> q -> Type)
+ (f :: ka -> q) (s :: ks) (t :: ks)
+ (a :: ka) (b :: ka). Foo s a
+ => p a (f b) -> p s (f t)
+bob f = undefined
=====================================
testsuite/tests/polykinds/T22793.stderr
=====================================
@@ -0,0 +1,44 @@
+
+T22793.hs:15:42: error: [GHC-25897]
+ • Couldn't match kind ‘ka’ with ‘k1’
+ Expected kind ‘ks’, but ‘a’ has kind ‘ka’
+ ‘ka’ is a rigid type variable bound by
+ the type signature for ‘bob’
+ at T22793.hs:13:26-27
+ ‘k1’ is a rigid type variable bound by
+ the type signature for ‘bob’
+ at T22793.hs:13:16-17
+ • In the second argument of ‘Foo’, namely ‘a’
+ In the type signature:
+ bob :: forall {k1}
+ {ks}
+ {ka}
+ q
+ (p :: k1 -> q -> Type)
+ (f :: ka -> q)
+ (s :: ks)
+ (t :: ks)
+ (a :: ka)
+ (b :: ka). Foo s a => p a (f b) -> p s (f t)
+
+T22793.hs:16:11: error: [GHC-25897]
+ • Couldn't match kind ‘ks’ with ‘k1’
+ Expected kind ‘k1’, but ‘a’ has kind ‘ka’
+ ‘ks’ is a rigid type variable bound by
+ the type signature for ‘bob’
+ at T22793.hs:13:21-22
+ ‘k1’ is a rigid type variable bound by
+ the type signature for ‘bob’
+ at T22793.hs:13:16-17
+ • In the first argument of ‘p’, namely ‘a’
+ In the type signature:
+ bob :: forall {k1}
+ {ks}
+ {ka}
+ q
+ (p :: k1 -> q -> Type)
+ (f :: ka -> q)
+ (s :: ks)
+ (t :: ks)
+ (a :: ka)
+ (b :: ka). Foo s a => p a (f b) -> p s (f t)
=====================================
testsuite/tests/polykinds/all.T
=====================================
@@ -243,3 +243,4 @@ test('T22379a', normal, compile, [''])
test('T22379b', normal, compile, [''])
test('T22743', normal, compile_fail, [''])
test('T22742', normal, compile_fail, [''])
+test('T22793', normal, compile_fail, [''])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bf43ba9215a726039ace7bac37c0a223a912d998
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bf43ba9215a726039ace7bac37c0a223a912d998
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/20230304/b825d8ed/attachment-0001.html>
More information about the ghc-commits
mailing list