More refactoring in TcValidity
This patch responds to Trac #15334 by making it an error to write an instance declaration for a tuple constraint like (Eq [a], Show [a]). I then discovered that instance validity checking was scattered betweeen TcInstDcls and TcValidity, so I took the time to bring it all together, into TcValidity.checkValidInstHead In doing so I discovered that there are lot of special cases. I have not changed them, but at least they are all laid out clearly now.
Showing
- compiler/hsSyn/HsDecls.hs 2 additions, 2 deletionscompiler/hsSyn/HsDecls.hs
- compiler/prelude/TysWiredIn.hs 1 addition, 1 deletioncompiler/prelude/TysWiredIn.hs
- compiler/typecheck/TcDeriv.hs 10 additions, 10 deletionscompiler/typecheck/TcDeriv.hs
- compiler/typecheck/TcInstDcls.hs 8 additions, 52 deletionscompiler/typecheck/TcInstDcls.hs
- compiler/typecheck/TcTyClsDecls.hs 1 addition, 1 deletioncompiler/typecheck/TcTyClsDecls.hs
- compiler/typecheck/TcType.hs 5 additions, 2 deletionscompiler/typecheck/TcType.hs
- compiler/typecheck/TcValidity.hs 142 additions, 61 deletionscompiler/typecheck/TcValidity.hs
- testsuite/tests/deriving/should_fail/T14916.stderr 2 additions, 4 deletionstestsuite/tests/deriving/should_fail/T14916.stderr
- testsuite/tests/deriving/should_fail/T9687.stderr 1 addition, 1 deletiontestsuite/tests/deriving/should_fail/T9687.stderr
- testsuite/tests/polykinds/T8132.stderr 1 addition, 1 deletiontestsuite/tests/polykinds/T8132.stderr
- testsuite/tests/quantified-constraints/T15334.hs 9 additions, 0 deletionstestsuite/tests/quantified-constraints/T15334.hs
- testsuite/tests/quantified-constraints/T15334.stderr 6 additions, 0 deletionstestsuite/tests/quantified-constraints/T15334.stderr
- testsuite/tests/quantified-constraints/all.T 1 addition, 0 deletionstestsuite/tests/quantified-constraints/all.T
- testsuite/tests/typecheck/should_fail/T12837.stderr 4 additions, 4 deletionstestsuite/tests/typecheck/should_fail/T12837.stderr
- testsuite/tests/typecheck/should_fail/T13068.stderr 1 addition, 1 deletiontestsuite/tests/typecheck/should_fail/T13068.stderr
- testsuite/tests/typecheck/should_fail/T14390.stderr 1 addition, 2 deletionstestsuite/tests/typecheck/should_fail/T14390.stderr
- testsuite/tests/typecheck/should_fail/TcCoercibleFail2.stderr 2 additions, 3 deletions...suite/tests/typecheck/should_fail/TcCoercibleFail2.stderr
Loading
Please register or sign in to comment