Perform a validity check on assoc type defaults.
authorRichard Eisenberg <eir@cis.upenn.edu>
Sat, 19 Sep 2015 18:32:44 +0000 (14:32 -0400)
committerRichard Eisenberg <eir@cis.upenn.edu>
Mon, 21 Sep 2015 14:53:39 +0000 (10:53 -0400)
commite27b267f3675180c03a75282dd952b8a59339a1f
treed4a47212e026a084f22b787b75ea9bef56f85dab
parent2f9809efdbc11fee445dbe3d5c555433ec3c5e6a
Perform a validity check on assoc type defaults.

This fixes #10817 and #10899. A knock-on effect is that we must
now remember locations of associated type defaults for error
messages during validity checking. This isn't too bad, but it
increases the size of the diff somewhat.

Test cases: indexed-types/should_fail/T108{17,99}
13 files changed:
compiler/iface/MkIface.hs
compiler/iface/TcIface.hs
compiler/typecheck/TcInstDcls.hs
compiler/typecheck/TcRnDriver.hs
compiler/typecheck/TcTyClsDecls.hs
compiler/typecheck/TcValidity.hs
compiler/types/Class.hs
testsuite/tests/indexed-types/should_fail/T10817.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/T10817.stderr [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/T10899.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/T10899.stderr [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/all.T
testsuite/tests/typecheck/should_compile/tc253.hs