[GHC] #15797: GHC panic using visible kind application

GHC ghc-devs at haskell.org
Wed Oct 24 02:40:44 UTC 2018


#15797: GHC panic using visible kind application
-------------------------------------+-------------------------------------
           Reporter:  Iceland_jack   |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.6.1
           Keywords:                 |  Operating System:  Unknown/Multiple
  TypeApplications                   |
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 {{{#!hs
 {-# Language    RankNTypes          #-}
 {-# Language    TypeFamilies        #-}
 {-# Language    ScopedTypeVariables #-}
 {-# Language    TypeApplications    #-}
 {-# Language    DataKinds           #-}
 {-# Language    PolyKinds           #-}
 {-# Language    TypeOperators       #-}
 {-# Language    GADTs               #-}

 {-# Options_GHC -dcore-lint #-}

 import Data.Kind

 class Ríki (obj :: Type) where
   type Obj :: obj -> Constraint
   type Obj = Bæ @obj

 class    Bæ    (a :: k)
 instance Bæ @k (a :: k)

 data
   EQ :: forall ob. ob -> ob -> Type where
   EQ :: EQ a a

 instance
   Ríki (EQ @ob)
 }}}

 {{{
 $ ghci -dcore-lint 568_bug.hs
 GHCi, version 8.7.20181017: http://www.haskell.org/ghc/  :? for help
 [1 of 1] Compiling Main             ( 568_bug.hs, interpreted )
 WARNING: file compiler/types/TyCoRep.hs, line 2567
   in_scope InScope {ob_a1zs co_a1zt}
   tenv []
   cenv [a1zt :-> co_a1zt]
   tys [Bæ]
   cos []
   needInScope [a1zn :-> co_a1zn, a1zs :-> ob_a1zs]
 ghc-stage2: panic! (the 'impossible' happened)
   (GHC version 8.7.20181017 for x86_64-unknown-linux):
         Core Lint error
   <no location info>: warning:
       In the type ‘Bæ’
       Unfilled coercion hole: {co_a1zn}
   <no location info>: warning:
       In the type ‘Bæ’
       co_a1zn :: (ob_a1zs -> ob_a1zs -> *) ~# *
       [LclId[CoVarId]] is out of scope
   Call stack:
       CallStack (from HasCallStack):
         callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in
 ghc:Outputable
         pprPanic, called at compiler/typecheck/FamInst.hs:171:31 in
 ghc:FamInst

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

 >
 }}}

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


More information about the ghc-tickets mailing list