Skip to content

Commit 52f86ce

Browse files
committed
Add support for method overloading
1 parent b633791 commit 52f86ce

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scaladoc/src/dotty/tools/scaladoc/tasty/SymOps.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ class SymOps[Q <: Quotes](val q: Q):
2121
else sym.maybeOwner.className
2222

2323
def anchor: Option[String] =
24-
if (!sym.isClassDef && !sym.isPackageDef) Some(sym.name)
24+
if (!sym.isClassDef && !sym.isPackageDef) {
25+
val params = sym.signature.paramSigs.map {
26+
case s: String => s
27+
case i: Int => i.toString
28+
}
29+
val result = sym.signature.resultSig
30+
val hash = (params.mkString + result).hashCode
31+
Some(s"${sym.name}-$hash")
32+
}
2533
else None
2634
//TODO: Retrieve string that will match scaladoc anchors
2735

0 commit comments

Comments
 (0)