Skip to content

9.6.2: haddock panic exporting bare `type data` constructor

Summary

Running Haddock on the below module results in:

panic! (the 'impossible' happened)
  GHC version 9.6.2:
	tyConStupidTheta

FooCon
Call stack:
    CallStack (from HasCallStack):
      callStackDoc, called at compiler/GHC/Utils/Panic.hs:189:37 in ghc:GHC.Utils.Panic
      pprPanic, called at compiler/GHC/Core/TyCon.hs:2649:17 in ghc:GHC.Core.TyCon

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

Steps to reproduce

{-# LANGUAGE TypeData #-}
module Bug (FooCon) where -- to avoid panic, export `Foo(FooCon)` instead

type data Foo = FooCon

Expected behavior

Not a panic. Either Haddock and GHC should both reject exporting FooCon without being wrapped in Foo(), or Haddock should handle this successfully.

Environment

  • GHC version used: 9.6.2

Optional:

  • Operating System: Linux (NixOS)
  • System Architecture: x86_64
Edited by Ryan Hendrickson
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information