bug icon indicating copy to clipboard operation
bug copied to clipboard

Type params ScalaDoc for PartialFunction.compose incorrectly fused

Open scabug opened this issue 10 years ago • 3 comments

The ScalaDoc for scala.PartialFunction.compose incorrectly limits the parameter type parameter for g to the same type parameter as itself.

Current: def compose[A](g: (A) ⇒ A): (A) ⇒ B | Suggested Correction: def compose[C](g: (C) ⇒ A): (C) ⇒ B |

The parameter descriptions are also misleading.

tparam/param description note
A the type to which function g can be applied Instead of A a new name should be used
g a function A => T1 Should be something similar to a function C => A

scabug avatar Aug 06 '15 22:08 scabug

Imported From: https://issues.scala-lang.org/browse/SI-9430?orig=1 Reporter: @janekdb Affected Versions: 2.11.7

scabug avatar Aug 06 '15 22:08 scabug

Still a bug in 2.13.0: https://www.scala-lang.org/api/current/scala/PartialFunction.html#composeA:A=%3ER

dwijnand avatar Jun 23 '19 09:06 dwijnand

Scala 3.6.3 gets it wrong in the same way.

SethTisue avatar Feb 13 '25 19:02 SethTisue