summaryrefslogtreecommitdiff
path: root/testsuite/tests/backpack/should_fail/bkpfail45.bkp
blob: 2222442bb38377c4da84174392d79060719c29bc (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
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE RoleAnnotations, FlexibleContexts #-}
unit p where
    signature A where
        type role T nominal
        data T a = T
    module B where
        import Data.Coerce
        import A
        f :: Coercible (T a) (T b) => a -> b
        f x = x
unit a where
    module A where
        data T a = T
unit q where
    dependency p[A=a:A]
    module C where
        import B
        g :: a -> b
        g = f

-- Either:
--  a) B should fail to typecheck against the signature, or
--  b) A should fail to match against the signature