When documenting parameters of methods with Scaladoc, we can write:
/** Is number even
* @param i number
* @return true if i is even, false otherwise
*/
def isEvenDef(i: Int) = i % 2 == 0
Which after generating the docs (e.g. via doc
from sbt) yields nice documentation of the parameters (pointless in this example, but useful in general):
However, writing an analogous function via val
and using the same documentation:
/** Is number even
* @param i number
* @return true if i is even, false otherwise
*/
val isEvenVal = (i: Int) => i % 2 == 0
The param
does not seem to show in the generated documentation:
Is there a way do document the parameters for functions defined via val
such that they show similarly to the parameters of methods defined via def
?