Check generic-default method for ambiguity
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 1 Jul 2016 21:33:33 +0000 (22:33 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Tue, 5 Jul 2016 12:54:54 +0000 (13:54 +0100)
commit85aa6ef09346e841abf4e089b24c7f783286cd74
tree7ed14c467fb650479acb542d001a74f688948d0e
parente10497b9a3622265b88caa60590ed620ff3d33e2
Check generic-default method for ambiguity

Fixes Trac #7497 and #12151.   In some earlier upheaval I introduced
a bug in the ambiguity check for genreric-default method.

This patch fixes it.  But in fixing it I realised that the
sourc-location of any such error message was bogus, so I fixed
that too, which involved a slightly wider change; see the
comments with TcMethInfo.
12 files changed:
compiler/iface/BuildTyCl.hs
compiler/iface/TcIface.hs
compiler/typecheck/TcClassDcl.hs
compiler/typecheck/TcTyClsDecls.hs
compiler/typecheck/TcTyDecls.hs
compiler/types/Class.hs
compiler/vectorise/Vectorise/Type/TyConDecl.hs
testsuite/tests/typecheck/should_fail/T12151.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T12151.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T7437.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T7437.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T