diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-06-18 14:12:54 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-06-18 14:15:59 +0100 |
commit | 02bac0254182def11029e2f7373ba8d2ba9ebe44 (patch) | |
tree | 9b254a1af59a751f28af395b98b52b51b0d61a39 /testsuite/tests/deriving/should_fail | |
parent | 4a7a6c3ac869f74dfe1c9af09c48faadc0ecba16 (diff) | |
download | haskell-02bac0254182def11029e2f7373ba8d2ba9ebe44.tar.gz |
Remove some horrible munging of origins for Coercible
I just didn't think it was buying enough for all the cruft it caused.
We can put some back if people start complaining about poor error
messages. I forget quite how I tripped over this but I got sucked in.
* Lots of tidying up in TcErrors
* Rename pprArisingAt to pprCtLoc, by analogy with pprCtOrigin
* Remove CoercibleOrigin data constructor from CtOrigin
* Make relevantBindings return a Ct with a zonked
and tidied CtOrigin
* Add to TcRnTypes
ctOrigin :: Ct -> CtOrigin
ctEvOrigin :: CtEvidence -> CtOrigin
setCtLoc :: Ct -> CtLoc -> Ct
Diffstat (limited to 'testsuite/tests/deriving/should_fail')
-rw-r--r-- | testsuite/tests/deriving/should_fail/T4846.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/deriving/should_fail/T5498.stderr | 9 | ||||
-rw-r--r-- | testsuite/tests/deriving/should_fail/T6147.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/deriving/should_fail/T7148.stderr | 22 | ||||
-rw-r--r-- | testsuite/tests/deriving/should_fail/T7148a.stderr | 18 | ||||
-rw-r--r-- | testsuite/tests/deriving/should_fail/T8851.stderr | 21 | ||||
-rw-r--r-- | testsuite/tests/deriving/should_fail/T8984.stderr | 8 |
7 files changed, 35 insertions, 57 deletions
diff --git a/testsuite/tests/deriving/should_fail/T4846.stderr b/testsuite/tests/deriving/should_fail/T4846.stderr index b0ebb9edfb..5a7339bf21 100644 --- a/testsuite/tests/deriving/should_fail/T4846.stderr +++ b/testsuite/tests/deriving/should_fail/T4846.stderr @@ -1,10 +1,7 @@ -T4846.hs:29:1: +T4846.hs:29:1: error: Couldn't match type ‘Bool’ with ‘BOOL’ - arising from trying to show that the representations of - ‘Expr Bool’ and - ‘Expr BOOL’ are the same - Relevant role signatures: type role Expr nominal + arising from a use of ‘coerce’ In the expression: coerce (mkExpr :: Expr Bool) :: Expr BOOL In an equation for ‘mkExpr’: mkExpr = coerce (mkExpr :: Expr Bool) :: Expr BOOL diff --git a/testsuite/tests/deriving/should_fail/T5498.stderr b/testsuite/tests/deriving/should_fail/T5498.stderr index ac91aaa4d0..ce87ef1867 100644 --- a/testsuite/tests/deriving/should_fail/T5498.stderr +++ b/testsuite/tests/deriving/should_fail/T5498.stderr @@ -1,11 +1,10 @@ -T5498.hs:30:39: +T5498.hs:30:39: error: Couldn't match representation of type ‘c a’ with that of ‘c (Down a)’ - arising from the coercion of the method ‘intIso’ - from type ‘forall (c :: * -> *). c a -> c Int’ - to type ‘forall (c :: * -> *). c (Down a) -> c Int’ - Relevant role signatures: type role Down representational + arising from the coercion of the method ‘intIso’ + from type ‘forall (c :: * -> *). c a -> c Int’ + to type ‘forall (c :: * -> *). c (Down a) -> c Int’ NB: We cannot know what roles the parameters to ‘c’ have; we must assume that the role is nominal When deriving the instance for (IntIso (Down a)) diff --git a/testsuite/tests/deriving/should_fail/T6147.stderr b/testsuite/tests/deriving/should_fail/T6147.stderr index 7f851a656b..a7bd1ab477 100644 --- a/testsuite/tests/deriving/should_fail/T6147.stderr +++ b/testsuite/tests/deriving/should_fail/T6147.stderr @@ -1,7 +1,6 @@ -T6147.hs:13:32: +T6147.hs:13:32: error: Couldn't match type ‘Int’ with ‘Foo’ - arising from the coercion of the method ‘foo’ - from type ‘Int -> T Int’ to type ‘Foo -> T Foo’ - Relevant role signatures: type role T nominal + arising from the coercion of the method ‘foo’ + from type ‘Int -> T Int’ to type ‘Foo -> T Foo’ When deriving the instance for (C Foo) diff --git a/testsuite/tests/deriving/should_fail/T7148.stderr b/testsuite/tests/deriving/should_fail/T7148.stderr index ba3a88b6fe..84c8205fb2 100644 --- a/testsuite/tests/deriving/should_fail/T7148.stderr +++ b/testsuite/tests/deriving/should_fail/T7148.stderr @@ -1,20 +1,14 @@ -T7148.hs:27:40: +T7148.hs:27:40: error: Occurs check: cannot construct the infinite type: b ~ Tagged a b - arising from the coercion of the method ‘iso2’ - from type ‘forall b. SameType b () -> SameType b b’ - to type ‘forall b. SameType b () -> SameType b (Tagged a b)’ - Relevant role signatures: - type role Tagged phantom representational - type role SameType nominal nominal + arising from the coercion of the method ‘iso2’ + from type ‘forall b. SameType b () -> SameType b b’ + to type ‘forall b. SameType b () -> SameType b (Tagged a b)’ When deriving the instance for (IsoUnit (Tagged a b)) -T7148.hs:27:40: +T7148.hs:27:40: error: Occurs check: cannot construct the infinite type: b ~ Tagged a b - arising from the coercion of the method ‘iso1’ - from type ‘forall b. SameType () b -> SameType b b’ - to type ‘forall b. SameType () b -> SameType (Tagged a b) b’ - Relevant role signatures: - type role Tagged phantom representational - type role SameType nominal nominal + arising from the coercion of the method ‘iso1’ + from type ‘forall b. SameType () b -> SameType b b’ + to type ‘forall b. SameType () b -> SameType (Tagged a b) b’ 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 4edb968702..8dd23aa034 100644 --- a/testsuite/tests/deriving/should_fail/T7148a.stderr +++ b/testsuite/tests/deriving/should_fail/T7148a.stderr @@ -1,14 +1,10 @@ -T7148a.hs:19:50: +T7148a.hs:19:50: error: Couldn't match representation of type ‘b’ with that of ‘Result a b’ - ‘b’ is a rigid type variable bound by - the type forall b1. Proxy b1 -> a -> Result a b1 at T7148a.hs:19:50 - arising from the coercion of the method ‘coerce’ - from type ‘forall b. Proxy b -> a -> Result a b’ - to type ‘forall b. - Proxy b -> IS_NO_LONGER a -> Result (IS_NO_LONGER a) b’ - Relevant role signatures: - type role IS_NO_LONGER representational - type role Result nominal nominal - type role Proxy phantom + arising from the coercion of the method ‘coerce’ + from type ‘forall b. Proxy b -> a -> Result a b’ + to type ‘forall b. + Proxy b -> IS_NO_LONGER a -> Result (IS_NO_LONGER a) b’ + ‘b’ is a rigid type variable bound by + the type forall b1. Proxy b1 -> a -> Result a b1 at T7148a.hs:19:50 When deriving the instance for (Convert (IS_NO_LONGER a)) diff --git a/testsuite/tests/deriving/should_fail/T8851.stderr b/testsuite/tests/deriving/should_fail/T8851.stderr index 0a2b384bd1..dd4a614785 100644 --- a/testsuite/tests/deriving/should_fail/T8851.stderr +++ b/testsuite/tests/deriving/should_fail/T8851.stderr @@ -1,16 +1,11 @@ -T8851.hs:24:12: +T8851.hs:24:12: error: Couldn't match type ‘Parser’ with ‘MyParser’ - arising from the coercion of the method ‘notFollowedBy’ - from type ‘forall a. - (Monad Parser, Show a) => - Parser a -> Parser ()’ - to type ‘forall a. - (Monad MyParser, Show a) => - MyParser a -> MyParser ()’ - Relevant role signatures: - type role Monad nominal - type role Show nominal - type role MyParser phantom - type role Parser phantom + arising from the coercion of the method ‘notFollowedBy’ + from type ‘forall a. + (Monad Parser, Show a) => + Parser a -> Parser ()’ + to type ‘forall a. + (Monad MyParser, Show a) => + MyParser a -> MyParser ()’ When deriving the instance for (Parsing MyParser) diff --git a/testsuite/tests/deriving/should_fail/T8984.stderr b/testsuite/tests/deriving/should_fail/T8984.stderr index 6606d66f63..1cdc425293 100644 --- a/testsuite/tests/deriving/should_fail/T8984.stderr +++ b/testsuite/tests/deriving/should_fail/T8984.stderr @@ -1,11 +1,9 @@ -T8984.hs:7:46: +T8984.hs:7:46: error: Couldn't match representation of type ‘cat a (N cat a Int)’ with that of ‘cat a (cat a Int)’ - arising from the coercion of the method ‘app’ - from type ‘cat a (cat a Int)’ to type ‘N cat a (N cat a Int)’ - Relevant role signatures: - type role N representational nominal nominal + arising from the coercion of the method ‘app’ + from type ‘cat a (cat a Int)’ to type ‘N cat a (N cat a Int)’ NB: We cannot know what roles the parameters to ‘cat a’ have; we must assume that the role is nominal When deriving the instance for (C (N cat a)) |