diff options
author | Oleg Grenrus <oleg.grenrus@iki.fi> | 2023-01-03 23:40:48 +0200 |
---|---|---|
committer | Oleg Grenrus <oleg.grenrus@iki.fi> | 2023-05-16 07:59:21 +0300 |
commit | bdb93cd28f4a40e9a9f28b0976ca8fa4f250cad2 (patch) | |
tree | 4b61e2541b49be36f20a07b05a9625d791e2177e /testsuite/tests/warnings/should_compile/T22702b.hs | |
parent | a8f0435fc5516ad978064eeabcc24776b6b86351 (diff) | |
download | haskell-bdb93cd28f4a40e9a9f28b0976ca8fa4f250cad2.tar.gz |
Add -Wmissing-role-annotations
Implements #22702
Diffstat (limited to 'testsuite/tests/warnings/should_compile/T22702b.hs')
-rw-r--r-- | testsuite/tests/warnings/should_compile/T22702b.hs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/warnings/should_compile/T22702b.hs b/testsuite/tests/warnings/should_compile/T22702b.hs new file mode 100644 index 0000000000..b9bb929f77 --- /dev/null +++ b/testsuite/tests/warnings/should_compile/T22702b.hs @@ -0,0 +1,23 @@ +{-# OPTIONS_GHC -Wmissing-role-annotations #-} +{-# LANGUAGE RoleAnnotations #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE StandaloneKindSignatures #-} +module T22702b where + +import Data.Kind (Type) + +-- type with parameters +type Foo :: Type -> Type -> Type +type role Foo representational phantom +data Foo x y = Foo x + +-- type without parameters +data Quu = Quu1 | Quu2 + +-- polykinded type +type Bar :: (k -> Type) -> k -> Type +type role Bar representational nominal +data Bar f a = Bar (f a) + +-- type-class may have roles as well +class C a where |