Skip to content

Compiler panic (piResultTy)

Type-checking the following type family

type family F (f :: forall a. g a) :: Type where
  F (f :: forall a. g a) = Int

panics with the message:

ghc: panic! (the 'impossible' happened)
  (GHC version 8.4.0.20180118 for x86_64-apple-darwin):
        piResultTy
  k_aVM[tau:1]
  a_aVF[sk:1]
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in ghc:Outputable
        pprPanic, called at compiler/types/Type.hs:950:35 in ghc:Type

The panic happens with HEAD, 8.4 and 8.2. 8.0 rejects the program with an error message, but even it panics on the following version:

type family F f :: Type where
  F ((f :: forall a. g a) :: forall a. g a) = Int

#14873 (closed) seemed somewhat related, so I tried with the patch implemented in 3d252037, but that fails with the same panic too.

Trac metadata
Trac field Value
Version 8.2.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related #14873 (closed)
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information