
#10255: API Annotations : ExprWithTySig processing discards annotated spans -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 (Parser) | Operating System: Unknown/Multiple Keywords: | Type of failure: Other ApiAnnotations | Blocked By: Architecture: | Related Tickets: Unknown/Multiple | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- In `RdrHsSyn.checkAPat` the processing for `ExprWithTySig` is defined as {{{#!hs 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. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10255 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler