Skip to content

Type families, holes and -fdefer-type-errors may cause 'opt_univ fell into a hole' panic

This program, when compiled like ghc -fdefer-type-errors -c panic.hs:

{-# LANGUAGE TypeFamilies #-}

module MorePanic where

transitive :: (a, b) -> (b, c) -> (a, c)
transitive = undefined

trigger :: a -> b -> (F a b, F b a)
trigger _ _ = _ `transitive` trigger _ _

type family F (n :: *) (m :: *) :: *

Gives this panic after several error messages:

ghc.EXE: panic! (the 'impossible' happened)
  (GHC version 8.4.3 for x86_64-unknown-mingw32):
	opt_univ fell into a hole
  {co_a7Sj}
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler\utils\Outputable.hs:1150:37 in ghc:Outputable
        pprPanic, called at compiler\\types\\OptCoercion.hs:242:5 in ghc:OptCoercion

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

This bug also affects GHCi. Attached is full output

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