Ticket #58 (closed defect: fixed)

Opened 6 years ago

Last modified 2 years ago

internal Haddock or GHC error with --source-entity arg

Reported by: NeilMitchell Owned by:
Priority: major Milestone:
Version: Keywords:


Bug reported on the Hoogle bug tracker (http://code.google.com/p/ndmitchell/issues/detail?id=95) which is really a Haddock bug. See Haddock.Backends.HTML for where the error is being thrown from.

What steps will reproduce the problem?
1. src/darcs$ haddock --ignore-all-exports --optghc=-I. --optghc=-I./src
--optghc=-i./src -B `ghc --p\
rint-libdir` -o api-doc -h --source-base=../src
--source-module=../src/%M.lhs --source-entity=../src/%M.lhs  src/darcs.lhs
 haddock --ignore-all-exports --optghc=-I. --optghc=-I./src
--optghc=-i./src -B `ghc --print-libdir` -o api-doc -h --sourc\
e-base=../src --source-module=../src/%M.lhs
--source-entity='../src/%M.lhs#%N'  src/darcs.lhs    # (similar to darcs'
make api-doc)

What is the expected output? What do you see instead?
Expected success, got output ending with:

haddock: internal Haddock or GHC error: This shouldn't happen (topDeclBox)

What version of the product are you using? On what operating system?
(Saying "latest" is fine, especially for Hoogle web search)
Latest, ubuntu hardy.

Please provide any additional information below.
I am sm on irc.freenode.net.

Change History

Changed 6 years ago by waern

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to 2.3.0

This has been fixed in the darcs version.

Changed 6 years ago by Dominic.Steinitz@…

  • status changed from closed to reopened
  • resolution fixed deleted
  • milestone changed from 2.3.0 to 2.5.0

I still get errors with ignore-exports. Here's an example:

{-# OPTIONS_HADDOCK ignore-exports #-}
-- |
-- Module      : HaddockBug
-- Copyright   : TBD
-- License     : TBD
-- Maintainer  : A N Other
-- Stability   : TBD
-- Export some functions but not all

module HaddockBug (exportThis) where

exportThis :: String
exportThis = "Export This"

dontExportThis :: String
dontExportThis = "Don\'t Export This"

../ThirdParty/bin/haddock.exe HaddockBug.hs --optghc=-cpp --optghc=-package=base- --html --od
ir=HaddockDocs -tFPF \
hc-6.10.1\doc\libraries\haskell98\haskell98.haddock \
6.10.1\doc\libraries\random\random.haddock \
0.1\doc\libraries\mtl\mtl.haddock \
c-6.10.1\doc\libraries\ghc-prim\ghc-prim.haddock \
ghc-6.10.1\doc\libraries\containers\containers.haddock \
10.1\doc\libraries\base\base.haddock \
Warning: main:HaddockBug: could not find link destinations for:
haddock: internal Haddock or GHC error: src\Haddock\Backends\Html.hs:1744:8-30: Irrefutable pattern
failed for pattern Haddock.DocName.Documented n mod

make: *** [HaddockBug.html] Error 1

Changed 6 years ago by Dominic.Steinitz@…

I should have added version details.

..\ThirdParty\bin\haddock.exe --version
Haddock version 2.4.1, (c) Simon Marlow 2006
Ported to use the GHC API by David Waern 2006-2008

Changed 6 years ago by waern

  • milestone changed from 2.5.0 to 2.4.2

Changed 6 years ago by waern

  • status changed from reopened to closed
  • resolution set to fixed

I think this was fixed by this patch:

Make visible names from ExportItems
David Waern <david.waern@gmail.com>**20081208231948
 Instead of a complicated calculation of visible names out of GHC's export
 items, we can get them straight out of the already calculated ExportItems.  The
 ExportItems should represent exactly those items that are visible in an
 If store all the exported sub-names in ExportDecl instead of only those with
 documentation, the calculation becomes very simple. So we do this change as
 well (should perhaps have been a separate patch).
 This should fix the problem with names from ghc-prim not appearing in the link

I tried your example, and it worked.

Changed 2 years ago by anonymous

  • milestone 2.4.2 deleted

Milestone 2.4.2 deleted

Note: See TracTickets for help on using tickets.