ApiAnnotations : Nested forall loses forall annotation
authorAlan Zimmerman <alan.zimm@gmail.com>
Wed, 6 May 2015 13:08:40 +0000 (08:08 -0500)
committerAustin Seipp <austin@well-typed.com>
Wed, 6 May 2015 13:10:00 +0000 (08:10 -0500)
commit81030ede73c4e3783219b2a8d7463524e847cfce
tree560817579d9141322b74e2a705d185705ffbe647
parent15aafc7fb61d2cbf95f2a564762399e82fe44e9c
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
compiler/parser/Parser.y
testsuite/tests/ghc-api/annotations/.gitignore
testsuite/tests/ghc-api/annotations/Makefile
testsuite/tests/ghc-api/annotations/T10278.stderr [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/T10278.stdout [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/Test10278.hs [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/all.T
testsuite/tests/ghc-api/annotations/t10278.hs [new file with mode: 0644]