In Kotlin v1.1 +, it is possible to declare type aliases that provide alternative names for existing types. This is especially useful for function types - for example:
typealias OnItemClick = (view: View, position: Int) -> Boolean
And they can be documented with KDoc comments, like the other participants:
typealias OnItemClick = (view: View, position: Int) -> Boolean
But is there a specific way to document parameters and the type of the return type of a function?
The Kotlin website contains information on documenting the Kotlin code , but does not mention types.
Like the functions themselves, it would be nice if the types of functions could be documented as follows:
typealias OnItemClick = (view: View, position: Int) -> Boolean
But tags are not recognized in KDoc.
So, how should parameters and return types be documented?
source share