Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rdesgroppes opened this issue Mar 5, 2020 · 3 comments

Comments

@rdesgroppes
Copy link

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
@raboof
Copy link
Contributor

raboof commented Mar 5, 2020

@rdesgroppes
Copy link
Author

@raboof alas not available in java 8

@baol
Copy link
Contributor

baol commented Apr 22, 2020

Even ignoring errors, the generated doc may not be correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants