summaryrefslogtreecommitdiff
path: root/testsuite/tests/warnings/should_compile/T22702b.hs
blob: b9bb929f77be7708b29c70c8b27a1aad87ddbb17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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