summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_fail/T2664.stderr
blob: 64fa8512585241f35ce13ee97646276177a19b5b (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

T2664.hs:31:9: error:
    • Could not deduce: Dual a ~ Dual b
      from the context: ((a :*: b) ~ Dual c, c ~ Dual (a :*: b))
        bound by the type signature for:
                   newPChan :: forall c.
                               ((a :*: b) ~ Dual c, c ~ Dual (a :*: b)) =>
                               IO (PChan (a :*: b), PChan c)
        at T2664.hs:23:5-12
      Expected: IO (PChan (a :*: b), PChan c)
        Actual: IO (PChan (a :*: b), PChan (Dual b :+: Dual a))
      NB: ‘Dual’ is a non-injective type family
    • In a stmt of a 'do' block:
        return
          (O $ takeMVar v, 
           E (pchoose Right v newPChan) (pchoose Left v newPChan))
      In the expression:
        do v <- newEmptyMVar
           return
             (O $ takeMVar v, 
              E (pchoose Right v newPChan) (pchoose Left v newPChan))
      In an equation for ‘newPChan’:
          newPChan
            = do v <- newEmptyMVar
                 return
                   (O $ takeMVar v, 
                    E (pchoose Right v newPChan) (pchoose Left v newPChan))
    • Relevant bindings include
        v :: MVar (Either (PChan a) (PChan b)) (bound at T2664.hs:24:9)
        newPChan :: IO (PChan (a :*: b), PChan c) (bound at T2664.hs:23:5)