Skip to content

scaladoc comment for multiple enum cases is silently ignored without any warning #16610

Closed
@unkarjedy

Description

@unkarjedy

Compiler version

ThisBuild / version := "0.1.0-SNAPSHOT"

ThisBuild / scalaVersion := "3.2.1"

lazy val root = (project in file("."))
  .settings(
    name := "untitled380"
  )

Minimized code

/**
 * Description of enum
 */
enum MyEnum {

  /**
   * Description of case 1
   */
  case MyCase1

  /**
   * Description of case 1 and 3
   */
  case MyCase2, MyCase3
}

Run sbt doc
Notice that no documentation will be generated for MyCase2 and MyCase3:

This is kinda expected (to some degree), for example because scala doc could contain references to parameters and type parameters:

/**
 * @param myParameter parameter description
 * @tparam MyTypeParameter type parameter description
 *
 */
enum TestEnum[MyTypeParameter](myParameter: Int) {
  /**
   * @param myParameterInner42 parameter description
   * @tparam MyTypeParameterInner type parameter description
   */
  case EnumMember[MyTypeParameterInner](myParameterInner42: Int)
    extends TestEnum[MyTypeParameterInner](myParameterInner42)
}

Expectation

At least some warning should be printed during sbt doc.
Something like "Scaladoc at position ... was ignored because..."

Actual result

The comment is silently ignored without any warning

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions