[GHC] #15518: -ddump-splices pretty-prints LambdaCase nonsensically
#15518: -ddump-splices pretty-prints LambdaCase nonsensically -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Template | Version: 8.4.3 Haskell | 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: -------------------------------------+------------------------------------- {{{#!hs {-# LANGUAGE LambdaCase #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -ddump-splices #-} module Bug where $([d| f :: Bool -> () f = \case True -> () False -> () |]) }}} {{{ $ /opt/ghc/8.4.3/bin/ghci Bug.hs GHCi, version 8.4.3: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/ryanglscott/.ghci [1 of 1] Compiling Bug ( Bug.hs, interpreted ) Bug.hs:(6,3)-(9,6): Splicing declarations [d| f_a1xr :: Bool -> () f_a1xr = \case True -> () False -> () |] ======> f_a48E :: Bool -> () f_a48E = \case \ True -> GHC.Tuple.() \ False -> GHC.Tuple.() Ok, one module loaded. }}} Notice the use of `\ True` and `\ False`. Those patterns should not be preceded with backslashes. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15518> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15518: -ddump-splices pretty-prints LambdaCase nonsensically -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.8.1 Component: Template Haskell | Version: 8.4.3 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:D5069 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D5069 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15518#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15518: -ddump-splices pretty-prints LambdaCase nonsensically -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.8.1 Component: Template Haskell | Version: 8.4.3 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:D5069 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Krzysztof Gogolewski <krz.gogolewski@…>): In [changeset:"32008a9d0e09f0cc8899aa871d9a6b63fcc28a1a/ghc" 32008a9d/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="32008a9d0e09f0cc8899aa871d9a6b63fcc28a1a" Properly designate LambdaCase alts as CaseAlt in TH Summary: When `\case` expressions are parsed normally, their alternatives are marked as `CaseAlt` (which means that they are pretty-printed without a `\` character in front of them, unlike for lambda expressions). However, `\case` expressions created by way of Template Haskell (in `Convert`) inconsistently designated the case alternatives as `LambdaExpr`, causing them to be pretty-printed poorly (as shown in #15518). The fix is simple: use `CaseAlt` consistently. Test Plan: make test TEST=T15518 Reviewers: goldfire, bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15518 Differential Revision: https://phabricator.haskell.org/D5069 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15518#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15518: -ddump-splices pretty-prints LambdaCase nonsensically -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.8.1 Component: Template Haskell | Version: 8.4.3 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:D5069 Wiki Page: | -------------------------------------+------------------------------------- Changes (by monoidal): * status: patch => merge -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15518#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15518: -ddump-splices pretty-prints LambdaCase nonsensically -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.6.1 Component: Template Haskell | Version: 8.4.3 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:D5069 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * milestone: 8.8.1 => 8.6.1 Comment: This was marked as merge, but not milestoned properly. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15518#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15518: -ddump-splices pretty-prints LambdaCase nonsensically -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Template Haskell | Version: 8.4.3 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:D5069 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged with e57a15d820b44751fcfc14c056ae284caab697a6. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15518#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC