[commit: ghc] ghc-7.10: ApiAnnotations : AST version of nested forall loses forall annotation (fb918ab)

git at git.haskell.org git at git.haskell.org
Fri May 22 13:09:25 UTC 2015


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

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/fb918ab551b6da75cdaf96ad62f9479dcab21400/ghc

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

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


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

fb918ab551b6da75cdaf96ad62f9479dcab21400
 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 fb918ab551b6da75cdaf96ad62f9479dcab21400


More information about the ghc-commits mailing list