[commit: ghc] master: ApiAnnotations : Nested forall loses forall annotation (81030ed)

git at git.haskell.org git at git.haskell.org
Wed May 6 13:09:40 UTC 2015


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

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

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

commit 81030ede73c4e3783219b2a8d7463524e847cfce
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   Wed May 6 08:08:40 2015 -0500

    ApiAnnotations : Nested forall loses forall annotation
    
    When parsing
    
        {-# LANGUAGE ScopedTypeVariables #-}
    
        extremumNewton :: forall tag. forall tag1.
                           tag -> tag1 -> Int
        extremumNewton = undefined
    
    The parser attaches an AnnForall to the second forall, which appears as
    a nested HsForAllTy.
    
    Somewhere this nesting is flattened, and the tyvarbndrs are collapsed
    into a single HsForAllTy. In this process the second AnnForAll loses its
    anchor in the AST.
    
    Reviewed By: austin
    
    Differential Revision: https://phabricator.haskell.org/D833
    
    GHC Trac Issues: #10278


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

81030ede73c4e3783219b2a8d7463524e847cfce
 compiler/parser/Parser.y                           | 83 ++++++++++---------
 testsuite/tests/ghc-api/annotations/.gitignore     |  1 +
 testsuite/tests/ghc-api/annotations/Makefile       |  5 ++
 testsuite/tests/ghc-api/annotations/T10278.stderr  | 16 ++++
 testsuite/tests/ghc-api/annotations/T10278.stdout  | 96 ++++++++++++++++++++++
 testsuite/tests/ghc-api/annotations/Test10278.hs   | 12 +++
 testsuite/tests/ghc-api/annotations/all.T          |  1 +
 .../ghc-api/annotations/{t10268.hs => t10278.hs}   |  2 +-
 8 files changed, 178 insertions(+), 38 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 81030ede73c4e3783219b2a8d7463524e847cfce


More information about the ghc-commits mailing list