[commit: ghc] wip/api-annots-ghc-7.10: ApiAnnotations : AST version of nested forall loses forall annotation (2cbd7f9)
git at git.haskell.org
git at git.haskell.org
Thu May 21 18:25:14 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/api-annots-ghc-7.10
Link : http://ghc.haskell.org/trac/ghc/changeset/2cbd7f959976618ddb03fcee5714d5801b60ab9e/ghc
>---------------------------------------------------------------
commit 2cbd7f959976618ddb03fcee5714d5801b60ab9e
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date: Thu May 21 14:13:42 2015 +0200
ApiAnnotations : AST version of nested forall loses forall annotation
Summary:
When parsing
{-# LANGUAGE ScopedTypeVariables #-}
extremumNewton :: forall tag. forall tag1.
tag -> tag1 -> Int
extremumNewton = undefined
the parser creates nested HsForAllTy's for the two forall statements.
These get flattened into a single one in `HsTypes.mk_forall_ty`
This patch removes the flattening, so that API Annotations are not lost in the
process.
Test Plan: ./validate
Reviewers: goldfire, austin, simonpj
Reviewed By: simonpj
Subscribers: bgamari, mpickering, thomie, goldfire
Differential Revision: https://phabricator.haskell.org/D836
GHC Trac Issues: #10278, #10315, #10354, #10363
(cherry picked from commit c553e980e4a5d149af13bb705ec02819a15937ee)
Conflicts:
compiler/hsSyn/HsTypes.hs
>---------------------------------------------------------------
2cbd7f959976618ddb03fcee5714d5801b60ab9e
compiler/hsSyn/Convert.hs | 5 +-
compiler/hsSyn/HsSyn.hs | 2 +-
compiler/hsSyn/HsTypes.hs | 94 ++++++++---
compiler/parser/Parser.y | 4 +-
compiler/parser/RdrHsSyn.hs | 13 +-
compiler/rename/RnNames.hs | 3 +-
compiler/rename/RnTypes.hs | 107 +++++++------
testsuite/tests/ghc-api/annotations/.gitignore | 1 +
testsuite/tests/ghc-api/annotations/Makefile | 8 +
testsuite/tests/ghc-api/annotations/T10278.stderr | 12 ++
testsuite/tests/ghc-api/annotations/T10278.stdout | 171 +++++++++++++++++++++
testsuite/tests/ghc-api/annotations/Test10278.hs | 20 +++
testsuite/tests/ghc-api/annotations/all.T | 1 +
.../ghc-api/annotations/{t10357.hs => t10278.hs} | 2 +-
14 files changed, 365 insertions(+), 78 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 2cbd7f959976618ddb03fcee5714d5801b60ab9e
More information about the ghc-commits
mailing list