[GHC] #11723: TYPE 'UnboxedTupleRep is a lie

GHC ghc-devs at haskell.org
Sat Mar 19 19:36:18 UTC 2016


#11723: TYPE 'UnboxedTupleRep is a lie
-------------------------------------+-------------------------------------
           Reporter:  goldfire       |             Owner:
               Type:  bug            |            Status:  new
           Priority:  high           |         Milestone:  8.0.1
          Component:  Compiler       |           Version:  8.1
           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:
-------------------------------------+-------------------------------------
 From @RyanGlScott, comment:28:ticket:11471:

 I notice that there's a single constructor of `RuntimeRep` for unboxed
 tuples (`UnboxedTupleRep`). Does this mean something like this should be
 allowed?

 {{{#!hs
 {-# LANGUAGE DataKinds #-}
 {-# LANGUAGE KindSignatures #-}
 module Example where

 import Data.Typeable
 import GHC.Exts

 data Wat (a :: TYPE 'UnboxedTupleRep) = Wat a
 }}}

 Currently, that fails to compile due to a separate GHC panic:

 {{{
 $ /opt/ghc/head/bin/ghc -O2 -fforce-recomp Example.hs
 [1 of 1] Compiling Example          ( Example.hs, Example.o )
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.1.20160317 for x86_64-unknown-linux):
         unboxed tuple PrimRep

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

 But wouldn't this be dangerous anyway? After all, unboxed tuples are
 supposed to represent arguments on the stack, so couldn't unboxed tuple
 polymorphic potentially lead to the RTS miscalculating how much data to
 read? Or am I misreading this?

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


More information about the ghc-tickets mailing list