Skip to content

moduledoc(false) does the opposite of what is expected #11152

@dotsimon

Description

@dotsimon

Describe the bug
When a module contains -moduledoc(false). then a documentation chunk is included in the resulting beam file.

To Reproduce
Compile this:

-module(a).
-moduledoc(false).
-export([b/0]).
b() -> c.

And use beam_lib:chunks("a.beam", [documentation]). to see the problem.

Expected behavior
No documentation for the entire module.

The docs for -moduledoc refer to -doc which says:

  • false - Set the current entity as hidden, that is, it should not be listed as an available function and has no documentation.

The logical reading of this for moduledoc is no documentation for the module.

Affected versions
OTP 29.0

Why this matters
BEAM with no abstract code but documentation causes xref to barf in xref_base:abst(File, Builtins, _Mode = functions) since there is no case clause

Since diameterc produces code with -moduledoc(false). it's twice as annoying.

Metadata

Metadata

Assignees

Labels

bugIssue is reported as a bugteam:VMAssigned to OTP team VM

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions