summaryrefslogtreecommitdiff
path: root/testsuite/tests/backpack/should_compile/T13140.bkp
blob: aa04b98c1e417238892e3ab0db2eb68d444e9c65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{-# LANGUAGE RoleAnnotations #-}
unit p where
    signature A where
        data T a
unit q1 where
    module A where
        data T a = T a
unit q2 where
    module A where
        type role T nominal
        data T a = T a
unit q3 where
    module A where
        data T a = T
unit r where
    -- Subtyping test
    dependency p[A=q1:A]
    dependency p[A=q2:A]
    dependency p[A=q3:A]

unit p2 where
    signature A where
        type role T representational
        data T a
    module M where
        import Data.Coerce
        import A
        newtype K = K Int
        f :: T K -> T Int
        f = coerce
unit p3 where
    -- Merge test
    dependency p[A=<A>]
    dependency p2[A=<A>]
    module M2 where
        import Data.Coerce
        import A
        newtype K = K Int
        f :: T K -> T Int
        f = coerce