summaryrefslogtreecommitdiff
path: root/compiler/GHC/Hs/Instances.hs
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2020-09-13 08:58:40 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-09-15 15:21:43 -0400
commit4283feaa9e0826211f7a71d543054c989ea32965 (patch)
tree93f96b0599ed403b0180b0416c13f14a193bb1e4 /compiler/GHC/Hs/Instances.hs
parentb3143f5a0827b640840ef241a30933dc23b69d91 (diff)
downloadhaskell-4283feaa9e0826211f7a71d543054c989ea32965.tar.gz
Introduce and use DerivClauseTys (#18662)
This switches `deriv_clause_tys` so that instead of using a list of `LHsSigType`s to represent the types in a `deriving` clause, it now uses a sum type. `DctSingle` represents a `deriving` clause with no enclosing parentheses, while `DctMulti` represents a clause with enclosing parentheses. This makes pretty-printing easier and avoids confusion between `HsParTy` and the enclosing parentheses in `deriving` clauses, which are different semantically. Fixes #18662.
Diffstat (limited to 'compiler/GHC/Hs/Instances.hs')
-rw-r--r--compiler/GHC/Hs/Instances.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/GHC/Hs/Instances.hs b/compiler/GHC/Hs/Instances.hs
index 34afe3a72d..e1f3d29f21 100644
--- a/compiler/GHC/Hs/Instances.hs
+++ b/compiler/GHC/Hs/Instances.hs
@@ -163,6 +163,11 @@ deriving instance Data (HsDerivingClause GhcPs)
deriving instance Data (HsDerivingClause GhcRn)
deriving instance Data (HsDerivingClause GhcTc)
+-- deriving instance DataIdLR p p => Data (DerivClauseTys p)
+deriving instance Data (DerivClauseTys GhcPs)
+deriving instance Data (DerivClauseTys GhcRn)
+deriving instance Data (DerivClauseTys GhcTc)
+
-- deriving instance (DataIdLR p p) => Data (ConDecl p)
deriving instance Data (ConDecl GhcPs)
deriving instance Data (ConDecl GhcRn)