
#12409: Unboxed tuples have no type representations -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: typeable Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- @@ -18,2 +18,1 @@ - The problem, as usual, is that the tycons are missing from - `knownKeyNames`. + The problem, as usual, is that the tycons are missing from `primTyCons`. New description: This ticket continues with the long tradition of types missing type representations (see #12082, #12132, #11120). This time the culprit is unboxed tuples, {{{ $ ghci GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/ben/.ghci λ> import Data.Typeable λ> :set -XUnboxedTuples λ> typeRep (Proxy :: Proxy (#Int, Int#)) ghc: panic! (the 'impossible' happened) (GHC version 8.0.1 for x86_64-unknown-linux): tyConRep (#,#) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} The problem, as usual, is that the tycons are missing from `primTyCons`. -- Comment (by bgamari):
Why does it matter that they are not in `knownKeyNames`?
Sorry, I had meant `primTyCons` above. The reason is that `TcTypeable` uses `primTyCons` as the list of `TyCon`s which are defined in `GHC.Prim`. When compiling `GHC.Types` `TcTypeable` generate Typeable representations for the types in `primTyCons`. If a primitive TyCon is missing from the list then that type's `Typeable` representation will also be missing (which I believe is what happened in this bug). Ultimately we don't want to add unboxed tuples to `primTyCons` since we don't want to add them to the original name cache (as discussed in #12357). I have a proposed solution on the way. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12409#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler