summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
blob: 4370b606cabfe1894f98702bdc779dc7a0046259 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68

TcCoercibleFail.hs:11:8: error:
    • Couldn't match representation of type ‘Int’ with that of ‘()’
        arising from a use of ‘coerce’
    • In the first argument of ‘($)’, namely ‘coerce’
      In the expression: coerce $ one :: ()
      In an equation for ‘foo1’: foo1 = coerce $ one :: ()

TcCoercibleFail.hs:14:8: error:
    • Couldn't match representation of type: m Int
                               with that of: m Age
        arising from a use of ‘coerce’
      NB: We cannot know what roles the parameters to ‘m’ have;
        we must assume that the role is nominal
    • In the first argument of ‘($)’, namely ‘coerce’
      In the expression: coerce $ (return one :: m Int)
      In an equation for ‘foo2’: foo2 = coerce $ (return one :: m Int)
    • Relevant bindings include
        foo2 :: m Age (bound at TcCoercibleFail.hs:14:1)

TcCoercibleFail.hs:16:8: error:
    • Couldn't match type ‘Int’ with ‘Age’
        arising from a use of ‘coerce’
    • In the first argument of ‘($)’, namely ‘coerce’
      In the expression: coerce $ Map one () :: Map Age ()
      In an equation for ‘foo3’: foo3 = coerce $ Map one () :: Map Age ()

TcCoercibleFail.hs:18:8: error:
    • Couldn't match representation of type ‘Int’
                               with that of ‘Down Int’
        arising from a use of ‘coerce’
      The data constructor ‘Data.Ord.Down’
        of newtype ‘Down’ is not in scope
    • In the first argument of ‘($)’, namely ‘coerce’
      In the expression: coerce $ one :: Down Int
      In an equation for ‘foo4’: foo4 = coerce $ one :: Down Int

TcCoercibleFail.hs:21:8: error:
    • Couldn't match representation of type ‘Void’ with that of ‘()’
        arising from a use of ‘coerce’
    • In the expression: coerce :: Void -> ()
      In an equation for ‘foo5’: foo5 = coerce :: Void -> ()

TcCoercibleFail.hs:30:9: error:
    • Couldn't match representation of type ‘VoidBad ()’
                               with that of ‘()’
        arising from a use of ‘coerce’
    • In the expression: coerce :: (VoidBad ()) -> ()
      In an equation for ‘foo5'’: foo5' = coerce :: (VoidBad ()) -> ()

TcCoercibleFail.hs:35:8: error:
    • Reduction stack overflow; size = 201
      When simplifying the following type: Fix (Either Int)
      Use -freduction-depth=0 to disable this check
      (any upper bound you could choose might fail unpredictably with
       minor updates to GHC, so disabling the check is recommended if
       you're sure that type checking should terminate)
    • In the expression: coerce :: Fix (Either Int) -> Fix (Either Age)
      In an equation for ‘foo6’:
          foo6 = coerce :: Fix (Either Int) -> Fix (Either Age)

TcCoercibleFail.hs:36:8: error:
    • Couldn't match representation of type ‘Either
                                               Int (Fix (Either Int))’
                               with that of ‘()’
        arising from a use of ‘coerce’
    • In the expression: coerce :: Fix (Either Int) -> ()
      In an equation for ‘foo7’: foo7 = coerce :: Fix (Either Int) -> ()