summaryrefslogtreecommitdiff
path: root/testsuite/tests/dependent/should_compile/T15264.hs
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2018-06-16 23:44:39 -0400
committerBen Gamari <ben@smart-cactus.org>2018-06-16 23:44:57 -0400
commit8df24474d0194d28b8273c1539af05793156e23f (patch)
treeeeeaf190edb831e45fb23af1960213b530637794 /testsuite/tests/dependent/should_compile/T15264.hs
parent4cd552184cbc5bed33da21497537df4e400a1a2f (diff)
downloadhaskell-8df24474d0194d28b8273c1539af05793156e23f.tar.gz
Warn about implicit kind variables with -Wcompat
According to an accepted proposal https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/002 4-no-kind-vars.rst With -Wcompat, warn if a kind variable is brought into scope implicitly in a type with an explicit forall. This applies to type signatures and to other contexts that allow a forall with the forall-or-nothing rule in effect (for example, class instances). Test Plan: Validate Reviewers: goldfire, hvr, bgamari, RyanGlScott Reviewed By: goldfire Subscribers: RyanGlScott, rwbarton, thomie, carter GHC Trac Issues: #15264 Differential Revision: https://phabricator.haskell.org/D4834
Diffstat (limited to 'testsuite/tests/dependent/should_compile/T15264.hs')
-rw-r--r--testsuite/tests/dependent/should_compile/T15264.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/dependent/should_compile/T15264.hs b/testsuite/tests/dependent/should_compile/T15264.hs
new file mode 100644
index 0000000000..a03cf4346e
--- /dev/null
+++ b/testsuite/tests/dependent/should_compile/T15264.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE ExplicitForAll, PolyKinds #-}
+{-# OPTIONS -Wcompat #-}
+
+module T15264 where
+
+import Data.Proxy
+
+bad1 :: forall (a :: k). Proxy a -> ()
+bad1 _ = ()
+
+bad2 :: forall (a :: k1) (b :: k2). Proxy a -> ()
+bad2 _ = ()
+
+good :: forall k (a :: k). Proxy a -> ()
+good _ = ()