Skip to content
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
@guibou

Description

@guibou

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 for foo won't be exported. However the link to foo 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 for Foo. I agree that b 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 that b is not exported, with something such as Minimal 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions