[GHC] #14817: GHC 8.4.1 pretty-prints data family instances with redundant kind signatures using -ddump-splices
#14817: GHC 8.4.1 pretty-prints data family instances with redundant kind signatures using -ddump-splices -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.4.1-alpha3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Consider this program: {{{#!hs {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -ddump-splices #-} module Bug where $([d| data family Foo :: * data instance Foo :: * |]) }}} On GHC 8.2.2, this gives the following `-ddump-splices` output: {{{ $ /opt/ghc/8.2.2/bin/ghci Bug.hs GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci [1 of 1] Compiling Bug ( Bug.hs, interpreted ) Bug.hs:(6,3)-(7,31): Splicing declarations [d| data family Foo_a1sB :: * data instance :: * |] ======> data family Foo_a494 :: GHC.Types.Type data instance :: GHC.Types.Type }}} But on GHC 8.4.1, we have: {{{ $ /opt/ghc/8.4.1/bin/ghci Bug.hs GHCi, version 8.4.0.20180209: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci [1 of 1] Compiling Bug ( Bug.hs, interpreted ) Bug.hs:(6,3)-(7,31): Splicing declarations [d| data family Foo_a1xd :: * data instance Foo_a1xd :: * :: * |] ======> data family Foo_a487 :: GHC.Types.Type data instance Foo_a487 :: GHC.Types.Type :: GHC.Types.Type }}} Notice how there is a redundant kind signature in `data instance Foo_a1xd :: * :: *`. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14817> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14817: GHC 8.4.1 pretty-prints data family instances with redundant kind signatures using -ddump-splices -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.4.1-alpha3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4418 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D4418 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14817#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14817: GHC 8.4.1 pretty-prints data family instances with redundant kind signatures using -ddump-splices -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.4.1-alpha3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4418 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"aef2b429072e3d3bbdbcb9e4082a0d86ba329d9e/ghc" aef2b429/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="aef2b429072e3d3bbdbcb9e4082a0d86ba329d9e" Fix #14817 by not double-printing data family instance kind signatures Within `pprDataFamInstDecl`, we were invoking `pprFamInstLHS` to pretty-print a data family instance header, and we were passing `Just` a kind signature to `pprFamInstLHS` to make it pretty-print the kind signature alongside it (this is a consequence of commit d1ef223cfebd23c25489a4b0c67fbaa2f91c1ec6). But this is silly, because then invoke `pp_data_defn`, which //also// pretty-prints the kind signature, resulting in the kind signature being printed twice by mistake. This fix is simple—pass `Nothing` to `pprFamInstLHS` instead. Test Plan: make test TEST=T14817 Reviewers: alanz, bgamari, mpickering Reviewed By: mpickering Subscribers: mpickering, rwbarton, thomie, carter GHC Trac Issues: #14817 Differential Revision: https://phabricator.haskell.org/D4418 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14817#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14817: GHC 8.4.1 pretty-prints data family instances with redundant kind signatures using -ddump-splices -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.1-alpha3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4418 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.6.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14817#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC