diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2017-09-02 15:33:25 -0400 |
---|---|---|
committer | Ryan Scott <ryan.gl.scott@gmail.com> | 2017-09-02 15:33:26 -0400 |
commit | 8e4229ab3dc3e1717ad557ef00f3518da6b5c523 (patch) | |
tree | 64a50dd06118a0d3709d37b258faa11eb4d1a218 /testsuite/tests/rename | |
parent | 5dd6b13c6e2942976aa3b5f4906ff7d0f959272d (diff) | |
download | haskell-8e4229ab3dc3e1717ad557ef00f3518da6b5c523.tar.gz |
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
Diffstat (limited to 'testsuite/tests/rename')
-rw-r--r-- | testsuite/tests/rename/should_fail/rnfail055.stderr | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/testsuite/tests/rename/should_fail/rnfail055.stderr b/testsuite/tests/rename/should_fail/rnfail055.stderr index 7fc5d80bad..b9ba174519 100644 --- a/testsuite/tests/rename/should_fail/rnfail055.stderr +++ b/testsuite/tests/rename/should_fail/rnfail055.stderr @@ -71,10 +71,8 @@ RnFail055.hs-boot:25:1: error: Type constructor ‘T7’ has conflicting definitions in the module and its hs-boot file Main module: type role T7 phantom - data T7 a where - T7 :: a1 -> T7 a - Boot file: data T7 a where - T7 :: a -> T7 a + data T7 a = forall a1. T7 a1 + Boot file: data T7 a = forall b. T7 a The roles do not match. Roles on abstract types default to ‘representational’ in boot files. The constructors do not match: The types for ‘T7’ differ |