-
Notifications
You must be signed in to change notification settings - Fork 452
Description
In K2 Dokka does not display members of enum entry, e.g. name
and ordinal
. if the body of an enum entry is empty (also see KT-61256 )
Dokka K2 will not display anonymous members of entry anymore. It does not make to have documentation for them since they are anonymous and unavailable outside of an enum entry's initializing anonymous object.
Pitfall: Overridden KDoc in an entry (anonymous classes) will not be displayed.
Example
enum class ProtocolState {
WAITING {
/*
* Dokka will display the documentation from the super member on entry page.
* In this example: `Some KDos`
*/
override fun signal() = anonymousFun()
/**
* This member will be invisible in generated documentation
*/
fun anonymousFun() = TALKING
},
TALKING {
override fun signal() = WAITING
};
/**
* Some KDoc
*/
abstract fun signal(): ProtocolState
}
So the Waiting
entry-page will have the members:
val name
val ordinal
fun signal()
Note: notoverride fun signal()
Some KDoc
Motivation/Technical details
Dokka will get the required members from the enum class's scope since, e.g. the A
enum entry in the enum E
is
static val A: E = object : E() {
val x: Int = 5
}
but it needs to exclude all static members like values
and valueOf
.
x
cannot be visible outside the object's initializer and is an implementation detail