[GHC] #10315: ApiAnnotations : Empty context loses annotations
#10315: ApiAnnotations : Empty context loses annotations -------------------------------------+------------------------------------- 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: | -------------------------------------+------------------------------------- A type signature of the form {{{#!hs bar :: ( ) => a-> Bool }}} generates annotations for the `( ) =>` but the SrcSpan they are attached to is discarded so the annotations are not attached to the AST. The discarding process happens in {{{#!hs mkHsForAllTy exp tvs (L _ []) ty = mk_forall_ty exp tvs ty }}} where the empty located context is discarded. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10315> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10315: ApiAnnotations : Empty context 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: | Test Case: | Blocking: | Differential Revisions: Phab:855 -------------------------------------+------------------------------------- Changes (by alanz): * differential: => Phab:855 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10315#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10315: ApiAnnotations : Empty context 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: | Test Case: | Blocking: | Differential Revisions: Phab:855 -------------------------------------+------------------------------------- Changes (by alanz): * status: new => patch -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10315#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10315: ApiAnnotations : Empty context 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: #10354 | Test Case: | Blocking: | Differential Revisions: Phab:855 -------------------------------------+------------------------------------- Changes (by alanz): * related: => #10354 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10315#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10315: ApiAnnotations : Empty context loses annotations -------------------------------------+------------------------------------- Reporter: alanz | Owner: 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: #10354 | Test Case: | Blocking: | Differential Revisions: | Phab:855,Phab:868 -------------------------------------+------------------------------------- Changes (by alanz): * owner: alanz => * status: patch => new * differential: Phab:855 => Phab:855,Phab:868 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10315#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10315: ApiAnnotations : Empty context 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: #10354 | Test Case: | Blocking: | Differential Revisions: | Phab:855,Phab:868 -------------------------------------+------------------------------------- Changes (by alanz): * owner: => alanz -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10315#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10315: ApiAnnotations : Empty context loses annotations -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: bug | Status: closed Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | ApiAnnotations Type of failure: None/Unknown | Architecture: Blocked By: | Unknown/Multiple Related Tickets: #10354 | Test Case: | Blocking: | Differential Revisions: Phab:D836 | Phab:D868 -------------------------------------+------------------------------------- Changes (by alanz): * status: new => closed * differential: Phab:855,Phab:868 => Phab:D836 Phab:D868 * resolution: => duplicate -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10315#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10315: ApiAnnotations : Empty context loses annotations -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: bug | Status: closed Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | ApiAnnotations Type of failure: None/Unknown | Architecture: Blocked By: | Unknown/Multiple Related Tickets: #10354 | Test Case: | Blocking: | Differential Revisions: Phab:D836 | 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/10315#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10315: ApiAnnotations : Empty context loses annotations -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: bug | Status: closed Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | ApiAnnotations Type of failure: None/Unknown | Architecture: Blocked By: | Unknown/Multiple Related Tickets: #10354 | Test Case: | Blocking: | Differential Revisions: Phab:D836 | 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/10315#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC