This repository was archived by the owner on Aug 3, 2024. It is now read-only.
This repository was archived by the owner on Aug 3, 2024. It is now read-only.
Do not warn about private link to private symbols #1070
Closed
Description
The following:
module Private (
bar,
Foo(a),
) where
-- | 'foo' is really great, and uses 'bar'. This reference to 'foo'
-- will triggers a warning when it is actually never used in the final
-- document, because this documentation is private.
foo = undefined
bar = undefined
class Foo t where
a :: t
b :: t
Leads to the following warnings when using haddock Private.hs
:
Warning: Private: could not find link destinations for:
b foo
- The link to
foo
cannot be resolved because the documentation forfoo
won't be exported. However the link tofoo
is inside an unexported piece of documentation, so this is not an issue. I then consider that this warning can be discarded. - The link to
b
will appear in the minimal complete definition exported forFoo
. I agree thatb
appears on the minimal complete definition (see haddock "leaks" the names of non exported type class methods in minimal complete definitions #330), but a warning should not be generated. I also think that the documentation must explicitly say thatb
is not exported, with something such asMinimal complete definition: a, b (private)
.
These warnings are especially annoying in continuous integration where we want to fail if haddock returns any warning. See for example the work of #927.
This was tested with ghc 8.8.1 (currently in rc status). Similar results appears with ghc 8.6.5.