I'm documenting a Scala class with overloaded methods. How can I distinguish them when referring to them in scaladoc comments? For example, if I have
/**
* The most important method is [[Doc.foo]].
*/
object Doc {
def foo[A]: A = throw new UnsupportedOperationException;
def foo[A,B >: A](x: A): B = x;
}
and run sbt doc
I get
Doc.scala:1: warning: The link target "Doc.foo" is ambiguous. Several (possibly overloaded) members fit the target:
- method
foo[A,B>:A](x:A):B
in object Doc [chosen]- method
foo[A]:Nothing
in object Doc
Using foo[A,B >: A]
etc. to the link doesn't work.
[[Doc.foo()]]
work? I know that in C# when there's an ambiguous reference in documentation, you have to either use()
when you one the method without parameters or spell out the argument types, e.g.foo(string)
. Maybe it's similar here... – Whitcher