haddock error if reexport pattern of data family instance.
Summary
haddock error if reexport pattern of data family instance.
Steps to reproduce
src/A.hs
{-# LANGUAGE PatternSynonyms #-}
module A (pattern BarUnit) where import B
src/B.hs
{-# LANGUAGE PatternSynonyms, TypeFamilies #-}
module B (pattern BarUnit) where
class Foo a where data Bar a
instance Foo () where data Bar () = BarUnit
run
% stack haddock
...
haddock: panic! (the 'impossible' happened)
(GHC version 8.10.1:
extractDecl
Ambigous decl for BarUnit in class:
class Foo a where
data Bar a
Matches:
[] []
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1179:37 in ghc:Outputable
pprPanic, called at utils/haddock/haddock-api/src/Haddock/Interface/Create.hs:1078:16 in main:Haddock.Interface.Create
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
...
Expected behavior
It create document.
Environment
- GHC version used: 8.10.1
- Stackage: nightly-2020-08-03
Optional:
- Operating System: Gentoo GNU/Linux
- System Architecture: