Clean up the conflicting data family instances error message
Summary: The way we were pretty-printing conflicting data family instances in an error message was far from ideal: 1. If a data type had no constructors, it would print an equals sign with nothing to the right of it. 2. It would try to print GADTs using Haskell98 syntax. 3. It eta-reduced away some type variables from the LHS. This patch addresses these three issues: 1. We no longer print constructors at all in this error message. There's really no reason to do so in the first place, since duplicate data family instances always conflict, regardless of their constructors. 2. Since we no longer print constructors, we no longer have to worry about whether we're using GADT or Haskell98 syntax. 3. I've put in a fix to ensure that type variables are no longer eta-reduced away from the LHS. Test Plan: make test TEST=T14179 Reviewers: goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14179 Differential Revision: https://phabricator.haskell.org/D4711
Showing
- compiler/types/Coercion.hs 26 additions, 7 deletionscompiler/types/Coercion.hs
- testsuite/tests/indexed-types/should_fail/Over.stderr 2 additions, 2 deletionstestsuite/tests/indexed-types/should_fail/Over.stderr
- testsuite/tests/indexed-types/should_fail/OverDirectThisMod.stderr 2 additions, 2 deletions.../tests/indexed-types/should_fail/OverDirectThisMod.stderr
- testsuite/tests/indexed-types/should_fail/OverIndirectThisMod.stderr 2 additions, 4 deletions...ests/indexed-types/should_fail/OverIndirectThisMod.stderr
- testsuite/tests/indexed-types/should_fail/SimpleFail11a.stderr 4 additions, 4 deletions...uite/tests/indexed-types/should_fail/SimpleFail11a.stderr
- testsuite/tests/indexed-types/should_fail/SimpleFail11b.stderr 4 additions, 4 deletions...uite/tests/indexed-types/should_fail/SimpleFail11b.stderr
- testsuite/tests/indexed-types/should_fail/SimpleFail11c.stderr 4 additions, 4 deletions...uite/tests/indexed-types/should_fail/SimpleFail11c.stderr
- testsuite/tests/indexed-types/should_fail/SimpleFail11d.stderr 3 additions, 3 deletions...uite/tests/indexed-types/should_fail/SimpleFail11d.stderr
- testsuite/tests/indexed-types/should_fail/SimpleFail2b.stderr 3 additions, 3 deletions...suite/tests/indexed-types/should_fail/SimpleFail2b.stderr
- testsuite/tests/indexed-types/should_fail/T14179.hs 20 additions, 0 deletionstestsuite/tests/indexed-types/should_fail/T14179.hs
- testsuite/tests/indexed-types/should_fail/T14179.stderr 15 additions, 0 deletionstestsuite/tests/indexed-types/should_fail/T14179.stderr
- testsuite/tests/indexed-types/should_fail/T2334A.stderr 13 additions, 13 deletionstestsuite/tests/indexed-types/should_fail/T2334A.stderr
- testsuite/tests/indexed-types/should_fail/T9371.stderr 3 additions, 3 deletionstestsuite/tests/indexed-types/should_fail/T9371.stderr
- testsuite/tests/indexed-types/should_fail/all.T 1 addition, 0 deletionstestsuite/tests/indexed-types/should_fail/all.T
- testsuite/tests/partial-sigs/should_compile/DataFamilyInstanceLHS.stderr 1 addition, 1 deletion.../partial-sigs/should_compile/DataFamilyInstanceLHS.stderr
- testsuite/tests/partial-sigs/should_compile/NamedWildcardInDataFamilyInstanceLHS.stderr 1 addition, 1 deletion...hould_compile/NamedWildcardInDataFamilyInstanceLHS.stderr
Loading
Please register or sign in to comment