Slightly better `Coercible` errors.
authorRichard Eisenberg <eir@cis.upenn.edu>
Sun, 20 Sep 2015 21:39:17 +0000 (17:39 -0400)
committerRichard Eisenberg <eir@cis.upenn.edu>
Mon, 21 Sep 2015 14:53:38 +0000 (10:53 -0400)
commit2f9809efdbc11fee445dbe3d5c555433ec3c5e6a
tree06d6702da1922186bf362653481e1112e457d42a
parentcbcad859acb350a33dec077d50438f929afbf0ad
Slightly better `Coercible` errors.

This makes two real changes:
 - Equalities like (a ~R [a]) really *are* insoluble. Previously,
   GHC refused to give up when an occurs check bit on a representational
   equality. But for datatypes, it really should bail.

 - Now, GHC will sometimes report an occurs check error (in cases above)
   for representational equalities. Previously, it never did.

This "fixes" #10715, where by "fix", I mean clarifies the error message.
It's unclear how to do more to fix that ticket.

Test cases: typecheck/should_fail/T10715{,b}
compiler/typecheck/TcCanonical.hs
compiler/typecheck/TcErrors.hs
compiler/typecheck/TcType.hs
testsuite/tests/typecheck/should_fail/T10715.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T10715.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T10715b.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T10715b.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T