ApiAnnotations : AST version of nested forall loses forall annotation
authorAlan Zimmerman <alan.zimm@gmail.com>
Thu, 21 May 2015 12:13:42 +0000 (14:13 +0200)
committerAlan Zimmerman <alan.zimm@gmail.com>
Thu, 21 May 2015 12:13:42 +0000 (14:13 +0200)
commitc553e980e4a5d149af13bb705ec02819a15937ee
treeab941f86fbc81d680db18cf8a740921d245582f8
parent9f968e97a0de9c2509da00f6337b612dd72a0389
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
14 files changed:
compiler/hsSyn/Convert.hs
compiler/hsSyn/HsSyn.hs
compiler/hsSyn/HsTypes.hs
compiler/parser/Parser.y
compiler/parser/RdrHsSyn.hs
compiler/rename/RnNames.hs
compiler/rename/RnTypes.hs
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]