Opened 3 years ago

Closed 2 years ago

#11722 closed bug (fixed)

No TypeRep for unboxed tuples

Reported by: goldfire Owned by:
Priority: normal Milestone: 8.2.1
Component: Compiler Version: 8.1
Keywords: Typeable Cc: bgamari
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #12409 Differential Rev(s):
Wiki Page:

Description

This now crashes on GHC HEAD:

{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
module Main where

import Data.Typeable
import GHC.Exts

main :: IO ()
main = print $ typeOf (Proxy :: Proxy (# Int, Int #))
$ /opt/ghc/head/bin/ghc -O2 -fforce-recomp Example.hs
[1 of 1] Compiling Main             ( Example.hs, Example.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 8.1.20160317 for x86_64-unknown-linux):
        tyConRep (#,#)

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

(Previously, this was rejected with an error message, since you couldn't put an unlifted type as the argument of Proxy.)

(Copied from comment:28:ticket:11471.)

Change History (6)

comment:1 Changed 3 years ago by RyanGlScott

Cc: bgamari added

Suspiciously similar shenanigans:

{-# LANGUAGE UnboxedTuples #-}
module Main where

import Data.Typeable

main :: IO ()
main = print $ typeOf (Proxy :: Proxy (# #))
$ /opt/ghc/head/bin/ghc -O2 -fforce-recomp Example.hs
[1 of 1] Compiling Main             ( Example.hs, Example.o )

Example.hs:7:24: error:
    • Couldn't match kind ‘'GHC.Types.VoidRep’
                     with ‘'GHC.Types.UnboxedTupleRep’
      When matching the kind of ‘(# #)’
    • In the first argument of ‘typeOf’, namely
        ‘(Proxy :: Proxy (# #))’
      In the second argument of ‘($)’, namely
        ‘typeOf (Proxy :: Proxy (# #))’
      In the expression: print $ typeOf (Proxy :: Proxy (# #))

comment:2 Changed 3 years ago by simonpj

See also #11736, which is closely related.

comment:3 Changed 3 years ago by simonpj

Keywords: Typeable added

comment:4 Changed 3 years ago by bgamari

#12409 is a duplicate of this.

comment:5 Changed 3 years ago by bgamari

comment:6 Changed 2 years ago by RyanGlScott

Milestone: 8.2.1
Resolution: fixed
Status: newclosed

This was fixed in 8fa4bf9ab3f4ea4b208f4a43cc90857987e6d497 (Type-indexed Typeable). See typecheck/should_compile/T11736 for a very similar test which exercises this.

Note: See TracTickets for help on using tickets.