
#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 bgamari):
**Disclaimer**: The following commentary is dangerously ignorant. I've
glanced at a few papers and read a bit of code but otherwise have
vanishingly little knowledge about the type checker.
I'm looking at this slightly easier example (which still replicates the
failure),
{{{#!hs
{-# LANGUAGE PolyKinds #-}
module Other where
data Other (f :: k -> *) (a :: k) = Other (f a)
}}}
{{{#!hs
{-# LANGUAGE DataKinds #-}
module Main where
import Data.Typeable
import Other
main :: IO ()
main = let a = typeOf (undefined :: Proxy 'Other) in return ()
}}}
As before enabling `PolyKinds` in `Main` results in the expected insoluble
`Typeable` error.
`-ddump-tc-trace -fprint-explicit-kinds` produces the following suspicious
output,
{{{
decideKindGeneralisationPlan
type: (Proxy k1_aJt[tau:5] ('Other k_aJB[tau:5] f_aJC[tau:5]
a_aJD[tau:5] |>