[commit: ghc] master: Fix #14167 by using isGadtSyntaxTyCon in more places (8e4229a)
git at git.haskell.org
git at git.haskell.org
Sat Sep 2 19:34:57 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/8e4229ab3dc3e1717ad557ef00f3518da6b5c523/ghc
>---------------------------------------------------------------
commit 8e4229ab3dc3e1717ad557ef00f3518da6b5c523
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date: Sat Sep 2 15:33:25 2017 -0400
Fix #14167 by using isGadtSyntaxTyCon in more places
Summary:
Two places in GHC effectively attempt to //guess// whether a data type
was declared using GADT syntax:
1. When reifying a data type in Template Haskell
2. When pretty-printing a data type (e.g., via `:info` in GHCi)
But there's no need for heuristics here, since we have a 100% accurate way to
determine whether a data type was declared using GADT syntax: the
`isGadtSyntaxTyCon` function! By simply using that as the metric, we obtain
far more accurate TH reification and pretty-printing results.
This is technically a breaking change, since Template Haskell reification will
now reify some data type constructors as `(Rec)GadtC` that it didn't before,
and some data type constructors that were previously reified as `(Rec)GadtC`
will no longer be reified as such. But it's a very understandable breaking
change, since the previous behavior was simply incorrect.
Test Plan: ./validate
Reviewers: simonpj, goldfire, austin, bgamari
Reviewed By: simonpj
Subscribers: rwbarton, thomie
GHC Trac Issues: #14167
Differential Revision: https://phabricator.haskell.org/D3901
>---------------------------------------------------------------
8e4229ab3dc3e1717ad557ef00f3518da6b5c523
compiler/iface/IfaceSyn.hs | 49 ++++++++++------------
compiler/iface/IfaceType.hs | 9 +++-
compiler/typecheck/TcSplice.hs | 34 ++-------------
docs/users_guide/8.4.1-notes.rst | 6 +++
testsuite/tests/ghci/scripts/T7730.stdout | 3 +-
testsuite/tests/ghci/scripts/T7873.stdout | 4 +-
testsuite/tests/ghci/scripts/T9181.stdout | 30 +++++++------
testsuite/tests/ghci/scripts/ghci030.stdout | 8 +---
.../tests/rename/should_fail/rnfail055.stderr | 6 +--
testsuite/tests/th/T4188.stderr | 11 ++---
testsuite/tests/typecheck/should_fail/T3468.stderr | 3 +-
11 files changed, 70 insertions(+), 93 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 8e4229ab3dc3e1717ad557ef00f3518da6b5c523
More information about the ghc-commits
mailing list