Refactor validity checking for type/data instances
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 22 Jan 2016 16:40:55 +0000 (16:40 +0000)
committerBartosz Nitka <niteria@gmail.com>
Mon, 25 Jul 2016 14:39:18 +0000 (07:39 -0700)
commit2b3de328f24a2c2113f65ceef715e6ee57045577
tree05a8809a8870db0fb96c3aeec009da6813f916cd
parentfbccc0b61184bf93c1135b87c2dc0687ca4a6976
Refactor validity checking for type/data instances

I found that there was some code duplication going on,
so I've put more into the shared function checkValidFamPats.

I did some refactoring in checkConsistentFamInst too,
preparatory to #11450; the error messages change a little
but no change in behaviour.

(cherry picked from commit 746764cce9a111a082a13bc3cd34b50e34fd2a31)
compiler/typecheck/TcInstDcls.hs
compiler/typecheck/TcTyClsDecls.hs
compiler/typecheck/TcValidity.hs
testsuite/tests/indexed-types/should_fail/SimpleFail2a.stderr