[GHC] #14520: GHC panic (TypeInType)

GHC ghc-devs at haskell.org
Fri Nov 24 05:42:55 UTC 2017


#14520: GHC panic (TypeInType)
-------------------------------------+-------------------------------------
           Reporter:  Iceland_jack   |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.1
           Keywords:  TypeInType     |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 {{{#!hs
 {-# Language TypeInType, TypeFamilies, TypeOperators #-}

 import Data.Kind

 type a ~>> b = (a, b) -> Type

 data family Sing (a::k)

 type family
   (·) (f::a~>>b) (x::a)::b

 class PCategory kat where
   type Id  ::kat·a·a
   type Comp::kat·b·c -> kat·a·b -> kat·a·c

 class SCategory kat where
   sId   :: Sing a -> Sing (Id::kat a a)
   sComp :: Sing f -> Sing g -> Sing (Comp f g)
 }}}

 triggers a panic

 {{{
 $ ghci -ignore-dot-ghci Bug.hs
 GHCi, version 8.3.20171122: http://www.haskell.org/ghc/  :? for help
 [1 of 1] Compiling Main             ( Bug.hs, interpreted )
 ghc-stage2: panic! (the 'impossible' happened)
   (GHC version 8.3.20171122 for x86_64-unknown-linux):
         piResultTy
   k_a1KI[tau:1]
   a_a1vb[sk:1]
   Call stack:
       CallStack (from HasCallStack):
         callStackDoc, called at compiler/utils/Outputable.hs:1147:37 in
 ghc:Outputable
         pprPanic, called at compiler/types/Type.hs:951:35 in ghc:Type
         piResultTy, called at compiler/types/Type.hs:2309:34 in ghc:Type
         typeKind, called at compiler/types/Type.hs:2309:46 in ghc:Type
         typeKind, called at compiler/typecheck/TcType.hs:1706:11 in
 ghc:TcType

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

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


More information about the ghc-tickets mailing list