summaryrefslogtreecommitdiff
path: root/testsuite/tests/backpack/should_compile/bkp53.bkp
blob: aa1dc53c61af5e933e361c5ecbdb492cc7a3f6ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{-# LANGUAGE RoleAnnotations #-}
-- Role merging test
unit p where
    signature A where
        type role T nominal representational
        data T a b
        newtype S a b = MkS (T a b)
unit q where
    signature A where
        type role T representational nominal
        data T a b
        newtype S a b = MkS (T a b)
unit r where
    dependency p[A=<A>]
    dependency q[A=<A>]
    module M where
        import A
        import Data.Coerce
        f :: (Coercible a1 a2, Coercible b1 b2) => T a1 b1 -> T a2 b2
        f = coerce
        g :: (Coercible a1 a2, Coercible b1 b2) => S a1 b1 -> S a2 b2
        g = coerce