[GHC] #10255: API Annotations : ExprWithTySig processing discards annotated spans

GHC ghc-devs at haskell.org
Tue Apr 14 12:33:18 UTC 2015


#10255: API Annotations : ExprWithTySig processing discards annotated spans
-------------------------------------+-------------------------------------
        Reporter:  alanz             |                   Owner:  alanz
            Type:  bug               |                  Status:  patch
        Priority:  normal            |               Milestone:  7.10.2
       Component:  Compiler          |                 Version:  7.10.1
  (Parser)                           |                Keywords:
      Resolution:                    |  ApiAnnotations
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Other             |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:  Phab:D823
-------------------------------------+-------------------------------------

Comment (by Austin Seipp <austin@…>):

 In [changeset:"8dc294487fdaf102349c373c7db4796693573310/ghc"]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="8dc294487fdaf102349c373c7db4796693573310"
 API Annotations : ExprWithTySig processing discards annotated spans

 In RdrHsSyn.checkAPat the processing for ExprWithTySig is defined as

    ExprWithTySig e t _ -> do e <- checkLPat msg e
                              -- Pattern signatures are parsed as sigtypes,
                              -- but they aren't explicit forall points.
 Hence
                              -- we have to remove the implicit forall
 here.
                              let t' = case t of
                                         L _ (HsForAllTy Implicit _ _
                                              (L _ []) ty) -> ty
                                         other -> other
                              return (SigPatIn e (mkHsWithBndrs t'))

 The t' variable ends up losing its original SrcSpan in the first case
 branch. This results in annotations becoming detached from the AST.

 Reviewed By: austin

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

 GHC Trac Issues: #10255
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10255#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list