[GHC] #15331: -ddump-splices does not parenthesize visible type applications correctly

GHC ghc-devs at haskell.org
Mon Jul 2 12:33:46 UTC 2018


#15331: -ddump-splices does not parenthesize visible type applications correctly
-------------------------------------+-------------------------------------
           Reporter:  RyanGlScott    |             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:
-------------------------------------+-------------------------------------
 So many `-ddump-splices` bugs...

 {{{#!hs
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# OPTIONS_GHC -ddump-splices #-}
 module Bug where

 import Data.Proxy

 $([d| f :: Proxy (Int -> Int)
       f = Proxy @(Int -> Int)
     |])
 }}}

 {{{
 $ /opt/ghc/8.6.1/bin/ghci Bug.hs
 GHCi, version 8.6.0.20180627: http://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /home/rgscott/.ghci
 [1 of 1] Compiling Bug              ( Bug.hs, interpreted )
 Bug.hs:(8,3)-(10,6): Splicing declarations
     [d| f_a1Dg :: Proxy (Int -> Int)
         f_a1Dg = Proxy @(Int -> Int) |]
   ======>
     f_a4tx :: Proxy (Int -> Int)
     f_a4tx = Proxy @Int -> Int
 }}}

 Ack—`Proxy @Int -> Int` should actually be `Proxy @(Int -> Int)`.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15331>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list