[GHC] #10354: ApiAnnotations : parens around a context with wildcard loses annotations
#10354: ApiAnnotations : parens around a context with wildcard loses annotations -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: bug | Status: new Priority: normal | Milestone: 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: | -------------------------------------+------------------------------------- In the following code, the extra set of parens around the context end up with detached annotations. {{{#!hs {-# LANGUAGE PartialTypeSignatures #-} module ParensAroundContext where f :: ((Eq a, _)) => a -> a -> Bool f x y = x == y }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10354> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10354: ApiAnnotations : parens around a context with wildcard loses annotations -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: bug | Status: new Priority: normal | Milestone: 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): It seems `RdrHsSyn.checkContext` is the culprit {{{#!hs ... check (HsParTy ty) -- to be sure HsParTy doesn't get into the way = check (unLoc ty) ... }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10354#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10354: ApiAnnotations : parens around a context with wildcard loses annotations -------------------------------------+------------------------------------- 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: #10315 | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by alanz): * related: => #10315 * milestone: => 7.10.2 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10354#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10354: ApiAnnotations : parens around a context with wildcard loses annotations -------------------------------------+------------------------------------- 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: #10315 | Test Case: | Blocking: | Differential Revisions: Phab:D868 -------------------------------------+------------------------------------- Changes (by alanz): * differential: => Phab:D868 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10354#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10354: ApiAnnotations : parens around a context with wildcard loses annotations -------------------------------------+------------------------------------- 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: #10315,#10354 | Test Case: | Blocking: | Differential Revisions: | Phab:D868,Phab:D836 -------------------------------------+------------------------------------- Changes (by alanz): * differential: Phab:D868 => Phab:D868,Phab:D836 * related: #10315 => #10315,#10354 Comment: Fixing the `HsForAllTy` properly sorts out a number of issues. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10354#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10354: ApiAnnotations : parens around a context with wildcard loses annotations -------------------------------------+------------------------------------- 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: #10315,#10354 | Test Case: | Blocking: | Differential Revisions: Phab:D868 -------------------------------------+------------------------------------- Changes (by alanz): * differential: Phab:D868,Phab:D836 => Phab:D868 Comment: Phab:D868 is required to be able to handle nested parens in a tuple context. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10354#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10354: ApiAnnotations : parens around a context with wildcard loses annotations -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: bug | Status: patch 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: #10315,#10354 | Test Case: | Blocking: | Differential Revisions: Phab:D868 -------------------------------------+------------------------------------- Changes (by alanz): * status: new => patch -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10354#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10354: ApiAnnotations : parens around a context with wildcard loses annotations -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: bug | Status: patch 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: #10315,#10354 | Test Case: | Blocking: | Differential Revisions: Phab:D868 -------------------------------------+------------------------------------- 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/10354#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10354: ApiAnnotations : parens around a context with wildcard loses annotations -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: bug | Status: patch 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: #10315,#10354 | Test Case: | Blocking: | Differential Revisions: Phab:D868 -------------------------------------+------------------------------------- Comment (by Alan Zimmerman <alan.zimm@…>): In [changeset:"0df14b5db06751f817d3ba794cc74ac54519b5b8/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="0df14b5db06751f817d3ba794cc74ac54519b5b8" ApiAnnotations : parens around a context with wildcard loses annotations Summary: In the following code, the extra set of parens around the context end up with detached annotations. {-# LANGUAGE PartialTypeSignatures #-} module ParensAroundContext where f :: ((Eq a, _)) => a -> a -> Bool f x y = x == y Trac ticket #10354 It turns out it was the TupleTy that was the culprit. This may also solve #10315 Test Plan: ./validate Reviewers: hvr, austin, goldfire Reviewed By: austin Subscribers: goldfire, bgamari, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D868 GHC Trac Issues: #10354, #10315 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10354#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10354: ApiAnnotations : parens around a context with wildcard loses annotations -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: bug | Status: closed Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | ApiAnnotations Type of failure: None/Unknown | Architecture: Blocked By: | Unknown/Multiple Related Tickets: #10315,#10354 | Test Case: | Blocking: | Differential Revisions: Phab:D868 -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: patch => closed * resolution: => fixed Comment: Merged to `ghc-7.10`. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10354#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC