Commit eb98c815 authored by Joachim Breitner's avatar Joachim Breitner
Browse files

Update testsuite for nicer Coercible message

parent a96f715f
T1496.hs:10:32:
No instance for (GHC.Types.Coercible (c1 Int) (c1 Moo))
because ‛c1 Int’ and ‛c1 Moo’ are different types.
arising from a use of ‛GHC.Prim.coerce’
In the expression:
GHC.Prim.coerce (isInt :: c Int -> c Int) ::
forall (c :: * -> *). c Int -> c Moo
In an equation for ‛isInt’:
isInt
= GHC.Prim.coerce (isInt :: c Int -> c Int) ::
forall (c :: * -> *). c Int -> c Moo
In the instance declaration for ‛IsInt Moo’
Could not coerce from ‛c Int’ to ‛c Moo’
because ‛c Int’ and ‛c Moo’ are different types.
arising from the 'deriving' clause of a data type declaration
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (IsInt Moo)
T4846.hs:29:1:
No instance for (GHC.Types.Coercible (Expr Bool) (Expr BOOL))
Could not coerce from ‛Expr Bool’ to ‛Expr BOOL
because the first type argument of ‛Expr’ has role Nominal,
but the arguments ‛Bool’ and ‛BOOL’ differ
arising from a use of ‛GHC.Prim.coerce’
......
T7148.hs:27:40:
Could not deduce (GHC.Types.Coercible
(SameType b b2) (SameType (Tagged a b) b2))
because the first type argument of ‛SameType’ has role Nominal,
Could not coerce from ‛SameType b1 b’ to ‛SameType b1 (Tagged a b)’
because the second type argument of ‛SameType’ has role Nominal,
but the arguments ‛b’ and ‛Tagged a b’ differ
arising from a use of ‛GHC.Prim.coerce’
from the context (IsoUnit b)
bound by the instance declaration at T7148.hs:27:40-46
In the expression:
GHC.Prim.coerce (iso1 :: SameType () b -> SameType b b) ::
forall (b :: *). SameType () b -> SameType (Tagged a b) b
In an equation for ‛iso1’:
iso1
= GHC.Prim.coerce (iso1 :: SameType () b -> SameType b b) ::
forall (b :: *). SameType () b -> SameType (Tagged a b) b
In the instance declaration for ‛IsoUnit (Tagged a b)’
arising from the 'deriving' clause of a data type declaration
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (IsoUnit (Tagged a b))
T7148.hs:27:40:
Could not deduce (GHC.Types.Coercible
(SameType b2 b) (SameType b2 (Tagged a b)))
because the second type argument of ‛SameType’ has role Nominal,
Could not coerce from ‛SameType b b1’ to ‛SameType (Tagged a b) b1’
because the first type argument of ‛SameType’ has role Nominal,
but the arguments ‛b’ and ‛Tagged a b’ differ
arising from a use of ‛GHC.Prim.coerce’
from the context (IsoUnit b)
bound by the instance declaration at T7148.hs:27:40-46
In the expression:
GHC.Prim.coerce (iso2 :: SameType b () -> SameType b b) ::
forall (b :: *). SameType b () -> SameType b (Tagged a b)
In an equation for ‛iso2’:
iso2
= GHC.Prim.coerce (iso2 :: SameType b () -> SameType b b) ::
forall (b :: *). SameType b () -> SameType b (Tagged a b)
In the instance declaration for ‛IsoUnit (Tagged a b)’
arising from the 'deriving' clause of a data type declaration
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (IsoUnit (Tagged a b))
T7148a.hs:19:50:
Could not deduce (GHC.Types.Coercible (Result a b1) b1)
because ‛Result a b1’ and ‛b1’ are different types.
arising from a use of ‛GHC.Prim.coerce’
from the context (Convert a)
bound by the instance declaration at T7148a.hs:19:50-56
In the expression:
GHC.Prim.coerce (coerce :: Proxy b -> a -> Result a b) ::
forall (b :: *).
Proxy b -> IS_NO_LONGER a -> Result (IS_NO_LONGER a) b
In an equation for ‛coerce’:
coerce
= GHC.Prim.coerce (coerce :: Proxy b -> a -> Result a b) ::
forall (b :: *).
Proxy b -> IS_NO_LONGER a -> Result (IS_NO_LONGER a) b
In the instance declaration for ‛Convert (IS_NO_LONGER a)’
Could not coerce from ‛Result a b’ to ‛b’
because ‛Result a b’ and ‛b’ are different types.
arising from the 'deriving' clause of a data type declaration
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Convert (IS_NO_LONGER a))
CasePrune.hs:14:31:
No instance for (GHC.Types.Coercible (T Int) (T A))
Could not coerce from ‛T Int’ to ‛T A
because the first type argument of ‛T’ has role Nominal,
but the arguments ‛Int’ and ‛A’ differ
arising from a use of ‛GHC.Prim.coerce’
In the expression: GHC.Prim.coerce (ic :: T Int) :: T A
In an equation for ‛ic’: ic = GHC.Prim.coerce (ic :: T Int) :: T A
In the instance declaration for ‛C A’
arising from the 'deriving' clause of a data type declaration
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (C A)
Roles10.hs:16:12:
No instance for (GHC.Types.Coercible Bool Char)
Could not coerce from ‛Bool’ to ‛Char
because ‛Bool’ and ‛Char’ are different types.
arising from a use of ‛GHC.Prim.coerce’
In the expression:
GHC.Prim.coerce (meth :: Int -> F Int) :: Age -> F Age
In an equation for ‛meth’:
meth = GHC.Prim.coerce (meth :: Int -> F Int) :: Age -> F Age
In the instance declaration for ‛C Age’
arising from the 'deriving' clause of a data type declaration
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (C Age)
TcCoercibleFail.hs:11:8:
No instance for (Coercible Int ())
Could not coerce from ‛Int’ to ‛()
because ‛Int’ and ‛()’ are different types.
arising from a use of ‛coerce’
In the expression: coerce
......@@ -8,7 +8,7 @@ TcCoercibleFail.hs:11:8:
In an equation for ‛foo1’: foo1 = coerce $ one :: ()
TcCoercibleFail.hs:14:8:
Could not deduce (Coercible (m Int) (m Age))
Could not coerce from ‛m Int’ to ‛m Age
because ‛m Int’ and ‛m Age’ are different types.
arising from a use of ‛coerce’
from the context (Monad m)
......@@ -19,7 +19,7 @@ TcCoercibleFail.hs:14:8:
In an equation for ‛foo2’: foo2 = coerce $ (return one :: m Int)
TcCoercibleFail.hs:16:8:
No instance for (Coercible (Map Int ()) (Map Age ()))
Could not coerce from ‛Map Int ()’ to ‛Map Age ()
because the first type argument of ‛Map’ has role Nominal,
but the arguments ‛Int’ and ‛Age’ differ
arising from a use of ‛coerce’
......@@ -28,7 +28,7 @@ TcCoercibleFail.hs:16:8:
In an equation for ‛foo3’: foo3 = coerce $ Map one () :: Map Age ()
TcCoercibleFail.hs:18:8:
No instance for (Coercible Int (Down Int))
Could not coerce from ‛Int’ to ‛Down Int
because the constructor of ‛Down’ is not imported
arising from a use of ‛coerce’
In the expression: coerce
......@@ -51,7 +51,7 @@ TcCoercibleFail.hs:30:8:
foo6 = coerce :: Fix (Either Int) -> Fix (Either Age)
TcCoercibleFail.hs:31:8:
No instance for (Coercible (Either Int (Fix (Either Int))) ())
Could not coerce from ‛Either Int (Fix (Either Int))’ to ‛()
because ‛Either
Int (Fix (Either Int))’ and ‛()’ are different types.
arising from a use of ‛coerce’
......
TcCoercibleFail3.hs:12:7:
No instance for (Coercible NT1 NT2)
Could not coerce from ‛NT1’ to ‛NT2
because ‛NT1’ and ‛NT2’ are different types.
arising from a use of ‛coerce’
In the expression: coerce
......
TcCoercibleFailSafe.hs:9:8:
No instance for (Coercible (Down Age) (Down Int))
Could not coerce from ‛Down Age’ to ‛Down Int
because the constructor of ‛Down’ is not imported
as required in SafeHaskell mode
arising from a use of ‛coerce’
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment