[GHC] #10314: ApiAnnotations: mkHsForAllTy discards parens

#10314: ApiAnnotations: mkHsForAllTy discards parens -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Keywords: | Operating System: Unknown/Multiple ApiAnnotations | Type of failure: None/Unknown Architecture: | Blocked By: Unknown/Multiple | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- The code for `HsForAllTy` is {{{#!hs mkHsForAllTy exp tvs ctxt ty = HsForAllTy exp extra (mkHsQTvs tvs) cleanCtxt ty where -- Separate the extra-constraints wildcard when present (cleanCtxt, extra) | (L l HsWildcardTy) <- ignoreParens (last (unLoc ctxt)) = (init `fmap` ctxt, Just l) | otherwise = (ctxt, Nothing) ignoreParens (L _ (HsParTy ty)) = ty ignoreParens ty = ty }}} The process of cleaning the context calls `ignoreParens` which strips out the `HsParTy`. In the process the `AnnOpenP` and `AnnCloseP` attached to this are discarded. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10314 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10314: ApiAnnotations: mkHsForAllTy discards parens -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | ApiAnnotations Type of failure: None/Unknown | Architecture: Blocked By: | Unknown/Multiple Related Tickets: | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by alanz): This process may also be taking place for {{{#!hs HsPArrTy HsParTy ParPat PArrPat HsPar ExplicitPArr HsCmdPar }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10314#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10314: ApiAnnotations: mkHsForAllTy discards parens -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | ApiAnnotations Type of failure: None/Unknown | Architecture: Blocked By: | Unknown/Multiple Related Tickets: | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by alanz): The `mkHsForAllTy` case is safe, as `ignoreParens` is only used in the conditional part. But, {{{#!hs mk_forall_ty exp tvs (L _ (HsParTy ty)) = mk_forall_ty exp tvs ty }}} does strip parens. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10314#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10314: ApiAnnotations: mkHsForAllTy discards parens -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: bug | Status: closed Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | ApiAnnotations Type of failure: None/Unknown | Architecture: Blocked By: | Unknown/Multiple Related Tickets: | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by alanz): * status: new => closed * resolution: => invalid Comment: Nope, these cases are all handled already. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10314#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC