[GHC] #10278: ApiAnnotations : Nested forall loses forall annotation
#10278: ApiAnnotations : Nested forall loses forall annotation -------------------------------------+------------------------------------- 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: None/Unknown ApiAnnotations | Blocked By: Architecture: | Related Tickets: Unknown/Multiple | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- When parsing {{{#!hs {-# LANGUAGE ScopedTypeVariables #-} extremumNewton :: forall tag. forall tag1. tag -> tag1 -> Int extremumNewton = undefined }}} The parser attaches an `AnnForall` to the second `forall`, which appears as a nested `HsForAllTy`. Somewhere this nesting is flattened, and the tyvarbndrs are collapsed into a single `HsForAllTy`. In this process the second `AnnForAll` loses its anchor in the AST. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10278> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10278: ApiAnnotations : Nested forall loses forall annotation -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 (Parser) | Keywords: Resolution: | ApiAnnotations Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by alanz): @jstolarek has pointed out that the offending function is `HsTypes.mk_forall_ty` -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10278#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10278: ApiAnnotations : Nested forall loses forall annotation -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 (Parser) | Keywords: Resolution: | ApiAnnotations Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D833 -------------------------------------+------------------------------------- Changes (by alanz): * differential: => Phab:D833 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10278#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10278: ApiAnnotations : Nested forall loses forall annotation -------------------------------------+------------------------------------- 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: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D833 -------------------------------------+------------------------------------- Changes (by alanz): * status: new => patch Comment: Although there is a version in development that gets rid of the collapsing, I am not going to have time to chase the last bugs through in the near future, and the Phab:D833 version will get the job done for ghc- exactprint in the interim. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10278#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10278: ApiAnnotations : Nested forall loses forall annotation -------------------------------------+------------------------------------- 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: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: | Phab:D833,Phab:D836 -------------------------------------+------------------------------------- Changes (by alanz): * differential: Phab:D833 => Phab:D833,Phab:D836 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10278#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10278: ApiAnnotations : Nested forall loses forall annotation -------------------------------------+------------------------------------- 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: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: | Phab:D833,Phab:D836 -------------------------------------+------------------------------------- Comment (by Austin Seipp <austin@…>): In [changeset:"81030ede73c4e3783219b2a8d7463524e847cfce/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="81030ede73c4e3783219b2a8d7463524e847cfce" ApiAnnotations : Nested forall loses forall annotation When parsing {-# LANGUAGE ScopedTypeVariables #-} extremumNewton :: forall tag. forall tag1. tag -> tag1 -> Int extremumNewton = undefined The parser attaches an AnnForall to the second forall, which appears as a nested HsForAllTy. Somewhere this nesting is flattened, and the tyvarbndrs are collapsed into a single HsForAllTy. In this process the second AnnForAll loses its anchor in the AST. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D833 GHC Trac Issues: #10278 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10278#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10278: ApiAnnotations : Nested forall loses forall annotation -------------------------------------+------------------------------------- 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: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: | Phab:D833,Phab:D836 -------------------------------------+------------------------------------- Comment (by Alan Zimmerman <alan.zimm@…>): In [changeset:"c553e980e4a5d149af13bb705ec02819a15937ee/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="c553e980e4a5d149af13bb705ec02819a15937ee" ApiAnnotations : AST version of nested forall loses forall annotation Summary: When parsing {-# LANGUAGE ScopedTypeVariables #-} extremumNewton :: forall tag. forall tag1. tag -> tag1 -> Int extremumNewton = undefined the parser creates nested HsForAllTy's for the two forall statements. These get flattened into a single one in `HsTypes.mk_forall_ty` This patch removes the flattening, so that API Annotations are not lost in the process. Test Plan: ./validate Reviewers: goldfire, austin, simonpj Reviewed By: simonpj Subscribers: bgamari, mpickering, thomie, goldfire Differential Revision: https://phabricator.haskell.org/D836 GHC Trac Issues: #10278, #10315, #10354, #10363 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10278#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10278: ApiAnnotations : Nested forall loses forall annotation -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: bug | Status: closed Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 (Parser) | Keywords: Resolution: fixed | ApiAnnotations Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: | Phab:D833,Phab:D836 -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: patch => closed * resolution: => fixed Comment: Merged to `ghc-7.10`. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10278#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC