diff options
Diffstat (limited to 'testsuite/tests/warnings/should_compile/T22702a.hs')
-rw-r--r-- | testsuite/tests/warnings/should_compile/T22702a.hs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/warnings/should_compile/T22702a.hs b/testsuite/tests/warnings/should_compile/T22702a.hs new file mode 100644 index 0000000000..14b0b94047 --- /dev/null +++ b/testsuite/tests/warnings/should_compile/T22702a.hs @@ -0,0 +1,25 @@ +{-# OPTIONS_GHC -Wmissing-role-annotations #-} +{-# LANGUAGE RoleAnnotations #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE StandaloneKindSignatures #-} +module T22702a where + +import Data.Kind (Type) + +-- type with parameters +-- warns +type Foo :: Type -> Type -> Type +data Foo x y = Foo x + +-- type without parameters +-- doesn't warn +data Quu = Quu1 | Quu2 + +-- polykinded type +-- warns, no role for `k` +type Bar :: (k -> Type) -> k -> Type +data Bar f a = Bar (f a) + +-- type-class may have roles as well +-- doesn't warn +class C a where |