[commit: ghc] master: Clean up the conflicting data family instances error message (979f085)
git at git.haskell.org
git at git.haskell.org
Thu May 24 15:19:42 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/979f085c4f87a93f48d6b567076d3c556d490fa8/ghc
>---------------------------------------------------------------
commit 979f085c4f87a93f48d6b567076d3c556d490fa8
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date: Thu May 24 10:33:51 2018 -0400
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
>---------------------------------------------------------------
979f085c4f87a93f48d6b567076d3c556d490fa8
compiler/types/Coercion.hs | 33 +++++++++++++++++-----
.../tests/indexed-types/should_fail/Over.stderr | 4 +--
.../should_fail/OverDirectThisMod.stderr | 4 +--
.../should_fail/OverIndirectThisMod.stderr | 6 ++--
.../indexed-types/should_fail/SimpleFail11a.stderr | 8 +++---
.../indexed-types/should_fail/SimpleFail11b.stderr | 8 +++---
.../indexed-types/should_fail/SimpleFail11c.stderr | 8 +++---
.../indexed-types/should_fail/SimpleFail11d.stderr | 6 ++--
.../indexed-types/should_fail/SimpleFail2b.stderr | 6 ++--
.../tests/indexed-types/should_fail/T14179.hs | 20 +++++++++++++
.../tests/indexed-types/should_fail/T14179.stderr | 15 ++++++++++
.../tests/indexed-types/should_fail/T2334A.stderr | 26 ++++++++---------
.../tests/indexed-types/should_fail/T9371.stderr | 6 ++--
testsuite/tests/indexed-types/should_fail/all.T | 1 +
.../should_compile/DataFamilyInstanceLHS.stderr | 2 +-
.../NamedWildcardInDataFamilyInstanceLHS.stderr | 2 +-
16 files changed, 104 insertions(+), 51 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 979f085c4f87a93f48d6b567076d3c556d490fa8
More information about the ghc-commits
mailing list