[GHC] #15206: Strictness annotations bind more tightly than doc strings on non-record data declarations

#15206: Strictness annotations bind more tightly than doc strings on non-record data declarations -------------------------------------+------------------------------------- Reporter: harpocrates | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.5 (Parser) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: GHC rejects Unknown/Multiple | valid program Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): Phab:D4727 | Wiki Page: -------------------------------------+------------------------------------- Consider the following declaration: {{{#!hs data Point = Point -- ^ a 2D point !Int -- ^ x coord !Int -- ^ y coord }}} With `-haddock` enabled, the first field parses as {{{ ({ bad.hs:2:16-32 } (HsDocTy ({ bad.hs:2:16-19 } (HsBangTy (HsSrcBang (NoSourceText) (NoSrcUnpack) (SrcStrict)) ({ bad.hs:2:17-19 } (HsTyVar (NotPromoted) ({ bad.hs:2:17-19 } (Unqual {OccName: Int})))))) ({ bad.hs:2:21-32 } (HsDocString {FastString: " x coord"})))) }}} However, this is incorrect since further down the compilation pipeline, strictness and unpackedness annotations are only looked for at the top- level of a field (meaning the above example hits the `strictness annotation cannot appear nested inside a type` error). We want this instead: {{{ ({ bad.hs:2:16-32 } (HsBangTy (NoExt) (HsSrcBang (NoSourceText) (NoSrcUnpack) (SrcStrict)) ({ bad.hs:2:17-32 } (HsDocTy (NoExt) ({ bad.hs:2:17-19 } (HsTyVar (NoExt) (NotPromoted) ({ bad.hs:2:17-19 } (Unqual {OccName: Int})))) ({ bad.hs:2:21-32 } (HsDocString {FastString: " x coord"})))))) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15206 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15206: Strictness annotations bind more tightly than doc strings on non-record data declarations -------------------------------------+------------------------------------- Reporter: harpocrates | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.5 (Parser) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4727 Wiki Page: | -------------------------------------+------------------------------------- Changes (by harpocrates): * status: new => closed * resolution: => fixed Comment: Replying to [comment:1 bgamari]:
These won't be addressed for GHC 8.6.
But this has already been fixed in 8.6! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15206#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15206: Strictness annotations bind more tightly than doc strings on non-record data declarations -------------------------------------+------------------------------------- Reporter: harpocrates | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.5 (Parser) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4727 Wiki Page: | -------------------------------------+------------------------------------- Changes (by harpocrates): * milestone: 8.8.1 => 8.6.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15206#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC