Skip to content

-ddump-splices shenanigans: promoted tycons aren't ticked

Consider the following program with a type family that contains four different promoted (i.e., ticked) type constructors:

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -ddump-splices #-}
module Bug where

data Unit = Unit

$([d| type family F (a :: k) :: k where
        F 'Unit = 'Unit
        F '(,)  = '(,)
        F '[]   = '[]
        F '(:)  = '(:)
    |])
$ /opt/ghc/8.4.3/bin/ghci Bug3.hs
GHCi, version 8.4.3: http://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /home/rgscott/.ghci
[1 of 1] Compiling Bug              ( Bug3.hs, interpreted )
Bug3.hs:(10,3)-(15,6): Splicing declarations
    [d| type family F_a1xJ (a_a1xL :: k_a1xK) :: k_a1xK where
          F_a1xJ  'Unit =  'Unit
          F_a1xJ  '(,) =  '(,)
          F_a1xJ '[] = '[]
          F_a1xJ  '(:) =  '(:) |]
  ======>
    type family F_a49g (a_a49i :: k_a49h) :: k_a49h where
      F_a49g Unit = Unit
      F_a49g GHC.Tuple.(,) = GHC.Tuple.(,)
      F_a49g '[] = '[]
      F_a49g (GHC.Types.:) = (GHC.Types.:)
Ok, one module loaded.

The -ddump-splices output is quite strange: '[] is ticked, but the other three are not! This seems off.

Trac metadata
Trac field Value
Version 8.4.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information