[GHC] #15502: -ddump-splices truncates Integer literals to Int literals

#15502: -ddump-splices truncates Integer literals to Int literals -------------------------------------+------------------------------------- Reporter: ChaiTRex | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 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: -------------------------------------+------------------------------------- I trusted that the splice results shown by `-ddump-splices` were correct. They weren't, which caused me to waste a lot of time debugging my Template Haskell expressions when they were already correct. {{{ $ ghc --version The Glorious Glasgow Haskell Compilation System, version 8.4.3 }}} == Example program == {{{#!hs {-# OPTIONS_GHC -ddump-splices #-} {-# LANGUAGE TemplateHaskell #-} module Main where import Language.Haskell.TH.Syntax (Lift(lift)) main = print ( $( lift (toInteger (maxBound :: Int) + 1) ) , $( lift (minBound :: Int) ) ) }}} == Output of `runghc` == Note that the output of the program on the bottom line below is correct. The two splice results shown by `-ddump-splices` incorrectly match each other: {{{ Example.hs:8:19-56: Splicing expression lift (toInteger (maxBound :: Int) + 1) ======> -9223372036854775808 Example.hs:9:19-40: Splicing expression lift (minBound :: Int) ======> (-9223372036854775808) (9223372036854775808,-9223372036854775808) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15502 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15502: -ddump-splices truncates Integer literals to Int literals -------------------------------------+------------------------------------- Reporter: ChaiTRex | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | 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): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * priority: normal => high Comment: That indeed looks bad. I'm bumping up the priority because it surely can't be hard to find and fix. Is anyone up for that? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15502#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15502: -ddump-splices truncates Integer literals to Int literals -------------------------------------+------------------------------------- Reporter: ChaiTRex | Owner: (none) Type: bug | Status: patch Priority: high | Milestone: 8.6.1 Component: Compiler | 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:D5089 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D5089 Comment: Phab:D5089 ought to do it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15502#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15502: -ddump-splices truncates Integer literals to Int literals
-------------------------------------+-------------------------------------
Reporter: ChaiTRex | Owner: (none)
Type: bug | Status: patch
Priority: high | Milestone: 8.6.1
Component: Compiler | 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:D5089
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Krzysztof Gogolewski

#15502: -ddump-splices truncates Integer literals to Int literals -------------------------------------+------------------------------------- Reporter: ChaiTRex | Owner: (none) Type: bug | Status: merge Priority: high | Milestone: 8.6.1 Component: Compiler | 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:D5089 Wiki Page: | -------------------------------------+------------------------------------- Changes (by monoidal): * status: patch => merge Comment: If it's not too late, this can be merged to 8.6. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15502#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15502: -ddump-splices truncates Integer literals to Int literals -------------------------------------+------------------------------------- Reporter: ChaiTRex | Owner: (none) Type: bug | Status: merge Priority: high | Milestone: 8.6.1 Component: Compiler | 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:D5089, Wiki Page: | Phab:D5151 -------------------------------------+------------------------------------- Changes (by monoidal): * differential: Phab:D5089 => Phab:D5089, Phab:D5151 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15502#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15502: -ddump-splices truncates Integer literals to Int literals
-------------------------------------+-------------------------------------
Reporter: ChaiTRex | Owner: (none)
Type: bug | Status: merge
Priority: high | Milestone: 8.6.1
Component: Compiler | 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:D5089,
Wiki Page: | Phab:D5151
-------------------------------------+-------------------------------------
Comment (by Krzysztof Gogolewski

#15502: -ddump-splices truncates Integer literals to Int literals -------------------------------------+------------------------------------- Reporter: ChaiTRex | Owner: (none) Type: bug | Status: closed Priority: high | Milestone: 8.6.1 Component: Compiler | 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:D5089, Wiki Page: | Phab:D5151 -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged comment:6 with 6cad8e31dc852594aad8512d01eb9730d3371249 and comment:3 with 8344588e23fc9bb3c1b15e81edd316134c9860ec. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15502#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC