[GHC] #11334: GHC panic when calling typeOf on a promoted data constructor

GHC ghc-devs at haskell.org
Wed Jan 27 14:15:34 UTC 2016


#11334: GHC panic when calling typeOf on a promoted data constructor
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  bgamari
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:  8.0.1
       Component:  Compiler (Type    |              Version:  8.0.1-rc1
  checker)                           |
      Resolution:                    |             Keywords:  TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash                              |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D1757
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 Oh dear.

 Something seems terribly terribly wrong.

 {{{#!hs
 newtype Compose (f :: k -> *) (g :: k1 -> k) (a :: k1)
   = Compose {getCompose :: f (g a)}
 }}}

 This gives `Compose :: forall k k1. (k -> *) -> (k1 -> k) -> k1 -> *`. But
 your code above has '''three''' `*`s passed to `Compose`. Somehow the
 third one is wrong. (I think the first two are correct, as set in
 `quantifyTyVars`. I'm unconvinced that `quantifyTyVars` is to blame.) GHC
 is getting duped into thinking `* :: * -> *`, which would, actually, make
 the `TYPE 'Lifted (TYPE 'Lifted *)` bit well kinded.

 I've no clue where this is going wrong, but it's going wrong rather
 spectacularly. My next step would be `-ddump-tc-trace -fprint-explicit-
 kinds` and search for the first occurrence of `Compose * * *`.

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


More information about the ghc-tickets mailing list