8000 scaladoc inheritance · Issue #4932 · scala/bug · GitHub
[go: up one dir, main page]

Skip to content
scaladoc inheritance #4932
@scabug

Description

@scabug

When writing scaladoc for an overrided member, it is convenient to be able to inherit the existing docs and extend them. Currently, it appears that you can either inherit or provide your own, but not merge the two. The simplest way I can think to address this is as follows:

trait Foo {
  /** Do interesting stuff. */
  def doStuff()
}

trait Bar {
  /** Actually does quite boring stuff. */
  override def doStuff()
}

trait Baz {
  /**
   * We make use of pixie magic to do stuff.
   */
  override def doStuff()
}

The scaladoc for Foo.doStuff() would be "Do interesting stuff." and the scaladoc for Bar.doStuff() would be "Actually does quite boring stuff.". However, the scaladoc for Baz would be:

Do interesting stuff.

We make use of pixie magic to do stuff.

So, the rule is that if the scaladoc starts on the /** line, it is treated as the documentation. If the /** line is blank, the inherited docs are inserted followed by these docs.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0