无法为重载方法创建ScalaDoc链接

无法为重载方法创建ScalaDoc链接,scala,overloading,scaladoc,Scala,Overloading,Scaladoc,我遇到了一个问题,ScalaDoc在使用重载时不接受方法链接 一个独立的示例:文件项目/build.properties: sbt.version=0.13.2 文件build.sbt: scalaVersion := "2.11.0" 文件src/main/scala/Foo.scala: package foobar /** @see [[Bar#foo]] * @see [[Bar#bar]] */ case class Foo() abstract class Bar {

我遇到了一个问题,ScalaDoc在使用重载时不接受方法链接

一个独立的示例:文件
项目/build.properties

sbt.version=0.13.2
文件
build.sbt

scalaVersion := "2.11.0"
文件
src/main/scala/Foo.scala

package foobar

/** @see [[Bar#foo]]
  * @see [[Bar#bar]]
  */
case class Foo()

abstract class Bar {
  def foo: Int

  def bar: Foo
  def bar(x: Option[Int]): Foo
}
当我运行
sbt doc
时,
[[Bar#foo]]
链接正常,但
[[Bar#foo]]
链接不被接受:

[warn] .../src/main/scala/Foo.scala:3: The link target "Bar#bar" is ambiguous. 
       Several members fit the target:
[warn] (x: Option[Int]): foobar.Foo in class Bar [chosen]
[warn] : foobar.Foo in class Bar
[warn] 
[warn] 
[warn] Quick crash course on using Scaladoc links
[warn] ==========================================
[warn] Disambiguating terms and types: Prefix terms with '$' and types with '!' in case both names are in use:
[warn]  - [[scala.collection.immutable.List!.apply class List's apply method]] and
[warn]  - [[scala.collection.immutable.List$.apply object List's apply method]]
[warn] Disambiguating overloaded members: If a term is overloaded, you can indicate the first part of its signature followed by *:
[warn]  - [[[scala.collection.immutable.List$.fill[A](Int)(⇒A):List[A]* Fill with a single parameter]]]
[warn]  - [[[scala.collection.immutable.List$.fill[A](Int,Int)(⇒A):List[List[A]]* Fill with a two parameters]]]
[warn] Notes:
[warn]  - you can use any number of matching square brackets to avoid interference with the signature
[warn]  - you can use \\. to escape dots in prefixes (don't forget to use * at the end to match the signature!)
[warn]  - you can use \\# to escape hashes, otherwise they will be considered as delimiters, like dots.
[warn] /** @see [[Bar#foo]]
[warn] ^
[warn] one warning found
所以通过“速成班”,我尝试了各种各样的东西,例如

[[Bar#bar:Foo*]]
[[Bar!.bar:Foo*]]
[[foobar.Bar!.bar:foobar.Foo*]]
这些都不管用。使用另一个重载变量时:

[[Bar#bar(Option[Int])]]
[[Bar#bar(Option[Int]):Foo]]
[[Bar!.bar(Option[Int]):Foo*]]
所以,要么(像往常一样…)scala doc完全坏了,要么我做错了什么?

我试过:

package foobar

/** @see [[Bar#foo]]
  * @see [[Bar!.bar*]]
  * @see [[[Bar!.bar(x:Option[Int])*]]]
  */
case class Foo()

abstract class Bar {
  def foo: Int

  def bar: Foo
  def bar(x: Option[Int]): Foo
}
尽管我得到了相同的警告,但生成的文档都带有指向这两个bar方法的链接


所以我想scala doc并没有完全崩溃。。。只是有点烦人。

下面这些对我来说很有用。使用完全限定的参数和返回类型,其中点的前缀为
\

[[Bar#bar:foobar\.Foo* The first bar method without argument]]
[[Bar#bar(x:Option[Int]):foobar\.Foo* The second bar method with argument]]