Skip to content

Scaladoc fails to include protected members of enum classes or case classes/objects #23814

@katrinafyi

Description

@katrinafyi

Compiler version

tested 3.7.1, 3.3.6

Minimized code

sealed trait Trait {
  // documented:
  protected def protect(): Int = ???
  protected type T = Int
}

class Class {
  // documented:
  protected def protect(): Int = ???
  protected type T = Int
}

enum Enum {
  case E1()
  case E2

  // NOT documented:
  protected type T = Int
  protected def protect(): Int = ???
}

case class CaseClass() {
  // NOT documented:
  protected def protect(): Int = ???
  protected type T = Int
}


case object CaseObject {
  // NOT documented:
  protected def protect(): Int = ???
  protected type T = Int
}

object MainObject {
  @main def main(): Unit = ()
}

Output

observe that the protected members marked "NOT documented" are missing from the documentation, contrary to the default behaviour described in the scaladoc -help:

                -private  Show all types and members. Unless specified, show only public and protected types and
                          members.

Screenshots:

Image Image

Expectation

the documentation should be accurate and these members should be visible by default in the scaladoc output. in any case, it is also very surprising that only some protected members are currently shown.

possibly related to #18946

Metadata

Metadata

Assignees

No one assigned

    Labels

    itype:bugstat:needs triageEvery issue needs to have an "area" and "itype" label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions