diff options
9 files changed, 48 insertions, 74 deletions
diff --git a/testsuite/tests/deriving/should_fail/T1496.stderr b/testsuite/tests/deriving/should_fail/T1496.stderr index 9108126ed0..59f70ca4b5 100644 --- a/testsuite/tests/deriving/should_fail/T1496.stderr +++ b/testsuite/tests/deriving/should_fail/T1496.stderr @@ -1,13 +1,9 @@ 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) diff --git a/testsuite/tests/deriving/should_fail/T4846.stderr b/testsuite/tests/deriving/should_fail/T4846.stderr index c9ca4d55ee..dde64de90f 100644 --- a/testsuite/tests/deriving/should_fail/T4846.stderr +++ b/testsuite/tests/deriving/should_fail/T4846.stderr @@ -1,6 +1,6 @@ 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’ diff --git a/testsuite/tests/deriving/should_fail/T7148.stderr b/testsuite/tests/deriving/should_fail/T7148.stderr index 0be369c49b..ab87a27234 100644 --- a/testsuite/tests/deriving/should_fail/T7148.stderr +++ b/testsuite/tests/deriving/should_fail/T7148.stderr @@ -1,34 +1,20 @@ 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)) diff --git a/testsuite/tests/deriving/should_fail/T7148a.stderr b/testsuite/tests/deriving/should_fail/T7148a.stderr index da28c8e750..484d5aadcb 100644 --- a/testsuite/tests/deriving/should_fail/T7148a.stderr +++ b/testsuite/tests/deriving/should_fail/T7148a.stderr @@ -1,17 +1,9 @@ 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)) diff --git a/testsuite/tests/gadt/CasePrune.stderr b/testsuite/tests/gadt/CasePrune.stderr index 220caacc19..7263461b3b 100644 --- a/testsuite/tests/gadt/CasePrune.stderr +++ b/testsuite/tests/gadt/CasePrune.stderr @@ -1,9 +1,10 @@ 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) diff --git a/testsuite/tests/roles/should_fail/Roles10.stderr b/testsuite/tests/roles/should_fail/Roles10.stderr index 9b466ff979..230f2c9c00 100644 --- a/testsuite/tests/roles/should_fail/Roles10.stderr +++ b/testsuite/tests/roles/should_fail/Roles10.stderr @@ -1,10 +1,9 @@ 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) diff --git a/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr b/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr index a9af883aa8..d6fd5eb0da 100644 --- a/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr +++ b/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr @@ -1,6 +1,6 @@ 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’ diff --git a/testsuite/tests/typecheck/should_fail/TcCoercibleFail3.stderr b/testsuite/tests/typecheck/should_fail/TcCoercibleFail3.stderr index d3d71e115f..54cd96ff6a 100644 --- a/testsuite/tests/typecheck/should_fail/TcCoercibleFail3.stderr +++ b/testsuite/tests/typecheck/should_fail/TcCoercibleFail3.stderr @@ -1,6 +1,6 @@ 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 diff --git a/testsuite/tests/typecheck/should_fail/TcCoercibleFailSafe.stderr b/testsuite/tests/typecheck/should_fail/TcCoercibleFailSafe.stderr index 1675157e67..90643dfbe4 100644 --- a/testsuite/tests/typecheck/should_fail/TcCoercibleFailSafe.stderr +++ b/testsuite/tests/typecheck/should_fail/TcCoercibleFailSafe.stderr @@ -1,6 +1,6 @@ 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’ |