Skip to content

Listing multiple -doc attributes for the same function #9672

@robertoaloi

Description

@robertoaloi

Describe the bug
In the EEP 59 proposal, it is stated that:

Listing multiple -doc attributes with string values for the same function should warn or error accordingly, unless the documentation is being set to hidden. For example, this is valid:

-doc "Example".
-doc hidden.
example() -> ok.

This does not seem to be the case though.

To Reproduce
Have the module:

-module(test).

-export([example/0]).

-doc "Example".
-doc hidden.
example() ->
  ok.

Compile it with:

$ erlc test.erl
test.erl:8:2: redefining documentation attribute (doc) previously set at line 5
%    8| -doc hidden.
%     |  ^

Expected behavior
No error is produced.

Affected versions
OTP 27.3

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions