New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misleading type signatures in scaladoc for Map classes #6947
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6947?orig=1 |
@szeiger said: I think the nicest solution, at least for Map, would be to rename the type parameters from A, B to K, V. |
@szeiger said: |
@szeiger said: |
@szeiger said: |
@szeiger said: This only scratches the tip of the iceberg. Many interesting subclasses inherit the wrong comments and in many cases cannot be In the end the problem with the scaladoc comments is the same as with nonsensical methods and slow implementations: Adding lots of stuff high up in the inheritance hierarchy means you end up with lots of stuff that doesn't really work. |
Short signature of the
|
when https://github.com/scala/collection-strawman replaces the old collections in Scala 2.13 we could take a fresh look at this |
ScalaDoc is suggesting the type for foldLeft is,
foldLeft[B](z: B)(op: (B, (A, B)) ⇒ B): B
which is of course wrong and very misleading. It looks like there is a systematic error in doing a naive text substitution without doing proper variable capture. This leads to the B's being confused in this example. folding would be rather less useful were its return type bound to the value type in the Map.
The text was updated successfully, but these errors were encountered: