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/typecheck | |
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/typecheck')
9 files changed, 29 insertions, 38 deletions
diff --git a/testsuite/tests/typecheck/bug1465/bug1465.stderr b/testsuite/tests/typecheck/bug1465/bug1465.stderr index 118d070075..1c67068762 100644 --- a/testsuite/tests/typecheck/bug1465/bug1465.stderr +++ b/testsuite/tests/typecheck/bug1465/bug1465.stderr @@ -1,8 +1,8 @@ -C.hs:6:11: +C.hs:6:11: error: Couldn't match expected type ‘bug1465-1.0:A.T’ with actual type ‘A.T’ - NB: ‘bug1465-1.0:A.T’ is defined in ‘A’ in package ‘bug1465-1.0’ - ‘A.T’ is defined in ‘A’ in package ‘bug1465-2.0’ + NB: ‘A.T’ is defined in ‘A’ in package ‘bug1465-2.0’ + ‘bug1465-1.0:A.T’ is defined in ‘A’ in package ‘bug1465-1.0’ In the expression: B2.f In the expression: [B1.f, B2.f] diff --git a/testsuite/tests/typecheck/should_compile/FD3.stderr b/testsuite/tests/typecheck/should_compile/FD3.stderr index 179fda19e6..f4c60451d8 100644 --- a/testsuite/tests/typecheck/should_compile/FD3.stderr +++ b/testsuite/tests/typecheck/should_compile/FD3.stderr @@ -1,5 +1,14 @@ FD3.hs:15:15: error: - No instance for (MkA (String, a) a) arising from a use of ‘mkA’ + Couldn't match type ‘a’ with ‘(String, a)’ + arising from a functional dependency between: + constraint ‘MkA (String, a) a’ arising from a use of ‘mkA’ + instance ‘MkA a1 a1’ at FD3.hs:12:10-16 + ‘a’ is a rigid type variable bound by + the type signature for: translate :: (String, a) -> A a + at FD3.hs:14:14 + Relevant bindings include + a :: (String, a) (bound at FD3.hs:15:11) + translate :: (String, a) -> A a (bound at FD3.hs:15:1) In the expression: mkA a In an equation for ‘translate’: translate a = mkA a diff --git a/testsuite/tests/typecheck/should_fail/T10285.stderr b/testsuite/tests/typecheck/should_fail/T10285.stderr index 1ed2046278..8a13daeae2 100644 --- a/testsuite/tests/typecheck/should_fail/T10285.stderr +++ b/testsuite/tests/typecheck/should_fail/T10285.stderr @@ -1,9 +1,6 @@ T10285.hs:8:17: error: - Could not deduce: Coercible a b - arising from trying to show that the representations of - ‘a’ and - ‘b’ are the same + Could not deduce: Coercible a b arising from a use of ‘coerce’ from the context: Coercible (N a) (N b) bound by a pattern with constructor: Coercion :: forall (k :: BOX) (a :: k) (b :: k). diff --git a/testsuite/tests/typecheck/should_fail/T10495.stderr b/testsuite/tests/typecheck/should_fail/T10495.stderr index 6e92505504..eec1cdb7c0 100644 --- a/testsuite/tests/typecheck/should_fail/T10495.stderr +++ b/testsuite/tests/typecheck/should_fail/T10495.stderr @@ -1,6 +1,7 @@ T10495.hs:5:7: error: Couldn't match representation of type ‘a0’ with that of ‘b0’ + arising from a use of ‘coerce’ Relevant bindings include foo :: a0 -> b0 (bound at T10495.hs:5:1) In the expression: coerce In an equation for ‘foo’: foo = coerce diff --git a/testsuite/tests/typecheck/should_fail/T10534.stderr b/testsuite/tests/typecheck/should_fail/T10534.stderr index ab2cde1cf5..5bb0e40097 100644 --- a/testsuite/tests/typecheck/should_fail/T10534.stderr +++ b/testsuite/tests/typecheck/should_fail/T10534.stderr @@ -1,9 +1,6 @@ T10534a.hs:10:9: error: - Could not deduce: Coercible a b - arising from trying to show that the representations of - ‘a’ and - ‘b’ are the same + Could not deduce: Coercible a b arising from a use of ‘coerce’ from the context: Coercible (DF a) (DF b) bound by the type signature for: silly :: Coercible (DF a) (DF b) => a -> b diff --git a/testsuite/tests/typecheck/should_fail/T5853.stderr b/testsuite/tests/typecheck/should_fail/T5853.stderr index 1489583154..2d5c90284b 100644 --- a/testsuite/tests/typecheck/should_fail/T5853.stderr +++ b/testsuite/tests/typecheck/should_fail/T5853.stderr @@ -1,6 +1,6 @@ T5853.hs:15:52: error: - Could not deduce: t2 ~ Subst t1 (Elem t2) + Could not deduce: Subst t1 (Elem t2) ~ t2 from the context: (F t, Subst t (Elem t2) ~ t2, Subst t2 (Elem t) ~ t, diff --git a/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr b/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr index 434d5e34a7..e41d8c1b10 100644 --- a/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr +++ b/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr @@ -1,12 +1,14 @@ TcCoercibleFail.hs:11:8: error: Couldn't match representation of type ‘Int’ with that of ‘()’ + arising from a use of ‘coerce’ In the expression: 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 Relevant bindings include @@ -16,18 +18,14 @@ TcCoercibleFail.hs:14:8: error: In an equation for ‘foo2’: foo2 = coerce $ (return one :: m Int) TcCoercibleFail.hs:16:8: error: - Couldn't match type ‘Int’ with ‘Age’ - arising from trying to show that the representations of - ‘Map Int ()’ and - ‘Map Age ()’ are the same - Relevant role signatures: type role Map nominal representational + Couldn't match type ‘Int’ with ‘Age’ arising from a use of ‘coerce’ In the expression: 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’ - Relevant role signatures: type role Down representational + arising from a use of ‘coerce’ The data constructor ‘Down’ of newtype ‘Down’ is not in scope In the expression: coerce In the expression: coerce $ one :: Down Int @@ -35,13 +33,14 @@ TcCoercibleFail.hs:18:8: error: 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:24:9: error: Couldn't match representation of type ‘VoidBad ()’ with that of ‘()’ - Relevant role signatures: type role VoidBad phantom + arising from a use of ‘coerce’ In the expression: coerce :: (VoidBad ()) -> () In an equation for ‘foo5'’: foo5' = coerce :: (VoidBad ()) -> () @@ -60,11 +59,6 @@ TcCoercibleFail.hs:29:8: error: Couldn't match representation of type ‘Either Int (Fix (Either Int))’ with that of ‘()’ - arising from trying to show that the representations of - ‘Fix (Either Int)’ and - ‘()’ are the same - Relevant role signatures: - type role Either representational representational - type role Fix nominal + arising from a use of ‘coerce’ In the expression: coerce :: Fix (Either Int) -> () In an equation for ‘foo7’: foo7 = coerce :: Fix (Either Int) -> () diff --git a/testsuite/tests/typecheck/should_fail/TcCoercibleFail3.stderr b/testsuite/tests/typecheck/should_fail/TcCoercibleFail3.stderr index f4ebe40bb1..823b4c375d 100644 --- a/testsuite/tests/typecheck/should_fail/TcCoercibleFail3.stderr +++ b/testsuite/tests/typecheck/should_fail/TcCoercibleFail3.stderr @@ -1,12 +1,6 @@ -TcCoercibleFail3.hs:12:7: +TcCoercibleFail3.hs:12:7: error: Couldn't match representation of type ‘NT1’ with that of ‘NT2’ - arising from trying to show that the representations of - ‘T NT1’ and - ‘T NT2’ are the same - Relevant role signatures: - type role NT2 representational - type role NT1 representational - type role T representational + arising from a use of ‘coerce’ In the expression: coerce In an equation for ‘foo’: foo = coerce diff --git a/testsuite/tests/typecheck/should_fail/tcfail182.stderr b/testsuite/tests/typecheck/should_fail/tcfail182.stderr index d223ca5e1a..fa628a4049 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail182.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail182.stderr @@ -1,10 +1,9 @@ -tcfail182.hs:9:3: +tcfail182.hs:9:3: error: Couldn't match expected type ‘Prelude.Maybe a’ with actual type ‘Maybe t0’ - NB: ‘Prelude.Maybe’ - is defined in ‘GHC.Base’ in package ‘base-4.8.2.0’ - ‘Maybe’ is defined at tcfail182.hs:6:1-18 + NB: ‘Maybe’ is defined at tcfail182.hs:6:1-18 + ‘Prelude.Maybe’ is defined in ‘GHC.Base’ in package ‘base-4.8.2.0’ Relevant bindings include f :: Prelude.Maybe a -> Int (bound at tcfail182.hs:9:1) In the pattern: Foo |