ApiAnnotations : quoted type variables missing leading quote
authorAlan Zimmerman <alan.zimm@gmail.com>
Wed, 6 May 2015 13:07:39 +0000 (08:07 -0500)
committerAustin Seipp <austin@well-typed.com>
Wed, 6 May 2015 13:09:52 +0000 (08:09 -0500)
commit15aafc7fb61d2cbf95f2a564762399e82fe44e9c
treee359e4a1f103e7a9eed1f28636df3eb01e2300fd
parentcaeae1a33e28745b51d952b034e253d3e51e0605
ApiAnnotations : quoted type variables missing leading quote

The HsOpTy can be constructed for a promoted type operator, in which case it has the following form

        | btype SIMPLEQUOTE qconop type     { sLL $1 $> $ mkHsOpTy $1 $3 $4 }
        | btype SIMPLEQUOTE varop  type     { sLL $1 $> $ mkHsOpTy $1 $3 $4 }

The SIMPLEQUOTE does not get an annotation, so cannot be reproduced via the API Annotations.

Also, in

splice_exp :: { LHsExpr RdrName }
        : TH_ID_SPLICE          { sL1 $1 $ mkHsSpliceE
                                        (sL1 $1 $ HsVar (mkUnqual varName
                                                        (getTH_ID_SPLICE $1))) }
        | '$(' exp ')'          {% ams (sLL $1 $> $ mkHsSpliceE $2) [mo $1,mc $3] }
        | TH_ID_TY_SPLICE       { sL1 $1 $ mkHsSpliceTE
                                        (sL1 $1 $ HsVar (mkUnqual varName
                                                     (getTH_ID_TY_SPLICE $1))) }
        | '$$(' exp ')'         {% ams (sLL $1 $> $ mkHsSpliceTE $2) [mo $1,mc $3] }

the TH_ID_SPLICE and TH_ID_TY_SPLICE positions are lost.

Reviewed By: austin

Differential Revision: https://phabricator.haskell.org/D825

GHC Trac Issues: #10268
compiler/parser/ApiAnnotation.hs
compiler/parser/Parser.y
testsuite/tests/ghc-api/annotations/.gitignore
testsuite/tests/ghc-api/annotations/Makefile
testsuite/tests/ghc-api/annotations/T10268.stderr [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/T10268.stdout [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/Test10268.hs [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/all.T
testsuite/tests/ghc-api/annotations/t10268.hs [new file with mode: 0644]