Skip to content

Typed hole with higher-rank kind causes GHC to panic (No skolem info)

Spun out from #14040 (closed)#ticket:15076#comment:152359, which was different enough from the original program in #14040 (closed) to warrant its own ticket. The following program panics on every version of GHC from 8.0.2 onward:

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

import Data.Kind
import Data.Proxy

foo :: forall (a :: Type)
              (f :: forall (x :: a). Proxy x -> Type).
       Proxy f -> ()
foo (_ :: _) = ()
$ ~/Software/ghc/inplace/bin/ghc-stage2 Bug.hs
[1 of 1] Compiling Bug              ( Bug.hs, Bug.o )

Bug.hs:12:11: error:ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 8.5.20180420 for x86_64-unknown-linux):
        No skolem info:
  [a_aZo[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
Edited by Ryan Scott
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information