Skip to content

Commit c93187f

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

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
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 % 4096).toHexString
31+
Some(s"${sym.name}-$hash")
32+
}
2533
else None
2634
//TODO: Retrieve string that will match scaladoc anchors
2735

scaladoc/test/dotty/tools/scaladoc/ExternalLocationProviderIntegrationTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Scaladoc3ExternalLocationProviderIntegrationTest extends ExternalLocationP
3333
List(".*scala.*::scaladoc3::https://dotty.epfl.ch/api/"),
3434
List(
3535
"https://dotty.epfl.ch/api/scala/collection/immutable/Map.html",
36-
"https://dotty.epfl.ch/api/scala/Predef$.html#String",
36+
"https://dotty.epfl.ch/api/scala/Predef$.html#String-0",
3737
"https://dotty.epfl.ch/api/scala/util/matching/Regex$$Match.html"
3838
)
3939
)

0 commit comments

Comments
 (0)