[commit: ghc] master: ApiAnnotations : AST version of nested forall loses forall annotation (c553e98)

git at git.haskell.org git at git.haskell.org
Thu May 21 12:13:51 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c553e980e4a5d149af13bb705ec02819a15937ee/ghc

>---------------------------------------------------------------

commit c553e980e4a5d149af13bb705ec02819a15937ee
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


>---------------------------------------------------------------

c553e980e4a5d149af13bb705ec02819a15937ee
 compiler/hsSyn/Convert.hs                          |   5 +-
 compiler/hsSyn/HsSyn.hs                            |   2 +-
 compiler/hsSyn/HsTypes.hs                          |  85 +++++++---
 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  |  16 ++
 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, 360 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 c553e980e4a5d149af13bb705ec02819a15937ee


More information about the ghc-commits mailing list