Skip to content

Skolem error (panic) with StandaloneKindSignatures

The following program:

{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE StandaloneKindSignatures #-}

module Bug where

import Data.Kind

type F2 :: forall a b. Type -> a
type family F2 :: forall b. Type -> Type where

panics on HEAD:

ghc: panic! (the 'impossible' happened)
  (GHC version 8.11.0.20200901:
        No skolem info:
  [a_auL]
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/GHC/Utils/Panic.hs:185:37 in ghc:GHC.Utils.Panic
        pprPanic, called at compiler/GHC/Tc/Errors.hs:2812:17 in ghc:GHC.Tc.Errors

It looks like the issue is that a doesn't get bound by the implication constraint that's emitted when unifying forall b. Type -> a ~ forall b. Type -> Type.

Edited by Csongor Kiss
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information