summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-01-06 17:22:02 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2016-01-07 08:37:23 +0000
commit02c1c5735aff0cce2b04a6b3e4732d62bb0a4f3c (patch)
treee2b92270f05ee9f5332d0057c813e3fbd944b514 /testsuite/tests/deriving
parentdc970966da5c2059bd91577f8d83a9d4f9fe4d3a (diff)
downloadhaskell-02c1c5735aff0cce2b04a6b3e4732d62bb0a4f3c.tar.gz
Use an Implication in 'deriving' error
Trac #11437 showed that erroneous constraints from a 'deriving' clause need to be wrapped in an Implication to properly scope their skolems. The main change is in TcDeriv.simplifyDeriv; the call to buildImplicationFor is new.
Diffstat (limited to 'testsuite/tests/deriving')
-rw-r--r--testsuite/tests/deriving/should_compile/T10561.stderr8
-rw-r--r--testsuite/tests/deriving/should_fail/T7148.stderr24
2 files changed, 19 insertions, 13 deletions
diff --git a/testsuite/tests/deriving/should_compile/T10561.stderr b/testsuite/tests/deriving/should_compile/T10561.stderr
index 3a158ddb9a..c74967ff43 100644
--- a/testsuite/tests/deriving/should_compile/T10561.stderr
+++ b/testsuite/tests/deriving/should_compile/T10561.stderr
@@ -1,5 +1,7 @@
T10561.hs:10:52: error:
- Couldn't match kind ‘k’ with ‘*’
- arising from the first field of ‘Compose’ (type ‘f (g a)’)
- When deriving the instance for (Functor (Compose f g))
+ • Couldn't match kind ‘k’ with ‘*’
+ arising from the first field of ‘Compose’ (type ‘f (g a)’)
+ ‘k’ is a rigid type variable bound by
+ the deriving clause for ‘Functor (Compose f g)’ at T10561.hs:10:52
+ • When deriving the instance for (Functor (Compose f g))
diff --git a/testsuite/tests/deriving/should_fail/T7148.stderr b/testsuite/tests/deriving/should_fail/T7148.stderr
index 84c8205fb2..afdd1f9d99 100644
--- a/testsuite/tests/deriving/should_fail/T7148.stderr
+++ b/testsuite/tests/deriving/should_fail/T7148.stderr
@@ -1,14 +1,18 @@
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)’
- When deriving the instance for (IsoUnit (Tagged a b))
+ • Couldn't match type ‘b’ with ‘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)’
+ ‘b’ is a rigid type variable bound by
+ the deriving clause for ‘IsoUnit (Tagged a b)’ at T7148.hs:27:40
+ • When deriving the instance for (IsoUnit (Tagged a b))
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’
- When deriving the instance for (IsoUnit (Tagged a b))
+ • Couldn't match type ‘b’ with ‘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’
+ ‘b’ is a rigid type variable bound by
+ the deriving clause for ‘IsoUnit (Tagged a b)’ at T7148.hs:27:40
+ • When deriving the instance for (IsoUnit (Tagged a b))