Skip to content

Problem handling a nested type with the same name as its enclosing type #225

Open
@rdesgroppes

Description

@rdesgroppes

I have an object definition MyName who has a nested object definition also named MyName. This seems to terminate the javadoc generation abruptly (javadoc exited with exit code 1).

Here's MyName.scala:

package my.namespace

/** Something about MyName.
  */
sealed trait MyName extends Product with Serializable {
  val value: Int
}

object MyName {
  def apply(value: Int): MyName = value match {
    case 1 => MyName
    case 2 => KnownName
    case _ => throw new IllegalArgumentException(s"$value is not a valid MyName")
  }

  def unapply(arg: MyName): Option[Int] = Some(arg.value)

  /** Something about MyName.MyName.
    */
  case object MyName extends MyName {
    override val value = 1
  }

  /** Something about MyName.KnownName.
    */
  case object KnownName extends MyName {
    override val value = 2
  }
}

sbt output:

[error] /unrelated/File.java:42:1:  error: cannot find symbol
[error]   /** unrelated comment. */
[error]                                                   ^  symbol:   variable MyName$
[error]   location: interface MyName
...
[info] 1 error
...
[warn] javadoc exited with exit code 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions