[GHC] #12409: Unboxed tuples have no type representations

#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 Keywords: typeable | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- 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 `knownKeyNames`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12409 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: | -------------------------------------+------------------------------------- Comment (by simonpj): Why does it matter that they are not in `knownKeyNames`? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12409#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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

#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: | -------------------------------------+------------------------------------- Comment (by bgamari): On further investigation, my previous hypothesis is completely wrong. The problem is that `TyCon.tyConRepName_maybe` does not handle the case of `AlgTyCon { algTcParent = UnboxedAlgTyCon }`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12409#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: | -------------------------------------+------------------------------------- Comment (by bgamari): I guess the question here is do we want unboxed tuples to be representable? It looks like it would be easy to make them representable: just add a field carrying the representation name to `UnboxedAlgTyCon` just as we do with `AlgTyCon`. If we'd prefer to keep them unrepresentable then I suppose we should make the solver throw a more polite error message. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12409#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: 11736 | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Yes -- for now, a more polite error would suffice I think. Anyway, it's unrelated to the other stuff about knownTyCons etc. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12409#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12409: Unboxed tuples have no type representations -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 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: 11736 | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.0.2 => 8.2.1 Comment: Sadly this won't make it for 8.0.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12409#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12409: Unboxed tuples have no type representations -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: duplicate | Keywords: typeable Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11722 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => duplicate * related: => #11722 Comment: This is a duplicate of #11722. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12409#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12409: Unboxed tuples have no type representations
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: (none)
Type: bug | Status: closed
Priority: normal | Milestone: 8.2.1
Component: Compiler | Version: 8.0.1
Resolution: duplicate | Keywords: typeable
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #11722 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari
participants (1)
-
GHC