scala / scala3

The Scala 3 compiler, also known as Dotty.
https://dotty.epfl.ch
Apache License 2.0
5.81k stars 1.05k forks source link

Scaladoc permits inheritDoc with different parameter names #18831

Open som-snytt opened 10 months ago

som-snytt commented 10 months ago

Compiler version

3.3

Minimized code

mutable.HashMap#getOrElseUpdate renames parameter ops to defaultValue, but inheritDoc does not warn or adjust.

Output

Dottydoc improves on Scaladoc 2, which simply omits the spurious param.

Expectation

It would be nice to get a warning (I didn't actually check whether Dottydoc warns) or fix up the name @param name. (References in the doc text would require edits.)

Scaladoc 2 also does not cope.

som-snytt commented 10 months ago

More generally, dottydoc does not check the @param name. Noticed when I @deprecatedName: I fixed the compilation error with the new name, but there was no doc warning or error. (It would be fine to support correlating a deprecated name.)