[GHC] #15076: Typed hole causes GHC to panic (No skolem info)

GHC ghc-devs at haskell.org
Sun Apr 22 14:29:52 UTC 2018


#15076: Typed hole causes GHC to panic (No skolem info)
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler (Type    |              Version:  8.2.2
  checker)                           |             Keywords:  TypedHoles,
      Resolution:                    |  TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #14040            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Description changed by RyanGlScott:

Old description:

> Spun out from https://ghc.haskell.org/trac/ghc/ticket/14040#comment:2,
> which was different enough from the original program in #14040 to warrant
> its own ticket. The following program panics on every version of GHC from
> 8.0.2 onward:
>
> {{{#!hs
> {-# LANGUAGE RankNTypes #-}
> {-# LANGUAGE ScopedTypeVariables #-}
> {-# LANGUAGE TypeInType #-}
> module Bug where
>
> import Data.Kind
> import Data.Proxy
>
> newtype S (f :: k1 -> k2)
>   = MkS (forall t. Proxy t -> Proxy (f t))
>
> foo :: forall (a :: Type)
>               (f :: forall (x :: a). Proxy x -> Type).
>        S f -> ()
> foo (MkS (sF :: _)) = ()
> }}}
> {{{
> $ ~/Software/ghc/inplace/bin/ghc-stage2 --interactive Bug.hs
> GHCi, version 8.5.20180420: http://www.haskell.org/ghc/  :? for help
> Loaded GHCi configuration from /home/rgscott/.ghci
> [1 of 1] Compiling Bug              ( Bug.hs, interpreted )
>
> Bug.hs:15:17: error:ghc-stage2: panic! (the 'impossible' happened)
>   (GHC version 8.5.20180420 for x86_64-unknown-linux):
>         No skolem info:
>   [a1_a1Cb[sk:1]]
>   Call stack:
>       CallStack (from HasCallStack):
>         callStackDoc, called at compiler/utils/Outputable.hs:1162:37 in
> ghc:Outputable
>         pprPanic, called at compiler/typecheck/TcErrors.hs:3224:5 in
> ghc:TcErrors
> }}}

New description:

 Spun out from https://ghc.haskell.org/trac/ghc/ticket/14040#comment:2,
 which was different enough from the original program in #14040 to warrant
 its own ticket. The following program panics on every version of GHC from
 8.0.2 onward:

 {{{#!hs
 {-# LANGUAGE RankNTypes #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TypeInType #-}
 module Bug where

 import Data.Kind
 import Data.Proxy

 newtype S (f :: k1 -> k2) = MkS (Proxy f)

 foo :: forall (a :: Type)
               (f :: forall (x :: a). Proxy x -> Type).
        S f -> ()
 foo (MkS (sF :: _)) = ()
 }}}
 {{{
 $ ~/Software/ghc/inplace/bin/ghc-stage2 --interactive Bug.hs
 GHCi, version 8.5.20180420: http://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /home/rgscott/.ghci
 [1 of 1] Compiling Bug              ( Bug.hs, interpreted )

 Bug.hs:14:17: error:ghc-stage2: panic! (the 'impossible' happened)
   (GHC version 8.5.20180420 for x86_64-unknown-linux):
         No skolem info:
   [a_a1Ca[sk:1]]
   Call stack:
       CallStack (from HasCallStack):
         callStackDoc, called at compiler/utils/Outputable.hs:1162:37 in
 ghc:Outputable
         pprPanic, called at compiler/typecheck/TcErrors.hs:3224:5 in
 ghc:TcErrors
 }}}

--

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


More information about the ghc-tickets mailing list