Skip to content

type synonym to unboxed tuple causes crash

{-# LANGUAGE UnboxedTuples #-}

module Main where

-- type Null = (# #)

{-# NOINLINE showNull #-}
showNull :: (# #) -> String
showNull (# #) = "(# #)"

{-# NOINLINE showNullPair #-}
showNullPair :: (# (# #), (# #) #) -> String
showNullPair (# n1, n2 #) = "(# " ++ showNull n1 ++ ", " ++ showNull n2 ++ "#)"

main :: IO ()
main = do
    putStrLn (showNullPair (# (# #), (# #) #))

If I use the Null type synonym here instead of (# #), I get:

[1 of 1] Compiling Main             ( empty.hs, empty.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 8.0.1 for x86_64-unknown-linux):
        unboxed tuple PrimRep

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Tried with: 8.0.1

Trac metadata
Trac field Value
Version 8.0.1
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