Opened 3 years ago

Closed 3 years ago

#10268 closed bug (fixed)

ApiAnnotations : quoted type variables missing leading quote

Reported by: alanz Owned by: alanz
Priority: normal Milestone: 7.10.2
Component: Compiler (Parser) Version: 7.10.1
Keywords: ApiAnnotations Cc: mpickering
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D825
Wiki Page:

Description (last modified by alanz)

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.

Change History (5)

comment:1 Changed 3 years ago by alanz

Description: modified (diff)

comment:2 Changed 3 years ago by alanz

Differential Rev(s): Phab:D825

comment:3 Changed 3 years ago by alanz

Status: newpatch

comment:4 Changed 3 years ago by Austin Seipp <austin@…>

In 15aafc7fb61d2cbf95f2a564762399e82fe44e9c/ghc:

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

comment:5 Changed 3 years ago by thoughtpolice

Resolution: fixed
Status: patchclosed

Merged to ghc-7.10.

Note: See TracTickets for help on using tickets.